Merge pull request #1 from baocaixiong/patch-1

365行少个f
This commit is contained in:
梁杰
2014-06-03 22:58:39 +08:00

View File

@ -326,7 +326,7 @@ secondForLoop
</code></pre><p>使用<code>..</code>创建的范围不包含上界,如果想包含的话需要使用<code>...</code></p>
<h2 id="-">函数和闭包</h2>
<p>使用<code>func</code>来声明一个函数,使用名字和参数来调用函数。使用<code>-&gt;</code>来指定函数返回值。</p>
<pre><code>unc greet(name: String, day: String) -&gt; String {
<pre><code>func greet(name: String, day: String) -&gt; String {
return &quot;Hello \(name), today is \(day).&quot;
}
greet(&quot;Bob&quot;, &quot;Tuesday&quot;)