title: Confused by the example code which adds new instance methods to types
body: <p>The following code snippet is copied from the <a href="https://developer.apple.com/library/prerelease/content/documentation/Swift/Conceptual/Swift_Programming_Language/Extensions.html#//apple_ref/doc/uid/TP40014097-CH24-ID151" rel="nofollow">official document</a> where it is used to demonstrate how to use the Extensions to add method to existing types.</p>
  
  <pre><code>extension Int {
      func repetitions(task: () -&gt; Void) {
          for _ in 0..&lt;self {
              task()//what's going on here?
          }
      }
  }
  
  3.repetitions { //why I don't have to call as `repetitions()`
      print("Hello!")
  }
  </code></pre>
  
  <p><strong>Question:</strong> The question is not asking how the extinsion extens. I just feel a bit confused about this code, why it looks like so? why use <code>task()</code> inside function body? Where it comes from? for the line <code>3.repetition</code> why not write it as <code>3.repetition()</code></p>
  
  <p>Thanks a lot</p>