correct an mistake

This commit is contained in:
numbbbbb
2014-06-09 22:06:47 +08:00
parent 5b2a5af734
commit 1985548298
42 changed files with 78 additions and 80 deletions

View File

@ -46,7 +46,7 @@
<div class="book" data-level="2.6" data-basepath=".." data-revision="1402322595980">
<div class="book" data-level="2.6" data-basepath=".." data-revision="1402322774243">
<div class="book-header">
<!-- Actions Left -->
<a href="#" class="btn pull-left toggle-summary" aria-label="Toggle summary"><i class="fa fa-align-justify"></i></a>
@ -587,7 +587,7 @@
<div class="page-inner">
<section class="normal" id="section-gitbook_95">
<section class="normal" id="section-gitbook_154">
<h1 id="-functions-">函数Functions</h1>
<p>本页包含内容:</p>
@ -770,9 +770,8 @@
return s1 + joiner + s2
}
</code></pre><p>在这个例子中Swift自动为<code>joiner</code>提供了外部参数名。因此,当函数调用时,外部参数名必须使用,这样使得参数的用途变得清晰。</p>
<pre><code> func join(s1: String, s2: String, joiner: String = &quot; &quot;) -&gt; String {
return s1 + joiner + s2
}
<pre><code> join(&quot;hello&quot;, &quot;world&quot;, joiner: &quot;-&quot;)
// returns &quot;hello-world&quot;
</code></pre><blockquote>
<p>注意:
你可以使用<code>下划线_</code>作为默认值参数的外部参数名,这样可以在调用时不用提供外部参数名。但是给带默认值的参数命名总是更加合适的。</p>