From c03de81059b97a70ca28bf21de76fbf85e10bc0a Mon Sep 17 00:00:00 2001 From: 088haizi <088haizi@gmail.com> Date: Wed, 4 Jun 2014 21:37:01 +0800 Subject: [PATCH] Update a_swift_tour.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “In an if statement, the conditional must be a Boolean expression—this means that code such as if score { ... } is an error, not an implicit comparison to zero.” 译文中 “not an implicit comparison to zero”未做翻译。 --- source/chapter1/a_swift_tour.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/chapter1/a_swift_tour.md b/source/chapter1/a_swift_tour.md index 18a39672..40bdf456 100644 --- a/source/chapter1/a_swift_tour.md +++ b/source/chapter1/a_swift_tour.md @@ -80,7 +80,7 @@ } teamScore -在`if`语句中,条件必须是一个布尔表达式——像`if score { ... }`这样的代码是错误的。 +在`if`语句中,条件必须是一个布尔表达式——这意味着像`if score { ... }`这样的代码将报错,而不会隐形地与 0 做对比。 你可以一起使用`if`和`let`来处理值缺失的情况。有些变量的值是可选的。一个可选的值可能是一个具体的值或者是`nil`,表示值缺失。在类型后面加一个问号来标记这个变量的值是可选的。