From a42f11d6dd4383db828d75650091d8976d308cc5 Mon Sep 17 00:00:00 2001 From: lyuka Date: Wed, 11 Jun 2014 22:16:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=AC=A1=E6=94=B9=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/chapter2/07_Closures.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/chapter2/07_Closures.md b/source/chapter2/07_Closures.md index 49f52aed..0ba7ae4b 100644 --- a/source/chapter2/07_Closures.md +++ b/source/chapter2/07_Closures.md @@ -194,7 +194,7 @@ someFunctionThatTakesAClosure() { } ``` > 注意: -> 如果函数只需要闭包表达式一个参数,当您使用尾随闭包时,您甚至可以把 () 省略掉。 +> 如果函数只需要闭包表达式一个参数,当您使用尾随闭包时,您甚至可以把`()`省略掉。 在上例中作为`sort`函数参数的字符串排序闭包可以改写为: @@ -252,7 +252,7 @@ let strings = numbers.map { > 注意: > 字典`digitNames`下标后跟着一个叹号 (!),因为字典下标返回一个可选值 (optional value),表明即使该 key 不存在也不会查找失败。 > 在上例中,它保证了`number % 10`可以总是作为一个`digitNames`字典的有效下标 key。 -> 因此叹号可以用于强制解析 (force-unwrap) 存储在可选下标项中的 **String** 类型值。 +> 因此叹号可以用于强制解析 (force-unwrap) 存储在可选下标项中的`String`类型值。 从`digitNames`字典中获取的字符串被添加到输出的前部,逆序建立了一个字符串版本的数字。 (在表达式`number % 10`中,如果number为16,则返回6,58返回8,510返回0)。