diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/CNAME b/CNAME new file mode 100755 index 00000000..eb06dc03 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +www.swiftguide.cn \ No newline at end of file diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 9117e11e..352c17a8 --- a/README.md +++ b/README.md @@ -11,78 +11,75 @@ 使用Gitbook制作,可以直接[在线阅读](http://numbbbbb.github.io/the-swift-programming-language-in-chinese/)。 +# 电子书下载 -# 翻译进度 +CocoaChina精校PDF→[点我下载](http://vdisk.weibo.com/s/EhsPPzRRQ5CZ/1402621206) -> 说明:翻译之前请先到PR列表中查看别人认领的内容,尽量不要重复,谢谢! +其他格式可以通过PDF转换 + +# 当前阶段 + +文章已经全部翻译完成,当前阶段为自由校对阶段,可以随意提issue和pr。 + + +# 译者记录 * 欢迎使用 Swift - * 关于 Swift(完成 By numbbbbb) - * Swift 初见(完成 By numbbbbb) + * 关于 Swift ([numbbbbb]) + * Swift 初见 ([numbbbbb]) * Swift 教程 - * 基础部分(完成 By numbbbbb, lyuka, JaySurplus) - * 基本操作符(完成 By @xielingwang) - * 字符串和字符(完成 By @wh1100717) - * 集合类型(认领) - * 控制流(@vclwei, @coverxit, @NicePiao 认领) - * 函数(完成 By @honghaoz) - * 闭包(完成 By @wh1100717) - * 枚举(完成 By @yankuangshi) - * 类和结构体(@JaySurplus 认领) - * 属性(完成 By @shinyzhu) - * 方法(完成 By @pp-prog) - * 下标(完成 By @siemenliu) - * 继承(完成 By @Hawstein) - * 构造过程(@lifedim 认领) - * 析构过程(完成) - * 自动引用计数(完成 By @TimothyYe) - * 可选链(完成) - * 类型检查(完成 By @xiehurricane) - * 嵌套类型(完成 By @Lin-H) - * 扩展(完成 By @lyuka) - * 协议(完成 By @geek5nan) - * 泛型(完成 By @takalard) - * 高级操作符(@xielingwang 认领) + * 基础部分 ([numbbbbb], [lyuka], [JaySurplus]) + * 基本操作符 ([xielingwang]) + * 字符串和字符 ([wh1100717]) + * 集合类型 ([zqp]) + * 控制流 ([vclwei], [coverxit], [NicePiao]) + * 函数 ([honghaoz]) + * 闭包 ([wh1100717]) + * 枚举 ([yankuangshi]) + * 类和结构体 ([JaySurplus]) + * 属性 ([shinyzhu]) + * 方法 ([pp-prog]) + * 下标 ([siemenliu]) + * 继承 ([Hawstein]) + * 构造过程 ([lifedim]) + * 析构过程 ([bruce0505]) + * 自动引用计数 ([TimothyYe]) + * 可选链 ([Jasonbroker]) + * 类型检查 ([xiehurricane]) + * 嵌套类型 ([Lin-H]) + * 扩展 ([lyuka]) + * 协议 ([geek5nan]) + * 泛型 ([takalard]) + * 高级操作符 ([xielingwang]) * 语言参考 - * 关于语言参考(完成 By @ChildhoodAndy) - * 词法结构(完成 By @superkam) - * 类型(完成 By @lyuka) - * 表达式(@sg552 认领) - * 语句(完成 By @coverxit) - * 声明(@marsprince 认领) - * 特性(完成 By @Hawstein) - * 模式(@honghaoz 认领) - * 泛型参数(完成 By @fd5788) - * 语法总结(@StanZhai 认领) - -# 更新频率 - -由于我是利用业余时间翻译,所以速度有限。 - -不过我会保证每天至少1小时的翻译时间。 - + * 关于语言参考 ([dabing1022]) + * 词法结构 ([superkam]) + * 类型 ([lyuka]) + * 表达式 ([sg552] ) + * 语句 ([coverxit]) + * 声明 ([marsprince]) + * 特性 ([Hawstein]) + * 模式 ([honghaoz]) + * 泛型参数 ([fd5788]) + * 语法总结 ([StanZhai]) # 贡献力量 如果想做出贡献的话,你可以: -- 帮忙一起翻译 - 帮忙校对,挑错别字、病句等等 - 提出修改建议 - 提出术语翻译建议 # 翻译建议 -如果你愿意一起翻译的话,请仔细阅读: +如果你愿意一起校对的话,请仔细阅读: - 使用markdown进行翻译,文件名必须使用英文,因为中文的话gitbook编译的时候会出问题 - 翻译后的文档请放到source文件夹下的对应章节中,然后pull request即可,我会用gitbook编译成网页 - 工作分支为gh-pages,用于GitHub的pages服务 - fork过去之后新建一个分支进行翻译,完成后pull request这个分支,没问题的话我会合并到gh-pages分支中 - 有其他任何问题都欢迎发issue,我看到了会尽快回复 -- **尽早pull request**,你不必翻译完整篇文章再pr,完全可以翻译完一段就pr一次,这样别的朋友可以及时看到你的进度,避免多人翻译同一段。此外,尽早pr也可以让校对的朋友们更早看到新内容,更快发现问题 -- 一定要记得**先查看当前的pr**再开始翻译,防止重复翻译 -- 我已经提前把所有章节的markdown文件都创建好了,翻译的时候直接写入对应文件即可 谢谢! @@ -107,12 +104,71 @@ 7. 运行 `git fetch upstream gh-pages` 拉取我的库的更新到本地 8. 运行 `git rebase upstream/gh-pages` 将我的更新合并到你的分支 -这是一个初始化流程,只需要做一遍就行,之后请一直在develop分支进行翻译。 +这是一个初始化流程,只需要做一遍就行,之后请一直在develop分支进行修改。 -如果翻译过程中我的库有了更新,请重复6、7、8步。 +如果修改过程中我的库有了更新,请重复6、7、8步。 -翻译完成之后,首先push到你的库,然后登录GitHub,在你的库的首页可以看到一个 `pull request` 按钮,点击它,填写一些说明信息,然后提交即可。 +修改之后,首先push到你的库,然后登录GitHub,在你的库的首页可以看到一个 `pull request` 按钮,点击它,填写一些说明信息,然后提交即可。 # 开源协议 基于[WTFPL](http://en.wikipedia.org/wiki/WTFPL)协议开源。 + + + +[numbbbbb]:https://github.com/numbbbbb +[stanzhai]:https://github.com/stanzhai +[coverxit]:https://github.com/coverxit +[wh1100717]:https://github.com/wh1100717 +[TimothyYe]:https://github.com/TimothyYe +[honghaoz]:https://github.com/honghaoz +[lyuka]:https://github.com/lyuka +[JaySurplus]:https://github.com/JaySurplus +[Hawstein]:https://github.com/Hawstein +[geek5nan]:https://github.com/geek5nan +[yankuangshi]:https://github.com/yankuangshi +[xielingwang]:https://github.com/xielingwang +[yulingtianxia]:https://github.com/yulingtianxia +[twlkyao]:https://github.com/twlkyao +[dabing1022]:https://github.com/dabing1022 +[vclwei]:https://github.com/vclwei +[fd5788]:https://github.com/fd5788 +[siemenliu]:https://github.com/siemenliu +[youkugems]:https://github.com/youkugems +[haolloyin]:https://github.com/haolloyin +[wxstars]:https://github.com/wxstars +[IceskYsl]:https://github.com/IceskYsl +[sg552]:https://github.com/sg552 +[superkam]:https://github.com/superkam +[zac1st1k]:https://github.com/zac1st1k +[bzsy]:https://github.com/bzsy +[pyanfield]:https://github.com/pyanfield +[ericzyh]:https://github.com/ericzyh +[peiyucn]:https://github.com/peiyucn +[sunfiled]:https://github.com/sunfiled +[lzw120]:https://github.com/lzw120 +[viztor]:https://github.com/viztor +[wongzigii]:https://github.com/wongzigii +[umcsdon]:https://github.com/umcsdon +[zq54zquan]:https://github.com/zq54zquan +[xiehurricane]:https://github.com/xiehurricane +[Jasonbroker]:https://github.com/Jasonbroker +[tualatrix]:https://github.com/tualatrix +[pp-prog]:https://github.com/pp-prog +[088haizi]:https://github.com/088haizi +[baocaixiong]:https://github.com/baocaixiong +[yeahdongcn]:https://github.com/yeahdongcn +[shinyzhu]:https://github.com/shinyzhu +[lslxdx]:https://github.com/lslxdx +[Evilcome]:https://github.com/Evilcome +[zqp]:https://github.com/zqp +[NicePiao]:https://github.com/NicePiao +[LunaticM]:https://github.com/LunaticM +[menlongsheng]:https://github.com/menlongsheng +[lifedim]:https://github.com/lifedim +[happyming]:https://github.com/happyming +[bruce0505]:https://github.com/bruce0505 +[Lin-H]:https://github.com/Lin-H +[takalard]:https://github.com/takalard +[dabing1022]:https://github.com/dabing1022 +[marsprince]:https://github.com/marsprince \ No newline at end of file diff --git a/Using Swift with Cocoa and ObjectiveC/02Interoperability/01Interacting with Objective-C APIs.md b/Using Swift with Cocoa and ObjectiveC/02Interoperability/01Interacting with Objective-C APIs.md old mode 100644 new mode 100755 index fca0d8c9..8bbaa431 --- a/Using Swift with Cocoa and ObjectiveC/02Interoperability/01Interacting with Objective-C APIs.md +++ b/Using Swift with Cocoa and ObjectiveC/02Interoperability/01Interacting with Objective-C APIs.md @@ -1,318 +1,62 @@ ---- [@haolloyin](https://github.com/haolloyin) 翻译自苹果官方文档 [Using Swift with Cocoa and Objective-C](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-XID_75) 的 [Interacting with Objective-C APIs](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html) 章节 +# 个人信息 +梁杰,男,北京航空航天大学,大三。 -## Interacting with Objective-C APIs - 与 Objc API 交互 +热爱Python,喜欢前端,GitHub重度脑残粉,目前正在维护swiftist.org社区。 -Swift 和 Objc 之间双向的`互用性`(`Interoperability`),让你可以用一种语言访问另一种语言写的代码。当你开始整合 Swift 代码到应用的开发工作流时,可以很好地理解这种互用性在重新定义,改善并强化你写 Cocoa 应用的方式。 +# 时间点 -互用性一个很重要的方面是在写 Swift 代码的同时可以用 Objc API。导入 Objc framework 之后,你可以用 Swift 原生的语法来实例化类,并和它们进行交互。 +6.3 项目发布 第一天仅有50Star +6.4 开始有人关注 300+Star +6.5~6.6 翻译工作开始步入正轨 +6.7~6.8 翻译速度一般 +6.9~6.11 建立QQ群 翻译速度加快 完成翻译 初步校对 +6.12 发布 -### Initialization - 初始化 +# 发起原因 -你可以用 Swift 语法调用 Objc 类的初始化方法,在 Swift 代码中进行 Objc 类的实例化。因为 Objc 的初始化方法都迁移到 Swift 了。`init` 前缀被去掉并成为关键字表示一个方法是初始化方法。以 `initWith` 开头的初始化方法中的 `With` 也被去掉了。从 `init` 或 `initWith` 中切分出来首字母变成小写,并且作为第一个参数名,该 selector 的其他部分也同样变成参数名。selector 括号内的各部分也是调用端 +最初其实没想到会做成这样,只是想着既然Swift这么火,我也想学一学,不如用点心去翻译一下,让我们广大群众也懂得一些知识,也算是为大家做点贡献。 -例如 Objc 中这么写: +万万没想到,最后变成了一个这么大的开源协作项目。 -``` -// OBJECTIVE-C +# 协作形式 -UITableView *myTableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; -``` +通过GitHub进行协作,文章使用markdown写成,用gitbook制作成静态页面并托管在GitHub上,可以直接在线阅读。markdown也可以转换成Epub、PDF、mobi等多种电子书格式。 -Swift 中则这么写: +参与翻译的朋友只需要更新markdown文件内容即可,我会将内容通过gitbook转换成页面并更新到GitHub。 -``` -// SWIFT +# 如何吸引译者 -let myTableView: UITableView = UITableView(frame: CGRectZero, style: .Grouped) -``` +项目发起之后我只是在自己的微博上提了一下,开始时候并没有什么人关注,不过经过一些大号转发之后关注的人越来越多,就开始有人参与进来。 -不需要调用 `alloc`,Swift 会为你正确处理。**注意调用 Swift 初始化方法时不应该再出现 `init` 字眼。** +其实能吸引到这么多人,主要还是因为苹果的影响力太大,再加上我发起项目的时间非常早,正是全民Swift的时候,所以吸引了很多人参与。 -初始化时你可以显式指明变量的类型,也可以忽略不写,Swift 的类型推导会确定对象的类型。 +# 如何组织开源翻译 -``` -// SWIFT +## 让新手也能参与 -let myTextField = UITextField(frame: CGRect(0.0, 0.0, 200.0, 40.0)) -``` +GitHub在国内的普及程度还是不够,很多有兴趣参与的朋友都不太会用。刚开始我也没有意识到这个问题,直到有一个朋友主动问我我才明白过来,迅速在项目首页的说明中添加了详细的贡献代码教程。实践证明很多朋友都是照着这个教程完成了工作。 -`UITableView` 和 `UITextField` 拥有和 Objc 类似的方法,可以像在 Objc 代码中那样使用它们来访问在类中定义的属性或方法。 +## 传达信息 -为了一致性和简单性,Objc 的工厂方法在 Swift 中以方便的初始化方法出现,这种映射方法使它们和初始化方法一样简洁明了。例如你在 Objc 中这么调用工厂方法: +组织开源项目最重要的一点就是保证信息的传达,其实秘诀很简单——重复说。 -``` -// OBJECTIVE-C +就拿 Swift 这本书来举例,我一直在项目说明中更新当前进度,按理说大家点进来都会立刻看到,但是仍然有很多朋友问我现在翻译了多少、还有没有未认领章节。之后我就开始主动通知大家,在所有能通知的地方通知,一旦有新变动就马上通知,慢慢的就没有人问我了,因为大家都很清楚项目进度。 -UIColor *color = [UIColor colorWithRed:0.5 green:0.0 blue:0.5 alpha:1.0]; -``` +重要的信息比如时间节点,一定要多次强调。刚开始的一段时间虽然章节很快被认领,但是完成的人很少。后来我开始在群里说,周三完成翻译开始校对,一天说了有十几遍吧,然后从第二天开始完成的人就越来越多。 -在 Swift 中这么调用: +大家参与开源项目时相对来说是比较被动的,如果你希望控制时间的话,一定要多次强调,把这个信息发送到每个人的潜意识里。 -``` -// SWIFT +## 把握发展方向 -let color = UIColor(red: 0.5, green: 0.0, blue: 0.5, alpha: 1.0) -``` +很多人会参与进来,但是几乎没人会主动考虑这个项目该如何发展,一定要记住这一点。 -### Accessing Properties - 属性访问 +如果你觉得很多人参与进来你就可以休息的话,那就大错特错了,大家擅长帮忙,但并不擅长主导项目。所以你要时刻提醒自己,下一步的目标是什么?我们应该怎么去做?主动提出一个方案然后和大家讨论,千万不要提出一个问题然后等待答案。 -在 Swift 中用点语法来访问、设置属性。 - -``` -// SWIFT - -myTextField.textColor = UIColor.darkGrayColor() -myTextField.text = "Hello world" -if myTextField.editing { - myTextField.editing = false -} -``` - -当获取或设置属性时,直接用属性名,不需要括号。注意 `darkGrayColor` 是 `UIColor` 中的方法,不是属性,因此带有括号。 - -在 Objc 中返回一个值并且不带参数的方法,可以看作隐式的属性访问器,并用和访问属性一样的语法来调用。这在 Swift 中很简单,只有在 Objc 中用 `@property` 语法声明的属性才会被看作属性。方法的导入、调用详见 [Working with Methods](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html#//apple_ref/doc/uid/TP40014216-CH4-XID_29)。 - -### Working with Methods - 方法调用 - -在 Swift 中调用 Obc 方法时,使用点语法。 - -因为 Objc 的方法都迁移到 Swift,方法名的第一部分作为基本的方法名,并出现在小括号左边。第一个实参写在小括号里面,并且不需要参数名;方法名的其余部分与实参相应写在小括号里面。方法名的所有部分在调用端都是必须的。 - -例如 Objc 中这样调用: - -``` -// OBJECTIVE-C - -[myTableView insertSubview:mySubview atIndex:2]; -``` - -在 Swift 中这样调用: - -``` -// SWIFT - -myTableView.insertSubview(mySubview, atIndex: 2) -``` - -如果调用的方法不带参数,你还是需要写上括号。 - -``` -// SWIFT - -myTableView.layoutIfNeeded() -``` - -### id Compatibility - 兼容 id - -Swift 包含一个叫做 `AnyObject` 的协议类型来表示任意一种对象,就像 Objc `id` 一样。`AnyObject` 协议允许你在写类型安全的 Swift 代码的同时,保留无类型(`untyped`)对象的灵活性。正由于 `AnyObjcet` 协议提供的安全性,Swift 用 `AnyObject` 替代 `id`。 - -像 `id` 一样,你可以把任何类类型的对象赋值(assign)给用 `AnyObject` 声明的常量或变量,也可以把变量重新赋值到不同类型的对象。 - -``` -// SWIFT - -var myObject: AnyObject = UITableViewCell() -myObject = NSDate() -``` - -也可以不经过类型转换来调用 Objc 的方法或访问属性(后赋值给常量),但必须是 Objc 中用 `@objc attribute` 标记过的兼容方法。 - -``` -// SWIFT - -let futureDate = myObject.dateByAddingTimeInterval(10) -let timeSinceNow = myObject.timeIntervalSinceNow -``` - -然而因为 `AnyObject` 对象只有到运行时才确定其真实类型,这很可能写出不安全的代码。另外对比 Objc ,如果你调用(或访问) `AnyObject` 对象不存在的方法(或属性),这会导致运行时错误。例如下面的代码会编译通过,但是在运行时引发 `unrecognized selector error`: - -``` -// SWIFT - -myObject.characterAtIndex(5) -// crash, myObject does't respond to that method -``` - -但是,你可以在代码中用 Swift 中的`可选值`(`optional`)来消除这种常见的 Objc error。当你在一个 `AnyObject` 类型的对象上调用一个 Objc 方法时,事实上跟`可选值隐式拆包`(`implicitly unwrapped optional`)很类似。你可以用跟可选协议中的方法相同的`可选链`(`optional chaining`)语法来调用 `AnyObject` 对象的方法。这对属性也同样适用。 - -例如下面的代码,第1~2行将不会执行,因为 `NSDate` 对象不存在 `length` 属性和 `characterAtIndex:` 方法。常量 `myLength` 将会被推断为可选整型(`optional Int`),并且赋值为 `nil`。你也可以用 `if-let` 语句来尝试性地拆包方法调用的结果,因为对象调用的方法可能不存在(not respond to),正如下面第3行所示: - -``` -// SWIFT - -let myLength = myObject.length? -let myChar = myObject.characterAtIndex?(5) -if let fifthCharacter = myObject.characterAtIndex(5) { - println("Found \(fifthCharacter) at index 5") -} -``` - -> 译注:关于可选链(`Optional Chain`),建议读下官方教程的 [Optional Chaining](https://github.com/CocoaChina-editors/Welcome-to-Swift/blob/master/The%20Swift%20Programming%20Language/02Language%20Guide/17Optional%20Chaining.md) 和这篇 “[Swift之 ? 和 !](http://joeyio.com/ios/2014/06/04/swift---/)”。 - -和 Swfit 中所有向下转型(`downcast`)一样,从 `AnyObject` 转型为具体对象类型是不保证成功的,因此会返回可选值(`optional value`),你可以通过检测可选值来确定转型是否成功。 - -``` -// SWIFT - -let userDefaults = NSUserDefaults.standardUserDefaults() -let lastRefreshDate: AnyObject? = userDefaults.objectForKey("LastRefreshDate") -if let date = lastRefreshDate as? NSDate { - println("\(date.timeIntervalSinceReferenceDate)") -} -``` - -Of course, if you are certain of the type of the object (and know that it is not nil), you can force the invocation with the as operator. - -当然如果你确定一个对象的类型(并且对象不为 `nil`),你可以把它作为操作数强行调用。 - -``` -// SWIFT - -let myDate = lastRefreshDate as NSDate -let timeInterval = myDate.timeIntervalSinceReferenceDate -``` - -### Working with nil - 关于 nil - -Objc 用原始指针(可能为 `NULL`,即 Objc 中的 `nil`)来指向对象。Swift 中的所有值(包括结构体,对象引用)都是非空的(`non-nil`)。作为替代,可以用一个`可选类型`(`optional type`)来表示一个值,尽管在封包过程中可能会丢失这个值。当值丢失时,得到的是 `nil`。阅读 [Optional](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5) 来了解更多。 - -**由于 Objc 没有确保对象非空(`non-nil`),Swift 在将 Objc API 导入时,将所有实参类型和返回类型都改成可选类型。当你使用 Objc 对象时,应该先检查它是否为 `nil`。** - -在某些情况下,你可能100%确定一个 Objc 方法或属性不会返回 `nil` 对象引用。为了在这些情景下更方便地使用对象,Swift 引入了叫做`隐式拆包可选值`(`implicitly unwrapped optionals`)的类型,它包含所有可选类型的安全特性。另外,你可以直接访问它的值,不用判断是否为 `nil`或者将它拆包。当你在未经过安全拆包之前访问这种可选类型的值时,隐式拆包可选值会检查值是否已经丢失,如果已经丢失,会发生运行时错误。因此,你应该总是自行检查或拆包一个`隐式拆包可选值`,除非你确定这个值没有丢失。 - - -### Extensions - 扩展 - -Swift 的扩展(`extension`)类似于 Objc 的类别(`category`),`extension` 给 Swift 现有的类,结构体,枚举,增加行为,也适用于 Objc 中定义的类、结构体和枚举。你可以给一个类型定义一个 `extension`,不管这个类型来自系统 framework 还是你自定义的类型。简单地导入对应的模块,用你在 Objc 中那样用相同的名字引用类,结构体和枚举。 - -例如你可以用等边三角型来扩展 `UIBezierPath` 类,基于你提供的边长和起始点创建一个简单的 Bézier 路径。 - -``` -// SWIFT - -extension UIBezierPath { - convenience init(triangleSideLength: Float, origin: CGPoint) { - self.init() - let squareRoot = Float(sqrt(3)) - let altitude = (squareRoot * triangleSideLength) / 2 - moveToPoint(origin) - addLineToPoint(CGPoint(triangleSideLength, origin.x)) - addLineToPoint(CGPoint(triangleSideLength / 2, altitude)) - closePath() - } -} -``` - -可以用 `extension` 添加属性(包括类属性,静态属性),但是这些**属性必须进行计算;`extension` 并不能给类型,结构体,枚举添加存储属性(`stored property`)。** - -下面的例子扩展了 `CGRect` 结构体,使之拥有一个计算 `area` 的属性: - -``` -// SWIFT - -extension CGRect { - var area: CGFloat { - return width * height - } -} -let rect = CGRect(x: 0.0, y: 0.0, width: 10.0, height: 50.0) -let area = rect.area -// area: CGFloat = 500.0 -``` - -也可以用 `extension` 给类添加协议(`protocol conformance`)而无需继承这个类。如果是 Swift 中定义的协议,你可以将它添加到结构体或者枚举,不管这个结构体或枚举是来自 Swift 还是 Objc。 - -**不能用 `extension` 对 Objc 类型现有的方法或属性进行重载(`override`)。** - -### Closures - 闭包 - -Objective-C blocks are automatically imported as Swift closures. For example, here is an Objective-C block variable: - -Objc 的 `block` 被自动导入为 Swift 的闭包(`closure`)。例如下面的 Objc block 变量: - -``` -// OBJECTIVE-C - -void (^completionBlock)(NSData *, NSError *) = ^(NSData *data, NSError *error) { - /* ... */ -} -``` - -在 Swift 中看起来是这样的: - -``` -// SWIFT - -let completionBlock: (NSData, NSError) -> Void = { data, error in - /* ... */ -} -``` - -Swift 的闭包和 Objc 的 block 是兼容的,所以你可以将 Swift 的闭包作为实参传给 Objc 中期望传入 block 的方法。Swift 的闭包和函数是相同的类型,所以你甚至可以传递 Swift 的函数名。 - -闭包拥有和 block 相似的捕获语义(`capture semantic`),但是有一个关键的不同之处:变量是可变的而不是拷贝一个副本。换句话说,Swift 中闭包的变量默认等同于 Objc 中用 `__block` 修饰的变量。 - -### Object Comparison - 对象比较 - -Swift 中比较两个对象有两种不同的方式。一种是相等(`equality ==`),比较两个对象的内容;另一种是全等(`identity ===`),比较两个常量或变量是否指向同一个的对象实例。 - -Swift 和 Objc 对象在 Swift 中一般用 `==` 和 `===` 操作符进行比较。Swift 为继承自 `NSObject` 类的对象提供了 `==` 操作符的默认实现,即 Swift 会调用 `NSObject` 类定义的 `isEqual:` 方法。`NSObject` 类只会判断是否全等(`identity comparison`,即是否指向同一实例),所以你应该自己实现 `NSObject` 子类的 `isEqual:` 方法。由于你可以传递 Swift 对心爱难过(包括那些没有继承自 `NSObject` 类的类对象)给 Objc API,你应该实现 `isEqual:` 方法,以便 Objc API 可以判断两个对象的内容是否相同,而不是判断是否指向同一个实例。 - -作为类对象判等的一部分,确保根据对象比较的规则来实现 `hash` 属性。进一步说,如果你想用你的类对象作为字典的 key,你还要实现 `Hashable` 协议的 `hashValue` 属性。 - -### Swift Type Compatibility - Swift 类型兼容性 - -当你在 Swift 中定义一个类继承自 `NSObject` 类或其他任意 Objc 类时,这个类自动与 Objc 兼容。这些步骤由 Swift 编译器为你完成。如果你不打算将一个 Swift 类导入到 Objc,那么你不用担心类型兼容相关的问题。另外,如果你的 Swift 类没有继承自 Objc 的类,并且你将会在 Objc 代码中使用,那么可以用 `@objc` 来修饰它。 - -`@objc attribute` 使你的 Swift API 在 Objc 与其运行时中可用。换句话说,你可以用 `@objc` 来修饰任何你想在 Objc 使用的 Swift 类,方法,属性。如果你的 Swift 类继承自 Objc 的类,编译器会自动给 Swift 类插入 `@objc`。编译器也会自动为类的所有方法和属性添加 `@objc`,只要这个类用 `@objc` 修饰了。当你用 `@IBOutlet` `@IBAction` `@NSManaged` 时,`@objc` 也会被自动加上。`@objc` 在你用 Objc 类的 `selector` 实现 `target-action` 设计模式这一类工作时很有用,例如 `NSTimer` 和 `UIButton`。 - -当你在 Objc 中使用 Swift API,编译器通常直接翻译。例如 Swift API `func playSong(name: String)` 会被导入 Objc 变成 `- (void)playSong:(NSString *)name`。但是有一个例外:当你在 Objc 中使用 Swift 初始化方法时,编译器为你在方法名最前面添加 `initWith` 字样,并且适当地将原来初始化方法的首字母大写。例如,Swift 的初始化方法 ` init (songName: String, artist: String)` 会被导入 Objc 变成 `(instancetype)initWithSongName:(NSString *)songName artist:(NSString *)artist`。 - -Swift 也提供一个 `@objc` 的变型类允许你指定 Objc 的符号名(`symbol`)。例如,如果你的 Swift 类名含有 Objc 不支持的字符,你可以指定一个替代名以便在 Objc 中使用。如果你想为 Swift 函数提供一个 Objc 名称,应该使用 Objc 的 `selector` 语法,要记得为 `selector` 的每一部分加上分号(`:`)。 - -``` -// SWIFT - -@objc(Squirrel) -class Белка { - @objc(initWithName:) - init (имя: String) { /*...*/ } - @objc(hideNuts:inTree:) - func прячьОрехи(Int, вДереве: Дерево) { /*...*/ } -} -``` - -当你给 Swift 类使用 `@objc(<#name#>)` 时,这个类可以在 Objc 中使用,并且不需要任何命名空间。因此 `@objc(<#name#>)` 在你迁移可存档的(`archivable`) Objc 类到 Swift 时很有用,因为被存档的(`archived`)对象在存档中保存了它们的类名,你在 Objc 类中应该用 `@objc(<#name#>)` 来指定同样的名字,使得旧的存档可以在你新的 Swift 类中反存档(`unarchived`)。 - -### Objective-C Selectors - -Objc 的 `selector` 是一种指向 Objc 方法名的类型。在 Swift 中,Objc 的 `selector` 相应地用 `Selector` 结构体表示。你可以用 string 字面量来构造一个 Swift 的 `Selector`,例如:`let mySelector: Selector = "tappedButton:"`。由于 string 字面量会自动转化为 `selector`,因此你可以传递一个 string 字面量给任何接受 `selector` 作为参数的方法。 - -``` -// SWIFT - -import UIKit - -class MyViewController: UIViewController { - let myButton = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: 50)) - - init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) { - super.init(nibName: nibName, bundle: nibBundle) - myButton.targetForAction("tappedButton:", withSender: self) - } - - func tappedButton(sender: UIButton!) { - println("tapped button") - } -} -``` - -> **注意** -> -> **`performSelector:` 方法和其他与方法调用(`selector-invoking`)相关的方法没有被迁移到 Swift,因为他们固有的不安全性。** - -如果你的 Swift 类继承自 Objc 的类,那么这个类的所有方法和属性都是对 Objc `selector` 可见的。反之,如果 Swift 类没有继承自 Objc 类,你需要加上 `@objc` 修饰符,使得它们成为 Objc 中可用的 `selector`,详见前面的 [Swift Type Compatibility](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html#//apple_ref/doc/uid/TP40014216-CH4-XID_36) 一节。 +# 一点感想 +还是那句话,万万没想到。 +第一天我还在和朋友说,我真羡慕别人的项目,有200多个Star,结果第二天我自己的项目就有了300多个Star,第三天600多……开始时候其实是抱着“做做试试”的心态来翻译,但是当Star和译者多起来之后,翻译完成就变成了一个责任,你肩负的是所有人的努力,一定不能让大家失望。 +这大概是我21年来做得最大的一件事。 diff --git a/Using Swift with Cocoa and ObjectiveC/03Mix and Match/DAG_2x.png b/Using Swift with Cocoa and ObjectiveC/03Mix and Match/DAG_2x.png old mode 100644 new mode 100755 diff --git a/Using Swift with Cocoa and ObjectiveC/03Mix and Match/Swift and Objective-C in the Same Project.md b/Using Swift with Cocoa and ObjectiveC/03Mix and Match/Swift and Objective-C in the Same Project.md old mode 100644 new mode 100755 diff --git a/Using Swift with Cocoa and ObjectiveC/03Mix and Match/bridgingheader_2x.png b/Using Swift with Cocoa and ObjectiveC/03Mix and Match/bridgingheader_2x.png old mode 100644 new mode 100755 diff --git a/change_cdn.py b/change_cdn.py old mode 100644 new mode 100755 index 312074b9..9842e4c7 --- a/change_cdn.py +++ b/change_cdn.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# coding:utf-8 import os @@ -14,6 +15,7 @@ def iter(path): insert_pos = content.find("", content.find("Generated using GitBook")) + 6 content = content[:insert_pos] + '''
  • ''' + content[insert_pos:] + content.replace(r'.*?', "《The Swift Programming Language》完整中文版") with open(root + '/' + fn, 'w') as f: f.write(content) diff --git a/chapter1/01_swift.html b/chapter1/01_swift.html index 0e764f69..47a1c05c 100644 --- a/chapter1/01_swift.html +++ b/chapter1/01_swift.html @@ -1,57 +1,45 @@ - - + - 关于 Swift | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,15 +595,19 @@
    -
    +
    -

    关于 Swift

    -

    Swift 是一种新的编程语言,用于编写 iOS 和 OS X 应用。Swift 结合了 C 和 Objective-C 的优点并且不受C的兼容性的限制。Swift 使用安全的编程模式并添加了很多新特性,这将使编程更简单,扩展性更强,也更有趣。除此之外,Swift 还支持人见人爱的 Cocoa 和 Cocoa Touch 框架。拥有了这些特性,Swift将重新定义软件开发。

    -

    Swift 的开发从很久之前就开始了。为了给 Swift 打好基础,苹果公司改进了编译器,调试器和框架结构。我们使用自动引用计数(Automatic Reference Counting, ARC)来简化内存管理。我们在 Foundation 和 Cocoa的基础上构建框架栈并将其标准化。Objective-C 本身支持块、集合语法和模块,所以框架可以轻松支持现代编程语言技术。得益于这些基础工作,我们现在可以发布一个新语言,用于未来的苹果软件的开发。

    -

    Objective-C 开发者对于 Swift 并不会感到陌生。它采用了 Objective-C 的命名参数以及动态对象模型,可以无缝对接到现有的 Cocoa 框架,并且可以兼容 Objective-C 代码。在此基础之上,Swift 还有许多新特性并且支持过程式编程和面向对象编程。

    +
    +

    翻译:numbbbbb
    校对:yeahdongcn

    +
    +

    关于 Swift

    +
    +

    Swift 是一种新的编程语言,用于编写 iOS 和 OS X 应用。Swift 结合了 C 和 Objective-C 的优点并且不受 C 兼容性的限制。Swift 采用安全的编程模式并添加了很多新特性,这将使编程更简单,更灵活,也更有趣。Swift 是基于成熟而且倍受喜爱的 Cocoa 和 Cocoa Touch 框架,它的降临将重新定义软件开发。

    +

    Swift 的开发从很久之前就开始了。为了给 Swift 打好基础,苹果公司改进了编译器,调试器和框架结构。我们使用自动引用计数(Automatic Reference Counting, ARC)来简化内存管理。我们在 Foundation 和 Cocoa 的基础上构建框架栈并将其标准化。Objective-C 本身支持块、集合语法和模块,所以框架可以轻松支持现代编程语言技术。正是得益于这些基础工作,我们现在才能发布这样一个用于未来苹果软件开发的新语言。

    +

    Objective-C 开发者对 Swift 并不会感到陌生。它采用了 Objective-C 的命名参数以及动态对象模型,可以无缝对接到现有的 Cocoa 框架,并且可以兼容 Objective-C 代码。在此基础之上,Swift 还有许多新特性并且支持过程式编程和面向对象编程。

    Swift 对于初学者来说也很友好。它是第一个既满足工业标准又像脚本语言一样充满表现力和趣味的编程语言。它支持代码预览,这个革命性的特性可以允许程序员在不编译和运行应用程序的前提下运行 Swift 代码并实时查看结果。

    -

    Swift 将现代编程语言的精华和苹果工程师文化的智慧结合了起来。编译器对性能进行了优化,编程语言对开发进行了优化,两者互不干扰,鱼与熊掌兼得。Swift 即可以用于开发“hello, world”这样的小程序,也可以用于开发一个完整的操作系统。所有的这些特性让 Swift 对于开发者和苹果来说都是一项值得的投资。

    -

    用 Swift 编写 iOS 和 OS X 应用将是一场美妙的体验,Swift 之后也会不断开发新特性和兼容性。我们对 Swift 充满信心,你还在等什么!

    +

    Swift 将现代编程语言的精华和苹果工程师文化的智慧结合了起来。编译器对性能进行了优化,编程语言对开发进行了优化,两者互不干扰,鱼与熊掌兼得。Swift 既可以用于开发 “hello, world” 这样的小程序,也可以用于开发一套完整的操作系统。所有的这些特性让 Swift 对于开发者和苹果来说都是一项值得的投资。

    +

    Swift 是编写 iOS 和 OS X 应用的极佳手段,并将伴随着新的特性和功能持续演进。我们对 Swift 充满信心,你还在等什么!

    @@ -614,16 +626,8 @@
    - - - - - - - - - - + + @@ -641,6 +645,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter1/02_a_swift_tour.html b/chapter1/02_a_swift_tour.html index 5c326b8e..8ec50b79 100644 --- a/chapter1/02_a_swift_tour.html +++ b/chapter1/02_a_swift_tour.html @@ -1,57 +1,45 @@ - - + - Swift 初见 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,71 +595,91 @@
    -
    +
    -

    Swift 初见

    +
    +

    翻译:numbbbbb +校对:shinyzhu, stanzhai

    +
    +

    Swift 初见

    +

    本页内容包括:

    通常来说,编程语言教程中的第一个程序应该在屏幕上打印“Hello, world”。在 Swift 中,可以用一行代码实现:

    -
    println("Hello, world")
    -

    如果你写过 C 或者 Objective-C 代码,那你应该很熟悉这种形式——在 Swift 中,这行代码就是一个完整的程序。你不需要为了输入输出或者字符串处理导入一个单独的库。全局作用域中的代码会被自动当做程序的入口点,所以你也不需要main函数。你同样不需要在每个语句结尾写上分号。

    +
    println("Hello, world")
    +
    +

    如果你写过 C 或者 Objective-C 代码,那你应该很熟悉这种形式——在 Swift 中,这行代码就是一个完整的程序。你不需要为了输入输出或者字符串处理导入一个单独的库。全局作用域中的代码会被自动当做程序的入口点,所以你也不需要main函数。你同样不需要在每个语句结尾写上分号。

    这个教程会通过一系列编程例子来让你对 Swift 有初步了解,如果你有什么不理解的地方也不用担心——任何本章介绍的内容都会在后面的章节中详细讲解。

    -

    注意:为了获得最好的体验,在 Xcode 当中使用代码预览功能。代码预览功能可以让你编辑代码并实时看到运行结果。

    +

    注意: +为了获得最好的体验,在 Xcode 当中使用代码预览功能。代码预览功能可以让你编辑代码并实时看到运行结果。 +打开Playground

    +

    简单值

    -

    使用let来声明常量,使用var来声明变量。一个常量的值在编译时并不需要获取,但是你只能为它赋值一次。也就是说你可以用常量来表示这样一个值:你只需要决定一次,但是需要使用很多次。

    -
    var myVariable = 42
    +

    使用let来声明常量,使用var来声明变量。一个常量的值,在编译的时候,并不需要有明确的值,但是你只能为它赋值一次。也就是说你可以用常量来表示这样一个值:你只需要决定一次,但是需要使用很多次。

    +
    var myVariable = 42
     myVariable = 50
     let myConstant = 42
    -

    常量或者变量的类型必须和你赋给它们的值一样。然而,声明时类型是可选的,声明的同时赋值的话,编译器会自动推断类型。在上面的例子中,编译器推断出myVariable是一个整数(integer)因为它的初始值是整数。

    +
    +

    常量或者变量的类型必须和你赋给它们的值一样。然而,声明时类型是可选的,声明的同时赋值的话,编译器会自动推断类型。在上面的例子中,编译器推断出myVariable是一个整数(integer)因为它的初始值是整数。

    如果初始值没有提供足够的信息(或者没有初始值),那你需要在变量后面声明类型,用冒号分割。

    -
    let implicitInteger = 70
    +
    let implicitInteger = 70
     let implicitDouble = 70.0
     let explicitDouble: Double = 70
    -
    -

    练习:创建一个常量,显式指定类型为Float并指定初始值为4。

    +
    +
    +

    练习: +创建一个常量,显式指定类型为Float并指定初始值为4。

    值永远不会被隐式转换为其他类型。如果你需要把一个值转换成其他类型,请显式转换。

    -
    let label = "The width is"
    +
    let label = "The width is"
     let width = 94
     let widthLabel = label + String(width)
    -
    -

    练习:删除最后一行中的String,错误提示是什么?

    +
    +
    +

    练习: +删除最后一行中的String,错误提示是什么?

    有一种更简单的把值转换成字符串的方法:把值写到括号中,并且在括号之前写一个反斜杠。例如:

    -
    let apples = 3
    +
    let apples = 3
     let oranges = 5
     let appleSummary = "I have \(apples) apples."
     let fruitSummary = "I have \(apples + oranges) pieces of fruit."
    -
    -

    练习:使用\()来把一个浮点计算转换成字符串,并加上某人的名字,和他打个招呼。

    +
    +
    +

    练习: +使用\()来把一个浮点计算转换成字符串,并加上某人的名字,和他打个招呼。

    使用方括号[]来创建数组和字典,并使用下标或者键(key)来访问元素。

    -
    var shoppingList = ["catfish", "water", "tulips", "blue paint"]
    +
    var shoppingList = ["catfish", "water", "tulips", "blue paint"]
     shoppingList[1] = "bottle of water"
    -
    -var occupations = [
    +
    +
    var occupations = [
         "Malcolm": "Captain",
         "Kaylee": "Mechanic",
     ]
     occupations["Jayne"] = "Public Relations"
    -

    要创建一个空数组或者字典,使用初始化语法。

    -
    let emptyArray = String[]()
    +
    +

    要创建一个空数组或者字典,使用初始化语法。

    +
    let emptyArray = String[]()
     let emptyDictionary = Dictionary<String, Float>()
    -

    如果类型信息可以被推断出来,你可以用[][:]来创建空数组和空字典——就像你声明变量或者给函数传参数的时候一样。

    -
    shoppingList = []   // 去逛街并买点东西
    -

    控制流

    +
    +

    如果类型信息可以被推断出来,你可以用[][:]来创建空数组和空字典——就像你声明变量或者给函数传参数的时候一样。

    +
    shoppingList = []   // 去逛街并买点东西
    +
    +

    +

    控制流

    使用ifswitch来进行条件操作,使用for-inforwhiledo-while来进行循环。包裹条件和循环变量括号可以省略,但是语句体的大括号是必须的。

    -
    let individualScores = [75, 43, 103, 87, 12]
    +
    let individualScores = [75, 43, 103, 87, 12]
     var teamScore = 0
     for score in individualScores {
         if score > 50 {
    @@ -661,9 +689,10 @@ for score in individualScores {
         }
     }
     teamScore
    -

    if语句中,条件必须是一个布尔表达式——这意味着像if score { ... }这样的代码将报错,而不会隐形地与 0 做对比。

    +
    +

    if语句中,条件必须是一个布尔表达式——这意味着像if score { ... }这样的代码将报错,而不会隐形地与 0 做对比。

    你可以一起使用iflet来处理值缺失的情况。有些变量的值是可选的。一个可选的值可能是一个具体的值或者是nil,表示值缺失。在类型后面加一个问号来标记这个变量的值是可选的。

    -
    var optionalString: String? = "Hello"
    +
    var optionalString: String? = "Hello"
     optionalString == nil
     
     var optionalName: String? = "John Appleseed"
    @@ -671,12 +700,14 @@ var greeting = "Hello!"
     if let name = optionalName {
         greeting = "Hello, \(name)"
     }
    -
    -

    练习:把optionalName改成nil,greeting会是什么?添加一个else语句,当optionalNamenil时给greeting赋一个不同的值。

    +
    +
    +

    练习: +把optionalName改成nil,greeting会是什么?添加一个else语句,当optionalNamenil时给greeting赋一个不同的值。

    如果变量的可选值是nil,条件会判断为false,大括号中的代码会被跳过。如果不是nil,会将值赋给let后面的常量,这样代码块中就可以使用这个值了。

    switch支持任意类型的数据以及各种比较操作——不仅仅是整数以及测试相等。

    -
    let vegetable = "red pepper"
    +
    let vegetable = "red pepper"
     switch vegetable {
     case "celery":
         let vegetableComment = "Add some raisins and make ants on a log."
    @@ -687,12 +718,14 @@ case let x where x.hasSuffix("pepper"):
     default:
         let vegetableComment = "Everything tastes good in soup."
     }
    -
    -

    练习:删除default语句,看看会有什么错误?

    +
    +
    +

    练习: +删除default语句,看看会有什么错误?

    运行switch中匹配到的子句之后,程序会退出switch语句,并不会继续向下运行,所以不需要在每个子句结尾写break

    你可以使用for-in来遍历字典,需要两个变量来表示每个键值对。

    -
    let interestingNumbers = [
    +
    let interestingNumbers = [
         "Prime": [2, 3, 5, 7, 11, 13],
         "Fibonacci": [1, 1, 2, 3, 5, 8],
         "Square": [1, 4, 9, 16, 25],
    @@ -706,11 +739,13 @@ for (kind, numbers) in interestingNumbers {
         }
     }
     largest
    -
    -

    练习:添加另一个变量来记录哪种类型的数字是最大的。

    +
    +
    +

    练习: +添加另一个变量来记录哪种类型的数字是最大的。

    使用while来重复运行一段代码直到不满足条件。循环条件可以在开头也可以在结尾。

    -
    var n = 2
    +
    var n = 2
     while n < 100 {
         n = n * 2
     }
    @@ -721,8 +756,9 @@ do {
         m = m * 2
     } while m < 100
     m
    -

    你可以在循环中使用..来表示范围,也可以使用传统的写法,两者是等价的:

    -
    var firstForLoop = 0
    +
    +

    你可以在循环中使用..来表示范围,也可以使用传统的写法,两者是等价的:

    +
    var firstForLoop = 0
     for i in 0..3 {
         firstForLoop += i
     }
    @@ -733,23 +769,28 @@ for var i = 0; i < 3; ++i {
         secondForLoop += 1
     }
     secondForLoop
    -

    使用..创建的范围不包含上界,如果想包含的话需要使用...

    +
    +

    使用..创建的范围不包含上界,如果想包含的话需要使用...

    +

    函数和闭包

    使用func来声明一个函数,使用名字和参数来调用函数。使用->来指定函数返回值。

    -
    func greet(name: String, day: String) -> String {
    +
    func greet(name: String, day: String) -> String {
         return "Hello \(name), today is \(day)."
     }
     greet("Bob", "Tuesday")
    -
    -

    练习:删除day参数,添加一个参数来表示今天吃了什么午饭。

    +
    +
    +

    练习: +删除day参数,添加一个参数来表示今天吃了什么午饭。

    使用一个元组来返回多个值。

    -
    func getGasPrices() -> (Double, Double, Double) {
    +
    func getGasPrices() -> (Double, Double, Double) {
         return (3.59, 3.69, 3.79)
     }
     getGasPrices()
    -

    函数的参数数量是可变的,用一个数组来获取它们:

    -
    func sumOf(numbers: Int...) -> Int {
    +
    +

    函数可以带有可变个数的参数,这些参数在函数内表现为数组的形式:

    +
    func sumOf(numbers: Int...) -> Int {
         var sum = 0
         for number in numbers {
             sum += number
    @@ -758,11 +799,13 @@ getGasPrices()
     }
     sumOf()
     sumOf(42, 597, 12)
    -
    -

    练习:写一个计算参数平均值的函数。

    +
    +
    +

    练习: +写一个计算参数平均值的函数。

    函数可以嵌套。被嵌套的函数可以访问外侧函数的变量,你可以使用嵌套函数来重构一个太长或者太复杂的函数。

    -
    func returnFifteen() -> Int {
    +
    func returnFifteen() -> Int {
         var y = 10
         func add() {
             y += 5
    @@ -771,8 +814,9 @@ sumOf(42, 597, 12)
         return y
     }
     returnFifteen()
    -

    函数是一等公民,这意味着函数可以作为另一个函数的返回值。

    -
    func makeIncrementer() -> (Int -> Int) {
    +
    +

    函数是第一等类型,这意味着函数可以作为另一个函数的返回值。

    +
    func makeIncrementer() -> (Int -> Int) {
         func addOne(number: Int) -> Int {
             return 1 + number
         }
    @@ -780,8 +824,9 @@ returnFifteen()
     }
     var increment = makeIncrementer()
     increment(7)
    -

    函数也可以当做参数传入另一个函数。

    -
    func hasAnyMatches(list: Int[], condition: Int -> Bool) -> Bool {
    +
    +

    函数也可以当做参数传入另一个函数。

    +
    func hasAnyMatches(list: Int[], condition: Int -> Bool) -> Bool {
         for item in list {
             if condition(item) {
                 return true
    @@ -794,35 +839,45 @@ func lessThanTen(number: Int) -> Bool {
     }
     var numbers = [20, 19, 7, 12]
     hasAnyMatches(numbers, lessThanTen)
    -

    函数实际上是一种特殊的闭包,你可以使用{}来创建一个匿名闭包。使用in来分割参数、返回值与执行体。

    -
    numbers.map({
    +
    +

    函数实际上是一种特殊的闭包,你可以使用{}来创建一个匿名闭包。使用in将参数和返回值类型声明与闭包函数体进行分离。

    +
    numbers.map({
         (number: Int) -> Int in
         let result = 3 * number
         return result
    -    })
    -
    -

    练习:重写闭包,对所有奇数返回0.

    +}) +
    +
    +

    练习: +重写闭包,对所有奇数返回0。

    有很多种创建闭包的方法。如果一个闭包的类型已知,比如作为一个回调函数,你可以忽略参数的类型和返回值。单个语句闭包会把它语句的值当做结果返回。

    +
    numbers.map({ number in 3 * number })
    +

    你可以通过参数位置而不是参数名字来引用参数——这个方法在非常短的闭包中非常有用。当一个闭包作为最后一个参数传给一个函数的时候,它可以直接跟在括号后面。

    -
    sort([1, 5, 3, 12, 2]) { $0 > $1 }
    -

    对象和类

    +
    sort([1, 5, 3, 12, 2]) { $0 > $1 }
    +
    +

    +

    对象和类

    使用class和类名来创建一个类。类中属性的声明和常量、变量声明一样,唯一的区别就是它们的上下文是类。同样,方法和函数声明也一样。

    -
    class Shape {
    +
    class Shape {
         var numberOfSides = 0
         func simpleDescription() -> String {
             return "A shape with \(numberOfSides) sides."
         }
     }
    -
    -

    练习:使用let添加一个常量属性,再添加一个接收一个参数的方法。

    +
    +
    +

    练习: +使用let添加一个常量属性,再添加一个接收一个参数的方法。

    要创建一个类的实例,在类名后面加上括号。使用点语法来访问实例的属性和方法。

    -
    var shape = Shape()
    +
    var shape = Shape()
     shape.numberOfSides = 7
     var shapeDescription = shape.simpleDescription()
    -

    这个版本的Shape类缺少了一些重要的东西:一个构造函数来初始化类实例。使用init来创建一个构造器。

    -
    class NamedShape {
    +
    +

    这个版本的Shape类缺少了一些重要的东西:一个构造函数来初始化类实例。使用init来创建一个构造器。

    +
    class NamedShape {
         var numberOfSides: Int = 0
         var name: String
     
    @@ -834,11 +889,12 @@ var shapeDescription = shape.simpleDescription()
             return "A shape with \(numberOfSides) sides."
         }
     }
    -

    注意self被用来区别实例变量。当你创建实例的时候,像传入函数参数一样给类传入构造器的参数。每个属性都需要赋值——无论是通过声明(就像numberOfSides)还是通过构造器(就像name)。

    +
    +

    注意self被用来区别实例变量。当你创建实例的时候,像传入函数参数一样给类传入构造器的参数。每个属性都需要赋值——无论是通过声明(就像numberOfSides)还是通过构造器(就像name)。

    如果你需要在删除对象之前进行一些清理工作,使用deinit创建一个析构函数。

    子类的定义方法是在它们的类名后面加上父类的名字,用冒号分割。创建类的时候并不需要一个标准的根类,所以你可以忽略父类。

    子类如果要重写父类的方法的话,需要用override标记——如果没有添加override就重写父类方法的话编译器会报错。编译器同样会检测override标记的方法是否确实在父类中。

    -
    class Square: NamedShape {
    +
    class Square: NamedShape {
         var sideLength: Double
     
         init(sideLength: Double, name: String) {
    @@ -858,11 +914,13 @@ var shapeDescription = shape.simpleDescription()
     let test = Square(sideLength: 5.2, name: "my test square")
     test.area()
     test.simpleDescription()
    -
    -

    练习:创建NamedShape的另一个子类Circle,构造器接收两个参数,一个是半径一个是名称,实现areadescribe方法。

    +
    +
    +

    练习: +创建NamedShape的另一个子类Circle,构造器接收两个参数,一个是半径一个是名称,实现areadescribe方法。

    属性可以有 getter 和 setter 。

    -
    class EquilateralTriangle: NamedShape {
    +
    class EquilateralTriangle: NamedShape {
         var sideLength: Double = 0.0
     
         init(sideLength: Double, name: String) {
    @@ -876,7 +934,7 @@ test.simpleDescription()
             return 3.0 * sideLength
         }
         set {
    -                sideLength = newValue / 3.0
    +        sideLength = newValue / 3.0
         }
         }
     
    @@ -888,16 +946,17 @@ var triangle = EquilateralTriangle(sideLength: 3.1, name: "a triangle"
     triangle.perimeter
     triangle.perimeter = 9.9
     triangle.sideLength
    -

    perimeter的 setter 中,新值的名字是newValue。你可以在set之后显式的设置一个名字。

    +
    +

    perimeter的 setter 中,新值的名字是newValue。你可以在set之后显式的设置一个名字。

    注意EquilateralTriangle类的构造器执行了三步:

    1. 设置子类声明的属性值
    2. 调用父类的构造器
    3. 改变父类定义的属性值。其他的工作比如调用方法、getters和setters也可以在这个阶段完成。
    -

    如果你不需要计算属性但是需要在设置一个新值之前运行一些代码,使用willSetdidSet

    +

    如果你不需要计算属性,但是仍然需要在设置一个新值之前或者之后运行代码,使用willSetdidSet

    比如,下面的类确保三角形的边长总是和正方形的边长相同。

    -
    class TriangleAndSquare {
    +
    class TriangleAndSquare {
         var triangle: EquilateralTriangle {
         willSet {
             square.sideLength = newValue.sideLength
    @@ -918,8 +977,9 @@ triangleAndSquare.square.sideLength
     triangleAndSquare.triangle.sideLength
     triangleAndSquare.square = Square(sideLength: 50, name: "larger square")
     triangleAndSquare.triangle.sideLength
    -

    类中的方法和一般的函数有一个重要的区别,函数的参数名只在函数内部使用,但是方法的参数名需要在调用的时候显式说明(除了第一个参数)。默认情况下,方法的参数名和它在方法内部的名字一样,不过你也可以定义第二个名字,这个名字被用在方法内部。

    -
    class Counter {
    +
    +

    类中的方法和一般的函数有一个重要的区别,函数的参数名只在函数内部使用,但是方法的参数名需要在调用的时候显式说明(除了第一个参数)。默认情况下,方法的参数名和它在方法内部的名字一样,不过你也可以定义第二个名字,这个名字被用在方法内部。

    +
    class Counter {
         var count: Int = 0
         func incrementBy(amount: Int, numberOfTimes times: Int) {
             count += amount * times
    @@ -927,12 +987,15 @@ triangleAndSquare.triangle.sideLength
     }
     var counter = Counter()
     counter.incrementBy(2, numberOfTimes: 7)
    -

    处理变量的可选值时,你可以在操作(比如方法、属性和子脚本)之前加?。如果?之前的值是nil?后面的东西都会被忽略,并且整个表达式返回nil。否则,?之后的东西都会被运行。在这两种情况下,整个表达式的值也是一个可选值。

    -
    let optionalSquare: Square? = Square(sideLength: 2.5, name: "optional square")
    +
    +

    处理变量的可选值时,你可以在操作(比如方法、属性和子脚本)之前加?。如果?之前的值是nil?后面的东西都会被忽略,并且整个表达式返回nil。否则,?之后的东西都会被运行。在这两种情况下,整个表达式的值也是一个可选值。

    +
    let optionalSquare: Square? = Square(sideLength: 2.5, name: "optional square")
     let sideLength = optionalSquare?.sideLength
    -

    枚举和结构体

    +
    +

    +

    枚举和结构体

    使用enum来创建一个枚举。就像类和其他所有命名类型一样,枚举可以包含方法。

    -
    enum Rank: Int {
    +
    enum Rank: Int {
         case Ace = 1
         case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten
         case Jack, Queen, King
    @@ -953,16 +1016,19 @@ let sideLength = optionalSquare?.sideLength
     }
     let ace = Rank.Ace
     let aceRawValue = ace.toRaw()
    -
    -

    练习:写一个函数,通过比较它们的原始值来比较两个Rank值。

    +
    +
    +

    练习: +写一个函数,通过比较它们的原始值来比较两个Rank值。

    在上面的例子中,枚举原始值的类型是Int,所以你只需要设置第一个原始值。剩下的原始值会按照顺序赋值。你也可以使用字符串或者浮点数作为枚举的原始值。

    使用toRawfromRaw函数来在原始值和枚举值之间进行转换。

    -
    if let convertedRank = Rank.fromRaw(3) {
    +
    if let convertedRank = Rank.fromRaw(3) {
         let threeDescription = convertedRank.simpleDescription()
     }
    -

    枚举的成员值是实际值,并不是原始值的另一种表达方法。实际上,如果原始值没有意义,你不需要设置。

    -
    enum Suit {
    +
    +

    枚举的成员值是实际值,并不是原始值的另一种表达方法。实际上,如果原始值没有意义,你不需要设置。

    +
    enum Suit {
         case Spades, Hearts, Diamonds, Clubs
         func simpleDescription() -> String {
             switch self {
    @@ -980,13 +1046,15 @@ let aceRawValue = ace.toRaw()
     }
     let hearts = Suit.Hearts
     let heartsDescription = hearts.simpleDescription()
    -
    -

    练习:给Suit添加一个color方法,对spadesclubs返回“black”,对heartsdiamonds返回“red”。

    +
    +
    +

    练习: +给Suit添加一个color方法,对spadesclubs返回“black”,对heartsdiamonds返回“red”。

    注意,有两种方式可以引用Hearts成员:给hearts常量赋值时,枚举成员Suit.Hearts需要用全名来引用,因为常量没有显式指定类型。在switch里,枚举成员使用缩写.Hearts来引用,因为self的值已经知道是一个suit。已知变量类型的情况下你可以使用缩写。

    使用struct来创建一个结构体。结构体和类有很多相同的地方,比如方法和构造器。它们之间最大的一个区别就是 结构体是传值,类是传引用。

    -
    struct Card {
    +
    struct Card {
         var rank: Rank
         var suit: Suit
         func simpleDescription() -> String {
    @@ -996,12 +1064,14 @@ let heartsDescription = hearts.simpleDescription()
     }
     let threeOfSpades = Card(rank: .Three, suit: .Spades)
     let threeOfSpadesDescription = threeOfSpades.simpleDescription()
    -
    -

    练习:给Card添加一个方法,创建一副完整的扑克牌并把每张牌的rank和suit对应起来。

    +
    +
    +

    练习: +给Card添加一个方法,创建一副完整的扑克牌并把每张牌的 rank 和 suit 对应起来。

    一个枚举成员的实例可以有实例值。相同枚举成员的实例可以有不同的值。创建实例的时候传入值即可。实例值和原始值是不同的:枚举成员的原始值对于所有实例都是相同的,而且你是在定义枚举的时候设置原始值。

    例如,考虑从服务器获取日出和日落的时间。服务器会返回正常结果或者错误信息。

    -
    enum ServerResponse {
    +
    enum ServerResponse {
         case Result(String, String)
         case Error(String)
     }
    @@ -1015,18 +1085,22 @@ case let .Result(sunrise, sunset):
     case let .Error(error):
         let serverResponse = "Failure...  \(error)"
     }
    -
    -

    练习:给ServerResponseswitch添加第三种情况。

    +
    +
    +

    练习: +给ServerResponseswitch添加第三种情况。

    注意如何从ServerResponse中提取日升和日落时间。

    -

    接口和扩展

    -

    使用protocol来声明一个接口。

    -
    protocol ExampleProtocol {
    +

    +

    协议和扩展

    +

    使用protocol来声明一个协议。

    +
    protocol ExampleProtocol {
         var simpleDescription: String { get }
         mutating func adjust()
     }
    -

    类、枚举和结构体都可以实现接口。

    -
    class SimpleClass: ExampleProtocol {
    +
    +

    类、枚举和结构体都可以实现协议。

    +
    class SimpleClass: ExampleProtocol {
         var simpleDescription: String = "A very simple class."
         var anotherProperty: Int = 69105
         func adjust() {
    @@ -1046,12 +1120,14 @@ struct SimpleStructure: ExampleProtocol {
     var b = SimpleStructure()
     b.adjust()
     let bDescription = b.simpleDescription
    -
    -

    练习:写一个实现这个接口的枚举。

    +
    +
    +

    练习: +写一个实现这个协议的枚举。

    注意声明SimpleStructure时候mutating关键字用来标记一个会修改结构体的方法。SimpleClass的声明不需要标记任何方法因为类中的方法经常会修改类。

    -

    使用extension来为现有的类型添加功能,比如添加一个计算属性的方法。你可以使用扩展来给任意类型添加协议,甚至是你从外部库或者框架中导入的类型。

    -
    extension Int: ExampleProtocol {
    +

    使用extension来为现有的类型添加功能,比如新的方法和参数。你可以使用扩展来改造定义在别处,甚至是从外部库或者框架引入的一个类型,使得这个类型遵循某个协议。

    +
    extension Int: ExampleProtocol {
         var simpleDescription: String {
         return "The number \(self)"
         }
    @@ -1060,17 +1136,21 @@ let bDescription = b.simpleDescription
         }
     }
     7.simpleDescription
    -
    -

    练习:给Double类型写一个扩展,添加absoluteValue功能。

    +
    +
    +

    练习: +给Double类型写一个扩展,添加absoluteValue功能。

    -

    你可以像使用其他命名类型一样使用接口名——例如,创建一个有不同类型但是都实现一个接口的对象集合。当你处理类型是接口的值时,接口外定义的方法不可用。

    -
    let protocolValue: ExampleProtocol = a
    +

    你可以像使用其他命名类型一样使用协议名——例如,创建一个有不同类型但是都实现一个协议的对象集合。当你处理类型是协议的值时,协议外定义的方法不可用。

    +
    let protocolValue: ExampleProtocol = a
     protocolValue.simpleDescription
     // protocolValue.anotherProperty  // Uncomment to see the error
    -

    即使protocolValue变量运行时的类型是simpleClass,编译器会把它的类型当做ExampleProtocol。这表示你不能调用类在它实现的接口之外实现的方法或者属性。

    +
    +

    即使protocolValue变量运行时的类型是simpleClass,编译器会把它的类型当做ExampleProtocol。这表示你不能调用类在它实现的协议之外实现的方法或者属性。

    +

    泛型

    在尖括号里写一个名字来创建一个泛型函数或者类型。

    -
    func repeat<ItemType>(item: ItemType, times: Int) -> ItemType[] {
    +
    func repeat<ItemType>(item: ItemType, times: Int) -> ItemType[] {
         var result = ItemType[]()
         for i in 0..times {
             result += item
    @@ -1078,16 +1158,18 @@ protocolValue.simpleDescription
         return result
     }
     repeat("knock", 4)
    -

    你也可以创建泛型类、枚举和结构体。

    -
    // Reimplement the Swift standard library's optional type
    +
    +

    你也可以创建泛型类、枚举和结构体。

    +
    // Reimplement the Swift standard library's optional type
     enum OptionalValue<T> {
         case None
         case Some(T)
     }
     var possibleInteger: OptionalValue<Int> = .None
     possibleInteger = .Some(100)
    -

    在类型名后面使用where来指定一个需求列表——例如,要限定实现一个协议的类型,需要限定两个类型要相同,或者限定一个类必须有一个特定的父类。

    -
    func anyCommonElements <T, U where T: Sequence, U: Sequence, T.GeneratorType.Element: Equatable, T.GeneratorType.Element == U.GeneratorType.Element> (lhs: T, rhs: U) -> Bool {
    +
    +

    在类型名后面使用where来指定对类型的需求,比如,限定类型实现某一个协议,限定两个类型是相同的,或者限定某个类必须有一个特定的父类

    +
    func anyCommonElements <T, U where T: Sequence, U: Sequence, T.GeneratorType.Element: Equatable, T.GeneratorType.Element == U.GeneratorType.Element> (lhs: T, rhs: U) -> Bool {
         for lhsItem in lhs {
             for rhsItem in rhs {
                 if lhsItem == rhsItem {
    @@ -1098,10 +1180,12 @@ possibleInteger = .Some(100)
         return false
     }
     anyCommonElements([1, 2, 3], [3])
    -
    -

    练习:修改anyCommonElements函数来创建一个函数,返回一个数组,内容是两个序列的共有元素。

    +
    +
    +

    练习: +修改anyCommonElements函数来创建一个函数,返回一个数组,内容是两个序列的共有元素。

    -

    简单起见,你可以忽略where,只在冒号后面写接口或者类名。<T: Equatable><T where T: Equatable>是等价的。

    +

    简单起见,你可以忽略where,只在冒号后面写协议或者类名。<T: Equatable><T where T: Equatable>是等价的。

    @@ -1120,16 +1204,8 @@ anyCommonElements([1, 2, 3], [3])
    - - - - - - - - - - + + @@ -1147,6 +1223,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter1/GuidedTour.playground.zip b/chapter1/GuidedTour.playground.zip new file mode 100644 index 00000000..13e2c05e Binary files /dev/null and b/chapter1/GuidedTour.playground.zip differ diff --git a/chapter1/chapter1.html b/chapter1/chapter1.html index 612b0b65..cb69e1ef 100644 --- a/chapter1/chapter1.html +++ b/chapter1/chapter1.html @@ -1,57 +1,45 @@ - - + - 欢迎使用 Swift | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,7 +595,7 @@
    -
    +

    欢迎使用 Swift

    在本章中您将了解 Swift 的特性和开发历史,并对 Swift 有一个初步的了解。

    @@ -609,16 +617,8 @@
    - - - - - - - - - - + + @@ -636,6 +636,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/01_The_Basics.html b/chapter2/01_The_Basics.html index 5dd912ab..b3d35a9c 100644 --- a/chapter2/01_The_Basics.html +++ b/chapter2/01_The_Basics.html @@ -1,57 +1,45 @@ - - + - 基础部分 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,99 +595,137 @@
    -
    +
    -

    基础部分

    +
    +

    翻译:numbbbbb, lyuka, JaySurplus
    校对:lslxdx

    +
    +

    基础部分

    +
    +

    本页包含内容:

    +

    Swift 是 iOS 和 OS X 应用开发的一门新语言。然而,如果你有 C 或者 Objective-C 开发经验的话,你会发现 Swift 的很多内容都是你熟悉的。

    -

    Swift 的类型是在 C 和 Objective-C 的基础上提出的,Int是整型;DoubleFloat是浮点型;Bool是布尔型;String是字符串。Swift 还有两个有用的集合类型,ArrayDictionary,详情参见集合类型(待添加链接)

    +

    Swift 的类型是在 C 和 Objective-C 的基础上提出的,Int是整型;DoubleFloat是浮点型;Bool是布尔型;String是字符串。Swift 还有两个有用的集合类型,ArrayDictionary,请参考集合类型

    就像 C 语言一样,Swift 使用变量来进行存储并通过变量名来关联值。在 Swift 中,值不可变的变量有着广泛的应用,它们就是常量,而且比 C 语言的常量更强大。在 Swift 中,如果你要处理的值不需要改变,那使用常量可以让你的代码更加安全并且更好地表达你的意图。

    除了我们熟悉的类型,Swift 还增加了 Objective-C 中没有的类型比如元组(Tuple)。元组可以让你创建或者传递一组数据,比如作为函数的返回值时,你可以用一个元组可以返回多个值。

    Swift 还增加了可选(Optional)类型,用于处理值缺失的情况。可选表示“那儿有一个值,并且它等于 x ”或者“那儿没有值”。可选有点像在 Objective-C 中使用nil,但是它可以用在任何类型上,不仅仅是类。可选类型比 Objective-C 中的nil指针更加安全也更具表现力,它是 Swift 许多强大特性的重要组成部分。

    Swift 是一个类型安全的语言,可选就是一个很好的例子。Swift 可以让你清楚地知道值的类型。如果你的代码期望得到一个String,类型安全会阻止你不小心传入一个Int。你可以在开发阶段尽早发现并修正错误。

    +

    常量和变量

    -

    常量和变量把一个名字(比如maximumNumberOfLoginAttempts或者welcomeMessage)和一个指定类型的值(比如数字10或者字符串Hello)关联起来。常量的值一旦设定就不能改变,而变量的值可以随意更改。

    +

    常量和变量把一个名字(比如maximumNumberOfLoginAttempts或者welcomeMessage)和一个指定类型的值(比如数字10或者字符串"Hello")关联起来。常量的值一旦设定就不能改变,而变量的值可以随意更改。

    声明常量和变量

    常量和变量必须在使用前声明,用let来声明常量,用var来声明变量。下面的例子展示了如何用常量和变量来记录用户尝试登录的次数:

    -
    let maximumNumberOfLoginAttempts = 10
    +
    let maximumNumberOfLoginAttempts = 10
     var currentLoginAttempt = 0
    -

    这两行代码可以被理解为 -: -“声明一个名字是maximumNumberOfLoginAttempts的新常量,并给它一个值10。然后,声明一个名字是currentLoginAttempt的变量并将它的值初始化为0.”

    +
    +

    这两行代码可以被理解为:

    +

    “声明一个名字是maximumNumberOfLoginAttempts的新常量,并给它一个值10。然后,声明一个名字是currentLoginAttempt的变量并将它的值初始化为0.”

    在这个例子中,允许的最大尝试登录次数被声明为一个常量,因为这个值不会改变。当前尝试登录次数被声明为一个变量,因为每次尝试登录失败的时候都需要增加这个值。

    你可以在一行中声明多个常量或者多个变量,用逗号隔开:

    -
    var x = 0.0, y = 0.0, z = 0.0
    -
    -

    注意:如果你的代码中有不需要改变的值,请将它声明为常量。只将需要改变的值声明为变量。

    +
    var x = 0.0, y = 0.0, z = 0.0
    +
    +
    +

    注意:
    如果你的代码中有不需要改变的值,请使用let关键字将它声明为常量。只将需要改变的值声明为变量。

    类型标注

    -

    当你声明常量或者变量的时候可以加上类型标注,说明常量或者变量中要存储的值的类型。如果要添加类型标注,在常量或者变量名后面加上一个冒号和空格,然后加上类型名称。

    +

    当你声明常量或者变量的时候可以加上类型标注(type annotation),说明常量或者变量中要存储的值的类型。如果要添加类型标注,需要在常量或者变量名后面加上一个冒号和空格,然后加上类型名称。

    这个例子给welcomeMessage变量添加了类型标注,表示这个变量可以存储String类型的值:

    -
    var welcomeMessage: String
    -

    声明中的冒号代表着“是...类型”,所以这行代码可以被理解为::

    +
    var welcomeMessage: String
    +
    +

    声明中的冒号代表着“是...类型”,所以这行代码可以被理解为:

    “声明一个类型为String,名字为welcomeMessage的变量。”

    “类型为String”的意思是“可以存储任意String类型的值。”

    welcomeMessage变量现在可以被设置成任意字符串:

    -
    welcomeMessage = "Hello"
    -
    -

    注意:一般来说你很少需要写类型标注。如果你在声明常量或者变量的时候赋了一个初始值,Swift可以推断出这个常量或者变量的类型,详情参见类型安全和类型推断(待添加链接)。在上面的例子中,没有给welcomeMessage赋初始值,所以添加了一个类型标注。

    +
    welcomeMessage = "Hello"
    +
    +
    +

    注意:
    一般来说你很少需要写类型标注。如果你在声明常量或者变量的时候赋了一个初始值,Swift可以推断出这个常量或者变量的类型,请参考类型安全和类型推断。在上面的例子中,没有给welcomeMessage赋初始值,所以变量welcomeMessage的类型是通过一个类型标注指定的,而不是通过初始值推断的。

    常量和变量的命名

    -

    你可以用任何你喜欢的字符作为常量和变量名,包括Unicode字符:

    -
        let π = 3.14159
    -    let 你好 = "你好世界"
    -    let 🐶🐮 = "dogcow"
    -

    常量与变量名不能包含数学符号,箭头,保留的(或者非法的)Unicode码位,连线与制表符。尽管常量与变量名中可以包含数字,但是它们不能以数字打头。

    -

    一旦你将常量或者变量声明为确定的类型,你就不能使用相同的名字再次进行声明,或者以改变其存储的值为其他类型。同时,你也不能将常量与变量进行互转。

    +

    你可以用任何你喜欢的字符作为常量和变量名,包括 Unicode 字符:

    +
    let π = 3.14159
    +let 你好 = "你好世界"
    +let 🐶🐮 = "dogcow"
    +
    +

    常量与变量名不能包含数学符号,箭头,保留的(或者非法的)Unicode 码位,连线与制表符。也不能以数字开头,但是可以在常量与变量名的其他地方包含数字。

    +

    一旦你将常量或者变量声明为确定的类型,你就不能使用相同的名字再次进行声明,或者改变其存储的值的类型。同时,你也不能将常量与变量进行互转。

    -

    注意:如果你需要使用与Swift保留关键字相同的名称作为常量或者变量名,你可以使用反引号(`)将关键字围住的方式将其作为名字使用。无论如何,你应当避免使用关键字作为常量或变量名,除非你别无选择。

    +

    注意:
    如果你需要使用与Swift保留关键字相同的名称作为常量或者变量名,你可以使用反引号(`)将关键字包围的方式将其作为名字使用。无论如何,你应当避免使用关键字作为常量或变量名,除非你别无选择。

    你可以更改现有的变量值为其他同类型的值,在下面的例子中,friendlyWelcome的值从"Hello!"改为了"Bonjour!":

    -
        var friendlyWelcome = "Hello!"
    -    friendlyWelcome = "Bonjour!"
    -    // friendlyWelcome is now "Bonjour!"
    -

    和变量不一样,常量的值一旦被确定以后就不能更改了。尝试这样做会在编译时报错:

    -
        let languageName = "Swift"
    -    languageName = "Swift++"
    -    // this is a compile-time error - languageName cannot be changed
    -

    输出常量和变量

    +
    var friendlyWelcome = "Hello!"
    +friendlyWelcome = "Bonjour!"
    +// friendlyWelcome 现在是 "Bonjour!"
    +
    +

    与变量不同,常量的值一旦被确定就不能更改了。尝试这样做会导致编译时报错:

    +
    let languageName = "Swift"
    +languageName = "Swift++"
    +// 这会报编译时错误 - languageName 不可改变
    +
    +

    输出常量和变量

    你可以用println函数来输出当前常量或变量的值:

    -
        println(friendlyWelcome)
    -    // prints "Bonjour!"
    -

    println是一个用来输出的全局函数,输出的内容会在最后带换行。如果你用Xcode,println将会输出内容到“console”面板上。(另一种函数叫print,唯一区别是在输出内容最后不会加入换行。)

    +
    println(friendlyWelcome)
    +// 输出 "Bonjour!"
    +
    +

    println是一个用来输出的全局函数,输出的内容会在最后换行。如果你用 Xcode,println将会输出内容到“console”面板上。(另一种函数叫print,唯一区别是在输出内容最后不会换行。)

    println函数输出传入的String值:

    -
        println("This is a string")
    -    // prints "This is a string"
    -

    像Cocoa里的NSLog函数一样,println函数可以输出更复杂的信息。这些信息可以包含当前常量和变量的值。

    -

    Swift用字符串插值(string interpolation)的方式把常量名或者变量名当做占位符加入到长字符串中,Swift会用当前常量或变量的值替换这些占位符。将常量或变量名放入反斜杠符加一对圆括号中"\()"

    -
        println("The current value of friendlyWelcome is \(friendlyWelcome)")
    -    // prints "The current value of friendlyWelcome is Bonjour!
    -
    -

    注意:字符串插值所有可用的选项在 字符串插值 这章中讲述。

    +
    println("This is a string")
    +// 输出 "This is a string"
    +
    +

    与 Cocoa 里的NSLog函数类似的是,println函数可以输出更复杂的信息。这些信息可以包含当前常量和变量的值。

    +

    Swift 用字符串插值(string interpolation)的方式把常量名或者变量名当做占位符加入到长字符串中,Swift 会用当前常量或变量的值替换这些占位符。将常量或变量名放入圆括号中,并在开括号前使用反斜杠将其转义:

    +
    println("The current value of friendlyWelcome is \(friendlyWelcome)")
    +// 输出 "The current value of friendlyWelcome is Bonjour!
    +
    +
    +

    注意:
    字符串插值所有可用的选项,请参考字符串插值

    -

    注释

    +

    +

    注释

    请将你的代码中的非执行文本注释成提示或者笔记以方便你将来阅读。Swift 的编译器将会在编译代码时自动忽略掉注释部分。

    -

    Swift 中的注释与C 语言的注释非常相似。单行注释以双正斜杠作(//)为起始标记:

    -
    // this is a comment
    -

    你也可以进行多行注释,其起始标记为单个正斜杠后跟随一个星号(/*),终止标记为一个星号后跟随单个正斜杠(*/):

    -
    /* this is also a comment,
    -but written over multiple lines */
    -

    与C 语言多行注释不同的是,Swift 的多行注释可以嵌套在其它的多行注释之中。你可以先生成一个多行注释块,然后在这个注释块之中再嵌套成第二个多行注释。终止注释时先插入第二个注释块的终止标记,然后再插入第一个注释块的终止标记:

    -
    /* this is the start of the first multiline comment
    -/* this is the second, nested multiline comment */
    -this is the end of the first multiline comment */
    -

    通过运用嵌套多行注释,你可以快速方便的注释掉一大段代码,即使这段代码之中已经含有了多行注释块。

    +

    Swift 中的注释与C 语言的注释非常相似。单行注释以双正斜杠(//)作为起始标记:

    +
    // 这是一个注释
    +
    +

    你也可以进行多行注释,其起始标记为单个正斜杠后跟随一个星号(/*),终止标记为一个星号后跟随单个正斜杠(*/):

    +
    /* 这是一个,
    +多行注释 */
    +
    +

    与 C 语言多行注释不同,Swift 的多行注释可以嵌套在其它的多行注释之中。你可以先生成一个多行注释块,然后在这个注释块之中再嵌套成第二个多行注释。终止注释时先插入第二个注释块的终止标记,然后再插入第一个注释块的终止标记:

    +
    /* 这是第一个多行注释的开头
    +/* 这是第二个被嵌套的多行注释 */
    +这是第一个多行注释的结尾 */
    +
    +

    通过运用嵌套多行注释,你可以快速方便的注释掉一大段代码,即使这段代码之中已经含有了多行注释块。

    +

    分号

    -

    与其他大部分编程语言不同,Swift 并不强制要求你在每条语句的结尾处使用分号(;),当然,你也可以按照你自己的习惯添加分号。有一种情况下必须要用分号,即你打算在同一行内写多条独立的语句:

    -
    let cat = "🐱"; println(cat)
    -// prints "🐱"
    -

    整数

    -

    整数就是没有小数部分的数字,比如42-23。整数可以是有符号(正、负、零)或者无符号(正、零)。

    -

    Swift 提供了8、16、32和64位的有符号和无符号整数类型。这些整数类型和 C 语言的命名方式很像,比如8位无符号整数类型是UInt8,32位有符号整数类型是Int32。就像 Swift 的其他类型一样,整数类型采用大写命名法。

    +

    与其他大部分编程语言不同,Swift 并不强制要求你在每条语句的结尾处使用分号(;),当然,你也可以按照你自己的习惯添加分号。有一种情况下必须要用分号,即你打算在同一行内写多条独立的语句:

    +
    let cat = "🐱"; println(cat)
    +// 输出 "🐱"
    +
    +

    +

    整数

    +

    整数就是没有小数部分的数字,比如42-23。整数可以是有符号(正、负、零)或者无符号(正、零)。

    +

    Swift 提供了8,16,32和64位的有符号和无符号整数类型。这些整数类型和 C 语言的命名方式很像,比如8位无符号整数类型是UInt8,32位有符号整数类型是Int32。就像 Swift 的其他类型一样,整数类型采用大写命名法。

    整数范围

    你可以访问不同整数类型的minmax属性来获取对应类型的最大值和最小值:

    -
    let minValue = UInt8.min  // minValue 为 0,是 UInt8 类型的最小值
    +
    let minValue = UInt8.min  // minValue 为 0,是 UInt8 类型的最小值
     let maxValue = UInt8.max  // maxValue 为 255,是 UInt8 类型的最大值
    -

    Int

    +
    +

    Int

    一般来说,你不需要专门指定整数的长度。Swift 提供了一个特殊的整数类型Int,长度与当前平台的原生字长相同:

    • 在32位平台上,IntInt32长度相同。
    • @@ -693,8 +739,9 @@ let maxValue = UInt8.max // maxValue 为 255,是 UInt8 类型的最大值
    • 在64位平台上,UIntUInt64长度相同。
    -

    注意:尽量不要使用UInt,除非你真的需要存储一个和当前平台原生字长相同的无符号整数。除了这种情况,最好使用Int,即使你要存储的值已知是非负的。统一使用Int可以提高代码的可复用性,避免不同类型数字之间的转换,并且匹配数字的类型推测,详情参见类型安全和类型推测

    +

    注意:
    尽量不要使用UInt,除非你真的需要存储一个和当前平台原生字长相同的无符号整数。除了这种情况,最好使用Int,即使你要存储的值已知是非负的。统一使用Int可以提高代码的可复用性,避免不同类型数字之间的转换,并且匹配数字的类型推断,请参考类型安全和类型推断

    +

    浮点数

    浮点数是有小数部分的数字,比如3.141590.1-273.15

    浮点类型比整数类型表示的范围更大,可以存储比Int类型更大或者更小的数字。Swift 提供了两种有符号浮点数类型:

    @@ -703,268 +750,310 @@ let maxValue = UInt8.max // maxValue 为 255,是 UInt8 类型的最大值
  • Float表示32位浮点数。精度要求不高的话可以使用此类型。
  • -

    注意:Double精确度很高,至少有15位数字,而Float最少只有6位数字。选择哪个类型取决于你的代码需要处理的数字大小。

    +

    注意:
    Double精确度很高,至少有15位数字,而Float最少只有6位数字。选择哪个类型取决于你的代码需要处理的值的范围。

    -

    类型安全和类型推测

    -

    Swift 是一个类型安全的语言。类型安全的语言可以让你清楚地知道代码要处理的值的类型。如果你的代码需要一个String,你绝对不可能不小心传进去一个Int

    -

    Swift 是类型安全的,会在编译你的代码时进行类型检查,如果遇到不匹配的类型会报错。这可以让你在开发的时候尽早发现并修复错误。

    -

    当你要处理不同类型的值时,类型检查可以帮你避免错误。然而,这并不是说你每次声明常量和变量的时候都需要显式指定类型。如果你没有显式指定类型,Swift 会使用类型推测来选择合适的类型。有了类型推测,编译器可以在编译代码的时候自动推测出表达式的类型。原理很简单,判断你赋的值即可。

    -

    因为有类型推测,和 C 或者 Objc 比起来 Swift 很少需要声明类型。常量和变量虽然需要明确类型,但是大部分工作并不需要你自己来完成。

    -

    当你声明常量或者变量并赋初值的时候类型推测非常有用。当你在声明常量或者变量的时候赋给它们一个原始值即可触发类型推测。(原始值就是会直接出现在你代码中的值,比如423.14159。)

    -

    举个例子,如果你给一个新常量赋值42并且没有标明类型,Swift 可以推测出常量类型是Int,因为你给它赋的初值看起来很像一个整数:

    -
    let meaningOfLife = 42
    +

    +

    类型安全和类型推断

    +

    Swift 是一个类型安全(type safe)的语言。类型安全的语言可以让你清楚地知道代码要处理的值的类型。如果你的代码需要一个String,你绝对不可能不小心传进去一个Int

    +

    由于 Swift 是类型安全的,所以它会在编译你的代码时进行类型检查(type checks),并把不匹配的类型标记为错误。这可以让你在开发的时候尽早发现并修复错误。

    +

    当你要处理不同类型的值时,类型检查可以帮你避免错误。然而,这并不是说你每次声明常量和变量的时候都需要显式指定类型。如果你没有显式指定类型,Swift 会使用类型推断(type inference)来选择合适的类型。有了类型推断,编译器可以在编译代码的时候自动推断出表达式的类型。原理很简单,只要检查你赋的值即可。

    +

    因为有类型推断,和 C 或者 Objective-C 比起来 Swift 很少需要声明类型。常量和变量虽然需要明确类型,但是大部分工作并不需要你自己来完成。

    +

    当你声明常量或者变量并赋初值的时候类型推断非常有用。当你在声明常量或者变量的时候赋给它们一个字面量(literal value 或 literal)即可触发类型推断。(字面量就是会直接出现在你代码中的值,比如423.14159。)

    +

    例如,如果你给一个新常量赋值42并且没有标明类型,Swift 可以推断出常量类型是Int,因为你给它赋的初始值看起来像一个整数:

    +
    let meaningOfLife = 42
     // meaningOfLife 会被推测为 Int 类型
    -

    同理,如果你没有给浮点原始值标明类型,Swift 会推测你想要的是Double

    -
    let pi = 3.14159
    +
    +

    同理,如果你没有给浮点字面量标明类型,Swift 会推断你想要的是Double

    +
    let pi = 3.14159
     // pi 会被推测为 Double 类型
    -

    当推测浮点数的类型时,Swift 总是会选择Double而不是Float

    -

    如果表达式中同时出现了整数和浮点数,会被推测为Double类型:

    -
    let anotherPi = 3 + 0.14159
    +
    +

    当推断浮点数的类型时,Swift 总是会选择Double而不是Float

    +

    如果表达式中同时出现了整数和浮点数,会被推断为Double类型:

    +
    let anotherPi = 3 + 0.14159
     // anotherPi 会被推测为 Double 类型
    -

    原始值3没有显式声明类型,而表达式中出现了一个浮点原始值,所以表达式会被推测为Double类型。

    -

    数值类原始值

    -

    整数原始值可以被写作:

    +
    +

    原始值3没有显式声明类型,而表达式中出现了一个浮点字面量,所以表达式会被推断为Double类型。

    +

    +

    数值型字面量

    +

    整数字面量可以被写作:

    • 一个十进制数,没有前缀
    • 一个二进制数,前缀是0b
    • 一个八进制数,前缀是0o
    • 一个十六进制数,前缀是0x
    -

    下面的所有整数原始值的十进制值都是17:

    -
    let decimalInteger = 17
    +

    下面的所有整数字面量的十进制值都是17:

    +
    let decimalInteger = 17
     let binaryInteger = 0b10001       // 二进制的17
     let octalInteger = 0o21           // 八进制的17
    -let hexadecimalInteger = 0x11     // 十六机制的17
    -

    浮点原始值可以是十进制(没有前缀)或者是十六进制(前缀是0x)。小数点两边必须有至少一个十进制数字(或者是十六进制的数字)。浮点原始值还有一个可选的指数,在十进制浮点数中通过大写或者小写的e来指定,在十六进制浮点数中通过大写或者小写的p来指定。

    +let hexadecimalInteger = 0x11 // 十六进制的17 +
    +

    浮点字面量可以是十进制(没有前缀)或者是十六进制(前缀是0x)。小数点两边必须有至少一个十进制数字(或者是十六进制的数字)。浮点字面量还有一个可选的指数(exponent),在十进制浮点数中通过大写或者小写的e来指定,在十六进制浮点数中通过大写或者小写的p来指定。

    如果一个十进制数的指数为exp,那这个数相当于基数和10^exp的乘积:

      -
    • 1.25e2 表示 1.25 × 10^2,等于 125.0。
    • -
    • 1.25e-2 表示 1.25 × 10^-2,等于 0.0125。
    • +
    • 1.25e2 表示 1.25 × 10^2,等于 125.0
    • +
    • 1.25e-2 表示 1.25 × 10^-2,等于 0.0125

    如果一个十六进制数的指数为exp,那这个数相当于基数和2^exp的乘积:

      -
    • 0xFp2 表示 15 × 2^2,等于 60.0。
    • -
    • 0xFp-2 表示 15 × 2^-2,等于 3.75。
    • +
    • 0xFp2 表示 15 × 2^2,等于 60.0
    • +
    • 0xFp-2 表示 15 × 2^-2,等于 3.75
    -

    下面的这些浮点原始值都等于十进制的12.1875

    -
    let decimalDouble = 12.1875
    +

    下面的这些浮点字面量都等于十进制的12.1875

    +
    let decimalDouble = 12.1875
     let exponentDouble = 1.21875e1
     let hexadecimalDouble = 0xC.3p0
    -

    数值类原始值可以包括额外的格式来增强可读性。整数和浮点数都可以添加额外的零并且包含下划线,并不会影响原始值:

    -
    let paddedDouble = 000123.456
    +
    +

    数值类字面量可以包括额外的格式来增强可读性。整数和浮点数都可以添加额外的零并且包含下划线,并不会影响字面量:

    +
    let paddedDouble = 000123.456
     let oneMillion = 1_000_000
     let justOverOneMillion = 1_000_000.000_000_1
    -

    数值类型转换

    -

    通常来讲,即使代码中的整数常量和变量已知非负,也请使用Int类型。总是使用默认的整数类型可以保证你的整数常量和变量可以直接被复用并且可以匹配整数类原始值的类型推测。 +

    +

    +

    数值型类型转换

    +

    通常来讲,即使代码中的整数常量和变量已知非负,也请使用Int类型。总是使用默认的整数类型可以保证你的整数常量和变量可以直接被复用并且可以匹配整数类字面量的类型推断。 只有在必要的时候才使用其他整数类型,比如要处理外部的长度明确的数据或者为了优化性能、内存占用等等。使用显式指定长度的类型可以及时发现值溢出并且可以暗示正在处理特殊数据。

    整数转换

    -

    不同整数类型的变量和常量可以存储不同大小的数字。Int8类型的常量或者变量可以存储的数字范围是-128~127UInt8类型的常量或者变量能存储的数字范围是0~255。如果数字超出了常量或者变量可存储的范围,编译的时候会报错:

    -
    let cannotBeNegative: UInt8 = -1
    +

    不同整数类型的变量和常量可以存储不同范围的数字。Int8类型的常量或者变量可以存储的数字范围是-128~127,而UInt8类型的常量或者变量能存储的数字范围是0~255。如果数字超出了常量或者变量可存储的范围,编译的时候会报错:

    +
    let cannotBeNegative: UInt8 = -1
     // UInt8 类型不能存储负数,所以会报错
     let tooBig: Int8 = Int8.max + 1
     // Int8 类型不能存储超过最大值的数,所以会报错
    -

    因为每一个整数类型都可以存储不同范围的值,你必须根据情况来选择不同的转换方法。不同的转换方法可以暴露出隐藏的转换错误并让你的代码更加清晰。

    -

    要将一种数字类型转换成另一种,你要用当前值来初始化一个新数字,这个数字的类型就是你的目标类型。在下面的例子中,常量twoThousand类型是UInt16,然而常量one类型是Uint8。它们不能直接相加,因为它们类型不同。所以要调用UInt16(one)来创建一个新的UInt16数字并用one的值来初始化,然后使用这个新数字来计算:

    -
    let twoThousand: UInt16 = 2_000
    +
    +

    由于每种整数类型都可以存储不同范围的值,所以你必须根据不同情况选择性使用数值型类型转换。这种选择性使用的方式,可以预防隐式转换的错误并让你的代码中的类型转换意图变得清晰。

    +

    要将一种数字类型转换成另一种,你要用当前值来初始化一个期望类型的新数字,这个数字的类型就是你的目标类型。在下面的例子中,常量twoThousandUInt16类型,然而常量oneUInt8类型。它们不能直接相加,因为它们类型不同。所以要调用UInt16(one)来创建一个新的UInt16数字并用one的值来初始化,然后使用这个新数字来计算:

    +
    let twoThousand: UInt16 = 2_000
     let one: UInt8 = 1
     let twoThousandAndOne = twoThousand + UInt16(one)
    -

    现在两个数字的类型都是UInt16,可以进行相加。目标常量twoThousandAndOne的类型被推测为UInt16,因为它是两个UInt16值的合。

    -

    SomeType(ofInitialValue)是调用 Swift 构造器并传入一个初始值的默认方法。在语言内部,UInt16有一个构造器,可以接受一个UInt8类型的值,所以这个构造器可以用现有的UInt8来创建一个新的UInt16。注意,你并不能传入任意类型的值,只能传入UInt16内部有对应构造器的值。不过你可以扩展现有的类型来让它可以接收其他类型的值(包括自定义类型),详情参见扩展(链接待添加).

    +
    +

    现在两个数字的类型都是UInt16,可以进行相加。目标常量twoThousandAndOne的类型被推断为UInt16,因为它是两个UInt16值的和。

    +

    SomeType(ofInitialValue)是调用 Swift 构造器并传入一个初始值的默认方法。在语言内部,UInt16有一个构造器,可以接受一个UInt8类型的值,所以这个构造器可以用现有的UInt8来创建一个新的UInt16。注意,你并不能传入任意类型的值,只能传入UInt16内部有对应构造器的值。不过你可以扩展现有的类型来让它可以接收其他类型的值(包括自定义类型),请参考扩展

    整数和浮点数转换

    整数和浮点数的转换必须显式指定类型:

    -
    let three = 3
    +
    let three = 3
     let pointOneFourOneFiveNine = 0.14159
     let pi = Double(three) + pointOneFourOneFiveNine
     // pi 等于 3.14159,所以被推测为 Double 类型
    -

    这个例子中,常量three的值被用来创建一个Double类型的值,所以加号两边的数类型相同。如果不进行转换,两者无法相加。

    -

    浮点数转换为整数也一样,整数类型可以用Double或者Float类型来初始化:

    -
    let integerPi = Int(pi)
    +
    +

    这个例子中,常量three的值被用来创建一个Double类型的值,所以加号两边的数类型须相同。如果不进行转换,两者无法相加。

    +

    浮点数到整数的反向转换同样行,整数类型可以用Double或者Float类型来初始化:

    +
    let integerPi = Int(pi)
     // integerPi 等于 3,所以被推测为 Int 类型
    -

    当用这种方式来初始化一个新的整数值时,浮点值会被截断。也就是说4.75会变成4-3.9会变成-3

    +
    +

    当用这种方式来初始化一个新的整数值时,浮点值会被截断。也就是说4.75会变成4-3.9会变成-3

    -

    注意:结合数字类常量和变量不同于结合数字类原始值。原始值3可以直接和原始值0.14159相加,因为数字原始值本身没有明确的类型。它们的类型只在编译器需要求值的时候被推测。

    +

    注意:
    结合数字类常量和变量不同于结合数字类字面量。字面量3可以直接和字面量0.14159相加,因为数字字面量本身没有明确的类型。它们的类型只在编译器需要求值的时候被推测。

    +

    类型别名

    -

    类型别名就是给现有类型定义一个可选名字。你可以使用typealias关键字来定义类型别名。

    +

    类型别名(type aliases)就是给现有类型定义另一个名字。你可以使用typealias关键字来定义类型别名。

    当你想要给现有类型起一个更有意义的名字时,类型别名非常有用。假设你正在处理特定长度的外部资源的数据:

    -
    typealias AudioSample = UInt16
    -

    定义了一个类型别名之后,你可以在任何使用原始名的地方使用别名:

    -
    var maxAmplitudeFound = AudioSample.min
    +
    typealias AudioSample = UInt16
    +
    +

    定义了一个类型别名之后,你可以在任何使用原始名的地方使用别名:

    +
    var maxAmplitudeFound = AudioSample.min
     // maxAmplitudeFound 现在是 0
    -

    本例中,AudioSample被定义为UInt16的一个别名。因为它是别名,AudioSample.min实际上是UInt16.min,所以会给maxAmplitudeFound赋一个初值0

    +
    +

    本例中,AudioSample被定义为UInt16的一个别名。因为它是别名,AudioSample.min实际上是UInt16.min,所以会给maxAmplitudeFound赋一个初值0

    +

    布尔值

    -

    Swift 有一个基本的布尔类型,叫做Bool。布尔值是指逻辑,因为它们只能是真或者假。Swift 有两个布尔常量,truefalse

    -
    let orangesAreOrange = true
    +

    Swift 有一个基本的布尔(Boolean)类型,叫做Bool。布尔值指逻辑上的(logical),因为它们只能是真或者假。Swift 有两个布尔常量,truefalse

    +
    let orangesAreOrange = true
     let turnipsAreDelicious = false
    -

    orangesAreOrangeturnipsAreDelicious的类型会被推测为Bool,因为它们的初值是布尔原始值。就像之前提到的IntDouble一样,如果你创建变量的时候给它们赋值true或者false,那你不需要给常量或者变量标明Bool类型。初始化常量或者变量的时候如果所赋的值类型已知,就可以触发类型推测,这让 Swift 代码更加简洁并且可读性更高。

    +
    +

    orangesAreOrangeturnipsAreDelicious的类型会被推断为Bool,因为它们的初值是布尔字面量。就像之前提到的IntDouble一样,如果你创建变量的时候给它们赋值true或者false,那你不需要将常量或者变量声明为Bool类型。初始化常量或者变量的时候如果所赋的值类型已知,就可以触发类型推断,这让 Swift 代码更加简洁并且可读性更高。

    当你编写条件语句比如if语句的时候,布尔值非常有用:

    -
    if turnipsAreDelicious {
    +
    if turnipsAreDelicious {
         println("Mmm, tasty turnips!")
     } else {
         println("Eww, turnips are horrible.")
     }
     // 输出 "Eww, turnips are horrible."
    -

    条件语句比如if语句的详细介绍参见控制流(待添加链接)

    +
    +

    条件语句,例如if,请参考控制流

    如果你在需要使用Bool类型的地方使用了非布尔值,Swift 的类型安全机制会报错。下面的例子会报告一个编译时错误:

    -
    let i = 1
    +
    let i = 1
     if i {
         // 这个例子不会通过编译,会报错
     }
    -

    然而,下面的例子是合法的:

    -
    let i = 1
    +
    +

    然而,下面的例子是合法的:

    +
    let i = 1
     if i == 1 {
         // 这个例子会编译成功
     }
    -

    i == 1的比较结果是Bool类型,所以第二个例子可以通过类型检查。类似i == 1这样的比较会在基本操作符(待添加链接)中详细讨论。

    -

    和 Swift 中的其他类型安全的例子一样,这个方法可以避免错误并保证这块代码的作用总是在意料之中。

    +
    +

    i == 1的比较结果是Bool类型,所以第二个例子可以通过类型检查。类似i == 1这样的比较,请参考基本操作符

    +

    和 Swift 中的其他类型安全的例子一样,这个方法可以避免错误并保证这块代码的意图总是清晰的。

    +

    元组

    -

    元组把多个值组合成一个复合值。元组内的值可以使任意类型,并不要求是相同类型。

    -

    下面这个例子中,(404, "Not Found")是一个描述 HTTP 状态码的元组。HTTP 状态码是当你请求网页的时候 web 服务器返回的一个特殊值。如果你请求的网页不存在就会返回一个404 Not Found状态码。

    -
    let http404Error = (404, "Not Found")
    +

    元组(tuples)把多个值组合成一个复合值。元组内的值可以使任意类型,并不要求是相同类型。

    +

    下面这个例子中,(404, "Not Found")是一个描述 HTTP 状态码(HTTP status code)的元组。HTTP 状态码是当你请求网页的时候 web 服务器返回的一个特殊值。如果你请求的网页不存在就会返回一个404 Not Found状态码。

    +
    let http404Error = (404, "Not Found")
     // http404Error 的类型是 (Int, String),值是 (404, "Not Found")
    -

    (404, "Not Found")元组把一个Int值和一个String值组合起来表示 HTTP 状态码的两个部分:一个数字和一个可以读懂的描述。这个元组可以被描述为“一个类型为(Int, String)的元组”。

    -

    你可以把任意顺序的类型组合成一个元组,这个元组可以包含所有类型。只要你想,你可以创建一个类型为(Int, Int, Int)或者(String, Bool)或者包含其他类型的元组。

    -

    你可以将一个元组的内容分解成单独的常量和变量,然后你就可以正常使用它们了:

    -
    let (statusCode, statusMessage) = http404Error
    +
    +

    (404, "Not Found")元组把一个Int值和一个String值组合起来表示 HTTP 状态码的两个部分:一个数字和一个人类可读的描述。这个元组可以被描述为“一个类型为(Int, String)的元组”。

    +

    你可以把任意顺序的类型组合成一个元组,这个元组可以包含所有类型。只要你想,你可以创建一个类型为(Int, Int, Int)或者(String, Bool)或者其他任何你想要的组合的元组。

    +

    你可以将一个元组的内容分解(decompose)成单独的常量和变量,然后你就可以正常使用它们了:

    +
    let (statusCode, statusMessage) = http404Error
     println("The status code is \(statusCode)")
     // 输出 "The status code is 404"
     println("The status message is \(statusMessage)")
     // 输出 "The status message is Not Found"
    -

    如果你只需要一部分元组值,分解的时候可以把要忽略的部分设置成_

    -
    let (justTheStatusCode, _) = http404Error
    +
    +

    如果你只需要一部分元组值,分解的时候可以把要忽略的部分用下划线(_)标记:

    +
    let (justTheStatusCode, _) = http404Error
     println("The status code is \(justTheStatusCode)")
     // 输出 "The status code is 404"
    -

    此外,你还可以通过下标来访问元组中的单个元素,下标从零开始:

    -
    println("The status code is \(http404Error.0)")
    +
    +

    此外,你还可以通过下标来访问元组中的单个元素,下标从零开始:

    +
    println("The status code is \(http404Error.0)")
     // 输出 "The status code is 404"
     println("The status message is \(http404Error.1)")
     // 输出 "The status message is Not Found"
    -

    你可以在定义元组的时候给单个元素命名:

    -
    let http200Status = (statusCode: 200, description: "OK")
    -

    给元组中的元素命名后,你可以通过名字来获取这些元素的值:

    -
    println("The status code is \(http200Status.statusCode)")
    +
    +

    你可以在定义元组的时候给单个元素命名:

    +
    let http200Status = (statusCode: 200, description: "OK")
    +
    +

    给元组中的元素命名后,你可以通过名字来获取这些元素的值:

    +
    println("The status code is \(http200Status.statusCode)")
     // 输出 "The status code is 200"
     println("The status message is \(http200Status.description)")
     // 输出 "The status message is OK"
    -

    作为函数返回值时,元组非常有用。一个用来获取网页的函数可能会返回一个(Int, String)元组来描述是否获取成功。和只能返回一个类型的值比较起来,一个包含两个不同类型值的元组可以让函数的返回信息更有用。详情参见返回多个值的函数(待添加链接)

    +
    +

    作为函数返回值时,元组非常有用。一个用来获取网页的函数可能会返回一个(Int, String)元组来描述是否获取成功。和只能返回一个类型的值比较起来,一个包含两个不同类型值的元组可以让函数的返回信息更有用。请参考函数参数与返回值

    -

    注意:元组在临时组织值的时候很有用,但是并不适合创建复杂的数据结构。如果你的数据结构并不是临时使用,请使用类或者结构体而不是元组。详情参见类和结构体(待添加链接)

    +

    注意:
    元组在临时组织值的时候很有用,但是并不适合创建复杂的数据结构。如果你的数据结构并不是临时使用,请使用类或者结构体而不是元组。请参考类和结构体

    -

    可选

    -

    使用可选来处理值可能缺失的情况。可选表示:

    +

    +

    可选类型

    +

    使用可选类型(optionals)来处理值可能缺失的情况。可选类型表示:

      -
    • 有值,等于 x
    • +
    • 值,等于 x

    或者

      -
    • 没有值
    • +
    • 没有
    -

    注意:C 和 Objective-C 中并没有可选这个概念。最接近的是 Objective-C 中的一个特性,一个方法要不返回一个对象要不返回nilnil表示“缺少一个合法的对象”。然而,这只对对象起作用——对于结构体,基本的 C 类型或者枚举类型不起作用。对于这些类型,Objective-C 方法一般会返回一个特殊值(比如NSNotFound)来暗示值缺失。这种方法假设方法的调用者知道并记得对特殊值进行判断。然而,Swift 的可选可以让你暗示任意类型的值缺失,并不需要一个特殊值。

    +

    注意:
    C 和 Objective-C 中并没有可选类型这个概念。最接近的是 Objective-C 中的一个特性,一个方法要不返回一个对象要不返回nilnil表示“缺少一个合法的对象”。然而,这只对对象起作用——对于结构体,基本的 C 类型或者枚举类型不起作用。对于这些类型,Objective-C 方法一般会返回一个特殊值(比如NSNotFound)来暗示值缺失。这种方法假设方法的调用者知道并记得对特殊值进行判断。然而,Swift 的可选类型可以让你暗示任意类型的值缺失,并不需要一个特殊值。

    来看一个例子。Swift 的String类型有一个叫做toInt的方法,作用是将一个String值转换成一个Int值。然而,并不是所有的字符串都可以转换成一个整数。字符串"123"可以被转换成数字123,但是字符串"hello, world"不行。

    下面的例子使用toInt方法来尝试将一个String转换成Int

    -
    let possibleNumber = "123"
    +
    let possibleNumber = "123"
     let convertedNumber = possibleNumber.toInt()
     // convertedNumber 被推测为类型 "Int?", 或者类型 "optional Int"
    -

    因为toInt方法可能会失败,所以它返回一个可选的Int,而不是一个Int。一个可选的Int被写作Int?而不是Int。问号暗示包含的值是可选,也就是说可能包含Int值也可能不包含值。(不能包含其他任何值比如Bool值或者String值。只能是Int或者什么都没有。)

    +
    +

    因为toInt方法可能会失败,所以它返回一个可选类型(optional)Int,而不是一个Int。一个可选的Int被写作Int?而不是Int。问号暗示包含的值是可选类型,也就是说可能包含Int值也可能不包含值。(不能包含其他任何值比如Bool值或者String值。只能是Int或者什么都没有。)

    if 语句以及强制解析

    -

    你可以使用if语句来判断一个可选是否包含值。如果可选有值,结果是true;如果没有值,结果是false

    -

    当你确定可选包含值之后,你可以在可选的名字后面加一个!来获取值。这个惊叹号表示“我知道这个可选有值,请使用它。”这被称为可选值的强制解析:

    -
    if convertedNumber {
    +

    你可以使用if语句来判断一个可选是否包含值。如果可选类型有值,结果是true;如果没有值,结果是false

    +

    当你确定可选类型确实包含值之后,你可以在可选的名字后面加一个感叹号(!)来获取值。这个惊叹号表示“我知道这个可选有值,请使用它。”这被称为可选值的强制解析(forced unwrapping)

    +
    if convertedNumber {
         println("\(possibleNumber) has an integer value of \(convertedNumber!)")
     } else {
         println("\(possibleNumber) could not be converted to an integer")
     }
     // 输出 "123 has an integer value of 123"
    -

    更多关于if语句的内容参见控制流(待添加链接)

    +
    +

    更多关于if语句的内容,请参考控制流

    -

    注意:使用!来获取一个不存在的可选值会导致运行时错误。。使用!来强制解析值之前,一定要确定可选包含一个非nil的值。

    +

    注意:
    使用!来获取一个不存在的可选值会导致运行时错误。使用!来强制解析值之前,一定要确定可选包含一个非nil的值。

    +

    可选绑定

    -

    使用可选绑定来判断可选是否包含值,如果包含就把值赋给一个临时常量或者变量。可选绑定可以用在ifwhile语句中来对可选的值进行判断并把值赋给一个常量或者变量。ifwhile语句详情参见控制流

    -

    像下面这样写一个可选绑定:

    -
    if let constantName = someOptional {
    +

    使用可选绑定(optional binding)来判断可选类型是否包含值,如果包含就把值赋给一个临时常量或者变量。可选绑定可以用在ifwhile语句中来对可选类型的值进行判断并把值赋给一个常量或者变量。ifwhile语句,请参考控制流

    +

    像下面这样在if语句中写一个可选绑定:

    +
    if let constantName = someOptional {
         statements
     }
    -

    你可以像上面这样使用可选绑定来重写possibleNumber这个例子:

    -
    if let actualNumber = possibleNumber.toInt() {
    +
    +

    你可以像上面这样使用可选绑定来重写possibleNumber这个例子:

    +
    if let actualNumber = possibleNumber.toInt() {
         println("\(possibleNumber) has an integer value of \(actualNumber)")
     } else {
         println("\(possibleNumber) could not be converted to an integer")
     }
     // 输出 "123 has an integer value of 123"
    -

    这段代码可以被理解为:

    +
    +

    这段代码可以被理解为:

    “如果possibleNumber.toInt返回的可选Int包含一个值,创建一个叫做actualNumber的新常量并将可选包含的值赋给它。”

    -

    如果转换成功,actualNumber常量可以在if语句的第一个分支中使用。它已经被可选包含的值初始化过,所以不需要再使用!后缀来获取它的值。在这个例子中,actualNumber只被用来输出转换结果。

    -

    你可以在可选绑定中使用常量和变量。如果你想在if语句的第一个分支中操作actualNumber的值,你可以改成if var actualNumber,这样可选包含的值就会被赋给一个变量。

    +

    如果转换成功,actualNumber常量可以在if语句的第一个分支中使用。它已经被可选类型包含的值初始化过,所以不需要再使用!后缀来获取它的值。在这个例子中,actualNumber只被用来输出转换结果。

    +

    你可以在可选绑定中使用常量和变量。如果你想在if语句的第一个分支中操作actualNumber的值,你可以改成if var actualNumber,这样可选类型包含的值就会被赋给一个变量而非常量。

    nil

    你可以给可选变量赋值为nil来表示它没有值:

    -
    var serverResponseCode: Int? = 404
    +
    var serverResponseCode: Int? = 404
     // serverResponseCode 包含一个可选的 Int 值 404
     serverResponseCode = nil
     // serverResponseCode 现在不包含值
    -
    -

    注意:nil不能用于非可选的常量和变量。如果你的代码中有常量或者变量需要处理值缺失的情况,请把它们声明成对应的可选类型。

    +
    +
    +

    注意:
    nil不能用于非可选的常量和变量。如果你的代码中有常量或者变量需要处理值缺失的情况,请把它们声明成对应的可选类型。

    如果你声明一个可选常量或者变量但是没有赋值,它们会自动被设置为nil

    -
    var surveyAnswer: String?
    +
    var surveyAnswer: String?
     // surveyAnswer 被自动设置为 nil
    -
    -

    注意:Swift 的nil和 Objective-C 中的nil并不一样。在 Objective-C 中,nil是一个指向不存在对象的指针。在 Swift 中,nil不是指针——它是一个确定的值,用来表示值缺失。任何类型的可选都可以被设置为nil,不只是对象类型。

    +
    +
    +

    注意:
    Swift 的nil和 Objective-C 中的nil并不一样。在 Objective-C 中,nil是一个指向不存在对象的指针。在 Swift 中,nil不是指针——它是一个确定的值,用来表示值缺失。任何类型的可选状态都可以被设置为nil,不只是对象类型。

    -

    隐式解析可选

    -

    如上所述,可选暗示了常量或者变量可以“没有值”。可选可以通过if语句来判断是否有值,如果有值的话可以通过可选绑定来解析值。

    -

    有时候在程序架构中,第一次被赋值之后,可以确定一个可选总会有值。在这种情况下,每次都要判断和解析可选值是非常低效的,因为可以确定它总会有值。

    -

    这种类型的可选被定义为隐式解析可选。把后缀?改成!来声明一个隐式解析可选,比如String!

    -

    当可选被第一次赋值之后就可以确定之后一直有值的时候,隐式解析可选非常有用。隐式解析可选主要被用在 Swift 中类的构造过程中,详情参见无主引用和隐式解析可选属性(Unowned References and Implicitly Unwrapped Optional Properties待添加链接)

    -

    一个隐式解析可选其实就是一个普通的可选,但是可以被当做非可选来使用,并不需要每次都使用解析来获取可选值。下面的例子展示了可选String和隐式解析可选String之间的区别:

    -
    let possibleString: String? = "An optional string."
    +

    隐式解析可选类型

    +

    如上所述,可选类型暗示了常量或者变量可以“没有值”。可选可以通过if语句来判断是否有值,如果有值的话可以通过可选绑定来解析值。

    +

    有时候在程序架构中,第一次被赋值之后,可以确定一个可选类型总会有值。在这种情况下,每次都要判断和解析可选值是非常低效的,因为可以确定它总会有值。

    +

    这种类型的可选状态被定义为隐式解析可选类型(implicitly unwrapped optionals)。把想要用作可选的类型的后面的问号(String?)改成感叹号(String!)来声明一个隐式解析可选类型。

    +

    当可选类型被第一次赋值之后就可以确定之后一直有值的时候,隐式解析可选类型非常有用。隐式解析可选类型主要被用在 Swift 中类的构造过程中,请参考类实例之间的循环强引用

    +

    一个隐式解析可选类型其实就是一个普通的可选类型,但是可以被当做非可选类型来使用,并不需要每次都使用解析来获取可选值。下面的例子展示了可选类型String和隐式解析可选类型String之间的区别:

    +
    let possibleString: String? = "An optional string."
     println(possibleString!) // 需要惊叹号来获取值
     // 输出 "An optional string."
    -
    -let assumedString: String! = "An implicitly unwrapped optional string."
    -println(assumedString)  // 不需要惊叹号
    +
    +
    let assumedString: String! = "An implicitly unwrapped optional string."
    +println(assumedString)  // 不需要感叹号
     // 输出 "An implicitly unwrapped optional string."
    -

    你可以把隐式解析可选当做一个可以自动解析的可选。你要做的只是声明的时候把惊叹号放到类型的结尾,而不是每次获取值的变量结尾。

    +
    +

    你可以把隐式解析可选类型当做一个可以自动解析的可选类型。你要做的只是声明的时候把感叹号放到类型的结尾,而不是每次取值的可选名字的结尾。

    -

    注意:如果你在隐式解析可选没有值的时候尝试获取,会触发运行时错误。和你在没有值的普通可选后面加一个惊叹号一样。

    +

    注意:
    如果你在隐式解析可选类型没有值的时候尝试取值,会触发运行时错误。和你在没有值的普通可选类型后面加一个惊叹号一样。

    -

    你仍然可以把隐式解析可选当做普通可选来判断它是否包含值: - if assumedString { - println(assumedString) - } - // 输出 "An implicitly unwrapped optional string."

    -

    你也可以在可选绑定中使用隐式解析可选来检查并解析它的值: - if let definiteString = assumedString { - println(definiteString) - } - // 输出 "An implicitly unwrapped optional string."

    +

    你仍然可以把隐式解析可选类型当做普通可选类型来判断它是否包含值:

    +
    if assumedString {
    +    println(assumedString)
    +}
    +// 输出 "An implicitly unwrapped optional string."
    +
    +

    你也可以在可选绑定中使用隐式解析可选类型来检查并解析它的值:

    +
    if let definiteString = assumedString {
    +    println(definiteString)
    +}
    +// 输出 "An implicitly unwrapped optional string."
    +
    -

    注意:如果一个变量之后可能变成nil的话请不要使用隐式解析可选。如果你需要在变量的生命周期中判断是否是nil的话,请使用普通可选类型。

    +

    注意:
    如果一个变量之后可能变成nil的话请不要使用隐式解析可选类型。如果你需要在变量的生命周期中判断是否是nil的话,请使用普通可选类型。

    +

    断言

    -

    可选可以让你判断值是否存在,你可以在代码中优雅地处理值缺失的情况。然而,在某些情况下,如果值缺失或者值并不满足特定的条件,你的代码可能并不需要继续执行。这时,你可以在你的代码中触发一个断言来结束代码运行并通过调试来找到值缺失的原因。

    -

    使用断言来调试

    +

    可选类型可以让你判断值是否存在,你可以在代码中优雅地处理值缺失的情况。然而,在某些情况下,如果值缺失或者值并不满足特定的条件,你的代码可能并不需要继续执行。这时,你可以在你的代码中触发一个断言(assertion)来结束代码运行并通过调试来找到值缺失的原因。

    +

    使用断言进行调试

    断言会在运行时判断一个逻辑条件是否为true。从字面意思来说,断言“断言”一个条件是否为真。你可以使用断言来保证在运行其他代码之前,某些重要的条件已经被满足。如果条件判断为true,代码运行会继续进行;如果条件判断为false,代码运行停止,你的应用被终止。

    如果你的代码在调试环境下触发了一个断言,比如你在 Xcode 中构建并运行一个应用,你可以清楚地看到不合法的状态发生在哪里并检查断言被触发时你的应用的状态。此外,断言允许你附加一条调试信息。

    -

    你可以使用全局assert函数来写一个断言。给assert函数传入一个结果为true或者false的表达式以及一条信息,当表达式为false的时候这条信息会被显示:

    -
    let age = -3
    +

    你可以使用全局assert函数来写一个断言。向assert函数传入一个结果为true或者false的表达式以及一条信息,当表达式为false的时候这条信息会被显示:

    +
    let age = -3
     assert(age >= 0, "A person's age cannot be less than zero")
     // 因为 age < 0,所以断言会触发
    -

    在这个例子中,只有age >= 0true的时候代码运行才会继续,也就是说,当age的值非负的时候。如果age的值是负数,就像代码中那样,age >= 0false,断言被触发,结束应用。

    +
    +

    在这个例子中,只有age >= 0true的时候代码运行才会继续,也就是说,当age的值非负的时候。如果age的值是负数,就像代码中那样,age >= 0false,断言被触发,结束应用。

    断言信息不能使用字符串插值。断言信息可以省略,就像这样:

    -
    assert(age >= 0)
    -

    何时使用断言

    -

    当条件可能为假时使用断言,但是最终一定要保证条件为真,这样你的代码才能继续运行。断言的适用情景:

    +
    assert(age >= 0)
    +
    +

    何时使用断言

    +

    当条件可能为假时使用断言,但是最终一定要保证条件为真,这样你的代码才能继续运行。断言的适用情景:

      -
    • 整数的下标(subscript)索引被传入一个自定义下标实现,但是下标索引值可能太小或者太大。
    • +
    • 整数类型的下标索引被传入一个自定义下标脚本实现,但是下标索引值可能太小或者太大。
    • 需要给函数传入一个值,但是非法的值可能导致函数不能正常执行。
    • 一个可选值现在是nil,但是后面的代码运行需要一个非nil值。
    -

    查看下标(链接待添加)函数(链接待添加)

    +

    请参考下标脚本函数

    -

    注意:断言可能导致你的应用终止运行,所以你应当仔细设计你的代码来让非法条件不会出现。然而,在你的应用发布之前,有时候非法条件可能出现,这时使用断言可以快速发现问题。

    +

    注意:
    断言可能导致你的应用终止运行,所以你应当仔细设计你的代码来让非法条件不会出现。然而,在你的应用发布之前,有时候非法条件可能出现,这时使用断言可以快速发现问题。

    @@ -984,16 +1073,8 @@ assert(age >= 0, "A person's age cannot be less than zero")
    - - - - - - - - - - + + @@ -1011,6 +1092,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/02_Basic_Operators.html b/chapter2/02_Basic_Operators.html index 97e85e65..69e7a618 100644 --- a/chapter2/02_Basic_Operators.html +++ b/chapter2/02_Basic_Operators.html @@ -1,57 +1,45 @@ - - + - 基本运算符 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,168 +595,175 @@
    -
    +
    -

    基础运算符

    -

    运算符是检查, 改变, 合并值的特殊符号或短语. 例如, 加号 + 把计算两个数的和(如 let i = 1 + 2). 复杂些的运行算包括逻辑与&&(如 if enteredDoorCode && passedRetinaScan), 还有自增运算符 ++i 这样让自身加一的便捷运算.

    -

    Swift支持大部分标准C语言的运算符, 且改进许多特性来减少常规编码错误. 如, 赋值符 = 不返回值, 以防止错把等号 == 写成赋值号 = 而导致Bug. 数值运算符( + , -, *, /, %等)会检测并不允许值溢出, 以此来避免保存变量时由于变量大于或小于其类型所能承载的范围时导致的异常结果. 当然允许你选择使用Swift的溢出运算符来玩溢出. 具体使用请移步溢出运算符.

    -

    区别于C语言, 在Swift中你可以对浮点数进行取余运算( % ), 还提供了C语言没有的表达两数之间的值的区间运算符, ( a..ba...b ), 这方便我们表达一个区间内的数值.

    -

    本章节只描述了Swift中的简单运算符, 高级运算符包含了高级运算符,及如何自定义运算符, 及如何进行自定义类型的运算符重载.

    -

    术语

    -

    运算符有一目, 双目和三目运算符.

    -

    一目运算符对单一操作对象操作, 如 -a.

    -

    一目运算符分前置符和后置运算符, 前置运算符需紧排操作对象之前, 如 !b, 后置运算符需紧跟操作对象之后,如 i++,

    -

    双目运算符操作两个操作对象, 如 2 + 3. 是中置的, 因为它们出现在两个操作对象之间.

    -

    三目运算符操作三个操作对象, 和C语言一样, Swift只有一个三目运算符, 就是三目条件运算符 a ? b : c.

    -

    受运算符影响的值叫操作数, 在表达式 1 + 2 中, 加号 + 是双目运算符, 它的两个操作数是值 12.

    -

    赋值运算符

    -

    赋值运算 a = b, 表示用 b 的值来初始化或更新 a 的值.

    +
    +

    翻译:xielingwang
    校对:Evilcome

    +
    +

    基本运算符

    +
    +

    本页包含内容:

    + +

    运算符是检查、改变、合并值的特殊符号或短语。例如,加号+将两个数相加(如let i = 1 + 2)。复杂些的运算例如逻辑与运算符&&(如if enteredDoorCode && passedRetinaScan),或让 i 值加1的便捷自增运算符++i等。

    +

    Swift 支持大部分标准 C 语言的运算符,且改进许多特性来减少常规编码错误。如:赋值符(=)不返回值,以防止把想要判断相等运算符(==)的地方写成赋值符导致的错误。数值运算符(+-*/%等)会检测并不允许值溢出,以此来避免保存变量时由于变量大于或小于其类型所能承载的范围时导致的异常结果。当然允许你使用 Swift 的溢出运算符来实现溢出。详情参见溢出运算符

    +

    区别于 C 语言,在 Swift 中你可以对浮点数进行取余运算(%),Swift 还提供了 C 语言没有的表达两数之间的值的区间运算符,(a..ba...b),这方便我们表达一个区间内的数值。

    +

    本章节只描述了 Swift 中的基本运算符,高级运算符包含了高级运算符,及如何自定义运算符,及如何进行自定义类型的运算符重载。

    +

    +

    术语

    +

    运算符有一元、二元和三元运算符。

    +
      +
    • 一元运算符对单一操作对象操作(如-a)。一元运算符分前置符和后置运算符,前置运算符需紧排操作对象之前(如!b),后置运算符需紧跟操作对象之后(如i++)。
    • +
    • 二元运算符操作两个操作对象(如2 + 3),是中置的,因为它们出现在两个操作对象之间。
    • +
    • 三元运算符操作三个操作对象,和 C 语言一样,Swift 只有一个三元运算符,就是三元条件运算符(a ? b : c)。
    • +
    +

    受运算符影响的值叫操作数,在表达式1 + 2中,加号+是二元运算符,它的两个操作数是值12

    +

    +

    赋值运算符

    +

    赋值运算(a = b),表示用b的值来初始化或更新a的值:

    let b = 10
     var a = 5
     a = b
     // a 现在等于 10
     
    -

    如果赋值的右边是一个多元组, 它的元素可以马上被分解多个变量或变量

    -
    let (x, y) = (1, 2)
    +

    如果赋值的右边是一个多元组,它的元素可以马上被分解多个变量或变量:

    +
    let (x, y) = (1, 2)
     // 现在 x 等于 1, y 等于 2
    -

    与C语言和Objective-C不同, Swift的赋值操作并不返回任何值. 所以以下代码是错误的:

    +
    +

    与 C 语言和 Objective-C 不同,Swift 的赋值操作并不返回任何值。所以以下代码是错误的:

    if x = y {
         // 此句错误, 因为 x = y 并不返回任何值
     }
     
    -

    这个特性使得你不无法把==错写成=了, 由于if x = y是错误代码, Swift从底层帮你避免了这些代码错误.

    -

    数值运算

    -

    Swift让所有数值类型都支持了基本的四则运算:

    +

    这个特性使你无法把(==)错写成(=),由于if x = y是错误代码,Swift 从底层帮你避免了这些错误代码。

    +

    +

    数值运算

    +

    Swift 中所有数值类型都支持了基本的四则运算:

      -
    • 加法 +
    • -
    • 减法 -
    • -
    • 乘法 *
    • -
    • 除法 /
    • +
    • 加法(+
    • +
    • 减法(-
    • +
    • 乘法(*
    • +
    • 除法(/
    1 + 2       // 等于 3
     5 - 3       // 等于 2
     2 * 3       // 等于 6
     10.0 / 2.5  // 等于 4.0
     
    -

    与C语言和Objective-C不同的是, Swift默认不允许在数值运算中出现溢出情况. 但你可以使用Swift的溢出运算符来达到你有目的的溢出, (如 a &+ b ). 详情请移步: 溢出运算符.

    -

    加法操作 + 也用于字符串的拼接:

    +

    与 C 语言和 Objective-C 不同的是,Swift 默认不允许在数值运算中出现溢出情况。但你可以使用 Swift 的溢出运算符来达到你有目的的溢出(如a &+ b)。详情参见溢出运算符

    +

    加法运算符也可用于String的拼接:

    "hello, " + "world"  // 等于 "hello, world"
     
    -

    两个字符类型或一个字符类型和一个字符串类型, 相加会生成一个新的字符串类型:

    +

    两个Character值或一个String和一个Character值,相加会生成一个新的String值:

    let dog: Character = "d"
     let cow: Character = "c"
     let dogCow = dog + cow
    -// 译者注: 原谅的引号内是很可爱的小狗和小牛, 但win os下不支持表情字符, 所以改成了普通字符
    +// 译者注: 原来的引号内是很可爱的小狗和小牛, 但win os下不支持表情字符, 所以改成了普通字符
     // dogCow 现在是 "dc"
     
    -

    详细请点击 字符,字符串的拼接.

    -

    求余运算

    -

    求余运算 a % b 是计算 b 的多少倍刚刚好可以容入 a , 多出来的那部分叫余数.

    +

    详情参见字符,字符串的拼接

    +

    求余运算

    +

    求余运算(a % b)是计算b的多少倍刚刚好可以容入a,返回多出来的那部分(余数)。

    -

    注意

    -

    求余运算(%)在其他语言也叫取模运算. 然而严格说来, 我们看该运算符对负数的操作结果, 求余取模 更合适些.

    +

    注意:
    求余运算(%)在其他语言也叫取模运算。然而严格说来,我们看该运算符对负数的操作结果,"求余"比"取模"更合适些。

    -

    我们来谈谈取余是怎么回事, 计算 9 % 4, 你先计算出4的多少倍会刚好可以容入 9 中.

    -

    2倍, 非常好, 那余数是1 (用'*'标出)

    - - - - - - - - - - - - - - - - - -
    1 2 3 4 5 6 7 8 9
    441*
    - -

    在Swift中这么来表达

    +

    我们来谈谈取余是怎么回事,计算9 % 4,你先计算出4的多少倍会刚好可以容入9中:

    +

    Art/remainderInteger_2x.png

    +

    2倍,非常好,那余数是1(用橙色标出)

    +

    在 Swift 中这么来表达:

    9 % 4    // 等于 1
     
    -

    为了得到 a % b 的结果, %计算了以下等式, 并输出余数作为结果:

    -
    a = (b × 倍数) + 余数
    -

    倍数取最大值的时候, 就会刚好可以容入 a 中.

    -

    94 代入等式中, 我们得 1:

    +

    为了得到a % b的结果,%计算了以下等式,并输出余数作为结果:

    +

    a = (b × 倍数) + 余数

    +

    倍数取最大值的时候,就会刚好可以容入a中。

    +

    94代入等式中,我们得1

    9 = (4 × 2) + 1
     
    -

    同样的方法, 我来们计算 -9 % 4 :

    -
    -9 % 4   // 等于 -1
    -

    -94 代入等式, -2 是取到的最大整数:

    +

    同样的方法,我来们计算 -9 % 4

    +
    -9 % 4   // 等于 -1
    +
    +

    -94代入等式,-2是取到的最大整数:

    -9 = (4 × -2) + -1
     
    -

    余数是 -1.

    -

    在对负数 -b 求余时, -b的符号会被忽略. 这意味着 a % ba % -b的结果是相同的.

    -

    浮点数求余计算

    -

    不同于C和Objective-C, Swift中是可以对浮点数进行求余的.

    +

    余数是-1

    +

    在对负数b求余时,b的符号会被忽略。这意味着 a % ba % -b的结果是相同的。

    +

    浮点数求余计算

    +

    不同于 C 语言和 Objective-C,Swift 中是可以对浮点数进行求余的。

    8 % 2.5 // 等于 0.5
     
    -

    这个例子中, 8除于2.5等于3余0.5, 所以结果是0.5.

    -

    自增和自增运算

    -

    和C一样, Swift也提供了方便对变量本身加1或减1的自增 ++ 和自减 -- 的运算符. 其操作对象可以是整形和浮点型。 +

    这个例子中,8除于2.5等于30.5,所以结果是一个Double0.5

    +

    Art/remainderFloat_2x.png

    +

    自增和自增运算

    +

    和 C 语言一样,Swift 也提供了方便对变量本身加1或减1的自增(++)和自减(--)的运算符。其操作对象可以是整形和浮点型。 ‌

    -
    var i = 0
    +
    var i = 0
     ++i      // 现在 i = 1
    -

    每调用一次 ++i, i 的值就会加1. -实际上, ++ii = i + 1 的简写, 而 --ii = i - 1的简写.

    -

    ++--既是前置又是后置运算. ++i, i++, --ii-- 都是有效的写法.

    -

    我们需要注意的是这些运算符修改了 i 后有一个返回值. 如果你只想修改 i 的值, 那你就可以忽略这个返回值. 但如果你想使用返回值, 你就需要留意前置和后置操作的返回值是不同的.

    -

    ++ 前置的时候, 先自増再返回.

    -

    ++ 后置的时候, 先返回再自增.

    -

    不懂? 我们看例子:

    +
    +

    每调用一次++ii的值就会加1。实际上,++ii = i + 1的简写,而--ii = i - 1的简写。

    +

    ++--既是前置又是后置运算。++ii++--ii--都是有效的写法。

    +

    我们需要注意的是这些运算符修改了i后有一个返回值。如果你只想修改i的值,那你就可以忽略这个返回值。但如果你想使用返回值,你就需要留意前置和后置操作的返回值是不同的。

    +
      +
    • ++前置的时候,先自増再返回。

      +
    • +
    • ++后置的时候,先返回再自增。

      +
    • +
    +

    例如:

    var a = 0
     let b = ++a // a 和 b 现在都是 1
     let c = a++ // a 现在 2, 但 c 是 a 自增前的值 1
     
    -

    上述例子, let b = ++a, 先把 a 加1了再返回 a 的值. 所以 ab 都是新值 1.

    -

    let c = a++, 是先返回了 a 的值, 然后 a 才加1. 所以 c 得到了 a 的旧值1, 而 a 加1后变成2.

    -

    除非你需要使用 i++ 的特性, 不然推荐你使用 ++i--i, 因为先修改后返回这样的行为更符合我们的逻辑.

    -

    单目负号

    -

    数值的正负号可以使用前缀 - (即单目负号) 来切换:

    +

    上述例子,let b = ++a先把a加1了再返回a的值。所以ab都是新值1

    +

    let c = a++,是先返回了a的值,然后a才加1。所以c得到了a的旧值1,而a加1后变成2。

    +

    除非你需要使用i++的特性,不然推荐你使用++i--i,因为先修改后返回这样的行为更符合我们的逻辑。

    +

    一元负号

    +

    数值的正负号可以使用前缀-(即一元负号)来切换:

    let three = 3
     let minusThree = -three       // minusThree 等于 -3
    -let plusThree = -minusThree   // plusThree 等于 3, o或 "负负3"
    +let plusThree = -minusThree   // plusThree 等于 3, 或 "负负3"
     
    -

    单目负号写在操作数之前, 中间没有空格.

    -

    单目正号

    -

    单目正号 + 不做任何改变地返回操作数的值.

    +

    一元负号(-)写在操作数之前,中间没有空格。

    +

    一元正号

    +

    一元正号(+)不做任何改变地返回操作数的值。

    let minusSix = -6
     let alsoMinusSix = +minusSix  // alsoMinusSix 等于 -6
     
    -

    虽然单目 + 做无用功, 但当你在使用单目负号来表达负数时, 你可以使用单目正号来表达正数, 如此你的代码会具有对称美.

    -

    复合赋值

    -

    如同强大的C语言, Swift也提供把其他运算符和赋值运算 = 组合的复合赋值运算符, 加赋运算 += 是其中一个例子:

    +

    虽然一元+做无用功,但当你在使用一元负号来表达负数时,你可以使用一元正号来表达正数,如此你的代码会具有对称美。

    +

    +

    复合赋值(Compound Assignment Operators)

    +

    如同强大的 C 语言,Swift 也提供把其他运算符和赋值运算(=)组合的复合赋值运算符,加赋运算(+=)是其中一个例子:

    var a = 1
     a += 2 // a 现在是 3
     
    -

    表达式 a += 2a = a + 2 的简写, 一个加赋运算就把加法和赋值两件事完成了.

    +

    表达式a += 2a = a + 2的简写,一个加赋运算就把加法和赋值两件事完成了。

    -

    注意:

    -

    复合赋值运算没有返回值, let b = a += 2 这类代码是错误. 这不同于上面提到的自增和自减运算符.

    +

    注意:
    复合赋值运算没有返回值,let b = a += 2这类代码是错误。这不同于上面提到的自增和自减运算符。

    -

    表达式里有复合运算符的完整列表. -‌

    -

    比较运算

    -

    所有标准C中的比较运算都可以在Swift中使用.

    +

    表达式章节里有复合运算符的完整列表。 +‌ +

    +

    比较运算

    +

    所有标准 C 语言中的比较运算都可以在 Swift 中使用。

      -
    • 等于 a == b
    • -
    • 不等于 a != b
    • -
    • 大于 a > b
    • -
    • 小于 a < b
    • -
    • 大于等于 a >= b
    • -
    • 小于等于 a <= b
    • +
    • 等于(a == b
    • +
    • 不等于(a != b
    • +
    • 大于(a > b
    • +
    • 小于(a < b
    • +
    • 大于等于(a >= b
    • +
    • 小于等于(a <= b
    -

    注意:

    -

    Swift也提供恒等 === 和不恒等 !== 这两个比较符来判断两个对象是否引用同一个对象实例. 更多细节在 类与结构.

    +

    注意:
    Swift 也提供恒等===和不恒等!==这两个比较符来判断两个对象是否引用同一个对象实例。更多细节在类与结构

    -

    每个比较运算都返回了一个标识表达式是否成立的布尔值:

    +

    每个比较运算都返回了一个标识表达式是否成立的布尔值:

    1 == 1   // true, 因为 1 等于 1
     2 != 1   // true, 因为 2 不等于 1
     2 > 1    // true, 因为 2 大于 1
    @@ -756,33 +771,33 @@ a += 2 // a 现在是 3
     1 >= 1   // true, 因为 1 大于等于 1
     2 <= 1   // false, 因为 2 并不小于等于 1
     
    -

    比较运算多用于条件语句, 如 if 条件:

    +

    比较运算多用于条件语句,如if条件:

    let name = "world"
     if name == "world" {
         println("hello, world")
     } else {
    -    println("对不起, \(name), 我不认识你!")
    +    println("I'm sorry \(name), but I don't recognize you")
     }
     // 输出 "hello, world", 因为 `name` 就是等于 "world"
     
    -

    关于 if 语句, 请看 控制流.

    -

    三目条件运算

    -

    三目条件运算的特殊在于它是有三个操作数的运算符, 它的原型是 问题 ? 答案1 : 答案2. 它简洁地表达根据 问题 成立与否作出二选一的操作. 如果 问题 成立, 返回 答案1 的结果; 如果不成立, 返回 答案2 的结果.

    -

    使用三目条件运算简化了以下代码:

    +

    关于if语句,请看控制流

    +

    +

    三元条件运算(Ternary Conditional Operator)

    +

    三元条件运算的特殊在于它是有三个操作数的运算符,它的原型是 问题 ? 答案1 : 答案2。它简洁地表达根据问题成立与否作出二选一的操作。如果问题成立,返回答案1的结果; 如果不成立,返回答案2的结果。

    +

    使用三元条件运算简化了以下代码:

    if question: {
       answer1
    -}
    -else {
    +} else {
       answer2
     }
     
    -

    这里有个计算表格行高的例子. 如果有表头, 那行高应比内容高度要高出50像素; 如果没有表头, 只需高出20像素.

    +

    这里有个计算表格行高的例子。如果有表头,那行高应比内容高度要高出50像素; 如果没有表头,只需高出20像素。

    let contentHeight = 40
     let hasHeader = true
     let rowHeight = contentHeight + (hasHeader ? 50 : 20)
     // rowHeight 现在是 90
     
    -

    这样写会比下面的代码简洁:

    +

    这样写会比下面的代码简洁:

    let contentHeight = 40
     let hasHeader = true
     var rowHeight = contentHeight
    @@ -793,16 +808,17 @@ if hasHeader {
     }
     // rowHeight 现在是 90
     
    -

    第一段代码例子使用了三目条件运算, 所以一行代码就能让我们得到正确答案. 这比第二段代码简洁得多, 无需将 rowHeight 定义成变量, 因为它的值无需在 if 语句中改变.

    -

    三目条件运算提供有效率且便捷的方式来表达二选一的选择. 需要注意的事, 过度使用三目条件运算就会由简洁的代码变成难懂的代码. 我们应避免在一个组合语句使用多个三目条件运算符.

    -

    区间运算符

    -

    Swift提供了两个方便表达一个区间的值的运算符.

    -

    闭区间运算符

    -

    闭区间运算符 a...b 定义一个包含从 ab (包括 ab)的所有值的区间. +

    第一段代码例子使用了三元条件运算,所以一行代码就能让我们得到正确答案。这比第二段代码简洁得多,无需将rowHeight定义成变量,因为它的值无需在if语句中改变。

    +

    三元条件运算提供有效率且便捷的方式来表达二选一的选择。需要注意的事,过度使用三元条件运算就会由简洁的代码变成难懂的代码。我们应避免在一个组合语句使用多个三元条件运算符。

    +

    +

    区间运算符

    +

    Swift 提供了两个方便表达一个区间的值的运算符。

    +

    闭区间运算符

    +

    闭区间运算符(a...b)定义一个包含从ab(包括ab)的所有值的区间。 ‌ -闭区间运算符在迭代一个区间的所有值时是非常有用的, 如在 for-in 循环中:

    +闭区间运算符在迭代一个区间的所有值时是非常有用的,如在for-in循环中:

    for index in 1...5 {
    -  println("\(index) * 5 = \(index * 5)")
    +    println("\(index) * 5 = \(index * 5)")
     }
     // 1 * 5 = 5
     // 2 * 5 = 10
    @@ -810,11 +826,11 @@ if hasHeader {
     // 4 * 5 = 20
     // 5 * 5 = 25
     
    -

    关于 for-in, 请看 控制流.

    -

    半闭区间

    -

    半闭区间 a..b 定义一个从 ab 但不包括 b 的区间. -之所以称为半闭区间, 是因为该区间包含第一个值而不包括最后的值.

    -

    半闭区间的实用性在于当你使用一个0始的列表(如数组)时, 非常方便地从0数到列表的长度.

    +

    关于for-in,请看控制流

    +

    半闭区间

    +

    半闭区间(a..b)定义一个从ab但不包括b的区间。 +之所以称为半闭区间,是因为该区间包含第一个值而不包括最后的值。

    +

    半闭区间的实用性在于当你使用一个0始的列表(如数组)时,非常方便地从0数到列表的长度。

    let names = ["Anna", "Alex", "Brian", "Jack"]
     let count = names.count
     for i in 0..count {
    @@ -825,31 +841,30 @@ for i in 0..count {
     // 第 3 个人叫 Brian
     // 第 4 个人叫 Jack
     
    -
    -

    注意: 数组有4个元素, 但 0..count 只数到 3 (最后一个元素的下标), 因为它是半闭区间. 关于数组, 请查阅 数组.

    -
    -

    逻辑运算

    -

    逻辑运算的操作对象是逻辑布尔值. Swift支持基于C语言的三个标准逻辑运算.

    +

    数组有4个元素,但0..count只数到3(最后一个元素的下标),因为它是半闭区间。关于数组,请查阅数组

    +

    +

    逻辑运算

    +

    逻辑运算的操作对象是逻辑布尔值。Swift 支持基于 C 语言的三个标准逻辑运算。

      -
    • 逻辑非 !a
    • -
    • 逻辑与 a && b
    • -
    • 逻辑或 a || b
    • +
    • 逻辑非(!a
    • +
    • 逻辑与(a && b
    • +
    • 逻辑或(a || b
    -

    逻辑非

    -

    逻辑非运算 !a 对一个布尔值取反, 使得 truefalse, falsetrue.

    -

    它是一个前置运算符, 需出现在操作数之前, 且不加空格. 读作 非 a, 然后我们看以下例子:

    +

    逻辑非

    +

    逻辑非运算(!a)对一个布尔值取反,使得truefalsefalsetrue

    +

    它是一个前置运算符,需出现在操作数之前,且不加空格。读作非 a,然后我们看以下例子:

    let allowedEntry = false
     if !allowedEntry {
         println("ACCESS DENIED")
     }
    -// prints "ACCESS DENIED"
    +// 输出 "ACCESS DENIED"
     
    -

    if !allowedEntry语句可以读作 "如果 非 alowed entry.", 接下一行代码只有在如果 "非 allow entry" 为 true, 即 allowEntryfalse 时被执行.

    -

    在示例代码中, 小心地选择布尔常量或变量有助于代码的可读性, 并且避免使用双重逻辑非运算, 或混乱的逻辑语句.

    -

    逻辑与

    -

    逻辑与 a && b 表达了只有 ab 的值都为 true 时, 整个表达式的值才会是 true .

    -

    只要任意一个值为 false, 整个表达式的值就为 false. 事实上, 如果第一个值为 false, 那么是不去计算第二个值的, 因为它已经不可能影响整个表达式的结果了. 这被称做 "短路计算".

    -

    以下例子, 只有两个值都为值的时候才允许进入:

    +

    if !allowedEntry语句可以读作 "如果 非 alowed entry。",接下一行代码只有在如果 "非 allow entry" 为true,即allowEntryfalse时被执行。

    +

    在示例代码中,小心地选择布尔常量或变量有助于代码的可读性,并且避免使用双重逻辑非运算,或混乱的逻辑语句。

    +

    逻辑与

    +

    逻辑与(a && b)表达了只有ab的值都为true时,整个表达式的值才会是true

    +

    只要任意一个值为false,整个表达式的值就为false。事实上,如果第一个值为false,那么是不去计算第二个值的,因为它已经不可能影响整个表达式的结果了。这被称做 "短路计算(short-circuit evaluation)"。

    +

    以下例子,只有两个Bool值都为true值的时候才允许进入:

    let enteredDoorCode = true
     let passedRetinaScan = false
     if enteredDoorCode && passedRetinaScan {
    @@ -857,12 +872,12 @@ if enteredDoorCode && passedRetinaScan {
     } else {
         println("ACCESS DENIED")
     }
    -// 输出 "ACCESS DENIED
    +// 输出 "ACCESS DENIED"
     
    -

    逻辑或

    -

    逻辑或 a || b 是一个由两个连续的 | 组成的中置运算符. 它表示了两个逻辑表达式的其中一个为 true, 整个表达式就为 true.

    -

    同逻辑与运算类似, 逻辑或也是"短路计算"的, 当左端的表达式为 true 时, 将不计算右边的表达式了, 因为它不可能改变整个表达式的值了.

    -

    以下示例代码中, 第一个布尔值 hasDoorKeyfalse, 但第二个值 knowsOverridePasswordtrue, 所以整个表达是 true, 于是允许进入:

    +

    逻辑或

    +

    逻辑或(a || b)是一个由两个连续的|组成的中置运算符。它表示了两个逻辑表达式的其中一个为true,整个表达式就为true

    +

    同逻辑与运算类似,逻辑或也是"短路计算"的,当左端的表达式为true时,将不计算右边的表达式了,因为它不可能改变整个表达式的值了。

    +

    以下示例代码中,第一个布尔值(hasDoorKey)为false,但第二个值(knowsOverridePassword)为true,所以整个表达是true,于是允许进入:

    let hasDoorKey = false
     let knowsOverridePassword = true
     if hasDoorKey || knowsOverridePassword {
    @@ -872,8 +887,8 @@ if hasDoorKey || knowsOverridePassword {
     }
     // 输出 "Welcome!"
     
    -

    组合逻辑

    -

    我们可以组合多个逻辑运算来表达一个复合逻辑:

    +

    组合逻辑

    +

    我们可以组合多个逻辑运算来表达一个复合逻辑:

    if enteredDoorCode && passedRetinaScan || hasDoorKey || knowsOverridePassword {
         println("Welcome!")
     } else {
    @@ -881,20 +896,19 @@ if hasDoorKey || knowsOverridePassword {
     }
     // 输出 "Welcome!"
     
    -

    这个例子使用了含多个 &&|| 的复合逻辑. 但无论怎样, &&|| 始终只能操作两个值. 所以这实际是三个简单逻辑连续操作的结果. 我们来解读一下:

    -

    如果我们输入了正确的密码并通过了视网膜扫描; 或者我们有一把有效的钥匙; 又或者我们知道紧急情况下重置的密码, 我们就能把门打开进入.

    -

    前两种情况, 我们都不满足, 所以前两个简单逻辑的结果是 false, 但是我们是知道紧急情况下重置的密码的, 所以整个复杂表达式的值还是 true.

    -

    使用括号来明确优先级

    -

    为了一个复杂表达式更容易读懂, 在合适的地方使用括号来明确优先级是很有效的, 虽然它并非必要的. 在上个关于门的权限的例子中, 我们给第一个部分加个括号, 使用它看起来逻辑更明确.

    +

    这个例子使用了含多个&&||的复合逻辑。但无论怎样,&&||始终只能操作两个值。所以这实际是三个简单逻辑连续操作的结果。我们来解读一下:

    +

    如果我们输入了正确的密码并通过了视网膜扫描; 或者我们有一把有效的钥匙; 又或者我们知道紧急情况下重置的密码,我们就能把门打开进入。

    +

    前两种情况,我们都不满足,所以前两个简单逻辑的结果是false,但是我们是知道紧急情况下重置的密码的,所以整个复杂表达式的值还是true

    +

    使用括号来明确优先级

    +

    为了一个复杂表达式更容易读懂,在合适的地方使用括号来明确优先级是很有效的,虽然它并非必要的。在上个关于门的权限的例子中,我们给第一个部分加个括号,使用它看起来逻辑更明确:

    if (enteredDoorCode && passedRetinaScan) || hasDoorKey || knowsOverridePassword {
         println("Welcome!")
     } else {
         println("ACCESS DENIED")
     }
    -// prints "Welcome!"
    +// 输出 "Welcome!"
     
    -

    这括号使得前两个值被看成整个逻辑表达中独立的一个部分. 虽然有括号和没括号的输出结果是一样的, 但对于读代码的人来说有括号的代码更清晰.

    -

    可读性比简洁性更重要, 请在可以让你代码变清晰地地方加个括号吧!

    +

    这括号使得前两个值被看成整个逻辑表达中独立的一个部分。虽然有括号和没括号的输出结果是一样的,但对于读代码的人来说有括号的代码更清晰。可读性比简洁性更重要,请在可以让你代码变清晰地地方加个括号吧!

    @@ -913,16 +927,8 @@ if hasDoorKey || knowsOverridePassword {
    - - - - - - - - - - + + @@ -940,6 +946,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/03_Strings_and_Characters.html b/chapter2/03_Strings_and_Characters.html index 6426b9ce..e992b2b5 100644 --- a/chapter2/03_Strings_and_Characters.html +++ b/chapter2/03_Strings_and_Characters.html @@ -1,57 +1,45 @@ - - + - 字符串和字符 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,111 +595,111 @@
    -
    +
    -

    字符串和字符 (Strings and Characters)

    +
    +

    翻译:wh1100717
    校对:Hawstein

    +
    +

    字符串和字符(Strings and Characters)

    +

    本页包含内容:

    -
    -

    String 是例如 "hello, world", "海贼王" 这样的有序的 Character (字符) 类型的值的集合,通过 String 类型来表示。

    -

    Swift 的 StringCharacter 类型提供了一个快速的,兼容 Unicode 的方式来处理代码中的文本信息。 +

    String是例如“hello, world”,“海贼王” 这样的有序的Character(字符)类型的值的集合,通过String类型来表示。

    +

    Swift 的StringCharacter类型提供了一个快速的,兼容 Unicode 的方式来处理代码中的文本信息。 创建和操作字符串的语法与 C 语言中字符串操作相似,轻量并且易读。 -字符串连接操作只需要简单地通过 + 号将两个字符串相连即可。 +字符串连接操作只需要简单地通过+号将两个字符串相连即可。 与 Swift 中其他值一样,能否更改字符串的值,取决于其被定义为常量还是变量。

    -

    尽管语法简易,但 String 类型是一种快速、现代化的字符串实现。 -每一个字符串都是由独立编码的 Unicode 字符组成,并提供了以不同 Unicode 表示 (representations) 来访问这些字符的支持。

    -

    Swift可以在常量、变量、字面量和表达式中进行字符串插值操作,可以轻松创建用于展示、存储和打印的自定义字符串。

    +

    尽管语法简易,但String类型是一种快速、现代化的字符串实现。 +每一个字符串都是由独立编码的 Unicode 字符组成,并提供了以不同 Unicode 表示(representations)来访问这些字符的支持。

    +

    Swift 可以在常量、变量、字面量和表达式中进行字符串插值操作,可以轻松创建用于展示、存储和打印的自定义字符串。

    -

    注意:

    -

    Swift 的 String 类型与 Foundation NSString 类进行了无缝桥接。 -如果您利用 Cocoa 或 Cocoa Touch 中的 Foundation 框架进行工作。 -所有 NSString API 都可以调用您创建的任意 String 类型的值。 -除此之外,还可以使用本章介绍的 String 特性。 -您也可以在任意要求传入 NSString 实例作为参数的 API 中使用 String 类型的值作为替代。

    -

    更多关于在 Foundation 和 Cocoa 中使用 String 的信息请查看 Using Swift with Cocoa and Objective-C

    +

    注意:
    Swift 的String类型与 Foundation NSString类进行了无缝桥接。如果您利用 Cocoa 或 Cocoa Touch 中的 Foundation 框架进行工作。所有NSString API 都可以调用您创建的任意String类型的值。除此之外,还可以使用本章介绍的String特性。您也可以在任意要求传入NSString实例作为参数的 API 中使用String类型的值作为替代。 +更多关于在 Foundation 和 Cocoa 中使用String的信息请查看 Using Swift with Cocoa and Objective-C

    -
    -

    字符串字面量

    +

    +

    字符串字面量(String Literals)

    您可以在您的代码中包含一段预定义的字符串值作为字符串字面量。 字符串字面量是由双引号 ("") 包裹着的具有固定顺序的文本字符集。

    字符串字面量可以用于为常量和变量提供初始值。

    -
    let someString = "Some string literal value"
    -
    -

    注意:

    -

    someString 变量通过字符串字面量进行初始化,Swift 因此推断该变量为 String 类型。

    +
    let someString = "Some string literal value"
    +
    +
    +

    注意:
    someString变量通过字符串字面量进行初始化,Swift 因此推断该变量为String类型。

    字符串字面量可以包含以下特殊字符:

      -
    • 转义字符 \0 (空字符)、\\(反斜线)、\t (水平制表符)、\n (换行符)、\r (回车符)、\" (双引号)、\' (单引号)。
    • -
    • 单字节 Unicode 标量,写成 \xnn,其中 nn 为两位十六进制数。
    • -
    • 双字节 Unicode 标量,写成 \unnnn,其中 nnnn 为四位十六进制数。
    • -
    • 四字节 Unicode 标量,写成 \Unnnnnnnn,其中 nnnnnnnn 为八位十六进制数。
    • +
    • 转义字符\0(空字符)、\\(反斜线)、\t(水平制表符)、\n(换行符)、\r(回车符)、\"(双引号)、\'(单引号)。
    • +
    • 单字节 Unicode 标量,写成\xnn,其中nn为两位十六进制数。
    • +
    • 双字节 Unicode 标量,写成\unnnn,其中nnnn为四位十六进制数。
    • +
    • 四字节 Unicode 标量,写成\Unnnnnnnn,其中nnnnnnnn为八位十六进制数。

    下面的代码为各种特殊字符的使用示例。 -wiseWords 常量包含了两个转移特殊字符 (双括号); -dollarSignblackHeartsparklingHeart 常量演示了三种不同格式的 Unicode 标量:

    -
    let wiseWords = "\"我是要成为海贼王的男人\" - 路飞"
    +wiseWords常量包含了两个转移特殊字符 (双括号);
    +dollarSignblackHeartsparklingHeart常量演示了三种不同格式的 Unicode 标量:

    +
    let wiseWords = "\"我是要成为海贼王的男人\" - 路飞"
     // "我是要成为海贼王的男人" - 路飞
    -let dollarSign = "\x24"                // $,  Unicode 标量 U+0024
    -let blackHeart = "\u2665"              // ♥,  Unicode 标量 U+2665
    -let sparklingHeart = "\U0001F496"    // 💖, Unicode 标量 U+1F496
    -

    -

    初始化空字符串

    +let dollarSign = "\x24" // $, Unicode 标量 U+0024 +let blackHeart = "\u2665" // ♥, Unicode 标量 U+2665 +let sparklingHeart = "\U0001F496" // 💖, Unicode 标量 U+1F496 +
    +

    +

    初始化空字符串 (Initializing an Empty String)

    为了构造一个很长的字符串,可以创建一个空字符串作为初始值。 -可以将空的字符串字面量赋值给变量,也可以初始化一个新的 String 实例:

    -
    var emptyString = ""               // 空字符串字面量
    +可以将空的字符串字面量赋值给变量,也可以初始化一个新的String实例:

    +
    var emptyString = ""               // 空字符串字面量
     var anotherEmptyString = String()  // 初始化 String 实例
     // 两个字符串均为空并等价。
    -

    您可以通过检查其 Boolean 类型的 isEmpty 属性来判断该字符串是否为空:

    -
    if emptyString.isEmpty {
    +
    +

    您可以通过检查其Boolean类型的isEmpty属性来判断该字符串是否为空:

    +
    if emptyString.isEmpty {
         println("什么都没有")
     }
    -// 输出 "什么都没有"
    -

    -

    字符串可变性

    +// 打印输出:"什么都没有" +
    +

    +

    字符串可变性 (String Mutability)

    您可以通过将一个特定字符串分配给一个变量来对其进行修改,或者分配给一个常量来保证其不会被修改:

    -
    var variableString = "Horse"
    +
    var variableString = "Horse"
     variableString += " and carriage"
     // variableString 现在为 "Horse and carriage"
     let constantString = "Highlander"
     constantString += " and another Highlander"
     // 这会报告一个编译错误 (compile-time error) - 常量不可以被修改。
    -
    -

    注意:

    -

    在 Objective-C 和 Cocoa 中,您通过选择两个不同的类( NSStringNSMutableString )来指定该字符串是否可以被修改,Swift 中的字符串是否可以修改仅通过定义的是变量还是常量来决定,实现了多种类型可变性操作的统一。

    +
    +
    +

    注意:
    在 Objective-C 和 Cocoa 中,您通过选择两个不同的类(NSStringNSMutableString)来指定该字符串是否可以被修改,Swift 中的字符串是否可以修改仅通过定义的是变量还是常量来决定,实现了多种类型可变性操作的统一。

    -
    -

    字符串是值类型

    -

    Swift 的 String 类型是值类型。 +

    +

    字符串是值类型(Strings Are Value Types)

    +

    Swift 的String类型是值类型。 如果您创建了一个新的字符串,那么当其进行常量、变量赋值操作或在函数/方法中传递时,会进行值拷贝。 任何情况下,都会对已有字符串值创建新副本,并对该新副本进行传递或赋值操作。 -值类型在 Structures and Enumerations Are Value Types 中进行了说明。

    +值类型在 结构体和枚举是值类型 中进行了说明。

    -

    注意:

    -

    与 Cocoa 中的 NSString 不同,当您在 Cocoa 中创建了一个 NSString 实例,并将其传递给一个函数/方法,或者赋值给一个变量,您传递或赋值的是该 NSString 实例的一个引用,除非您特别要求进行值拷贝,否则字符串不会生成新的副本来进行赋值操作。

    +

    注意:
    与 Cocoa 中的NSString不同,当您在 Cocoa 中创建了一个NSString实例,并将其传递给一个函数/方法,或者赋值给一个变量,您传递或赋值的是该NSString实例的一个引用,除非您特别要求进行值拷贝,否则字符串不会生成新的副本来进行赋值操作。

    Swift 默认字符串拷贝的方式保证了在函数/方法中传递的是字符串的值。 很明显无论该值来自于哪里,都是您独自拥有的。 您可以放心您传递的字符串本身不会被更改。

    在实际编译时,Swift 编译器会优化字符串的使用,使实际的复制只发生在绝对必要的情况下,这意味着您将字符串作为值类型的同时可以获得极高的性能。

    -
    -

    使用字符(Characters)

    -

    Swift 的 String 类型表示特定序列的 Character (字符) 类型值的集合。 +

    +

    使用字符(Working with Characters)

    +

    Swift 的String类型表示特定序列的Character(字符) 类型值的集合。 每一个字符值代表一个 Unicode 字符。 -您可利用 for-in 循环来遍历字符串中的每一个字符:

    -
    for character in "Dog!🐶" {
    +您可利用for-in循环来遍历字符串中的每一个字符:

    +
    for character in "Dog!🐶" {
         println(character)
     }
     // D
    @@ -699,29 +707,26 @@ constantString += " and another Highlander"
     // g
     // !
     // 🐶
    -

    for-in 循环在For Loops中进行了详细描述。

    -

    另外,通过标明一个 Character 类型注解并通过字符字面量进行赋值,可以建立一个独立的字符常量或变量:

    -
    let yenSign: Character = "¥"
    -

    -

    计算字符数量

    -

    通过调用全局 countElements 函数,并将字符串作为参数进行传递,可以获取该字符串的字符数量。

    -
    let unusualMenagerie = "Koala 🐨, Snail 🐌, Penguin 🐧, Dromedary 🐪"
    +
    +

    for-in 循环在 For Loops 中进行了详细描述。

    +

    另外,通过标明一个Character类型注解并通过字符字面量进行赋值,可以建立一个独立的字符常量或变量:

    +
    let yenSign: Character = "¥"
    +
    +

    +

    计算字符数量 (Counting Characters)

    +

    通过调用全局countElements函数,并将字符串作为参数进行传递,可以获取该字符串的字符数量。

    +
    let unusualMenagerie = "Koala 🐨, Snail 🐌, Penguin 🐧, Dromedary 🐪"
     println("unusualMenagerie has \(countElements(unusualMenagerie)) characters")
    -// prints "unusualMenagerie has 40 characters"
    -
    -

    注意:

    -

    不同的 Unicode 字符以及相同 Unicode 字符的不同表示方式可能需要不同数量的内存空间来存储。 -所以Swift 中的字符在一个字符串中并不一定占用相同的内存空间。 -因此字符串的长度不得不通过迭代字符串中每一个字符的长度来进行计算。 -如果您正在处理一个长字符串,需要注意 countElements 函数必须遍历字符串中的字符以精准计算字符串的长度。

    -

    另外需要注意的是通过 countElements 返回的字符数量并不总是与包含相同字符的 NSString 的 length 属性相同。 -NSString 的 length 属性是基于利用 UTF-16 表示的十六位代码单元数字,而不是基于 Unicode 字符。 -为了解决这个问题,NSString 的 length 属性在被 Swift的 String 访问时会成为 utf16count

    +// 打印输出:"unusualMenagerie has 40 characters" +
    +
    +

    注意:
    不同的 Unicode 字符以及相同 Unicode 字符的不同表示方式可能需要不同数量的内存空间来存储。所以 Swift 中的字符在一个字符串中并不一定占用相同的内存空间。因此字符串的长度不得不通过迭代字符串中每一个字符的长度来进行计算。如果您正在处理一个长字符串,需要注意countElements函数必须遍历字符串中的字符以精准计算字符串的长度。 +另外需要注意的是通过countElements返回的字符数量并不总是与包含相同字符的NSStringlength属性相同。NSStringlength属性是基于利用 UTF-16 表示的十六位代码单元数字,而不是基于 Unicode 字符。为了解决这个问题,NSStringlength属性在被 Swift 的String访问时会成为utf16count

    -
    -

    连接字符串和字符

    -

    字符串和字符的值可以通过加法运算符 (+) 相加在一起并创建一个新的字符串值:

    -
    let string1 = "hello"
    +

    +

    连接字符串和字符 (Concatenating Strings and Characters)

    +

    字符串和字符的值可以通过加法运算符(+)相加在一起并创建一个新的字符串值:

    +
    let string1 = "hello"
     let string2 = " there"
     let character1: Character = "!"
     let character2: Character = "?"
    @@ -730,51 +735,55 @@ let stringPlusCharacter = string1 + character1        // 等于 "hello!&quo
     let stringPlusString = string1 + string2              // 等于 "hello there"
     let characterPlusString = character1 + string1        // 等于 "!hello"
     let characterPlusCharacter = character1 + character2  // 等于 "!?"
    -

    您也可以通过加法赋值运算符 (+=) 将一个字符串或者字符添加到一个已经存在字符串变量上:

    -
    var instruction = "look over"
    +
    +

    您也可以通过加法赋值运算符 (+=) 将一个字符串或者字符添加到一个已经存在字符串变量上:

    +
    var instruction = "look over"
     instruction += string2
     // instruction 现在等于 "look over there"
     
     var welcome = "good morning"
     welcome += character1
     // welcome 现在等于 "good morning!"
    -
    -

    注意:

    -

    您不能将一个字符串或者字符添加到一个已经存在的字符变量上,因为字符变量只能包含一个字符。

    +
    +
    +

    注意:
    您不能将一个字符串或者字符添加到一个已经存在的字符变量上,因为字符变量只能包含一个字符。

    -
    -

    字符串插值

    +

    +

    字符串插值 (String Interpolation)

    字符串插值是一种构建新字符串的方式,可以在其中包含常量、变量、字面量和表达式。 您插入的字符串字面量的每一项都被包裹在以反斜线为前缀的圆括号中:

    -
    let multiplier = 3
    +
    let multiplier = 3
     let message = "\(multiplier) 乘以 2.5 是 \(Double(multiplier) * 2.5)"
    -// message is "3 乘以 2.5 是 7.5"
    -

    在上面的例子中,multiplier 作为 \(multiplier) 被插入到一个字符串字面量中。 -当创建字符串执行插值计算时此占位符会被替换为 multiplier 实际的值。

    -

    multiplier 的值也作为字符串中后面表达式的一部分。 -该表达式计算 Double(multiplier) * 2.5 的值并将结果 (7.5) 插入到字符串中。 -在这个例子中,表达式写为 \(Double(multiplier) * 2.5) 并包含在字符串字面量中。

    +// message 是 "3 乘以 2.5 是 7.5" +
    +

    在上面的例子中,multiplier作为\(multiplier)被插入到一个字符串字面量中。 +当创建字符串执行插值计算时此占位符会被替换为multiplier实际的值。

    +

    multiplier的值也作为字符串中后面表达式的一部分。 +该表达式计算Double(multiplier) * 2.5的值并将结果 (7.5) 插入到字符串中。 +在这个例子中,表达式写为\(Double(multiplier) * 2.5)并包含在字符串字面量中。

    -

    注意:

    -

    您插值字符串中写在括号中的表达式不能包含非转义双引号 (") 和反斜杠 (\),并且不能包含回车或换行符。

    +

    注意:
    插值字符串中写在括号中的表达式不能包含非转义双引号 (") 和反斜杠 (\),并且不能包含回车或换行符。

    -
    -

    比较字符串

    -

    Swift 提供了三种方式来比较字符串的值:字符串相等,前缀相等和后缀相等。

    -
    字符串相等
    +

    +

    比较字符串 (Comparing Strings)

    +

    Swift 提供了三种方式来比较字符串的值:字符串相等、前缀相等和后缀相等。

    +

    +

    字符串相等 (String Equality)

    如果两个字符串以同一顺序包含完全相同的字符,则认为两者字符串相等:

    -
    let quotation = "我们是一样一样滴."
    +
    let quotation = "我们是一样一样滴."
     let sameQuotation = "我们是一样一样滴."
     if quotation == sameQuotation {
         println("这两个字符串被认为是相同的")
     }
    -// prints "这两个字符串被认为是相同的"
    -
    前缀/后缀相等
    -

    通过调用字符串的 hasPrefix/hasSuffix 方法来检查字符串是否拥有特定前缀/后缀。 -两个方法均需要以字符串作为参数传入并传出 Boolean 值。 +// 打印输出:"这两个字符串被认为是相同的" +

    +

    +

    前缀/后缀相等 (Prefix and Suffix Equality)

    +

    通过调用字符串的hasPrefix/hasSuffix方法来检查字符串是否拥有特定前缀/后缀。 +两个方法均需要以字符串作为参数传入并传出Boolean值。 两个方法均执行基本字符串和前缀/后缀字符串之间逐个字符的比较操作。

    -

    下面的例子以一个字符串数组表示莎士比亚话剧 罗密欧与朱丽叶 中前两场的场景位置:

    -
    let romeoAndJuliet = [
    +

    下面的例子以一个字符串数组表示莎士比亚话剧《罗密欧与朱丽叶》中前两场的场景位置:

    +
    let romeoAndJuliet = [
         "Act 1 Scene 1: Verona, A public place",
         "Act 1 Scene 2: Capulet's mansion",
         "Act 1 Scene 3: A room in Capulet's mansion",
    @@ -787,79 +796,105 @@ if quotation == sameQuotation {
         "Act 2 Scene 5: Capulet's mansion",
         "Act 2 Scene 6: Friar Lawrence's cell"
     ]
    -

    您可以利用 hasPrefix 方法来计算话剧中第一幕的场景数:

    -
    var act1SceneCount = 0
    +
    +

    您可以利用hasPrefix方法来计算话剧中第一幕的场景数:

    +
    var act1SceneCount = 0
     for scene in romeoAndJuliet {
         if scene.hasPrefix("Act 1 ") {
             ++act1SceneCount
         }
     }
     println("There are \(act1SceneCount) scenes in Act 1")
    -// prints "There are 5 scenes in Act 1"
    -
    大写和小写字符串
    -

    您可以通过字符串的 uppercaseStringlowercaseString 属性来访问大写/小写版本的字符串。

    -
    let normal = "Could you help me, please?"
    +// 打印输出:"There are 5 scenes in Act 1"
    +
    +

    相似地,您可以用hasSuffix方法来计算发生在不同地方的场景数:

    +
    var mansionCount = 0
    +var cellCount = 0
    +for scene in romeoAndJuliet {
    +    if scene.hasSuffix("Capulet's mansion") {
    +        ++mansionCount
    +    } else if scene.hasSuffix("Friar Lawrence's cell") {
    +        ++cellCount
    +    }
    +}
    +println("\(mansionCount) mansion scenes; \(cellCount) cell scenes")
    +// 打印输出:"6 mansion scenes; 2 cell scenes”
    +
    +

    +

    大写和小写字符串(Uppercase and Lowercase Strings)

    +

    您可以通过字符串的uppercaseStringlowercaseString属性来访问大写/小写版本的字符串。

    +
    let normal = "Could you help me, please?"
     let shouty = normal.uppercaseString
     // shouty 值为 "COULD YOU HELP ME, PLEASE?"
     let whispered = normal.lowercaseString
     // whispered 值为 "could you help me, please?"
    -

    -

    Unicode

    +
    +

    +

    Unicode

    Unicode 是一个国际标准,用于文本的编码和表示。 它使您可以用标准格式表示来自任意语言几乎所有的字符,并能够对文本文件或网页这样的外部资源中的字符进行读写操作。

    Swift 的字符串和字符类型是完全兼容 Unicode 标准的,它支持如下所述的一系列不同的 Unicode 编码。

    -
    Unicode 术语(Terminology)
    +

    +

    Unicode 术语(Unicode Terminology)

    Unicode 中每一个字符都可以被解释为一个或多个 unicode 标量。 -字符的 unicode 标量是一个唯一的21位数字(和名称),例如 U+0061 表示小写的拉丁字母A ("a"),U+1F425 表示小幺鸡表情 ("🐥")

    -

    当 Unicode 字符串被写进文本文件或其他存储结构当中,这些 unicode 标量将会按照 Unicode 定义的集中格式之一进行编码。其包括 UTF-8 (以8位代码单元进行编码) 和 UTF-16 (以16位代码单元进行编码)。

    -
    字符串的 Unicode 表示
    +字符的 unicode 标量是一个唯一的21位数字(和名称),例如U+0061表示小写的拉丁字母A ("a"),U+1F425表示小鸡表情 ("🐥")

    +

    当 Unicode 字符串被写进文本文件或其他存储结构当中,这些 unicode 标量将会按照 Unicode 定义的集中格式之一进行编码。其包括UTF-8(以8位代码单元进行编码) 和UTF-16(以16位代码单元进行编码)。

    +

    +

    字符串的 Unicode 表示(Unicode Representations of Strings)

    Swift 提供了几种不同的方式来访问字符串的 Unicode 表示。

    -

    您可以利用 for-in 来对字符串进行遍历,从而以 Unicode 字符的方式访问每一个字符值。 -该过程在 Working with Characters 中进行了描述。

    +

    您可以利用for-in来对字符串进行遍历,从而以 Unicode 字符的方式访问每一个字符值。 +该过程在 使用字符 中进行了描述。

    另外,能够以其他三种 Unicode 兼容的方式访问字符串的值:

      -
    • UTF-8 代码单元集合 (利用字符串的 utf8 属性进行访问)
    • -
    • UTF-16 代码单元集合 (利用字符串的 utf16 属性进行访问)
    • -
    • 21位的 Unicode 标量值集合 (利用字符串的 unicodeScalars 属性进行访问)
    • +
    • UTF-8 代码单元集合 (利用字符串的utf8属性进行访问)
    • +
    • UTF-16 代码单元集合 (利用字符串的utf16属性进行访问)
    • +
    • 21位的 Unicode 标量值集合 (利用字符串的unicodeScalars属性进行访问)
    -

    下面由 D o g !🐶 (DOG FACE,Unicode 标量为 U+1F436)组成的字符串中的每一个字符代表着一种不同的表示:

    -
    let dogString = "Dog!🐶"
    -
    UTF-8
    -

    您可以通过遍历字符串的 utf8 属性来访问它的 UTF-8 表示。 -其为 UTF8View 类型的属性,UTF8View 是无符号8位 (UInt8) 值的集合,每一个 UInt8 值都是一个字符的 UTF-8 表示:

    -
    for codeUnit in dogString.utf8 {
    +

    下面由D``o``g``!🐶(DOG FACE,Unicode 标量为U+1F436)组成的字符串中的每一个字符代表着一种不同的表示:

    +
    let dogString = "Dog!🐶"
    +
    +

    +

    UTF-8

    +

    您可以通过遍历字符串的utf8属性来访问它的UTF-8表示。 +其为UTF8View类型的属性,UTF8View是无符号8位 (UInt8) 值的集合,每一个UInt8值都是一个字符的 UTF-8 表示:

    +
    for codeUnit in dogString.utf8 {
         print("\(codeUnit) ")
     }
     print("\n")
     // 68 111 103 33 240 159 144 182
    -

    上面的例子中,前四个10进制代码单元值 (68, 111, 103, 33) 代表了字符 D o g! ,他们的 UTF-8 表示与 ASCII 表示相同。 -后四个代码单元值 (240, 159, 144, 182) 是 DOG FACE 的4位 UTF-8 表示。

    -
    UTF-16
    -

    您可以通过遍历字符串的 utf16 属性来访问它的 UTF-16 表示。 -其为 UTF16View 类型的属性,UTF16View 是无符号16位 (UInt16) 值的集合,每一个 UInt16 都是一个字符的 UTF-16 表示:

    -
    for codeUnit in dogString.utf16 {
    +
    +

    上面的例子中,前四个10进制代码单元值 (68, 111, 103, 33) 代表了字符D o g!,它们的 UTF-8 表示与 ASCII 表示相同。 +后四个代码单元值 (240, 159, 144, 182) 是DOG FACE的4字节 UTF-8 表示。

    +

    +

    UTF-16

    +

    您可以通过遍历字符串的utf16属性来访问它的UTF-16表示。 +其为UTF16View类型的属性,UTF16View是无符号16位 (UInt16) 值的集合,每一个UInt16都是一个字符的 UTF-16 表示:

    +
    for codeUnit in dogString.utf16 {
         print("\(codeUnit) ")
     }
     print("\n")
     // 68 111 103 33 55357 56374
    -

    同样,前四个代码单元值 (68, 111, 103, 33) 代表了字符 D o g! ,他们的 UTF-16 代码单元和 UTF-8 完全相同。

    -

    第五和第六个代码单元值 (55357 and 56374) 是 DOG FACE 字符的UTF-16 表示。 -第一个值为 U+D83D (十进制值为 55357),第二个值为 U+DC36 (十进制值为 56374)。

    -
    Unicode 标量 (Scalars)
    -

    您可以通过遍历字符串的 unicodeScalars 属性来访问它的 Unicode 标量表示。 -其为 UnicodeScalarView 类型的属性, UnicodeScalarViewUnicodeScalar 的集合。 -UnicodeScalar 是21位的 Unicode 代码点。

    -

    每一个 UnicodeScalar 拥有一个值属性,可以返回对应的21位数值,用 UInt32 来表示。

    -
    for scalar in dogString.unicodeScalars {
    +
    +

    同样,前四个代码单元值 (68, 111, 103, 33) 代表了字符D o g!,它们的 UTF-16 代码单元和 UTF-8 完全相同。

    +

    第五和第六个代码单元值 (55357 和 56374) 是DOG FACE字符的UTF-16 表示。 +第一个值为U+D83D(十进制值为 55357),第二个值为U+DC36(十进制值为 56374)。

    +

    +

    Unicode 标量 (Unicode Scalars)

    +

    您可以通过遍历字符串的unicodeScalars属性来访问它的 Unicode 标量表示。 +其为UnicodeScalarView类型的属性, UnicodeScalarViewUnicodeScalar的集合。 +UnicodeScalar是21位的 Unicode 代码点。

    +

    每一个UnicodeScalar拥有一个值属性,可以返回对应的21位数值,用UInt32来表示。

    +
    for scalar in dogString.unicodeScalars {
         print("\(scalar.value) ")
     }
     print("\n")
     // 68 111 103 33 128054
    -

    同样,前四个代码单元值 (68, 111, 103, 33) 代表了字符 D o g! 。 +

    +

    同样,前四个代码单元值 (68, 111, 103, 33) 代表了字符D o g!。 第五位数值,128054,是一个十六进制1F436的十进制表示。 -其等同于 DOG FACE 的Unicode 标量 U+1F436。

    -

    作为查询字符值属性的一种替代方法,每个 UnicodeScalar 值也可以用来构建一个新的字符串值,比如在字符串插值中使用:

    -
    for scalar in dogString.unicodeScalars {
    +其等同于DOG FACE的Unicode 标量 U+1F436。

    +

    作为查询字符值属性的一种替代方法,每个UnicodeScalar值也可以用来构建一个新的字符串值,比如在字符串插值中使用:

    +
    for scalar in dogString.unicodeScalars {
         println("\(scalar) ")
     }
     // D
    @@ -867,7 +902,7 @@ print("\n")
     // g
     // !
     // 🐶
    -

    +
    @@ -886,16 +921,8 @@ print("\n")
    - - - - - - - - - - + + @@ -913,6 +940,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/04_Collection_Types.html b/chapter2/04_Collection_Types.html index 92c4c35b..d9ea3e55 100644 --- a/chapter2/04_Collection_Types.html +++ b/chapter2/04_Collection_Types.html @@ -1,57 +1,45 @@ - - + - 集合类型 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,9 +595,288 @@
    -
    +
    -

    集合类型 (Collection Types)

    +
    +

    翻译:zqp
    校对:shinyzhu, stanzhai

    +
    +

    集合类型 (Collection Types)

    +
    +

    本页包含内容:

    + +

    Swift 语言提供经典的数组和字典两种集合类型来存储集合数据。数组用来按顺序存储相同类型的数据。字典虽然无序存储相同类型数据值但是需要由独有的标识符引用和寻址(就是键值对)。

    +

    Swift 语言里的数组和字典中存储的数据值类型必须明确。 这意味着我们不能把不正确的数据类型插入其中。 同时这也说明我们完全可以对获取出的值类型非常自信。 Swift 对显式类型集合的使用确保了我们的代码对工作所需要的类型非常清楚,也让我们在开发中可以早早地找到任何的类型不匹配错误。

    +
    +

    注意:
    Swift 的数组结构在被声明成常量和变量或者被传入函数与方法中时会相对于其他类型展现出不同的特性。 获取更多信息请参见集合的可变性集合在赋值和复制中的行为章节。

    +
    +

    +

    数组

    +

    数组使用有序列表存储同一类型的多个值。相同的值可以多次出现在一个数组的不同位置中。

    +

    Swift 数组特定于它所存储元素的类型。这与 Objective-C 的 NSArray 和 NSMutableArray 不同,这两个类可以存储任意类型的对象,并且不提供所返回对象的任何特别信息。在 Swift 中,数据值在被存储进入某个数组之前类型必须明确,方法是通过显式的类型标注或类型推断,而且不是必须是class类型。例如: 如果我们创建了一个Int值类型的数组,我们不能往其中插入任何不是Int类型的数据。 Swift 中的数组是类型安全的,并且它们中包含的类型必须明确。

    +

    +

    数组的简单语法

    +

    写 Swift 数组应该遵循像Array<SomeType>这样的形式,其中SomeType是这个数组中唯一允许存在的数据类型。 我们也可以使用像SomeType[]这样的简单语法。 尽管两种形式在功能上是一样的,但是推荐较短的那种,而且在本文中都会使用这种形式来使用数组。

    +

    +

    数组构造语句

    +

    我们可以使用字面量来进行数组构造,这是一种用一个或者多个数值构造数组的简单方法。字面量是一系列由逗号分割并由方括号包含的数值。 +[value 1, value 2, value 3]

    +

    下面这个例子创建了一个叫做shoppingList并且存储字符串的数组:

    +
    var shoppingList: String[] = ["Eggs", "Milk"]
    +// shoppingList 已经被构造并且拥有两个初始项。
    +
    +

    shoppingList变量被声明为“字符串值类型的数组“,记作String[]。 因为这个数组被规定只有String一种数据结构,所以只有String类型可以在其中被存取。 在这里,shoppinglist数组由两个String值("Eggs""Milk")构造,并且由字面量定义。

    +
    +

    注意:
    Shoppinglist数组被声明为变量(var关键字创建)而不是常量(let创建)是因为以后可能会有更多的数据项被插入其中。

    +
    +

    在这个例子中,字面量仅仅包含两个String值。匹配了该数组的变量声明(只能包含String的数组),所以这个字面量的分配过程就是允许用两个初始项来构造shoppinglist

    +

    由于 Swift 的类型推断机制,当我们用字面量构造只拥有相同类型值数组的时候,我们不必把数组的类型定义清楚。 shoppinglist的构造也可以这样写:

    +
    var shoppingList = ["Eggs", "Milk"]
    +
    +

    因为所有字面量中的值都是相同的类型,Swift 可以推断出String[]shoppinglist中变量的正确类型。

    +

    +

    访问和修改数组

    +

    我们可以通过数组的方法和属性来访问和修改数组,或者下标语法。 +还可以使用数组的只读属性count来获取数组中的数据项数量。

    +
    println("The shopping list contains \(shoppingList.count) items.")
    +// 输出"The shopping list contains 2 items."(这个数组有2个项)
    +
    +

    使用布尔项isEmpty来作为检查count属性的值是否为 0 的捷径。

    +
    if shoppingList.isEmpty {
    +    println("The shopping list is empty.")
    +} else {
    +    println("The shopping list is not empty.")
    +}
    +// 打印 "The shopping list is not empty."(shoppinglist不是空的)
    +
    +

    也可以使用append方法在数组后面添加新的数据项:

    +
    shoppingList.append("Flour")
    +// shoppingList 现在有3个数据项,有人在摊煎饼
    +
    +

    除此之外,使用加法赋值运算符(+=)也可以直接在数组后面添加数据项:

    +
    shoppingList += "Baking Powder"
    +// shoppingList 现在有四项了
    +
    +

    我们也可以使用加法赋值运算符(+=)直接添加拥有相同类型数据的数组。

    +
    shoppingList += ["Chocolate Spread", "Cheese", "Butter"]
    +// shoppingList 现在有7项了
    +
    +

    可以直接使用下标语法来获取数组中的数据项,把我们需要的数据项的索引值放在直接放在数组名称的方括号中:

    +
    var firstItem = shoppingList[0]
    +// 第一项是 "Eggs"
    +
    +

    注意第一项在数组中的索引值是0而不是1。 Swift 中的数组索引总是从零开始。

    +

    我们也可以用下标来改变某个已有索引值对应的数据值:

    +
    shoppingList[0] = "Six eggs"
    +// 其中的第一项现在是 "Six eggs" 而不是 "Eggs"
    +
    +

    还可以利用下标来一次改变一系列数据值,即使新数据和原有数据的数量是不一样的。下面的例子把"Chocolate Spread""Cheese",和"Butter"替换为"Bananas""Apples"

    +
    shoppingList[4...6] = ["Bananas", "Apples"]
    +// shoppingList 现在有六项
    +
    +
    +

    注意:
    我们不能使用下标语法在数组尾部添加新项。如果我们试着用这种方法对索引越界的数据进行检索或者设置新值的操作,我们会引发一个运行期错误。我们可以使用索引值和数组的count属性进行比较来在使用某个索引之前先检验是否有效。除了当count等于 0 时(说明这是个空数组),最大索引值一直是count - 1,因为数组都是零起索引。

    +
    +

    调用数组的insert(atIndex:)方法来在某个具体索引值之前添加数据项:

    +
    shoppingList.insert("Maple Syrup", atIndex: 0)
    +// shoppingList 现在有7项
    +// "Maple Syrup" 现在是这个列表中的第一项
    +
    +

    这次insert函数调用把值为"Maple Syrup"的新数据项插入列表的最开始位置,并且使用0作为索引值。

    +

    类似的我们可以使用removeAtIndex方法来移除数组中的某一项。这个方法把数组在特定索引值中存储的数据项移除并且返回这个被移除的数据项(我们不需要的时候就可以无视它):

    +
    let mapleSyrup = shoppingList.removeAtIndex(0)
    +// 索引值为0的数据项被移除
    +// shoppingList 现在只有6项,而且不包括Maple Syrup
    +// mapleSyrup常量的值等于被移除数据项的值 "Maple Syrup"
    +
    +

    数据项被移除后数组中的空出项会被自动填补,所以现在索引值为0的数据项的值再次等于"Six eggs":

    +
    firstItem = shoppingList[0]
    +// firstItem 现在等于 "Six eggs"
    +
    +

    如果我们只想把数组中的最后一项移除,可以使用removeLast方法而不是removeAtIndex方法来避免我们需要获取数组的count属性。就像后者一样,前者也会返回被移除的数据项:

    +
    let apples = shoppingList.removeLast()
    +// 数组的最后一项被移除了
    +// shoppingList现在只有5项,不包括cheese
    +// apples 常量的值现在等于"Apples" 字符串
    +
    +

    +

    数组的遍历

    +

    我们可以使用for-in循环来遍历所有数组中的数据项:

    +
    for item in shoppingList {
    +    println(item)
    +}
    +// Six eggs
    +// Milk
    +// Flour
    +// Baking Powder
    +// Bananas
    +
    +

    如果我们同时需要每个数据项的值和索引值,可以使用全局enumerate函数来进行数组遍历。enumerate返回一个由每一个数据项索引值和数据值组成的元组。我们可以把这个元组分解成临时常量或者变量来进行遍历:

    +
    for (index, value) in enumerate(shoppingList) {
    +    println("Item \(index + 1): \(value)")
    +}
    +// Item 1: Six eggs
    +// Item 2: Milk
    +// Item 3: Flour
    +// Item 4: Baking Powder
    +// Item 5: Bananas
    +
    +

    更多关于for-in循环的介绍请参见for 循环

    +

    +

    创建并且构造一个数组

    +

    我们可以使用构造语法来创建一个由特定数据类型构成的空数组:

    +
    var someInts = Int[]()
    +println("someInts is of type Int[] with \(someInts.count) items。")
    +// 打印 "someInts is of type Int[] with 0 items。"(someInts是0数据项的Int[]数组)
    +
    +

    注意someInts被设置为一个Int[]构造函数的输出所以它的变量类型被定义为Int[]

    +

    除此之外,如果代码上下文中提供了类型信息, 例如一个函数参数或者一个已经定义好类型的常量或者变量,我们可以使用空数组语句创建一个空数组,它的写法很简单:[](一对空方括号):

    +
    someInts.append(3)
    +// someInts 现在包含一个INT值
    +someInts = []
    +// someInts 现在是空数组,但是仍然是Int[]类型的。
    +
    +

    Swift 中的Array类型还提供一个可以创建特定大小并且所有数据都被默认的构造方法。我们可以把准备加入新数组的数据项数量(count)和适当类型的初始值(repeatedValue)传入数组构造函数:

    +
    var threeDoubles = Double[](count: 3, repeatedValue:0.0)
    +// threeDoubles 是一种 Double[]数组, 等于 [0.0, 0.0, 0.0]
    +
    +

    因为类型推断的存在,我们使用这种构造方法的时候不需要特别指定数组中存储的数据类型,因为类型可以从默认值推断出来:

    +
    var anotherThreeDoubles = Array(count: 3, repeatedValue: 2.5)
    +// anotherThreeDoubles is inferred as Double[], and equals [2.5, 2.5, 2.5]
    +
    +

    最后,我们可以使用加法操作符(+)来组合两种已存在的相同类型数组。新数组的数据类型会被从两个数组的数据类型中推断出来:

    +
    var sixDoubles = threeDoubles + anotherThreeDoubles
    +// sixDoubles 被推断为 Double[], 等于 [0.0, 0.0, 0.0, 2.5, 2.5, 2.5]
    +
    +

    +

    字典

    +

    字典是一种存储多个相同类型的值的容器。每个值(value)都关联唯一的键(key),键作为字典中的这个值数据的标识符。和数组中的数据项不同,字典中的数据项并没有具体顺序。我们在需要通过标识符(键)访问数据的时候使用字典,这种方法很大程度上和我们在现实世界中使用字典查字义的方法一样。

    +

    Swift 的字典使用时需要具体规定可以存储键和值类型。不同于 Objective-C 的NSDictionaryNSMutableDictionary 类可以使用任何类型的对象来作键和值并且不提供任何关于这些对象的本质信息。在 Swift 中,在某个特定字典中可以存储的键和值必须提前定义清楚,方法是通过显性类型标注或者类型推断。

    +

    Swift 的字典使用Dictionary<KeyType, ValueType>定义,其中KeyType是字典中键的数据类型,ValueType是字典中对应于这些键所存储值的数据类型。

    +

    KeyType的唯一限制就是可哈希的,这样可以保证它是独一无二的,所有的 Swift 基本类型(例如StringIntDoubleBool)都是默认可哈希的,并且所有这些类型都可以在字典中当做键使用。未关联值的枚举成员(参见枚举)也是默认可哈希的。

    +

    +

    字典字面量

    +

    我们可以使用字典字面量来构造字典,它们和我们刚才介绍过的数组字面量拥有相似语法。一个字典字面量是一个定义拥有一个或者多个键值对的字典集合的简单语句。

    +

    一个键值对是一个key和一个value的结合体。在字典字面量中,每一个键值对的键和值都由冒号分割。这些键值对构成一个列表,其中这些键值对由方括号包含并且由逗号分割:

    +
    [key 1: value 1, key 2: value 2, key 3: value 3]
    +
    +

    下面的例子创建了一个存储国际机场名称的字典。在这个字典中键是三个字母的国际航空运输相关代码,值是机场名称:

    +
    var airports: Dictionary<String, String> = ["TYO": "Tokyo", "DUB": "Dublin"]
    +
    +

    airports字典被定义为一种Dictionary<String, String>,它意味着这个字典的键和值都是String类型。

    +
    +

    注意:
    airports字典被声明为变量(用var关键字)而不是常量(let关键字)因为后来更多的机场信息会被添加到这个示例字典中。

    +
    +

    airports字典使用字典字面量初始化,包含两个键值对。第一对的键是TYO,值是Tokyo。第二对的键是DUB,值是Dublin

    +

    这个字典语句包含了两个String: String类型的键值对。它们对应airports变量声明的类型(一个只有String键和String值的字典)所以这个字典字面量是构造两个初始数据项的airport字典。

    +

    和数组一样,如果我们使用字面量构造字典就不用把类型定义清楚。airports的也可以用这种方法简短定义:

    +
    var airports = ["TYO": "Tokyo", "DUB": "Dublin"]
    +
    +

    因为这个语句中所有的键和值都分别是相同的数据类型,Swift 可以推断出Dictionary<String, String>airports字典的正确类型。

    +

    +

    读取和修改字典

    +

    我们可以通过字典的方法和属性来读取和修改字典,或者使用下标语法。和数组一样,我们可以通过字典的只读属性count来获取某个字典的数据项数量:

    +
    println("The dictionary of airports contains \(airports.count) items.")
    +// 打印 "The dictionary of airports contains 2 items."(这个字典有两个数据项)
    +
    +

    我们也可以在字典中使用下标语法来添加新的数据项。可以使用一个合适类型的 key 作为下标索引,并且分配新的合适类型的值:

    +
    airports["LHR"] = "London"
    +// airports 字典现在有三个数据项
    +
    +

    我们也可以使用下标语法来改变特定键对应的值:

    +
    airports["LHR"] = "London Heathrow"
    +// "LHR"对应的值 被改为 "London Heathrow
    +
    +

    作为另一种下标方法,字典的updateValue(forKey:)方法可以设置或者更新特定键对应的值。就像上面所示的示例,updateValue(forKey:)方法在这个键不存在对应值的时候设置值或者在存在时更新已存在的值。和上面的下标方法不一样,这个方法返回更新值之前的原值。这样方便我们检查更新是否成功。

    +

    updateValue(forKey:)函数会返回包含一个字典值类型的可选值。举例来说:对于存储String值的字典,这个函数会返回一个String?或者“可选 String”类型的值。如果值存在,则这个可选值值等于被替换的值,否则将会是nil

    +
    if let oldValue = airports.updateValue("Dublin Internation", forKey: "DUB") {
    +    println("The old value for DUB was \(oldValue).")
    +}
    +// 输出 "The old value for DUB was Dublin."(DUB原值是dublin)
    +
    +

    我们也可以使用下标语法来在字典中检索特定键对应的值。由于使用一个没有值的键这种情况是有可能发生的,可选类型返回这个键存在的相关值,否则就返回nil

    +
    if let airportName = airports["DUB"] {
    +    println("The name of the airport is \(airportName).")
    +} else {
    +    println("That airport is not in the airports dictionary.")
    +}
    +// 打印 "The name of the airport is Dublin Internation."(机场的名字是都柏林国际)
    +
    +

    我们还可以使用下标语法来通过给某个键的对应值赋值为nil来从字典里移除一个键值对:

    +
    airports["APL"] = "Apple Internation"
    +// "Apple Internation"不是真的 APL机场, 删除它
    +airports["APL"] = nil
    +// APL现在被移除了
    +
    +

    另外,removeValueForKey方法也可以用来在字典中移除键值对。这个方法在键值对存在的情况下会移除该键值对并且返回被移除的value或者在没有值的情况下返回nil

    +
    if let removedValue = airports.removeValueForKey("DUB") {
    +    println("The removed airport's name is \(removedValue).")
    +} else {
    +    println("The airports dictionary does not contain a value for DUB.")
    +}
    +// prints "The removed airport's name is Dublin International."
    +
    +

    +

    字典遍历

    +

    我们可以使用for-in循环来遍历某个字典中的键值对。每一个字典中的数据项都由(key, value)元组形式返回,并且我们可以使用临时常量或者变量来分解这些元组:

    +
    for (airportCode, airportName) in airports {
    +    println("\(airportCode): \(airportName)")
    +}
    +// TYO: Tokyo
    +// LHR: London Heathrow
    +
    +

    for-in循环请参见For 循环

    +

    我们也可以通过访问它的keys或者values属性(都是可遍历集合)检索一个字典的键或者值:

    +
    for airportCode in airports.keys {
    +    println("Airport code: \(airportCode)")
    +}
    +// Airport code: TYO
    +// Airport code: LHR
    +
    +for airportName in airports.values {
    +    println("Airport name: \(airportName)")
    +}
    +// Airport name: Tokyo
    +// Airport name: London Heathrow
    +
    +

    如果我们只是需要使用某个字典的键集合或者值集合来作为某个接受Array实例 API 的参数,可以直接使用keys或者values属性直接构造一个新数组:

    +
    let airportCodes = Array(airports.keys)
    +// airportCodes is ["TYO", "LHR"]
    +
    +let airportNames = Array(airports.values)
    +// airportNames is ["Tokyo", "London Heathrow"]
    +
    +
    +

    注意:
    Swift 的字典类型是无序集合类型。其中字典键,值,键值对在遍历的时候会重新排列,而且其中顺序是不固定的。

    +
    +

    +

    创建一个空字典

    +

    我们可以像数组一样使用构造语法创建一个空字典:

    +
    var namesOfIntegers = Dictionary<Int, String>()
    +// namesOfIntegers 是一个空的 Dictionary<Int, String>
    +
    +

    这个例子创建了一个Int, String类型的空字典来储存英语对整数的命名。它的键是Int型,值是String型。

    +

    如果上下文已经提供了信息类型,我们可以使用空字典字面量来创建一个空字典,记作[:](中括号中放一个冒号):

    +
    namesOfIntegers[16] = "sixteen"
    +// namesOfIntegers 现在包含一个键值对
    +namesOfIntegers = [:]
    +// namesOfIntegers 又成为了一个 Int, String类型的空字典
    +
    +
    +

    注意:
    在后台,Swift 的数组和字典都是由泛型集合来实现的,想了解更多泛型和集合信息请参见泛型

    +
    +

    +

    集合的可变性

    +

    数组和字典都是在单个集合中存储可变值。如果我们创建一个数组或者字典并且把它分配成一个变量,这个集合将会是可变的。这意味着我们可以在创建之后添加更多或移除已存在的数据项来改变这个集合的大小。与此相反,如果我们把数组或字典分配成常量,那么它就是不可变的,它的大小不能被改变。

    +

    对字典来说,不可变性也意味着我们不能替换其中任何现有键所对应的值。不可变字典的内容在被首次设定之后不能更改。 +不可变性对数组来说有一点不同,当然我们不能试着改变任何不可变数组的大小,但是我们可以重新设定相对现存索引所对应的值。这使得 Swift 数组在大小被固定的时候依然可以做的很棒。

    +

    Swift 数组的可变性行为同时影响了数组实例如何被分配和修改,想获取更多信息,请参见集合在赋值和复制中的行为

    +
    +

    注意:
    在我们不需要改变数组大小的时候创建不可变数组是很好的习惯。如此 Swift 编译器可以优化我们创建的集合。

    +
    @@ -608,16 +895,8 @@
    - - - - - - - - - - + + @@ -635,6 +914,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/05_Control_Flow.html b/chapter2/05_Control_Flow.html index 8b134f6f..9c97a817 100644 --- a/chapter2/05_Control_Flow.html +++ b/chapter2/05_Control_Flow.html @@ -1,57 +1,45 @@ - - + - 控制流 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,10 +595,531 @@
    -
    +
    -

    控制流

    -

    Swift提供了类似C语言的流程控制结构,包括将任务执行多次的forwhile循环,基于特定条件选择执行不同分支的ifswitch语句,还有控制流程跳转到其他代码的breakcontinue语句。

    +
    +

    翻译:vclwei, coverxit, NicePiao
    校对:coverxit, stanzhai

    +
    +

    控制流

    +
    +

    本页包含内容:

    + +

    Swift提供了类似 C 语言的流程控制结构,包括可以多次执行任务的forwhile循环,基于特定条件选择执行不同代码分支的ifswitch语句,还有控制流程跳转到其他代码的breakcontinue语句。

    +

    除了 C 语言里面传统的 for 条件递增(for-condition-increment)循环,Swift 还增加了for-in循环,用来更简单地遍历数组(array),字典(dictionary),区间(range),字符串(string)和其他序列类型。

    +

    Swift 的switch语句比 C 语言中更加强大。在 C 语言中,如果某个 case 不小心漏写了break,这个 case 就会贯穿(fallthrough)至下一个 case,Swift 无需写break,所以不会发生这种贯穿(fallthrough)的情况。case 还可以匹配更多的类型模式,包括区间匹配(range matching),元组(tuple)和特定类型的描述。switch的 case 语句中匹配的值可以是由 case 体内部临时的常量或者变量决定,也可以由where分句描述更复杂的匹配条件。

    +

    +

    For 循环

    +

    for循环用来按照指定的次数多次执行一系列语句。Swift 提供两种for循环形式:

    +
      +
    • for-in用来遍历一个区间(range),序列(sequence),集合(collection),系列(progression)里面所有的元素执行一系列语句。
    • +
    • for条件递增(for-condition-increment)语句,用来重复执行一系列语句直到达成特定条件达成,一般通过在每次循环完成后增加计数器的值来实现。
    • +
    +

    +

    For-In

    +

    你可以使用for-in循环来遍历一个集合里面的所有元素,例如由数字表示的区间、数组中的元素、字符串中的字符。

    +

    下面的例子用来输出乘 5 乘法表前面一部分内容:

    +
    for index in 1...5 {
    +    println("\(index) times 5 is \(index * 5)")
    +}
    +// 1 times 5 is 5
    +// 2 times 5 is 10
    +// 3 times 5 is 15
    +// 4 times 5 is 20
    +// 5 times 5 is 25
    +
    +

    例子中用来进行遍历的元素是一组使用闭区间操作符(...)表示的从15的数字。index被赋值为闭区间中的第一个数字(1),然后循环中的语句被执行一次。在本例中,这个循环只包含一个语句,用来输出当前index值所对应的乘 5 乘法表结果。该语句执行后,index的值被更新为闭区间中的第二个数字(2),之后println方法会再执行一次。整个过程会进行到闭区间结尾为止。

    +

    上面的例子中,index是一个每次循环遍历开始时被自动赋值的常量。这种情况下,index在使用前不需要声明,只需要将它包含在循环的声明中,就可以对其进行隐式声明,而无需使用let关键字声明。

    +
    +

    注意:
    index常量只存在于循环的生命周期里。如果你想在循环完成后访问index的值,又或者想让index成为一个变量而不是常量,你必须在循环之前自己进行声明。

    +
    +

    如果你不需要知道区间内每一项的值,你可以使用下划线(_)替代变量名来忽略对值的访问:

    +
    let base = 3
    +let power = 10
    +var answer = 1
    +for _ in 1...power {
    +    answer *= base
    +}
    +println("\(base) to the power of \(power) is \(answer)")
    +// 输出 "3 to the power of 10 is 59049"
    +
    +

    这个例子计算 base 这个数的 power 次幂(本例中,是310次幂),从130次幂)开始做3的乘法, 进行10次,使用110的闭区间循环。这个计算并不需要知道每一次循环中计数器具体的值,只需要执行了正确的循环次数即可。下划线符号_(替代循环中的变量)能够忽略具体的值,并且不提供循环遍历时对值的访问。

    +

    使用for-in遍历一个数组所有元素:

    +
    let names = ["Anna", "Alex", "Brian", "Jack"]
    +for name in names {
    +    println("Hello, \(name)!")
    +}
    +// Hello, Anna!
    +// Hello, Alex!
    +// Hello, Brian!
    +// Hello, Jack!
    +
    +

    你也可以通过遍历一个字典来访问它的键值对(key-value pairs)。遍历字典时,字典的每项元素会以(key, value)元组的形式返回,你可以在for-in循环中使用显式的常量名称来解读(key, value)元组。下面的例子中,字典的键(key)解读为常量animalName,字典的值会被解读为常量legCount

    +
    let numberOfLegs = ["spider": 8, "ant": 6, "cat": 4]
    +for (animalName, legCount) in numberOfLegs {
    +    println("\(animalName)s have \(legCount) legs")
    +}
    +// spiders have 8 legs
    +// ants have 6 legs
    +// cats have 4 legs
    +
    +

    字典元素的遍历顺序和插入顺序可能不同,字典的内容在内部是无序的,所以遍历元素时不能保证顺序。关于数组和字典,详情参见集合类型

    +

    除了数组和字典,你也可以使用for-in循环来遍历字符串中的字符(Character):

    +
    for character in "Hello" {
    +    println(character)
    +}
    +// H
    +// e
    +// l
    +// l
    +// o
    +
    +

    +

    For条件递增(for-condition-increment)

    +

    除了for-in循环,Swift 提供使用条件判断和递增方法的标准 C 样式for循环:

    +
    for var index = 0; index < 3; ++index {
    +    println("index is \(index)")
    +}
    +// index is 0
    +// index is 1
    +// index is 2
    +
    +

    下面是一般情况下这种循环方式的格式:

    +
    +

    for initialization; condition; increment {
    statements
    }

    +
    +

    和 C 语言中一样,分号将循环的定义分为 3 个部分,不同的是,Swift 不需要使用圆括号将“initialization; condition; increment”包括起来。

    +

    这个循环执行流程如下:

    +
      +
    1. 循环首次启动时,初始化表达式(initialization expression)被调用一次,用来初始化循环所需的所有常量和变量。
    2. +
    3. 条件表达式(condition expression)被调用,如果表达式调用结果为false,循环结束,继续执行for循环关闭大括号 +(})之后的代码。如果表达式调用结果为true,则会执行大括号内部的代码(statements)。
    4. +
    5. 执行所有语句(statements)之后,执行递增表达式(increment expression)。通常会增加或减少计数器的值,或者根据语句(statements)输出来修改某一个初始化的变量。当递增表达式运行完成后,重复执行第 2 步,条件表达式会再次执行。
    6. +
    +

    上述描述和循环格式等同于:

    +
    +

    initialization
    while condition {
    statements
    increment
    }

    +
    +

    在初始化表达式中声明的常量和变量(比如var index = 0)只在for循环的生命周期里有效。如果想在循环结束后访问index的值,你必须要在循环生命周期开始前声明index

    +
    var index: Int
    +for index = 0; index < 3; ++index {
    +    println("index is \(index)")
    +}
    +// index is 0
    +// index is 1
    +// index is 2
    +println("The loop statements were executed \(index) times")
    +// 输出 "The loop statements were executed 3 times
    +
    +

    注意index在循环结束后最终的值是3而不是2。最后一次调用递增表达式++index会将index设置为3,从而导致index < 3条件为false,并终止循环。

    +

    +

    While 循环

    +

    while循环运行一系列语句直到条件变成false。这类循环适合使用在第一次迭代前迭代次数未知的情况下。Swift 提供两种while循环形式:

    +
      +
    • while循环,每次在循环开始时计算条件是否符合;
    • +
    • do-while循环,每次在循环结束时计算条件是否符合。
    • +
    +

    +

    While

    +

    while循环从计算单一条件开始。如果条件为true,会重复运行一系列语句,直到条件变为false

    +

    下面是一般情况下 while 循环格式:

    +
    +

    while condition {
    statements
    }

    +
    +

    下面的例子来玩一个叫做蛇和梯子(Snakes and Ladders)的小游戏,也叫做滑道和梯子(Chutes and Ladders)

    +

    image

    +

    游戏的规则如下:

    +
      +
    • 游戏盘面包括 25 个方格,游戏目标是达到或者超过第 25 个方格;
    • +
    • 每一轮,你通过掷一个 6 边的骰子来确定你移动方块的步数,移动的路线由上图中横向的虚线所示;
    • +
    • 如果在某轮结束,你移动到了梯子的底部,可以顺着梯子爬上去;
    • +
    • 如果在某轮结束,你移动到了蛇的头部,你会顺着蛇的身体滑下去。
    • +
    +

    游戏盘面可以使用一个Int数组来表达。数组的长度由一个finalSquare常量储存,用来初始化数组和检测最终胜利条件。游戏盘面由 26 个 Int 0 值初始化,而不是 25 个(由025,一共 26 个):

    +
    let finalSquare = 25
    +var board = Int[](count: finalSquare + 1, repeatedValue: 0)
    +
    +

    一些方块被设置成有蛇或者梯子的指定值。梯子底部的方块是一个正值,使你可以向上移动,蛇头处的方块是一个负值,会让你向下移动:

    +
    board[03] = +08; board[06] = +11; board[09] = +09; board[10] = +02
    +board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08
    +
    +

    3 号方块是梯子的底部,会让你向上移动到 11 号方格,我们使用board[03]等于+08(来表示113之间的差值)。使用一元加运算符(+i)是为了和一元减运算符(-i)对称,为了让盘面代码整齐,小于 10 的数字都使用 0 补齐(这些风格上的调整都不是必须的,只是为了让代码看起来更加整洁)。

    +

    玩家由左下角编号为 0 的方格开始游戏。一般来说玩家第一次掷骰子后才会进入游戏盘面:

    +
    var square = 0
    +var diceRoll = 0
    +while square < finalSquare {
    +    // 掷骰子
    +    if ++diceRoll == 7 { diceRoll = 1 }
    +    // 根据点数移动
    +    square += diceRoll
    +    if square < board.count {
    +        // 如果玩家还在棋盘上,顺着梯子爬上去或者顺着蛇滑下去
    +        square += board[square]
    +    }
    +}
    +println("Game over!")
    +
    +

    本例中使用了最简单的方法来模拟掷骰子。 diceRoll的值并不是一个随机数,而是以0为初始值,之后每一次while循环,diceRoll的值使用前置自增操作符(++i)来自增 1 ,然后检测是否超出了最大值。++diceRoll调用完成,返回值等于diceRoll自增后的值。任何时候如果diceRoll的值等于7时,就超过了骰子的最大值,会被重置为1。所以diceRoll的取值顺序会一直是12345612

    +

    掷完骰子后,玩家向前移动diceRoll个方格,如果玩家移动超过了第 25 个方格,这个时候游戏结束,相应地,代码会在square增加board[square]的值向前或向后移动(遇到了梯子或者蛇)之前,检测square的值是否小于boardcount属性。

    +

    如果没有这个检测(square < board.count),board[square]可能会越界访问board数组,导致错误。例如如果square等于26, 代码会去尝试访问board[26],超过数组的长度。

    +

    当本轮while循环运行完毕,会再检测循环条件是否需要再运行一次循环。如果玩家移动到或者超过第 25 个方格,循环条件结果为false,此时游戏结束。

    +

    while 循环比较适合本例中的这种情况,因为在 while 循环开始时,我们并不知道游戏的长度或者循环的次数,只有在达成指定条件时循环才会结束。

    +

    +

    Do-While

    +

    while循环的另外一种形式是do-while,它和while的区别是在判断循环条件之前,先执行一次循环的代码块,然后重复循环直到条件为false

    +

    下面是一般情况下 do-while循环的格式:

    +
    +

    do {
    statements
    } while condition

    +
    +

    还是蛇和梯子的游戏,使用do-while循环来替代while循环。finalSquareboardsquarediceRoll的值初始化同while循环一样:

    +
    let finalSquare = 25
    +var board = Int[](count: finalSquare + 1, repeatedValue: 0)
    +board[03] = +08; board[06] = +11; board[09] = +09; board[10] = +02
    +board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08
    +var square = 0
    +var diceRoll = 0
    +
    +

    do-while的循环版本,循环中第一步就需要去检测是否在梯子或者蛇的方块上。没有梯子会让玩家直接上到第 25 个方格,所以玩家不会通过梯子直接赢得游戏。这样在循环开始时先检测是否踩在梯子或者蛇上是安全的。

    +

    游戏开始时,玩家在第 0 个方格上,board[0]一直等于 0, 不会有什么影响:

    +
    do {
    +    // 顺着梯子爬上去或者顺着蛇滑下去
    +    square += board[square]
    +    // 掷骰子
    +    if ++diceRoll == 7 { diceRoll = 1 }
    +    // 根据点数移动
    +    square += diceRoll
    +} while square < finalSquare
    +println("Game over!")
    +
    +

    检测完玩家是否踩在梯子或者蛇上之后,开始掷骰子,然后玩家向前移动diceRoll个方格,本轮循环结束。

    +

    循环条件(while square < finalSquare)和while方式相同,但是只会在循环结束后进行计算。在这个游戏中,do-while表现得比while循环更好。do-while方式会在条件判断square没有超出后直接运行square += board[square],这种方式可以去掉while版本中的数组越界判断。

    +

    +

    条件语句

    +

    根据特定的条件执行特定的代码通常是十分有用的,例如:当错误发生时,你可能想运行额外的代码;或者,当输入的值太大或太小时,向用户显示一条消息等。要实现这些功能,你就需要使用条件语句

    +

    Swift 提供两种类型的条件语句:if语句和switch语句。通常,当条件较为简单且可能的情况很少时,使用if语句。而switch语句更适用于条件较复杂、可能情况较多且需要用到模式匹配(pattern-matching)的情境。

    +

    +

    If

    +

    if语句最简单的形式就是只包含一个条件,当且仅当该条件为true时,才执行相关代码:

    +
    var temperatureInFahrenheit = 30
    +if temperatureInFahrenheit <= 32 {
    +    println("It's very cold. Consider wearing a scarf.")
    +}
    +// 输出 "It's very cold. Consider wearing a scarf."
    +
    +

    上面的例子会判断温度是否小于等于 32 华氏度(水的冰点)。如果是,则打印一条消息;否则,不打印任何消息,继续执行if块后面的代码。

    +

    当然,if语句允许二选一,也就是当条件为false时,执行 else 语句

    +
    temperatureInFahrenheit = 40
    +if temperatureInFahrenheit <= 32 {
    +    println("It's very cold. Consider wearing a scarf.")
    +} else {
    +    println("It's not that cold. Wear a t-shirt.")
    +}
    +// 输出 "It's not that cold. Wear a t-shirt."
    +
    +

    显然,这两条分支中总有一条会被执行。由于温度已升至 40 华氏度,不算太冷,没必要再围围巾——因此,else分支就被触发了。

    +

    你可以把多个if语句链接在一起,像下面这样:

    +
    temperatureInFahrenheit = 90
    +if temperatureInFahrenheit <= 32 {
    +    println("It's very cold. Consider wearing a scarf.")
    +} else if temperatureInFahrenheit >= 86 {
    +    println("It's really warm. Don't forget to wear sunscreen.")
    +} else {
    +    println("It's not that cold. Wear a t-shirt.")
    +}
    +// 输出 "It's really warm. Don't forget to wear sunscreen."
    +
    +

    在上面的例子中,额外的if语句用于判断是不是特别热。而最后的else语句被保留了下来,用于打印既不冷也不热时的消息。

    +

    实际上,最后的else语句是可选的:

    +
    temperatureInFahrenheit = 72
    +if temperatureInFahrenheit <= 32 {
    +    println("It's very cold. Consider wearing a scarf.")
    +} else if temperatureInFahrenheit >= 86 {
    +    println("It's really warm. Don't forget to wear sunscreen.")
    +}
    +
    +

    在这个例子中,由于既不冷也不热,所以不会触发ifelse if分支,也就不会打印任何消息。

    +

    +

    Switch

    +

    switch语句会尝试把某个值与若干个模式(pattern)进行匹配。根据第一个匹配成功的模式,switch语句会执行对应的代码。当有可能的情况较多时,通常用switch语句替换if语句。

    +

    switch语句最简单的形式就是把某个值与一个或若干个相同类型的值作比较:

    +
    +

    switch some value to consider {
    case value 1:
    respond to value 1
    case value 2,
    value 3:
    respond to value 2 or 3
    default:
    otherwise, do something else
    }

    +
    +

    switch语句都由多个 case 构成。为了匹配某些更特定的值,Swift 提供了几种更复杂的匹配模式,这些模式将在本节的稍后部分提到。

    +

    每一个 case 都是代码执行的一条分支,这与if语句类似。与之不同的是,switch语句会决定哪一条分支应该被执行。

    +

    switch语句必须是完备的。这就是说,每一个可能的值都必须至少有一个 case 分支与之对应。在某些不可能涵盖所有值的情况下,你可以使用默认(default)分支满足该要求,这个默认分支必须在switch语句的最后面。

    +

    下面的例子使用switch语句来匹配一个名为someCharacter的小写字符:

    +
    let someCharacter: Character = "e"
    +switch someCharacter {
    +case "a", "e", "i", "o", "u":
    +    println("\(someCharacter) is a vowel")
    +case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m",
    +"n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z":
    +    println("\(someCharacter) is a consonant")
    +default:
    +    println("\(someCharacter) is not a vowel or a consonant")
    +}
    +// 输出 "e is a vowel"
    +
    +

    在这个例子中,第一个 case 分支用于匹配五个元音,第二个 case 分支用于匹配所有的辅音。

    +

    由于为其它可能的字符写 case 分支没有实际的意义,因此在这个例子中使用了默认分支来处理剩下的既不是元音也不是辅音的字符——这就保证了switch语句的完备性。

    +

    +

    不存在隐式的贯穿(No Implicit Fallthrough)

    +

    与 C 语言和 Objective-C 中的switch语句不同,在 Swift 中,当匹配的 case 分支中的代码执行完毕后,程序会终止switch语句,而不会继续执行下一个 case 分支。这也就是说,不需要在 case 分支中显式地使用break语句。这使得switch语句更安全、更易用,也避免了因忘记写break语句而产生的错误。

    +
    +

    注意:
    你依然可以在 case 分支中的代码执行完毕前跳出,详情请参考Switch 语句中的 break

    +
    +

    每一个 case 分支都必须包含至少一条语句。像下面这样书写代码是无效的,因为第一个 case 分支是空的:

    +
    let anotherCharacter: Character = "a"
    +switch anotherCharacter {
    +case "a":
    +case "A":
    +    println("The letter A")
    +default:
    +    println("Not the letter A")
    +}
    +// this will report a compile-time error
    +
    +

    不像 C 语言里的switch语句,在 Swift 中,switch语句不会同时匹配"a""A"。相反的,上面的代码会引起编译期错误:case "a": does not contain any executable statements——这就避免了意外地从一个 case 分支贯穿到另外一个,使得代码更安全、也更直观。

    +

    一个 case 也可以包含多个模式,用逗号把它们分开(如果太长了也可以分行写):

    +
    +

    switch some value to consider {
    case value 1,
    value 2:
    statements
    }

    +

    注意:
    如果想要贯穿至特定的 case 分支中,请使用fallthrough语句,详情请参考贯穿(Fallthrough)

    +
    +

    +

    区间匹配(Range Matching)

    +

    case 分支的模式也可以是一个值的区间。下面的例子展示了如何使用区间匹配来输出任意数字对应的自然语言格式:

    +
    let count = 3_000_000_000_000
    +let countedThings = "stars in the Milky Way"
    +var naturalCount: String
    +switch count {
    +case 0:
    +    naturalCount = "no"
    +case 1...3:
    +    naturalCount = "a few"
    +case 4...9:
    +    naturalCount = "several"
    +case 10...99:
    +    naturalCount = "tens of"
    +case 100...999:
    +    naturalCount = "hundreds of"
    +case 1000...999_999:
    +    naturalCount = "thousands of"
    +default:
    +    naturalCount = "millions and millions of"
    +}
    +println("There are \(naturalCount) \(countedThings).")
    +// 输出 "There are millions and millions of stars in the Milky Way."
    +
    +

    +

    元组(Tuple)

    +

    你可以使用元组在同一个switch语句中测试多个值。元组中的元素可以是值,也可以是区间。另外,使用下划线(_)来匹配所有可能的值。

    +

    下面的例子展示了如何使用一个(Int, Int)类型的元组来分类下图中的点(x, y):

    +
    let somePoint = (1, 1)
    +switch somePoint {
    +case (0, 0):
    +    println("(0, 0) is at the origin")
    +case (_, 0):
    +    println("(\(somePoint.0), 0) is on the x-axis")
    +case (0, _):
    +    println("(0, \(somePoint.1)) is on the y-axis")
    +case (-2...2, -2...2):
    +    println("(\(somePoint.0), \(somePoint.1)) is inside the box")
    +default:
    +    println("(\(somePoint.0), \(somePoint.1)) is outside of the box")
    +}
    +// 输出 "(1, 1) is inside the box"
    +
    +

    image

    +

    在上面的例子中,switch语句会判断某个点是否是原点(0, 0),是否在红色的x轴上,是否在黄色y轴上,是否在一个以原点为中心的4x4的矩形里,或者在这个矩形外面。

    +

    不像 C 语言,Swift 允许多个 case 匹配同一个值。实际上,在这个例子中,点(0, 0)可以匹配所有四个 case。但是,如果存在多个匹配,那么只会执行第一个被匹配到的 case 分支。考虑点(0, 0)会首先匹配case (0, 0),因此剩下的能够匹配(0, 0)的 case 分支都会被忽视掉。

    +

    +

    值绑定(Value Bindings)

    +

    case 分支的模式允许将匹配的值绑定到一个临时的常量或变量,这些常量或变量在该 case 分支里就可以被引用了——这种行为被称为值绑定(value binding)。

    +

    下面的例子展示了如何在一个(Int, Int)类型的元组中使用值绑定来分类下图中的点(x, y):

    +
    let anotherPoint = (2, 0)
    +switch anotherPoint {
    +case (let x, 0):
    +    println("on the x-axis with an x value of \(x)")
    +case (0, let y):
    +    println("on the y-axis with a y value of \(y)")
    +case let (x, y):
    +    println("somewhere else at (\(x), \(y))")
    +}
    +// 输出 "on the x-axis with an x value of 2"
    +
    +

    image

    +

    在上面的例子中,switch语句会判断某个点是否在红色的x轴上,是否在黄色y轴上,或者不在坐标轴上。

    +

    这三个 case 都声明了常量xy的占位符,用于临时获取元组anotherPoint的一个或两个值。第一个 case ——case (let x, 0)将匹配一个纵坐标为0的点,并把这个点的横坐标赋给临时的常量x。类似的,第二个 case ——case (0, let y)将匹配一个横坐标为0的点,并把这个点的纵坐标赋给临时的常量y

    +

    一旦声明了这些临时的常量,它们就可以在其对应的 case 分支里引用。在这个例子中,它们用于简化println的书写。

    +

    请注意,这个switch语句不包含默认分支。这是因为最后一个 case ——case let(x, y)声明了一个可以匹配余下所有值的元组。这使得switch语句已经完备了,因此不需要再书写默认分支。

    +

    在上面的例子中,xy是常量,这是因为没有必要在其对应的 case 分支中修改它们的值。然而,它们也可以是变量——程序将会创建临时变量,并用相应的值初始化它。修改这些变量只会影响其对应的 case 分支。

    +

    +

    Where

    +

    case 分支的模式可以使用where语句来判断额外的条件。

    +

    下面的例子把下图中的点(x, y)进行了分类:

    +
    let yetAnotherPoint = (1, -1)
    +switch yetAnotherPoint {
    +case let (x, y) where x == y:
    +    println("(\(x), \(y)) is on the line x == y")
    +case let (x, y) where x == -y:
    +    println("(\(x), \(y)) is on the line x == -y")
    +case let (x, y):
    +    println("(\(x), \(y)) is just some arbitrary point")
    +}
    +// 输出 "(1, -1) is on the line x == -y"
    +
    +

    image

    +

    在上面的例子中,switch语句会判断某个点是否在绿色的对角线x == y上,是否在紫色的对角线x == -y上,或者不在对角线上。

    +

    这三个 case 都声明了常量xy的占位符,用于临时获取元组yetAnotherPoint的两个值。这些常量被用作where语句的一部分,从而创建一个动态的过滤器(filter)。当且仅当where语句的条件为true时,匹配到的 case 分支才会被执行。

    +

    就像是值绑定中的例子,由于最后一个 case 分支匹配了余下所有可能的值,switch语句就已经完备了,因此不需要再书写默认分支。

    +

    +

    控制转移语句(Control Transfer Statements)

    +

    控制转移语句改变你代码的执行顺序,通过它你可以实现代码的跳转。Swift有四种控制转移语句。

    +
      +
    • continue
    • +
    • break
    • +
    • fallthrough
    • +
    • return
    • +
    +

    我们将会在下面讨论continuebreakfallthrough语句。return语句将会在函数章节讨论。

    +

    +

    Continue

    +

    continue语句告诉一个循环体立刻停止本次循环迭代,重新开始下次循环迭代。就好像在说“本次循环迭代我已经执行完了”,但是并不会离开整个循环体。

    +
    +

    注意:
    在一个for条件递增(for-condition-increment)循环体中,在调用continue语句后,迭代增量仍然会被计算求值。循环体继续像往常一样工作,仅仅只是循环体中的执行代码会被跳过。

    +
    +

    下面的例子把一个小写字符串中的元音字母和空格字符移除,生成了一个含义模糊的短句:

    +
    let puzzleInput = "great minds think alike"
    +var puzzleOutput = ""
    +for character in puzzleInput {
    +    switch character {
    +    case "a", "e", "i", "o", "u", " ":
    +        continue
    +    default:
    +        puzzleOutput += character
    +    }
    +}
    +println(puzzleOutput)
    +    // 输出 "grtmndsthnklk"
    +
    +

    在上面的代码中,只要匹配到元音字母或者空格字符,就调用continue语句,使本次循环迭代结束,从新开始下次循环迭代。这种行为使switch匹配到元音字母和空格字符时不做处理,而不是让每一个匹配到的字符都被打印。

    +

    +

    Break

    +

    break语句会立刻结束整个控制流的执行。当你想要更早的结束一个switch代码块或者一个循环体时,你都可以使用break语句。

    +

    +

    循环语句中的 break

    +

    当在一个循环体中使用break时,会立刻中断该循环体的执行,然后跳转到表示循环体结束的大括号(})后的第一行代码。不会再有本次循环迭代的代码被执行,也不会再有下次的循环迭代产生。

    +

    +

    Switch 语句中的 break

    +

    当在一个switch代码块中使用break时,会立即中断该switch代码块的执行,并且跳转到表示switch代码块结束的大括号(})后的第一行代码。

    +

    这种特性可以被用来匹配或者忽略一个或多个分支。因为 Swift 的switch需要包含所有的分支而且不允许有为空的分支,有时为了使你的意图更明显,需要特意匹配或者忽略某个分支。那么当你想忽略某个分支时,可以在该分支内写上break语句。当那个分支被匹配到时,分支内的break语句立即结束switch代码块。

    +
    +

    注意:
    当一个switch分支仅仅包含注释时,会被报编译时错误。注释不是代码语句而且也不能让switch分支达到被忽略的效果。你总是可以使用break来忽略某个分支。

    +
    +

    下面的例子通过switch来判断一个Character值是否代表下面四种语言之一。为了简洁,多个值被包含在了同一个分支情况中。

    +
    let numberSymbol: Character = "三"  // 简体中文里的数字 3
    +var possibleIntegerValue: Int?
    +switch numberSymbol {
    +case "1", "١", "一", "๑":
    +    possibleIntegerValue = 1
    +case "2", "٢", "二", "๒":
    +    possibleIntegerValue = 2
    +case "3", "٣", "三", "๓":
    +    possibleIntegerValue = 3
    +case "4", "٤", "四", "๔":
    +    possibleIntegerValue = 4
    +default:
    +    break
    +}
    +if let integerValue = possibleIntegerValue {
    +    println("The integer value of \(numberSymbol) is \(integerValue).")
    +} else {
    +    println("An integer value could not be found for \(numberSymbol).")
    +}
    +// 输出 "The integer value of 三 is 3."
    +
    +

    这个例子检查numberSymbol是否是拉丁,阿拉伯,中文或者泰语中的14之一。如果被匹配到,该switch分支语句给Int?类型变量possibleIntegerValue设置一个整数值。

    +

    switch代码块执行完后,接下来的代码通过使用可选绑定来判断possibleIntegerValue是否曾经被设置过值。因为是可选类型的缘故,possibleIntegerValue有一个隐式的初始值nil,所以仅仅当possibleIntegerValue曾被switch代码块的前四个分支中的某个设置过一个值时,可选的绑定将会被判定为成功。

    +

    在上面的例子中,想要把Character所有的的可能性都枚举出来是不现实的,所以使用default分支来包含所有上面没有匹配到字符的情况。由于这个default分支不需要执行任何动作,所以它只写了一条break语句。一旦落入到default分支中后,break语句就完成了该分支的所有代码操作,代码继续向下,开始执行if let语句。

    +

    +

    贯穿(Fallthrough)

    +

    Swift 中的switch不会从上一个 case 分支落入到下一个 case 分支中。相反,只要第一个匹配到的 case 分支完成了它需要执行的语句,整个switch代码块完成了它的执行。相比之下,C 语言要求你显示的插入break语句到每个switch分支的末尾来阻止自动落入到下一个 case 分支中。Swift 的这种避免默认落入到下一个分支中的特性意味着它的switch 功能要比 C 语言的更加清晰和可预测,可以避免无意识地执行多个 case 分支从而引发的错误。

    +

    如果你确实需要 C 风格的贯穿(fallthrough)的特性,你可以在每个需要该特性的 case 分支中使用fallthrough关键字。下面的例子使用fallthrough来创建一个数字的描述语句。

    +
    let integerToDescribe = 5
    +var description = "The number \(integerToDescribe) is"
    +switch integerToDescribe {
    +case 2, 3, 5, 7, 11, 13, 17, 19:
    +    description += " a prime number, and also"
    +    fallthrough
    +default:
    +    description += " an integer."
    +}
    +println(description)
    +// 输出 "The number 5 is a prime number, and also an integer."
    +
    +

    这个例子定义了一个String类型的变量description并且给它设置了一个初始值。函数使用switch逻辑来判断integerToDescribe变量的值。当integerToDescribe的值属于列表中的质数之一时,该函数添加一段文字在description后,来表明这个是数字是一个质数。然后它使用fallthrough关键字来“贯穿”到default分支中。default分支添加一段额外的文字在description的最后,至此switch代码块执行完了。

    +

    如果integerToDescribe的值不属于列表中的任何质数,那么它不会匹配到第一个switch分支。而这里没有其他特别的分支情况,所以integerToDescribe匹配到包含所有的default分支中。

    +

    switch代码块执行完后,使用println函数打印该数字的描述。在这个例子中,数字5被准确的识别为了一个质数。

    +
    +

    注意:
    fallthrough关键字不会检查它下一个将会落入执行的 case 中的匹配条件。fallthrough简单地使代码执行继续连接到下一个 case 中的执行代码,这和 C 语言标准中的switch语句特性是一样的。

    +
    +

    +

    带标签的语句(Labeled Statements)

    +

    在 Swift 中,你可以在循环体和switch代码块中嵌套循环体和switch代码块来创造复杂的控制流结构。然而,循环体和switch代码块两者都可以使用break语句来提前结束整个方法体。因此,显示地指明break语句想要终止的是哪个循环体或者switch代码块,会很有用。类似地,如果你有许多嵌套的循环体,显示指明continue语句想要影响哪一个循环体也会非常有用。

    +

    为了实现这个目的,你可以使用标签来标记一个循环体或者switch代码块,当使用break或者continue时,带上这个标签,可以控制该标签代表对象的中断或者执行。

    +

    产生一个带标签的语句是通过在该语句的关键词的同一行前面放置一个标签,并且该标签后面还需带着一个冒号。下面是一个while循环体的语法,同样的规则适用于所有的循环体和switch代码块。

    +
    +

    label name: while condition {
    statements
    }

    +
    +

    下面的例子是在一个带有标签的while循环体中调用breakcontinue语句,该循环体是前面章节中蛇和梯子的改编版本。这次,游戏增加了一条额外的规则:

    +
      +
    • 为了获胜,你必须刚好落在第 25 个方块中。
    • +
    +

    如果某次掷骰子使你的移动超出第 25 个方块,你必须重新掷骰子,直到你掷出的骰子数刚好使你能落在第 25 个方块中。

    +

    游戏的棋盘和之前一样:

    +

    image

    +

    finalSquareboardsquarediceRoll的初始化也和之前一样:

    +
    let finalSquare = 25
    +var board = Int[](count: finalSquare + 1, repeatedValue: 0)
    +board[03] = +08; board[06] = +11; board[09] = +09; board[10] = +02
    +board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08
    +var square = 0
    +var diceRoll = 0
    +
    +

    这个版本的游戏使用while循环体和switch方法块来实现游戏的逻辑。while循环体有一个标签名gameLoop,来表明它是蛇与梯子的主循环。

    +

    while循环体的条件判断语句是while square !=finalSquare,这表明你必须刚好落在方格25中。

    +
    gameLoop: while square != finalSquare {
    +    if ++diceRoll == 7 { diceRoll = 1 }
    +    switch square + diceRoll {
    +    case finalSquare:
    +        // 到达最后一个方块,游戏结束
    +        break gameLoop
    +    case let newSquare where newSquare > finalSquare:
    +        // 超出最后一个方块,再掷一次骰子
    +        continue gameLoop
    +    default:
    +        // 本次移动有效
    +        square += diceRoll
    +        square += board[square]
    +    }
    +}
    +println("Game over!")
    +
    +

    每次循环迭代开始时掷骰子。与之前玩家掷完骰子就立即移动不同,这里使用了switch来考虑每次移动可能产生的结果,从而决定玩家本次是否能够移动。

    +
      +
    • 如果骰子数刚好使玩家移动到最终的方格里,游戏结束。break gameLoop语句跳转控制去执行while循环体后的第一行代码,游戏结束。
    • +
    • 如果骰子数将会使玩家的移动超出最后的方格,那么这种移动是不合法的,玩家需要重新掷骰子。continue gameLoop语句结束本次while循环的迭代,开始下一次循环迭代。
    • +
    • 在剩余的所有情况中,骰子数产生的都是合法的移动。玩家向前移动骰子数个方格,然后游戏逻辑再处理玩家当前是否处于蛇头或者梯子的底部。本次循环迭代结束,控制跳转到while循环体的条件判断语句处,再决定是否能够继续执行下次循环迭代。
    • +
    +
    +

    注意:
    如果上述的break语句没有使用gameLoop标签,那么它将会中断switch代码块而不是while循环体。使用gameLoop标签清晰的表明了break想要中断的是哪个代码块。 +同时请注意,当调用continue gameLoop去跳转到下一次循环迭代时,这里使用gameLoop标签并不是严格必须的。因为在这个游戏中,只有一个循环体,所以continue语句会影响到哪个循环体是没有歧义的。然而,continue语句使用gameLoop标签也是没有危害的。这样做符合标签的使用规则,同时参照旁边的break gameLoop,能够使游戏的逻辑更加清晰和易于理解。

    +
    @@ -609,16 +1138,8 @@
    - - - - - - - - - - + + @@ -636,6 +1157,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/06_Functions.html b/chapter2/06_Functions.html index 895e4423..a00940c0 100644 --- a/chapter2/06_Functions.html +++ b/chapter2/06_Functions.html @@ -1,57 +1,45 @@ - - + - 函数 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,359 +595,396 @@
    -
    +
    -

    函数(Functions)

    +
    +

    翻译:honghaoz
    校对:LunaticM

    +
    +

    函数(Functions)

    +

    本页包含内容:

    -

    函数是用来完成特定任务的独立的代码块。你给一个函数起一个合适的名字,用来标示函数做什么,并且当函数需要执行的时候,这个名字会被“调用”。

    -

    Swift统一的函数语法足够灵活,可以用来表示任何函数,包括从最简单的没有参数名字的C风格函数,到复杂的带局部和外部参数名的Objective-C风格函数。参数可以提供默认值,以简化函数调用。参数也可以即当做传入参数,也当做传出参数,也就是说,一旦函数执行结束,传入的参数值可以被修改。

    -

    在Swift中,每个函数都有一种类型,包括函数的参数值类型和返回值类型。你可以把函数类型当做任何其他普通变量类型一样处理,这样就可以更简单地把函数当做别的函数的参数,也可以从其他函数中返回函数。函数的定义可以写在在其他函数定义中,这样可以在嵌套函数范围内实现功能封装。

    +

    函数是用来完成特定任务的独立的代码块。你给一个函数起一个合适的名字,用来标识函数做什么,并且当函数需要执行的时候,这个名字会被“调用”。

    +

    Swift 统一的函数语法足够灵活,可以用来表示任何函数,包括从最简单的没有参数名字的 C 风格函数,到复杂的带局部和外部参数名的 Objective-C 风格函数。参数可以提供默认值,以简化函数调用。参数也可以既当做传入参数,也当做传出参数,也就是说,一旦函数执行结束,传入的参数值可以被修改。

    +

    在 Swift 中,每个函数都有一种类型,包括函数的参数值类型和返回值类型。你可以把函数类型当做任何其他普通变量类型一样处理,这样就可以更简单地把函数当做别的函数的参数,也可以从其他函数中返回函数。函数的定义可以写在在其他函数定义中,这样可以在嵌套函数范围内实现功能封装。

    +

    函数的定义与调用(Defining and Calling Functions)

    当你定义一个函数时,你可以定义一个或多个有名字和类型的值,作为函数的输入(称为参数,parameters),也可以定义某种类型的值作为函数执行结束的输出(称为返回类型)。

    每个函数有个函数名,用来描述函数执行的任务。要使用一个函数时,你用函数名“调用”,并传给它匹配的输入值(称作实参,arguments)。一个函数的实参必须与函数参数表里参数的顺序一致。

    -

    在下面例子中的函数叫做"greetingForPerson",之所以叫这个名字是因为这个函数用一个人的名字当做输入,并返回给这个人的问候语。为了完成这个任务,你定义一个输入参数-一个叫做personNameString值,和一个包含给这个人问候语的String类型的返回值:

    -
            func sayHello(personName: String) -> String {
    -            let greeting = "Hello, " + personName + "!"
    -            return greeting
    -        }
    -

    所有的这些信息汇总起来成为函数的定义,并以func作为前缀。指定函数返回类型时,用返回箭头->(一个连字符后跟一个右尖括号)后跟返回类型的名称的方式来表示。

    +

    在下面例子中的函数叫做"greetingForPerson",之所以叫这个名字是因为这个函数用一个人的名字当做输入,并返回给这个人的问候语。为了完成这个任务,你定义一个输入参数-一个叫做 personNameString 值,和一个包含给这个人问候语的 String 类型的返回值:

    +
    func sayHello(personName: String) -> String {
    +    let greeting = "Hello, " + personName + "!"
    +    return greeting
    +}
    +
    +

    所有的这些信息汇总起来成为函数的定义,并以 func 作为前缀。指定函数返回类型时,用返回箭头 ->(一个连字符后跟一个右尖括号)后跟返回类型的名称的方式来表示。

    该定义描述了函数做什么,它期望接收什么和执行结束时它返回的结果是什么。这样的定义使的函数可以在别的地方以一种清晰的方式被调用:

    -
            println(sayHello("Anna"))
    -        // prints "Hello, Anna!"
    -        println(sayHello("Brian"))
    -        // prints "Hello, Brian!
    -

    调用sayHello函数时,在圆括号中传给它一个String类型的实参。因为这个函数返回一个String类型的值,sayHello可以被包含在println的调用中,用来输出这个函数的返回值,正如上面所示。

    -

    sayHello的函数体中,先定义了一个新的名为greetingString常量,同时赋值了给personName的一个简单问候消息。然后用return关键字把这个问候返回出去。一旦return greeting被调用,该函数结束它的执行并返回greeting的当前值。

    -

    你可以用不同的输入值多次调用sayHello。上面的例子展示的是用"Anna""Brian"调用的结果,该函数分别返回了不同的结果。

    +
    println(sayHello("Anna"))
    +// prints "Hello, Anna!"
    +println(sayHello("Brian"))
    +// prints "Hello, Brian!"
    +
    +

    调用 sayHello 函数时,在圆括号中传给它一个 String 类型的实参。因为这个函数返回一个 String 类型的值,sayHello 可以被包含在 println 的调用中,用来输出这个函数的返回值,正如上面所示。

    +

    sayHello 的函数体中,先定义了一个新的名为 greetingString 常量,同时赋值了给 personName 的一个简单问候消息。然后用 return 关键字把这个问候返回出去。一旦 return greeting 被调用,该函数结束它的执行并返回 greeting 的当前值。

    +

    你可以用不同的输入值多次调用 sayHello。上面的例子展示的是用"Anna""Brian"调用的结果,该函数分别返回了不同的结果。

    为了简化这个函数的定义,可以将问候消息的创建和返回写成一句:

    -
            func sayHelloAgain(personName: String) -> String {
    -            return "Hello again, " + personName + "!"
    -        }
    -        println(sayHelloAgain("Anna"))
    -        // prints "Hello again, Anna!
    -

    函数参数与返回值(Function Parameters and Return Values)

    +
    func sayHelloAgain(personName: String) -> String {
    +    return "Hello again, " + personName + "!"
    +}
    +println(sayHelloAgain("Anna"))
    +// prints "Hello again, Anna!"
    +
    +

    +

    函数参数与返回值(Function Parameters and Return Values)

    函数参数与返回值在Swift中极为灵活。你可以定义任何类型的函数,包括从只带一个未名参数的简单函数到复杂的带有表达性参数名和不同参数选项的复杂函数。

    多重输入参数(Multiple Input Parameters)

    函数可以有多个输入参数,写在圆括号中,用逗号分隔。

    下面这个函数用一个半开区间的开始点和结束点,计算出这个范围内包含多少数字:

    -
            func halfOpenRangeLength(start: Int, end: Int) -> Int {
    -            return end - start
    -        }
    -        println(halfOpenRangeLength(1, 10))
    -        // prints "9
    -

    无参函数(Functions Without Parameters)

    -

    函数可以没有参数。下面这个函数就是一个无参函数,当被调用时,它返回固定的String消息:

    -
            func sayHelloWorld() -> String {
    -            return "hello, world"
    -        }
    -        println(sayHelloWorld())
    -        // prints "hello, world
    -

    尽管这个函数没有参数,但是定义中在函数名后还是需要一对圆括号。当被调用时,也需要在函数名后写一对圆括号。

    +
    func halfOpenRangeLength(start: Int, end: Int) -> Int {
    +    return end - start
    +}
    +println(halfOpenRangeLength(1, 10))
    +// prints "9"
    +
    +

    无参函数(Functions Without Parameters)

    +

    函数可以没有参数。下面这个函数就是一个无参函数,当被调用时,它返回固定的 String 消息:

    +
    func sayHelloWorld() -> String {
    +    return "hello, world"
    +}
    +println(sayHelloWorld())
    +// prints "hello, world"
    +
    +

    尽管这个函数没有参数,但是定义中在函数名后还是需要一对圆括号。当被调用时,也需要在函数名后写一对圆括号。

    无返回值函数(Functions Without Return Values)

    -

    函数可以没有返回值。下面是sayHello函数的另一个版本,叫waveGoodbye,这个函数直接输出String值,而不是返回它:

    -
            func sayGoodbye(personName: String) {
    -            println("Goodbye, \(personName)!")
    -        }
    -        sayGoodbye("Dave")
    -        // prints "Goodbye, Dave!
    -

    因为这个函数不需要返回值,所以这个函数的定义中没有返回箭头(->)和返回类型。

    +

    函数可以没有返回值。下面是 sayHello 函数的另一个版本,叫 waveGoodbye,这个函数直接输出 String 值,而不是返回它:

    +
    func sayGoodbye(personName: String) {
    +    println("Goodbye, \(personName)!")
    +}
    +sayGoodbye("Dave")
    +// prints "Goodbye, Dave!"
    +
    +

    因为这个函数不需要返回值,所以这个函数的定义中没有返回箭头(->)和返回类型。

    -

    注意: -严格上来说,虽然没有返回值被定义,sayGoodbye函数依然返回了值。没有定义返回类型的函数会返回特殊的值,叫Void。它其实是一个空的元组(tuple),没有任何元素,可以写成()

    +

    注意:
    严格上来说,虽然没有返回值被定义,sayGoodbye 函数依然返回了值。没有定义返回类型的函数会返回特殊的值,叫 Void。它其实是一个空的元组(tuple),没有任何元素,可以写成()

    被调用时,一个函数的返回值可以被忽略:

    -
            func printAndCount(stringToPrint: String) -> Int {
    -            println(stringToPrint)
    -            return countElements(stringToPrint)
    -        }
    -        func printWithoutCounting(stringToPrint: String) {
    -            printAndCount(stringToPrint)
    -        }
    -        printAndCount("hello, world")
    -        // prints "hello, world" and returns a value of 12
    -        printWithoutCounting("hello, world")
    -        // prints "hello, world" but does not return a value
    -

    第一个函数printAndCount,输出一个字符串并返回Int类型的字符数。第二个函数printWithoutCounting调用了第一个函数,但是忽略了它的返回值。当第二个函数被调用时,消息依然会由第一个函数输出,但是返回值不会被用到。

    +
    func printAndCount(stringToPrint: String) -> Int {
    +    println(stringToPrint)
    +    return countElements(stringToPrint)
    +}
    +func printWithoutCounting(stringToPrint: String) {
    +    printAndCount(stringToPrint)
    +}
    +printAndCount("hello, world")
    +// prints "hello, world" and returns a value of 12
    +printWithoutCounting("hello, world")
    +// prints "hello, world" but does not return a value
    +
    +

    第一个函数 printAndCount,输出一个字符串并返回 Int 类型的字符数。第二个函数 printWithoutCounting调用了第一个函数,但是忽略了它的返回值。当第二个函数被调用时,消息依然会由第一个函数输出,但是返回值不会被用到。

    -

    注意: -返回值可以被忽略,但定义了有返回值的函数必须返回一个值,如果在函数定义底部没有返回任何值,这叫导致编译错误(compile-time error)。

    +

    注意:
    返回值可以被忽略,但定义了有返回值的函数必须返回一个值,如果在函数定义底部没有返回任何值,这将导致编译错误(compile-time error)。

    多重返回值函数(Functions with Multiple Return Values)

    你可以用元组(tuple)类型让多个值作为一个复合值从函数中返回。

    -

    下面的这个例子中,count函数用来计算一个字符串中元音,辅音和其他字母的个数(基于美式英语的标准)。

    -
            func count(string: String) -> (vowels: Int, consonants: Int, others: Int) {
    -            var vowels = 0, consonants = 0, others = 0
    -            for character in string {
    -                switch String(character).lowercaseString {
    -                case "a", "e", "i", "o", "u":
    -                       ++vowels
    -                case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m",
    -                "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z":
    -                    ++consonants
    -                default:
    -                    ++others
    -                }
    -            }
    -            return (vowels, consonants, others)
    +

    下面的这个例子中,count 函数用来计算一个字符串中元音,辅音和其他字母的个数(基于美式英语的标准)。

    +
    func count(string: String) -> (vowels: Int, consonants: Int, others: Int) {
    +    var vowels = 0, consonants = 0, others = 0
    +    for character in string {
    +        switch String(character).lowercaseString {
    +        case "a", "e", "i", "o", "u":
    +            ++vowels
    +        case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m",
    +          "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z":
    +            ++consonants
    +        default:
    +            ++others
             }
    -

    你可以用count函数来处理任何一个字符串,返回的值将是一个包含三个Int型值的元组(tuple):

    -
            let total = count("some arbitrary string!")
    -        println("\(total.vowels) vowels and \(total.consonants) consonants")
    -        // prints "6 vowels and 13 consonants
    -

    需要注意的是,元组的成员不需要在函数中返回时命名,因为它们的名字已经在函数返回类型有有了定义。

    -

    函数参数名(Function Parameter Names)

    + } + return (vowels, consonants, others) +} +
    +

    你可以用 count 函数来处理任何一个字符串,返回的值将是一个包含三个 Int 型值的元组(tuple):

    +
    let total = count("some arbitrary string!")
    +println("\(total.vowels) vowels and \(total.consonants) consonants")
    +// prints "6 vowels and 13 consonants"
    +
    +

    需要注意的是,元组的成员不需要在函数中返回时命名,因为它们的名字已经在函数返回类型中有了定义。

    +

    +

    函数参数名称(Function Parameter Names)

    以上所有的函数都给它们的参数定义了参数名(parameter name)

    -
            func someFunction(parameterName: Int) {
    -            // function body goes here, and can use parameterName
    -            // to refer to the argument value for that parameter
    -        }
    -

    但是,这些参数名仅在函数体中使用,不能在函数调用时使用。这种类型的参数名被称作局部参数名(local parameter name),因为它们只能在函数体中使用。

    +
    func someFunction(parameterName: Int) {
    +    // function body goes here, and can use parameterName
    +    // to refer to the argument value for that parameter
    +}
    +
    +

    但是,这些参数名仅在函数体中使用,不能在函数调用时使用。这种类型的参数名被称作局部参数名(local parameter name),因为它们只能在函数体中使用。

    外部参数名(External Parameter Names)

    有时候,调用函数时,给每个参数命名是非常有用的,因为这些参数名可以指出各个实参的用途是什么。

    如果你希望函数的使用者在调用函数时提供参数名字,那就需要给每个参数除了局部参数名外再定义一个外部参数名。外部参数名写在局部参数名之前,用空格分隔。

    -
            func someFunction(externalParameterName localParameterName: Int) {
    -            // function body goes here, and can use localParameterName
    -            // to refer to the argument value for that parameter
    -        }
    -
    -

    注意: -如果你提供了外部参数名,那么函数在被调用时,必须使用外部参数名。

    +
    func someFunction(externalParameterName localParameterName: Int) {
    +    // function body goes here, and can use localParameterName
    +    // to refer to the argument value for that parameter
    +}
    +
    +
    +

    注意:
    如果你提供了外部参数名,那么函数在被调用时,必须使用外部参数名。

    以下是个例子,这个函数使用一个结合者(joiner)把两个字符串联在一起:

    -
            func join(s1: String, s2: String, joiner: String) -> String {
    -            return s1 + joiner + s2
    -        }
    -

    当你调用这个函数时,这三个字符串的用途是不清楚的:

    -
            join("hello", "world", ", ")
    -        // returns "hello, world
    -

    为了让这些字符串的用途更为明显,我们为join函数添加外部参数名:

    -
            func join(string s1: String, toString s2: String, withJoiner joiner: String) -> String {
    -                return s1 + joiner + s2
    -        }
    -

    在这个版本的join函数中,第一个参数有一个叫string的外部参数名和s1的局部参数名,第二个参数有一个叫toString的外部参数名和s2的局部参数名,第三个参数有一个叫withJoiner的外部参数名和joiner的局部参数名。

    +
    func join(s1: String, s2: String, joiner: String) -> String {
    +    return s1 + joiner + s2
    +}
    +
    +

    当你调用这个函数时,这三个字符串的用途是不清楚的:

    +
    join("hello", "world", ", ")
    +// returns "hello, world"
    +
    +

    为了让这些字符串的用途更为明显,我们为 join 函数添加外部参数名:

    +
    func join(string s1: String, toString s2: String, withJoiner joiner: String) -> String {
    +    return s1 + joiner + s2
    +}
    +
    +

    在这个版本的 join 函数中,第一个参数有一个叫 string 的外部参数名和 s1 的局部参数名,第二个参数有一个叫 toString 的外部参数名和 s2 的局部参数名,第三个参数有一个叫 withJoiner 的外部参数名和 joiner 的局部参数名。

    现在,你可以使用这些外部参数名以一种清晰地方式来调用函数了:

    -
            join(string: "hello", toString: "world", withJoiner: ", ")
    -        // returns "hello, world
    -

    使用外部参数名让第二个版本的join函数的调用更为有表现力,更为通顺,同时还保持了函数体是可读的和有明确意图的。

    +
    join(string: "hello", toString: "world", withJoiner: ", ")
    +// returns "hello, world"
    +
    +

    使用外部参数名让第二个版本的 join 函数的调用更为有表现力,更为通顺,同时还保持了函数体是可读的和有明确意图的。

    -

    注意: -当其他人在第一次读你的代码,函数参数的意图显得不明显时,考虑使用外部参数名。如果函数参数名的意图是很明显的,那就不需要定义外部参数名了。

    +

    注意:
    当其他人在第一次读你的代码,函数参数的意图显得不明显时,考虑使用外部参数名。如果函数参数名的意图是很明显的,那就不需要定义外部参数名了。

    简写外部参数名(Shorthand External Parameter Names)

    -

    如果你需要提供外部参数名,但是局部参数名已经定义好了,那么你不需要写两次这些参数名。相反,只写一次参数名,并用井号(#)作为前缀就可以了。这告诉Swift使用这个参数名作为局部和外部参数名。

    -

    下面这个例子定义了一个叫containsCharacter的函数,使用井号(#)的方式定义了外部参数名:

    -
            func containsCharacter(#string: String, #characterToFind: Character) -> Bool {
    -            for character in string {
    -                if character == characterToFind {
    -                    return true
    -                }
    -            }
    -            return false
    +

    如果你需要提供外部参数名,但是局部参数名已经定义好了,那么你不需要写两次参数名。相反,只写一次参数名,并用井号(#)作为前缀就可以了。这告诉 Swift 使用这个参数名作为局部和外部参数名。

    +

    下面这个例子定义了一个叫 containsCharacter 的函数,使用井号(#)的方式定义了外部参数名:

    +
    func containsCharacter(#string: String, #characterToFind: Character) -> Bool {
    +    for character in string {
    +        if character == characterToFind {
    +            return true
             }
    -

    这样定义参数名,使得函数体更为可读,清晰,同时也可以以一个不含糊的方式被调用:

    -
            let containsAVee = containsCharacter(string: "aardvark", characterToFind: "v")
    -        // containsAVee equals true, because "aardvark" contains a "v”
    -

    默认参数值(Default Parameter Values)

    -

    你可以在函数体中为每个参数定义默认值。当默认值被定义后,调用这个函数时可以略去这个参数。

    + } + return false +} +
    +

    这样定义参数名,使得函数体更为可读,清晰,同时也可以以一个不含糊的方式被调用:

    +
    let containsAVee = containsCharacter(string: "aardvark", characterToFind: "v")
    +// containsAVee equals true, because "aardvark" contains a "v”
    +
    +

    默认参数值(Default Parameter Values)

    +

    你可以在函数体中为每个参数定义默认值。当默认值被定义后,调用这个函数时可以忽略这个参数。

    -

    注意: -将带有默认值的参数放在函数参数表的最后。这样可以保证在函数调用时,非默认参数的顺序是一致的,同时使得相同的函数在不同情况下调用时显得更为清晰。

    +

    注意:
    将带有默认值的参数放在函数参数列表的最后。这样可以保证在函数调用时,非默认参数的顺序是一致的,同时使得相同的函数在不同情况下调用时显得更为清晰。

    以下是另一个版本的join函数,其中joiner有了默认参数值:

    -
            func join(string s1: String, toString s2: String, withJoiner joiner: String = " ") -> String {
    -            return s1 + joiner + s2
    -        }
    -

    像第一个版本的join函数一样,如果joiner被幅值时,函数将使用这个字符串值来连接两个字符串:

    -
            join(string: "hello", toString: "world", withJoiner: "-")
    -        // returns "hello-world
    -

    当这个函数被调用时,如果joiner的值没有被指定,函数会使用默认值(" "):

    -
            join(string: "hello", toString:"world")
    -        // returns "hello world"
    -

    默认值参数的外部参数名(External Names for Parameters with Default Values)

    +
    func join(string s1: String, toString s2: String, withJoiner joiner: String = " ") -> String {
    +    return s1 + joiner + s2
    +}
    +
    +

    像第一个版本的 join 函数一样,如果 joiner 被赋值时,函数将使用这个字符串值来连接两个字符串:

    +
    join(string: "hello", toString: "world", withJoiner: "-")
    +// returns "hello-world"
    +
    +

    当这个函数被调用时,如果 joiner 的值没有被指定,函数会使用默认值(" "):

    +
    join(string: "hello", toString:"world")
    +// returns "hello world"
    +
    +

    默认值参数的外部参数名(External Names for Parameters with Default Values)

    在大多数情况下,给带默认值的参数起一个外部参数名是很有用的。这样可以保证当函数被调用且带默认值的参数被提供值时,实参的意图是明显的。

    -

    为了使定义外部参数名更加简单,当你未给带默认值的参数提供外部参数名时,Swift会自动提供外部名字。此时外部参数名与局部名字是一样的,就像你已经在局部参数名前写了井号(#)一样。

    -

    下面是join函数的另一个版本,这个版本中并没有为它的参数提供外部参数名,但是joiner参数依然有外部参数名:

    -
            func join(s1: String, s2: String, joiner: String = " ") -> String {
    -            return s1 + joiner + s2
    -        }
    -

    在这个例子中,Swift自动为joiner提供了外部参数名。因此,当函数调用时,外部参数名必须使用,这样使得参数的用途变得清晰。

    -
            join("hello", "world", joiner: "-")
    -        // returns "hello-world"
    -
    -

    注意: -你可以使用下划线(_)作为默认值参数的外部参数名,这样可以在调用时不用提供外部参数名。但是给带默认值的参数命名总是更加合适的。

    +

    为了使定义外部参数名更加简单,当你未给带默认值的参数提供外部参数名时,Swift 会自动提供外部名字。此时外部参数名与局部名字是一样的,就像你已经在局部参数名前写了井号(#)一样。

    +

    下面是 join 函数的另一个版本,这个版本中并没有为它的参数提供外部参数名,但是 joiner 参数依然有外部参数名:

    +
    func join(s1: String, s2: String, joiner: String = " ") -> String {
    +    return s1 + joiner + s2
    +}
    +
    +

    在这个例子中,Swift 自动为 joiner 提供了外部参数名。因此,当函数调用时,外部参数名必须使用,这样使得参数的用途变得清晰。

    +
    join("hello", "world", joiner: "-")
    +// returns "hello-world"
    +
    +
    +

    注意:
    你可以使用下划线(_)作为默认值参数的外部参数名,这样可以在调用时不用提供外部参数名。但是给带默认值的参数命名总是更加合适的。

    可变参数(Variadic Parameters)

    一个可变参数(variadic parameter)可以接受一个或多个值。函数调用时,你可以用可变参数来传入不确定数量的输入参数。通过在变量类型名后面加入(...)的方式来定义可变参数。

    -

    传入可变参数的值在函数体内当做这个类型的一个数组。例如,一个叫做numbersDouble...型可变参数,在函数体内可以当做一个叫numbersDouble[]型的数组常量。

    +

    传入可变参数的值在函数体内当做这个类型的一个数组。例如,一个叫做 numbersDouble... 型可变参数,在函数体内可以当做一个叫 numbersDouble[] 型的数组常量。

    下面的这个函数用来计算一组任意长度数字的算术平均数:

    -
            func arithmeticMean(numbers: Double...) -> Double {
    -            var total: Double = 0
    -            for number in numbers {
    -                total += number
    -            }
    -            return total / Double(numbers.count)
    -        }
    -        arithmeticMean(1, 2, 3, 4, 5)
    -        // returns 3.0, which is the arithmetic mean of these five numbers
    -        arithmeticMean(3, 8, 19)
    -        // returns 10.0, which is the arithmetic mean of these three numbers
    -
    -

    注意: -一个函数至多能有一个可变参数,而且它必须是参数表中最后的一个。这样做是为了避免函数调用时出现歧义。

    +
    func arithmeticMean(numbers: Double...) -> Double {
    +    var total: Double = 0
    +    for number in numbers {
    +        total += number
    +    }
    +    return total / Double(numbers.count)
    +}
    +arithmeticMean(1, 2, 3, 4, 5)
    +// returns 3.0, which is the arithmetic mean of these five numbers
    +arithmeticMean(3, 8, 19)
    +// returns 10.0, which is the arithmetic mean of these three numbers
    +
    +
    +

    注意:
    一个函数至多能有一个可变参数,而且它必须是参数表中最后的一个。这样做是为了避免函数调用时出现歧义。

    如果函数有一个或多个带默认值的参数,而且还有一个可变参数,那么把可变参数放在参数表的最后。

    常量参数和变量参数(Constant and Variable Parameters)

    函数参数默认是常量。试图在函数体中更改参数值将会导致编译错误。这意味着你不能错误地更改参数值。

    但是,有时候,如果函数中有传入参数的变量值副本将是很有用的。你可以通过指定一个或多个参数为变量参数,从而避免自己在函数中定义新的变量。变量参数不是常量,你可以在函数中把它当做新的可修改副本来使用。

    -

    通过在参数名前加关键字var来定义变量参数:

    -
            func alignRight(var string: String, count: Int, pad: Character) -> String {
    -            let amountToPad = count - countElements(string)
    -            for _ in 1...amountToPad {
    -                string = pad + string
    -            }
    -            return string
    -        }
    -        let originalString = "hello"
    -        let paddedString = alignRight(originalString, 10, "-")
    -        // paddedString is equal to "-----hello"
    -        // originalString is still equal to "hello”
    -

    这个例子中定义了一个新的叫做alignRight的函数,用来右对齐输入的字符串到一个长的输出字符串中。左侧空余的地方用指定的填充字符填充。这个例子中,字符串"hello"被转换成了"-----hello"

    -

    alignRight函数将参数string定义为变量参数。这意味着string现在可以作为一个局部变量,用传入的字符串值初始化,并且可以在函数体中进行操作。

    -

    该函数首先计算出多少个字符需要被添加到string的左边,以右对齐到总的字符串中。这个值存在局部常量amountToPad中。这个函数然后将amountToPad多的填充(pad)字符填充到string左边,并返回结果。它使用了string这个变量参数来进行所有字符串操作。

    +

    通过在参数名前加关键字 var 来定义变量参数:

    +
    func alignRight(var string: String, count: Int, pad: Character) -> String {
    +    let amountToPad = count - countElements(string)
    +    for _ in 1...amountToPad {
    +        string = pad + string
    +    }
    +    return string
    +}
    +let originalString = "hello"
    +let paddedString = alignRight(originalString, 10, "-")
    +// paddedString is equal to "-----hello"
    +// originalString is still equal to "hello"
    +
    +

    这个例子中定义了一个新的叫做 alignRight 的函数,用来右对齐输入的字符串到一个长的输出字符串中。左侧空余的地方用指定的填充字符填充。这个例子中,字符串"hello"被转换成了"-----hello"

    +

    alignRight 函数将参数 string 定义为变量参数。这意味着 string 现在可以作为一个局部变量,用传入的字符串值初始化,并且可以在函数体中进行操作。

    +

    该函数首先计算出多少个字符需要被添加到 string 的左边,以右对齐到总的字符串中。这个值存在局部常量 amountToPad 中。这个函数然后将 amountToPad 多的填充(pad)字符填充到 string 左边,并返回结果。它使用了 string 这个变量参数来进行所有字符串操作。

    -

    注意: -对变量参数所进行的修改在函数调用结束后变消息了,并且对于函数体外是不可见的。变量参数仅仅存在于函数调用的生命周期中。

    +

    注意:
    对变量参数所进行的修改在函数调用结束后便消失了,并且对于函数体外是不可见的。变量参数仅仅存在于函数调用的生命周期中。

    输入输出参数(In-Out Parameters)

    变量参数,正如上面所述,仅仅能在函数体内被更改。如果你想要一个函数可以修改参数的值,并且想要在这些修改在函数调用结束后仍然存在,那么就应该把这个参数定义为输入输出参数(In-Out Parameters)。

    -

    定义一个输入输出参数时,在参数定义前加inout关键字。一个输入输出参数有传入函数的值,这个值被函数修改,然后被传出函数,替换原来的值。

    +

    定义一个输入输出参数时,在参数定义前加 inout 关键字。一个输入输出参数有传入函数的值,这个值被函数修改,然后被传出函数,替换原来的值。

    你只能传入一个变量作为输入输出参数。你不能传入常量或者字面量(literal value),因为这些量是不能被修改的。当传入的参数作为输入输出参数时,需要在参数前加&符,表示这个值可以被函数修改。

    -

    注意: -输入输出参数不能有默认值,而且变量参数不能用inout标记。如果你用inout标记一个参数,这个参数不能别var或者let标记。

    +

    注意:
    输入输出参数不能有默认值,而且可变参数不能用 inout 标记。如果你用 inout 标记一个参数,这个参数不能被 var 或者 let 标记。

    -

    下面是例子,swapTwoInts函数,有两个分别叫做ab的输出输出参数:

    -
            func swapTwoInts(inout a: Int, inout b: Int) {
    -            let temporaryA = a
    -            a = b
    -            b = temporaryA
    -        }
    -

    这个swapTwoInts函数仅仅交换ab的值。该函数先将a的值存到一个暂时常量temporaryA中,然后将b的值赋给a,最后将temporaryA幅值给b

    -

    你可以用两个Int型的变量来调用swapTwoInts。需要注意的是,someIntanotherInt在传入swapTwoInts函数前,都加了&的前缀:

    -
            var someInt = 3
    -        var anotherInt = 107
    -        swapTwoInts(&someInt, &anotherInt)
    -        println("someInt is now \(someInt), and anotherInt is now \(anotherInt)")
    -        // prints "someInt is now 107, and anotherInt is now 3”
    -

    从上面这个例子中,我们可以看到someIntanotherInt的原始值在swapTwoInts函数中被修改,尽管它们的定义在函数体外。

    +

    下面是例子,swapTwoInts 函数,有两个分别叫做 ab 的输出输出参数:

    +
    func swapTwoInts(inout a: Int, inout b: Int) {
    +    let temporaryA = a
    +    a = b
    +    b = temporaryA
    +}
    +
    +

    这个 swapTwoInts 函数仅仅交换 ab 的值。该函数先将 a 的值存到一个暂时常量 temporaryA 中,然后将 b 的值赋给 a,最后将 temporaryA 幅值给 b

    +

    你可以用两个 Int 型的变量来调用 swapTwoInts。需要注意的是,someIntanotherInt 在传入 swapTwoInts 函数前,都加了 & 的前缀:

    +
    var someInt = 3
    +var anotherInt = 107
    +swapTwoInts(&someInt, &anotherInt)
    +println("someInt is now \(someInt), and anotherInt is now \(anotherInt)")
    +// prints "someInt is now 107, and anotherInt is now 3”
    +
    +

    从上面这个例子中,我们可以看到 someIntanotherInt 的原始值在 swapTwoInts 函数中被修改,尽管它们的定义在函数体外。

    -

    注意: -输出输出参数和返回值是不一样的。上面的swapTwoInts函数并没有定义任何返回值,但仍然修改了someIntanotherInt的值。输入输出参数是函数对函数体外产生影响的另一种方式。

    +

    注意:
    输出输出参数和返回值是不一样的。上面的 swapTwoInts 函数并没有定义任何返回值,但仍然修改了 someIntanotherInt 的值。输入输出参数是函数对函数体外产生影响的另一种方式。

    +

    函数类型(Function Types)

    每个函数都有种特定的函数类型,由函数的参数类型和返回类型组成。

    例如:

    -
            func addTwoInts(a: Int, b: Int) -> Int {
    -            return a + b
    -        }
    -        func multiplyTwoInts(a: Int, b: Int) -> Int {
    -            return a * b
    -        }
    -

    这个例子中定义了两个简单的数学函数:addTwoIntsmultiplyTwoInts。这两个函数都传入两个Int类型, 返回一个合适的Int值。

    -

    这两个函数的类型是(Int, Int) -> Int,可以读作“这个函数类型,它有两个Int型的参数并返回一个Int型的值。”。

    +
    func addTwoInts(a: Int, b: Int) -> Int {
    +    return a + b
    +}
    +func multiplyTwoInts(a: Int, b: Int) -> Int {
    +    return a * b
    +}
    +
    +

    这个例子中定义了两个简单的数学函数:addTwoIntsmultiplyTwoInts。这两个函数都传入两个 Int 类型, 返回一个合适的Int值。

    +

    这两个函数的类型是 (Int, Int) -> Int,可以读作“这个函数类型,它有两个 Int 型的参数并返回一个 Int 型的值。”。

    下面是另一个例子,一个没有参数,也没有返回值的函数:

    -
            func printHelloWorld() {
    -            println("hello, world")
    -        }
    -

    这个函数的类型是:() -> (),或者叫“没有参数,并返回Void类型的函数。”。没有指定返回类型的函数总返回 Void。在Swift中,Void与空的元组是一样的。

    +
    func printHelloWorld() {
    +    println("hello, world")
    +}
    +
    +

    这个函数的类型是:() -> (),或者叫“没有参数,并返回 Void 类型的函数”。没有指定返回类型的函数总返回 Void。在Swift中,Void 与空的元组是一样的。

    使用函数类型(Using Function Types)

    -

    在Swift中,使用函数类型就像使用其他类型一样。例如,你可以定义一个常量或变量,它的类型是函数,并且可以幅值为一个函数:

    -
            var mathFunction: (Int, Int) -> Int = addTwoInts
    -

    这个可以读作:

    -

    “定义一个叫做mathFunction的变量,类型是‘一个有两个Int型的参数并返回一个Int型的值的函数’,并让这个新变量指向addTwoInts函数”。

    -

    addTwoIntsmathFunction有同样的类型,所以这个赋值过程在Swift类型检查中是允许的。

    -

    现在,你可以用mathFunction来调用被赋值的函数了:

    -
            println("Result: \(mathFunction(2, 3))")
    -        // prints "Result: 5
    -

    有相同匹配类型的不同函数可以被赋值给同一个变量,就像非函数类型的变量一样:

    -
            mathFunction = multiplyTwoInts
    -        println("Result: \(mathFunction(2, 3))")
    -        // prints "Result: 6"
    -

    就像其他类型一样,当赋值一个函数给常量或变量时,你可以让Swift来推测其函数类型:

    -
            let anotherMathFunction = addTwoInts
    -        // anotherMathFunction is inferred to be of type (Int, Int) -> Int
    -

    函数类型作为参数类型(Function Types as Parameter Types)

    +

    在 Swift 中,使用函数类型就像使用其他类型一样。例如,你可以定义一个类型为函数的常量或变量,并将函数赋值给它:

    +
    var mathFunction: (Int, Int) -> Int = addTwoInts
    +
    +

    这个可以读作:

    +

    “定义一个叫做 mathFunction 的变量,类型是‘一个有两个 Int 型的参数并返回一个 Int 型的值的函数’,并让这个新变量指向 addTwoInts 函数”。

    +

    addTwoIntsmathFunction 有同样的类型,所以这个赋值过程在 Swift 类型检查中是允许的。

    +

    现在,你可以用 mathFunction 来调用被赋值的函数了:

    +
    println("Result: \(mathFunction(2, 3))")
    +// prints "Result: 5"
    +
    +

    有相同匹配类型的不同函数可以被赋值给同一个变量,就像非函数类型的变量一样:

    +
    mathFunction = multiplyTwoInts
    +println("Result: \(mathFunction(2, 3))")
    +// prints "Result: 6"
    +
    +

    就像其他类型一样,当赋值一个函数给常量或变量时,你可以让 Swift 来推断其函数类型:

    +
    let anotherMathFunction = addTwoInts
    +// anotherMathFunction is inferred to be of type (Int, Int) -> Int
    +
    +

    函数类型作为参数类型(Function Types as Parameter Types)

    你可以用(Int, Int) -> Int这样的函数类型作为另一个函数的参数类型。这样你可以将函数的一部分实现交由给函数的调用者。

    下面是另一个例子,正如上面的函数一样,同样是输出某种数学运算结果:

    -
            func printMathResult(mathFunction: (Int, Int) -> Int, a: Int, b: Int) {
    -            println("Result: \(mathFunction(a, b))")
    -        }
    -        printMathResult(addTwoInts, 3, 5)
    -        // prints "Result: 8”
    -

    这个例子定义了printMathResult函数,它有三个参数:第一个参数叫mathFunction,类型是(Int, Int) -> Int,你可以传入任何这种类型的函数;第二个和第三个参数叫ab,它们的类型都是Int,这两个值作为已给的函数的输入值。

    -

    printMathResult被调用时,它被传入addTwoInts函数和整数35。它用传入35调用addTwoInts,并输出结果:8

    -

    printMathResult函数的作用就是输出另一个合适类型的数学函数的调用结果。它不关心传入函数是如何实现的,它只关心这个传入的函数类型是正确的。这使得printMathResult可以以一种类型安全(type-safe)的方式来保证传入函数的调用是正确的。

    +
    func printMathResult(mathFunction: (Int, Int) -> Int, a: Int, b: Int) {
    +    println("Result: \(mathFunction(a, b))")
    +}
    +printMathResult(addTwoInts, 3, 5)
    +// prints "Result: 8”
    +
    +

    这个例子定义了 printMathResult 函数,它有三个参数:第一个参数叫 mathFunction,类型是(Int, Int) -> Int,你可以传入任何这种类型的函数;第二个和第三个参数叫 ab,它们的类型都是 Int,这两个值作为已给的函数的输入值。

    +

    printMathResult 被调用时,它被传入 addTwoInts 函数和整数35。它用传入35调用 addTwoInts,并输出结果:8

    +

    printMathResult 函数的作用就是输出另一个合适类型的数学函数的调用结果。它不关心传入函数是如何实现的,它只关心这个传入的函数类型是正确的。这使得 printMathResult 可以以一种类型安全(type-safe)的方式来保证传入函数的调用是正确的。

    函数类型作为返回类型(Function Type as Return Types)

    你可以用函数类型作为另一个函数的返回类型。你需要做的是在返回箭头(->)后写一个完整的函数类型。

    -

    下面的这个例子中定义了两个简单函数,分别是stepForwardstepBackwardstepForward函数返回一个比输入值大一的值。stepBackward函数返回一个比输入值小一的值。这两个函数的类型都是(Int) -> Int

    -
            func stepForward(input: Int) -> Int {
    -            return input + 1
    -        }
    -        func stepBackward(input: Int) -> Int {
    -            return input - 1
    -        }
    -

    下面这个叫做chooseStepFunction的函数,它的返回类型是(Int) -> Int的函数。chooseStepFunction根据布尔值backwards来返回stepForward函数或stepBackward函数:

    -
            func chooseStepFunction(backwards: Bool) -> (Int) -> Int {
    -            return backwards ? stepBackward : stepForward
    -        }
    -

    你现在可以用chooseStepFunction来获得一个函数,不管是那个方向:

    -
            var currentValue = 3
    -        let moveNearerToZero = chooseStepFunction(currentValue > 0)
    -        // moveNearerToZero now refers to the stepBackward() function
    -

    上面这个例子中计算出从currentValue逐渐接近到0是需要向正数走还是向负数走。currentValue的初始值是3,这意味着currentValue > 0是真的(true),这将使得chooseStepFunction返回stepBackward函数。一个指向返回的函数的引用保存在了moveNearerToZero常量中。

    -

    现在,moveNearerToZero指向了正确的函数,它可以被用来数到0

    -
            println("Counting to zero:")
    -        // Counting to zero:
    -        while currentValue != 0 {
    -            println("\(currentValue)... ")
    -            currentValue = moveNearerToZero(currentValue)
    -        }
    -        println("zero!")
    -        // 3...
    -        // 2...
    -        // 1...
    -        // zero!
    -

    嵌套函数(Nested Functions)

    +

    下面的这个例子中定义了两个简单函数,分别是 stepForwardstepBackwardstepForward 函数返回一个比输入值大一的值。stepBackward 函数返回一个比输入值小一的值。这两个函数的类型都是 (Int) -> Int

    +
    func stepForward(input: Int) -> Int {
    +    return input + 1
    +}
    +func stepBackward(input: Int) -> Int {
    +    return input - 1
    +}
    +
    +

    下面这个叫做 chooseStepFunction 的函数,它的返回类型是 (Int) -> Int 的函数。chooseStepFunction 根据布尔值 backwards 来返回 stepForward 函数或 stepBackward 函数:

    +
    func chooseStepFunction(backwards: Bool) -> (Int) -> Int {
    +    return backwards ? stepBackward : stepForward
    +}
    +
    +

    你现在可以用 chooseStepFunction 来获得一个函数,不管是那个方向:

    +
    var currentValue = 3
    +let moveNearerToZero = chooseStepFunction(currentValue > 0)
    +// moveNearerToZero now refers to the stepBackward() function
    +
    +

    上面这个例子中计算出从 currentValue 逐渐接近到0是需要向正数走还是向负数走。currentValue 的初始值是3,这意味着 currentValue > 0 是真的(true),这将使得 chooseStepFunction 返回 stepBackward 函数。一个指向返回的函数的引用保存在了 moveNearerToZero 常量中。

    +

    现在,moveNearerToZero 指向了正确的函数,它可以被用来数到0

    +
    println("Counting to zero:")
    +// Counting to zero:
    +while currentValue != 0 {
    +    println("\(currentValue)... ")
    +    currentValue = moveNearerToZero(currentValue)
    +}
    +println("zero!")
    +// 3...
    +// 2...
    +// 1...
    +// zero!
    +
    +

    +

    嵌套函数(Nested Functions)

    这章中你所见到的所有函数都叫全局函数(global functions),它们定义在全局域中。你也可以把函数定义在别的函数体中,称作嵌套函数(nested functions)。

    默认情况下,嵌套函数是对外界不可见的,但是可以被他们封闭函数(enclosing function)来调用。一个封闭函数也可以返回它的某一个嵌套函数,使得这个函数可以在其他域中被使用。

    -

    你可以用返回嵌套函数的方式重写chooseStepFunction函数:

    -
            func chooseStepFunction(backwards: Bool) -> (Int) -> Int {
    -            func stepForward(input: Int) -> Int { return input + 1 }
    -            func stepBackward(input: Int) -> Int { return input - 1 }
    -            return backwards ? stepBackward : stepForward
    -        }
    -        var currentValue = -4
    -        let moveNearerToZero = chooseStepFunction(currentValue > 0)
    -        // moveNearerToZero now refers to the nested stepForward() function
    -        while currentValue != 0 {
    -            println("\(currentValue)... ")
    -            currentValue = moveNearerToZero(currentValue)
    -        }
    -        println("zero!")
    -        // -4...
    -        // -3...
    -        // -2...
    -        // -1...
    -        // zero!
    +

    你可以用返回嵌套函数的方式重写 chooseStepFunction 函数:

    +
    func chooseStepFunction(backwards: Bool) -> (Int) -> Int {
    +    func stepForward(input: Int) -> Int { return input + 1 }
    +    func stepBackward(input: Int) -> Int { return input - 1 }
    +    return backwards ? stepBackward : stepForward
    +}
    +var currentValue = -4
    +let moveNearerToZero = chooseStepFunction(currentValue > 0)
    +// moveNearerToZero now refers to the nested stepForward() function
    +while currentValue != 0 {
    +    println("\(currentValue)... ")
    +    currentValue = moveNearerToZero(currentValue)
    +}
    +println("zero!")
    +// -4...
    +// -3...
    +// -2...
    +// -1...
    +// zero!
     
    +
    @@ -957,16 +1002,8 @@
    - - - - - - - - - - + + @@ -984,6 +1021,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/07_Closures.html b/chapter2/07_Closures.html index 1721f5da..4e5dfa80 100644 --- a/chapter2/07_Closures.html +++ b/chapter2/07_Closures.html @@ -1,57 +1,45 @@ - - + - 闭包 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,146 +595,170 @@
    -
    +
    -

    闭包

    -

    本页内容包含:

    -
      -
    • 闭包表达式
    • -
    • Trailing闭包
    • -
    • 值捕获
    • -
    • 闭包是引用类型
    • -
    -

    闭包是功能性自包含模块,可以在代码中被传递和使用。 -Swift 中的闭包与 C 和 Objective-C 中的 blocks 以及其他一些编程语言中的 lambdas 比较相似。

    -

    闭包可以 捕获 和存储其所在上下文中任意常量和变量的引用。 -这就是所谓的闭合并包裹着这些常量和变量,俗称闭包。Swift 会为您管理在 捕获 过程中涉及到的内存操作。

    -
    -

    注意:

    -

    如果您不熟悉 捕获 (capturing) 这个概念也不用担心,后面会详细对其进行介绍。

    +
    +

    翻译:wh1100717
    校对:lyuka

    -

    函数 章节中介绍的全局和嵌套函数实际上也是特殊的闭包,闭包采取如下三种形式之一:

    +

    闭包(Closures)

    +
    +

    本页包含内容:

    + +

    闭包是自包含的函数代码块,可以在代码中被传递和使用。 +Swift 中的闭包与 C 和 Objective-C 中的代码块(blocks)以及其他一些编程语言中的 lambdas 函数比较相似。

    +

    闭包可以捕获和存储其所在上下文中任意常量和变量的引用。 +这就是所谓的闭合并包裹着这些常量和变量,俗称闭包。Swift 会为您管理在捕获过程中涉及到的所有内存操作。

    +
    +

    注意:
    如果您不熟悉捕获(capturing)这个概念也不用担心,您可以在 值捕获 章节对其进行详细了解。

    +
    +

    函数 章节中介绍的全局和嵌套函数实际上也是特殊的闭包,闭包采取如下三种形式之一:

    • 全局函数是一个有名字但不会捕获任何值的闭包
    • 嵌套函数是一个有名字并可以捕获其封闭函数域内值的闭包
    • -
    • 闭包表达式是一个利用轻量级语法所写的可以捕获其上下文中变量或常量值的没有名字的闭包
    • +
    • 闭包表达式是一个利用轻量级语法所写的可以捕获其上下文中变量或常量值的匿名闭包

    Swift 的闭包表达式拥有简洁的风格,并鼓励在常见场景中进行语法优化,主要优化如下:

    • 利用上下文推断参数和返回值类型
    • -
    • 单表达式闭包可以省略 return 关键字
    • +
    • 隐式返回单表达式闭包,即单表达式闭包可以省略return关键字
    • 参数名称缩写
    • -
    • Trailing 闭包语法
    • +
    • 尾随(Trailing)闭包语法
    -

    闭包表达式

    -

    嵌套函数是一个在较复杂函数中方便进行命名和定义自包含代码模块的方式。 -当然,有时候撰写小巧的没有完整定义和命名的类函数结构也是很有用处的,尤其是在您处理一些函数并需要将另外一些函数作为该函数的参数时。

    +

    +

    闭包表达式(Closure Expressions)

    +

    嵌套函数 是一个在较复杂函数中方便进行命名和定义自包含代码模块的方式。当然,有时候撰写小巧的没有完整定义和命名的类函数结构也是很有用处的,尤其是在您处理一些函数并需要将另外一些函数作为该函数的参数时。

    闭包表达式是一种利用简洁语法构建内联闭包的方式。 闭包表达式提供了一些语法优化,使得撰写闭包变得简单明了。 -下面闭包表达式的例子通过使用几次迭代展示了 sort 函数定义和语法优化的方式。 +下面闭包表达式的例子通过使用几次迭代展示了sort函数定义和语法优化的方式。 每一次迭代都用更简洁的方式描述了相同的功能。

    -
    sort 函数
    -

    Swift 标准库提供了 sort 函数,会根据您提供的排序闭包将已知类型数组中的值进行排序。 +

    +

    sort 函数(The Sort Function)

    +

    Swift 标准库提供了sort函数,会根据您提供的基于输出类型排序的闭包函数将已知类型数组中的值进行排序。 一旦排序完成,函数会返回一个与原数组大小相同的新数组,该数组中包含已经正确排序的同类型元素。

    -

    下面的闭包表达式示例使用 sort 函数对一个 String 类型的数组进行字母逆序排序,以下是初始数组值:

    -
    let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"]
    -

    该例子对一个 String 类型的数组进行排序,因此排序闭包需为 (String, String) -> Bool 类型的函数。

    -

    提供排序闭包的一种方式是撰写一个符合其类型要求的普通函数,并将其作为 sort 函数的第二个参数传入:

    -
    func backwards(s1: String, s2: String) -> Bool {
    +

    下面的闭包表达式示例使用sort函数对一个String类型的数组进行字母逆序排序,以下是初始数组值:

    +
    let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"]
    +
    +

    sort函数需要传入两个参数:

    +
      +
    • 已知类型的数组
    • +
    • 闭包函数,该闭包函数需要传入与数组类型相同的两个值,并返回一个布尔类型值来告诉sort函数当排序结束后传入的第一个参数排在第二个参数前面还是后面。如果第一个参数值出现在第二个参数值前面,排序闭包函数需要返回true,反之返回false
    • +
    +

    该例子对一个String类型的数组进行排序,因此排序闭包函数类型需为(String, String) -> Bool

    +

    提供排序闭包函数的一种方式是撰写一个符合其类型要求的普通函数,并将其作为sort函数的第二个参数传入:

    +
    func backwards(s1: String, s2: String) -> Bool {
         return s1 > s2
     }
     var reversed = sort(names, backwards)
    -// reversed is equal to ["Ewa", "Daniella", "Chris", "Barry", "Alex"]
    -

    如果第一个字符串 (s1) 大于第二个字符串 (s2),backwards 函数则返回 true,表示在新的数组中 s1 应该出现在 s2 前。 -字符中的 "大于" 表示 "按照字母顺序后出现"。 -这意味着字母 "B" 大于字母 "A", 字符串 "Tom" 大于字符串 "Tim"。 -其将进行字母逆序排序,"Barry" 将会排在 "Alex" 之后。

    +// reversed 为 ["Ewa", "Daniella", "Chris", "Barry", "Alex"] +
    +

    如果第一个字符串 (s1) 大于第二个字符串 (s2),backwards函数返回true,表示在新的数组中s1应该出现在s2前。 +对于字符串中的字符来说,“大于” 表示 “按照字母顺序较晚出现”。 +这意味着字母"B"大于字母"A",字符串"Tom"大于字符串"Tim"。 +其将进行字母逆序排序,"Barry"将会排在"Alex"之后。

    然而,这是一个相当冗长的方式,本质上只是写了一个单表达式函数 (a > b)。 在下面的例子中,利用闭合表达式语法可以更好的构造一个内联排序闭包。

    -
    闭包表达式语法
    +

    +

    闭包表达式语法(Closure Expression Syntax)

    闭包表达式语法有如下一般形式:

    -
    { (parameters) -> returnType in
    +
    { (parameters) -> returnType in
         statements
     }
    -

    闭包表达式语法可以使用常量、变量和 inout 类型作为参数,不提供默认值。 -也可以在参数列表的最后使用可变参数。元组也可以作为参数和返回值。

    -

    下面的例子展示了之前 backwards 函数对应的闭包表达式版本的代码:

    -
    reversed = sort(names, { (s1: String, s2: String) -> Bool in
    +
    +

    闭包表达式语法可以使用常量、变量和inout类型作为参数,不提供默认值。 +也可以在参数列表的最后使用可变参数。 +元组也可以作为参数和返回值。

    +

    下面的例子展示了之前backwards函数对应的闭包表达式版本的代码:

    +
    reversed = sort(names, { (s1: String, s2: String) -> Bool in
         return s1 > s2
    -    })
    -

    需要注意的是内联闭包参数和返回值类型声明与 backwards 函数类型声明相同。 -在这两种方式中,都写成了 (s1: String, s2: String) -> Bool。 +}) +

    +

    需要注意的是内联闭包参数和返回值类型声明与backwards函数类型声明相同。 +在这两种方式中,都写成了(s1: String, s2: String) -> Bool。 然而在内联闭包表达式中,函数和返回值类型都写在大括号内,而不是大括号外。

    -

    闭包的函数体部分由关键字 in 引入。 +

    闭包的函数体部分由关键字in引入。 该关键字表示闭包的参数和返回值类型定义已经完成,闭包函数体即将开始。

    因为这个闭包的函数体部分如此短以至于可以将其改写成一行代码:

    -
    reversed = sort(names, { (s1: String, s2: String) -> Bool in return s1 > s2 } )
    -

    这说明 sort 函数的整体调用保持不变,一对圆括号仍然包裹住了函数中整个参数集合。而其中一个参数现在变成了内联闭包 (相比于 backwards 版本的代码)。

    -
    根据上下文推断类型
    -

    因为排序闭包是作为函数的参数进行传入的,Swift可以推断其参数和返回值的类型。 -sort 期望第二个参数是类型为 (String, String) -> Bool 的函数,因此实际上 String, StringBool 类型并不需要作为闭包表达式定义中的一部分。 -因为所有的类型都可以被正确推断,返回箭头 (->) 和 围绕在参数周围的括号也可以被省略:

    -
    reversed = sort(names, { s1, s2 in return s1 > s2 } )
    -

    实际上任何情况下,通过内联闭包表达式构造的闭包作为参数传递给函数时,都可以推断出闭包的参数和返回值类型,这意味着您几乎不需要利用完整格式构造任何内联闭包。

    -
    单行表达式闭包可以省略 return
    -

    单行表达式闭包可以通过隐藏 return 关键字来隐式返回单行表达式的结果,如上版本的例子可以改写为:

    -
    reversed = sort(names, { s1, s2 in s1 > s2 } )
    -

    在这个例子中,sort 函数的第二个参数函数类型明确了闭包必须返回一个 Bool 类型值。 -因为闭包函数体只包含了一个单一表达式 (s1 > s2),该表达式返回 Bool 类型值,因此这里没有歧义,return关键字可以省略。

    -
    参数名称缩写
    -

    Swift 自动为内联函数提供了参数名称缩写功能,您可以直接通过 $0,$1,$2 来顺序调用闭包的参数。

    +
    reversed = sort(names, { (s1: String, s2: String) -> Bool in return s1 > s2 } )
    +
    +

    这说明sort函数的整体调用保持不变,一对圆括号仍然包裹住了函数中整个参数集合。而其中一个参数现在变成了内联闭包(相比于backwards版本的代码)。

    +

    +

    根据上下文推断类型(Inferring Type From Context)

    +

    因为排序闭包函数是作为sort函数的参数进行传入的,Swift可以推断其参数和返回值的类型。 +sort期望第二个参数是类型为(String, String) -> Bool的函数,因此实际上String,StringBool类型并不需要作为闭包表达式定义中的一部分。 +因为所有的类型都可以被正确推断,返回箭头 (->) 和围绕在参数周围的括号也可以被省略:

    +
    reversed = sort(names, { s1, s2 in return s1 > s2 } )
    +
    +

    实际上任何情况下,通过内联闭包表达式构造的闭包作为参数传递给函数时,都可以推断出闭包的参数和返回值类型,这意味着您几乎不需要利用完整格式构造任何内联闭包。

    +

    +

    单表达式闭包隐式返回(Implicit Return From Single-Expression Clossures)

    +

    单行表达式闭包可以通过隐藏return关键字来隐式返回单行表达式的结果,如上版本的例子可以改写为:

    +
    reversed = sort(names, { s1, s2 in s1 > s2 } )
    +
    +

    在这个例子中,sort函数的第二个参数函数类型明确了闭包必须返回一个Bool类型值。 +因为闭包函数体只包含了一个单一表达式 (s1 > s2),该表达式返回Bool类型值,因此这里没有歧义,return关键字可以省略。

    +

    +

    参数名称缩写(Shorthand Argument Names)

    +

    Swift 自动为内联函数提供了参数名称缩写功能,您可以直接通过$0,$1,$2来顺序调用闭包的参数。

    如果您在闭包表达式中使用参数名称缩写,您可以在闭包参数列表中省略对其的定义,并且对应参数名称缩写的类型会通过函数类型进行推断。 -in 关键字也同样可以被省略,因为此时闭包表达式完全由闭包函数体构成:

    -
    reversed = sort(names, { $0 > $1 } )
    -

    在这个例子中,$0$1 表示闭包中第一个和第二个 String 类型的参数。

    -
    运算符函数
    +in关键字也同样可以被省略,因为此时闭包表达式完全由闭包函数体构成:

    +
    reversed = sort(names, { $0 > $1 } )
    +
    +

    在这个例子中,$0$1表示闭包中第一个和第二个String类型的参数。

    +

    +

    运算符函数(Operator Functions)

    实际上还有一种更简短的方式来撰写上面例子中的闭包表达式。 -Swift 的 String 类型定义了关于大于号 (>) 的字符串实现,其作为一个函数接受两个 String 类型的参数并返回 Bool 类型的值。 -而这正好与 sort 函数的第二个参数需要的函数类型相符合。 +Swift 的String类型定义了关于大于号 (>) 的字符串实现,其作为一个函数接受两个String类型的参数并返回Bool类型的值。 +而这正好与sort函数的第二个参数需要的函数类型相符合。 因此,您可以简单地传递一个大于号,Swift可以自动推断出您想使用大于号的字符串函数实现:

    -
    reversed = sort(names, >)
    -

    更多关于运算符表达式的内容请查看 Operator Functions

    -

    Trailing 闭包

    -

    如果您需要将一个很长的闭包表达式作为最后一个参数传递给函数,可以使用 trailing 闭包来增强函数的可读性。 -Trailing 闭包是一个书写在函数括号之外(之后)的闭包表达式,函数支持将其作为最后一个参数调用。

    -
    func someFunctionThatTakesAClosure(closure: () -> ()) {
    +
    reversed = sort(names, >)
    +
    +

    更多关于运算符表达式的内容请查看 运算符函数

    +

    +

    尾随闭包(Trailing Closures)

    +

    如果您需要将一个很长的闭包表达式作为最后一个参数传递给函数,可以使用尾随闭包来增强函数的可读性。 +尾随闭包是一个书写在函数括号之后的闭包表达式,函数支持将其作为最后一个参数调用。

    +
    func someFunctionThatTakesAClosure(closure: () -> ()) {
         // 函数体部分
     }
     
    -// 以下是不使用 trailing 闭包进行函数调用
    -
    +// 以下是不使用尾随闭包进行函数调用
     someFunctionThatTakesAClosure({
         // 闭包主体部分
    -    })
    -
    -// 以下是使用 trailing 闭包进行函数调用
    +})
     
    +// 以下是使用尾随闭包进行函数调用
     someFunctionThatTakesAClosure() {
    -    // 闭包主体部分
    +  // 闭包主体部分
     }
    -
    -

    注意:

    -

    如果函数只需要闭包表达式一个参数,当您使用 trailing 闭包时,您甚至可以把 () 省略掉。 -NOTE

    +
    +
    +

    注意:
    如果函数只需要闭包表达式一个参数,当您使用尾随闭包时,您甚至可以把()省略掉。

    -

    在上例中作为 sort 函数参数的字符串排序闭包可以改写为:

    -
    reversed = sort(names) { $0 > $1 }
    -

    当闭包非常长以至于不能在一行中进行书写时,Trailing 闭包变得非常有用。 -举例来说,Swift 的 Array 类型有一个 map 方法,其获取一个闭包表达式作为其唯一参数。 +

    在上例中作为sort函数参数的字符串排序闭包可以改写为:

    +
    reversed = sort(names) { $0 > $1 }
    +
    +

    当闭包非常长以至于不能在一行中进行书写时,尾随闭包变得非常有用。 +举例来说,Swift 的Array类型有一个map方法,其获取一个闭包表达式作为其唯一参数。 数组中的每一个元素调用一次该闭包函数,并返回该元素所映射的值(也可以是不同类型的值)。 具体的映射方式和返回值类型由闭包来指定。

    -

    当提供给数组闭包函数后,map 方法将返回一个新的数组,数组中包含了与原数组一一对应的映射后的值。

    -

    下例介绍了如何在 map 方法中使用 trailing 闭包将 Int 类型数组 [16,58,510] 转换为包含对应 String 类型的数组 ["OneSix", "FiveEight", "FiveOneZero"]:

    -
    let digitNames = [
    +

    当提供给数组闭包函数后,map方法将返回一个新的数组,数组中包含了与原数组一一对应的映射后的值。

    +

    下例介绍了如何在map方法中使用尾随闭包将Int类型数组[16,58,510]转换为包含对应String类型的数组["OneSix", "FiveEight", "FiveOneZero"]:

    +
    let digitNames = [
         0: "Zero", 1: "One", 2: "Two",   3: "Three", 4: "Four",
         5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine"
     ]
     let numbers = [16, 58, 510]
    -

    如上代码创建了一个数字位和他们名字映射的英文版本字典。 +

    +

    如上代码创建了一个数字位和它们名字映射的英文版本字典。 同时定义了一个准备转换为字符串的整型数组。

    -

    您现在可以通过传递一个 trailing 闭包给 numbersmap 方法来创建对应的字符串版本数组。 -需要注意的时调用 numbers.map 不需要在 map 后面包含任何括号,因为其只需要传递闭包表达式这一个参数,并且该闭包表达式参数通过 trailing 方式进行撰写:

    -
    let strings = numbers.map {
    +

    您现在可以通过传递一个尾随闭包给numbersmap方法来创建对应的字符串版本数组。 +需要注意的时调用numbers.map不需要在map后面包含任何括号,因为其只需要传递闭包表达式这一个参数,并且该闭包表达式参数通过尾随方式进行撰写:

    +
    let strings = numbers.map {
         (var number) -> String in
         var output = ""
         while number > 0 {
    @@ -737,35 +769,33 @@ let numbers = [16, 58, 510]
     }
     // strings 常量被推断为字符串类型数组,即 String[]
     // 其值为 ["OneSix", "FiveEight", "FiveOneZero"]
    -

    map 在数组中为每一个元素调用了闭包表达式。 -您不需要指定闭包的输入参数 number 的类型,因为可以通过要映射的数组类型进行推断。

    -

    闭包 number 参数被声明为一个变量参数 (变量的具体描述请参看Constant and Variable Parameters),因此可以在闭包函数体内对其进行修改。 -闭包表达式制定了返回类型为 String,以表明存储映射值的新数组类型为 String

    +
    +

    map在数组中为每一个元素调用了闭包表达式。 +您不需要指定闭包的输入参数number的类型,因为可以通过要映射的数组类型进行推断。

    +

    闭包number参数被声明为一个变量参数(变量的具体描述请参看常量参数和变量参数),因此可以在闭包函数体内对其进行修改。闭包表达式制定了返回类型为String,以表明存储映射值的新数组类型为String

    闭包表达式在每次被调用的时候创建了一个字符串并返回。 -其使用求余运算符 (number % 10) 计算最后一位数字并利用 digitNames 字典获取所映射的字符串。

    +其使用求余运算符 (number % 10) 计算最后一位数字并利用digitNames字典获取所映射的字符串。

    -

    注意:

    -

    字典 digitNames 下标后跟着一个叹号 (!),因为字典下标返回一个可选值 (optional value),表明即使该 key 不存在也不会查找失败。 -在上例中,它保证了 number % 10 可以总是作为一个 digitNames 字典的有效下标 key。 -因此叹号可以用于强制展开 (force-unwrap) 存储在可选下标项中的 String 类型值。

    +

    注意:
    字典digitNames下标后跟着一个叹号 (!),因为字典下标返回一个可选值 (optional value),表明即使该 key 不存在也不会查找失败。
    在上例中,它保证了number % 10可以总是作为一个digitNames字典的有效下标 key。
    因此叹号可以用于强制解析 (force-unwrap) 存储在可选下标项中的String类型值。

    -

    digitNames 字典中获取的字符串被添加到输出的前部,逆序建立了一个字符串版本的数字。 -(在表达式 number % 10中,如果number为16,则返回6,58返回8,510返回0)。

    -

    number 变量之后除以10。 +

    digitNames字典中获取的字符串被添加到输出的前部,逆序建立了一个字符串版本的数字。 +(在表达式number % 10中,如果number为16,则返回6,58返回8,510返回0)。

    +

    number变量之后除以10。 因为其是整数,在计算过程中未除尽部分被忽略。 因此 16变成了1,58变成了5,510变成了51。

    -

    整个过程重复进行,直到 number /= 10 为0,这时闭包会将字符串输出,而map函数则会将字符串添加到所映射的数组中。

    -

    上例中 trailing 闭包语法在函数后整洁封装了具体的闭包功能,而不再需要将整个闭包包裹在 map 函数的括号内。

    -

    捕获 (Caputure)

    +

    整个过程重复进行,直到number /= 10为0,这时闭包会将字符串输出,而map函数则会将字符串添加到所映射的数组中。

    +

    上例中尾随闭包语法在函数后整洁封装了具体的闭包功能,而不再需要将整个闭包包裹在map函数的括号内。

    +

    +

    捕获值(Capturing Values)

    闭包可以在其定义的上下文中捕获常量或变量。 即使定义这些常量和变量的原域已经不存在,闭包仍然可以在闭包函数体内引用和修改这些值。

    Swift最简单的闭包形式是嵌套函数,也就是定义在其他函数的函数体内的函数。 嵌套函数可以捕获其外部函数所有的参数以及定义的常量和变量。

    -

    下例为一个叫做 makeIncrementor 的函数,其包含了一个叫做 incrementor 嵌套函数。 -嵌套函数 incrementor 从上下文中捕获了两个值,runningTotalamount。 -之后 makeIncrementorincrementor 作为闭包返回。 -每次调用 incrementor 时,其会以 amount 作为增量增加 runningTotal 的值。

    -
    func makeIncrementor(forIncrement amount: Int) -> () -> Int {
    +

    下例为一个叫做makeIncrementor的函数,其包含了一个叫做incrementor嵌套函数。 +嵌套函数incrementor从上下文中捕获了两个值,runningTotalamount。 +之后makeIncrementorincrementor作为闭包返回。 +每次调用incrementor时,其会以amount作为增量增加runningTotal的值。

    +
    func makeIncrementor(forIncrement amount: Int) -> () -> Int {
         var runningTotal = 0
         func incrementor() -> Int {
             runningTotal += amount
    @@ -773,61 +803,63 @@ let numbers = [16, 58, 510]
         }
         return incrementor
     }
    -

    makeIncrementor 返回类型为 () -> Int。 +

    +

    makeIncrementor返回类型为() -> Int。 这意味着其返回的是一个函数,而不是一个简单类型值。 -该函数在每次调用时不接受参数只返回一个 Int 类型的值。 -关于函数返回其他函数的内容,请查看Function Types as Return Types

    -

    makeIncrementor 函数定义了一个整型变量 runningTotal (初始为0) 用来存储当前跑步总数。 -该值通过 incrementor 返回。

    -

    makeIncrementor 有一个 Int 类型的参数,其外部命名为 forIncrement, 内部命名为 amount,表示每次 incrementor 被调用时 runningTotal 将要增加的量。

    -

    incrementor 函数用来执行实际的增加操作。 -该函数简单地使 runningTotal 增加 amount,并将其返回。

    +该函数在每次调用时不接受参数只返回一个Int类型的值。 +关于函数返回其他函数的内容,请查看函数类型作为返回类型

    +

    makeIncrementor函数定义了一个整型变量runningTotal(初始为0) 用来存储当前跑步总数。 +该值通过incrementor返回。

    +

    makeIncrementor有一个Int类型的参数,其外部命名为forIncrement, 内部命名为amount,表示每次incrementor被调用时runningTotal将要增加的量。

    +

    incrementor函数用来执行实际的增加操作。 +该函数简单地使runningTotal增加amount,并将其返回。

    如果我们单独看这个函数,会发现看上去不同寻常:

    -
    func incrementor() -> Int {
    +
    func incrementor() -> Int {
         runningTotal += amount
         return runningTotal
     }
    -

    incrementor 函数并没有获取任何参数,但是在函数体内访问了 runningTotalamount 变量。这是因为其通过捕获在包含它的函数体内已经存在的 runningTotalamount 变量而实现。

    -

    由于没有修改 amount 变量,incrementor 实际上捕获并存储了该变量的一个副本,而该副本随着 incrementor 一同被存储。

    -

    然而,因为每次调用该函数的时候都会修改 runningTotal 的值,incrementor 捕获了当前 runningTotal 变量的引用,而不是仅仅复制该变量的初始值。捕获一个引用保证了当 makeIncrementor 结束时候并不会消失,也保证了当下一次执行 incrementor 函数时,runningTotal 可以继续增加。

    +
    +

    incrementor函数并没有获取任何参数,但是在函数体内访问了runningTotalamount变量。这是因为其通过捕获在包含它的函数体内已经存在的runningTotalamount变量而实现。

    +

    由于没有修改amount变量,incrementor实际上捕获并存储了该变量的一个副本,而该副本随着incrementor一同被存储。

    +

    然而,因为每次调用该函数的时候都会修改runningTotal的值,incrementor捕获了当前runningTotal变量的引用,而不是仅仅复制该变量的初始值。捕获一个引用保证了当makeIncrementor结束时候并不会消失,也保证了当下一次执行incrementor函数时,runningTotal可以继续增加。

    -

    注意:

    -

    Swift 会决定捕获引用还是拷贝值。 -您不需要标注 amount 或者 runningTotal 来声明在嵌入的 incrementor 函数中的使用方式。 -Swift 同时也处理 runingTotal 变量的内存管理操作,如果不再被 incrementor 函数使用,则会被清除。

    +

    注意:
    Swift 会决定捕获引用还是拷贝值。
    您不需要标注amount或者runningTotal来声明在嵌入的incrementor函数中的使用方式。
    Swift 同时也处理runingTotal变量的内存管理操作,如果不再被incrementor函数使用,则会被清除。

    -

    下面为一个使用 makeIncrementor 的例子:

    -
    let incrementByTen = makeIncrementor(forIncrement: 10)
    -

    该例子定义了一个叫做 incrementByTen 的常量,该常量指向一个每次调用会加10的 incrementor 函数。 +

    下面代码为一个使用makeIncrementor的例子:

    +
    let incrementByTen = makeIncrementor(forIncrement: 10)
    +
    +

    该例子定义了一个叫做incrementByTen的常量,该常量指向一个每次调用会加10的incrementor函数。 调用这个函数多次可以得到以下结果:

    -
    incrementByTen()
    +
    incrementByTen()
     // 返回的值为10
     incrementByTen()
     // 返回的值为20
     incrementByTen()
     // 返回的值为30
    -

    如果您创建了另一个 incrementor,其会有一个属于自己的独立的 runningTotal 变量的引用。 -下面的例子中,incrementBySevne 捕获了一个新的 runningTotal 变量,该变量和 incrementByTen 中捕获的变量没有任何联系:

    -
    let incrementBySeven = makeIncrementor(forIncrement: 7)
    +
    +

    如果您创建了另一个incrementor,其会有一个属于自己的独立的runningTotal变量的引用。 +下面的例子中,incrementBySevne捕获了一个新的runningTotal变量,该变量和incrementByTen中捕获的变量没有任何联系:

    +
    let incrementBySeven = makeIncrementor(forIncrement: 7)
     incrementBySeven()
     // 返回的值为7
     incrementByTen()
     // 返回的值为40
    -
    -

    注意:

    -

    如果您闭包分配给一个类实例的属性,并且该闭包通过指向该实例或其成员来捕获了该实例,您将创建一个在闭包和实例间的强引用环。 -Swift 使用捕获列表来打破这种强引用环。更多信息,请参考 Strong Reference Cycles for Closures

    +
    +
    +

    注意:
    如果您将闭包赋值给一个类实例的属性,并且该闭包通过指向该实例或其成员来捕获了该实例,您将创建一个在闭包和实例间的强引用环。
    Swift 使用捕获列表来打破这种强引用环。更多信息,请参考 闭包引起的循环强引用

    -

    闭包是引用类型

    -

    上面的例子中,incrementBySevenincrementByTen 是常量,但是这些常量指向的闭包仍然可以增加其捕获的变量值。 +

    +

    闭包是引用类型(Closures Are Reference Types)

    +

    上面的例子中,incrementBySevenincrementByTen是常量,但是这些常量指向的闭包仍然可以增加其捕获的变量值。 这是因为函数和闭包都是引用类型。

    无论您将函数/闭包赋值给一个常量还是变量,您实际上都是将常量/变量的值设置为对应函数/闭包的引用。 -上面的例子中,incrementByTen 指向闭包的引用是一个常量,而并非闭包内容本身。

    +上面的例子中,incrementByTen指向闭包的引用是一个常量,而并非闭包内容本身。

    这也意味着如果您将闭包赋值给了两个不同的常量/变量,两个值都会指向同一个闭包:

    -
    let alsoIncrementByTen = incrementByTen
    +
    let alsoIncrementByTen = incrementByTen
     alsoIncrementByTen()
     // 返回的值为50
     
    +
    @@ -845,16 +877,8 @@ alsoIncrementByTen()
    - - - - - - - - - - + + @@ -872,6 +896,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/08_Enumerations.html b/chapter2/08_Enumerations.html index ccaf4646..9cb71525 100644 --- a/chapter2/08_Enumerations.html +++ b/chapter2/08_Enumerations.html @@ -1,57 +1,45 @@ - - + - 枚举 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,50 +595,60 @@
    -
    +
    -

    枚举

    +
    +

    翻译:yankuangshi
    校对:shinyzhu

    +
    +

    枚举(Enumerations)

    +

    本页内容包含:

    -

    枚举(enumeration)定义了一个通用类型的一组相关的值,使你可以在你的代码中以一个安全的方式来使用这些值。

    -

    如果你熟悉C语言,你就会知道,在C语言中枚举指定相关名称为一组整型值。Swift中的枚举更加灵活,不必给每一个枚举成员(enumeration member)提供一个值。如果一个值(被认为是“原始”值)被提供给每个枚举成员,则该值可以是一个字符串,一个字符,或是一个整型值或浮点值。

    -

    此外,枚举成员可以指定任何类型的关联值存储到枚举成员值中,就像其他语言中的联合体(unions)和变体(variants)。你可以定义一组通用的相关成员作为枚举的一部分,每一组都有不同的一组与它相关的适当类型的数值。

    -

    在Swift中,枚举类型是一等(first-class)类型。它们采用了很多传统上只被类(class)所支持的特征,例如计算型属性(computed properties),用于提供关于枚举当前值的附加信息,实例方法(instance methods),用于提供和枚举所代表的值相关联的功能。枚举也可以定义构造函数(initializers)来提供一个初始成员值;可以在原始的实现基础上扩展它们的功能;可以遵守协议(protocols)来提供标准的功能。

    -

    欲了解更多相关功能,请参见属性(Properties),方法(Methods),构造过程(Initialization),扩展(Extensions),和协议(Protocols)。

    +

    枚举定义了一个通用类型的一组相关的值,使你可以在你的代码中以一个安全的方式来使用这些值。

    +

    如果你熟悉 C 语言,你就会知道,在 C 语言中枚举指定相关名称为一组整型值。Swift 中的枚举更加灵活,不必给每一个枚举成员提供一个值。如果一个值(被认为是“原始”值)被提供给每个枚举成员,则该值可以是一个字符串,一个字符,或是一个整型值或浮点值。

    +

    此外,枚举成员可以指定任何类型的相关值存储到枚举成员值中,就像其他语言中的联合体(unions)和变体(variants)。你可以定义一组通用的相关成员作为枚举的一部分,每一组都有不同的一组与它相关的适当类型的数值。

    +

    在 Swift 中,枚举类型是一等(first-class)类型。它们采用了很多传统上只被类(class)所支持的特征,例如计算型属性(computed properties),用于提供关于枚举当前值的附加信息, 实例方法(instance methods),用于提供和枚举所代表的值相关联的功能。枚举也可以定义构造函数(initializers)来提供一个初始成员值;可以在原始的实现基础上扩展它们的功能;可以遵守协议(protocols)来提供标准的功能。

    +

    欲了解更多相关功能,请参见属性(Properties)方法(Methods)构造过程(Initialization)扩展(Extensions)协议(Protocols)

    +

    枚举语法

    使用enum关键词并且把它们的整个定义放在一对大括号内:

    -
    enum SomeEumeration {
    -    // enumeration definition goes here
    +
    enum SomeEnumeration {
    +  // enumeration definition goes here
     }
    -

    以下是指南针四个方向的一个例子:

    -
    enum CompassPoint {
    -    case North
    -    case South
    -    case East
    -    case West
    +
    +

    以下是指南针四个方向的一个例子:

    +
    enum CompassPoint {
    +  case North
    +  case South
    +  case East
    +  case West
     }
    -

    一个枚举中被定义的值(例如 NorthSouthEastWest)是枚举的成员值(或者成员)。case关键词表明新的一行成员值将被定义。

    +
    +

    一个枚举中被定义的值(例如 NorthSouthEastWest)是枚举的成员值(或者成员)。case关键词表明新的一行成员值将被定义。

    -

    注意: -不像C和Objective-C一样,Swift的枚举成员在被创建时不会被赋予一个默认的整数值。在上面的CompassPoints例子中,NorthSouthEastWest不是隐式得等于0123。相反的,这些不同的枚举成员在CompassPoint的一种显示定义中拥有各自不同的值。

    +

    注意:
    不像 C 和 Objective-C 一样,Swift 的枚举成员在被创建时不会被赋予一个默认的整数值。在上面的CompassPoints例子中,NorthSouthEastWest不是隐式的等于0123。相反的,这些不同的枚举成员在CompassPoint的一种显示定义中拥有各自不同的值。

    多个成员值可以出现在同一行上,用逗号隔开:

    -
    enum Planet {
    -    case Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Nepturn
    +
    enum Planet {
    +  case Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Nepturn
     }
    -

    每个枚举定义了一个全新的类型。像Swift中其他类型一样,它们的名字(例如CompassPointPlanet)必须以一个大写字母开头。给枚举类型起一个单数名字而不是复数名字,以便于读起来更加容易理解:

    -
    var directionToHead = CompassPoint.West
    -

    directionToHead的类型被推断当它被CompassPoint的一个可能值初始化。一旦directionToHead被声明为一个CompassPoint,你可以使用更短的点(.)语法将其设置为另一个CompassPoint的值:

    -
    directionToHead = .East
    -

    directionToHead的类型已知时,当设定它的值时,你可以不再写类型名。使用显示类型的枚举值可以让代码具有更好的可读性。

    +
    +

    每个枚举定义了一个全新的类型。像 Swift 中其他类型一样,它们的名字(例如CompassPointPlanet)必须以一个大写字母开头。给枚举类型起一个单数名字而不是复数名字,以便于读起来更加容易理解:

    +
    var directionToHead = CompassPoint.West
    +
    +

    directionToHead的类型被推断当它被CompassPoint的一个可能值初始化。一旦directionToHead被声明为一个CompassPoint,你可以使用更短的点(.)语法将其设置为另一个CompassPoint的值:

    +
    directionToHead = .East
    +
    +

    directionToHead的类型已知时,当设定它的值时,你可以不再写类型名。使用显示类型的枚举值可以让代码具有更好的可读性。

    +

    匹配枚举值和Switch语句

    你可以匹配单个枚举值和switch语句:

    -
    directionToHead = .South
    +
    directionToHead = .South
     switch directionToHead {
     case .North:
         println("Lots of planets have a north")
    @@ -641,83 +659,96 @@ case .East:
     case .West:
         println("Where the skies are blue")
     }
    -// prints "Watch out for penguins”
    -

    你可以如此理解这段代码:

    +// 输出 "Watch out for penguins” +
    +

    你可以如此理解这段代码:

    “考虑directionToHead的值。当它等于.North,打印“Lots of planets have a north”。当它等于.South,打印“Watch out for penguins”。”

    等等依次类推。

    -

    正如在控制流(Control Flow)中介绍,当考虑一个枚举的成员们时,一个switch语句必须全面。如果忽略了.West这种情况,上面那段代码将无法通过编译,因为它没有考虑到CompassPoint的全部成员。全面性的要求确保了枚举成员不会被意外遗漏。

    +

    正如在控制流(Control Flow)中介绍,当考虑一个枚举的成员们时,一个switch语句必须全面。如果忽略了.West这种情况,上面那段代码将无法通过编译,因为它没有考虑到CompassPoint的全部成员。全面性的要求确保了枚举成员不会被意外遗漏。

    当不需要匹配每个枚举成员的时候,你可以提供一个默认default分支来涵盖所有未明确被提出的任何成员:

    -
    let somePlanet = Planet.Earth
    +
    let somePlanet = Planet.Earth
     switch somePlanet {
     case .Earth:
         println("Mostly harmless")
     default:
         println("Not a safe place for humans")
     }
    -// prints "Mostly harmless”
    -

    关联值(Associated Values)

    -

    上一小节的例子演示了一个枚举的成员是如何被定义(分类)的。你可以为Planet.Earth设置一个常量或则变量,并且在之后查看这个值。然而,有时候会很有用如果能够把其他类型的关联值和成员值一起存储起来。这能让你随着成员值存储额外的自定义信息,并且当每次你在代码中利用该成员时允许这个信息产生变化。

    -

    你可以定义Swift的枚举存储任何类型的关联值,如果需要的话,每个成员的数据类型可以是各不相同的。枚举的这种特性跟其他语言中的可辨识联合(discriminated unions),标签联合(tagged unions),或者变体(variants)相似。

    -

    例如,假设一个库存跟踪系统需要利用两种不同类型的条形码来跟踪商品。有些商品上标有UPC-A格式的一维码,它使用数字0到9.每一个条形码都有一个代表“数字系统”的数字,该数字后接10个代表“标识符”的数字。最后一个数字是“检查”位,用来验证代码是否被正确扫描:

    -

    -

    其他商品上标有QR码格式的二维码,它可以使用任何ISO8859-1字符,并且可以编码一个最多拥有2,953字符的字符串:

    +// 输出 "Mostly harmless” +
    +

    +

    相关值(Associated Values)

    +

    上一小节的例子演示了一个枚举的成员是如何被定义(分类)的。你可以为Planet.Earth设置一个常量或则变量,并且在之后查看这个值。然而,有时候会很有用如果能够把其他类型的相关值和成员值一起存储起来。这能让你存储成员值之外的自定义信息,并且当你每次在代码中使用该成员时允许这个信息产生变化。

    +

    你可以定义 Swift 的枚举存储任何类型的相关值,如果需要的话,每个成员的数据类型可以是各不相同的。枚举的这种特性跟其他语言中的可辨识联合(discriminated unions),标签联合(tagged unions),或者变体(variants)相似。

    +

    例如,假设一个库存跟踪系统需要利用两种不同类型的条形码来跟踪商品。有些商品上标有 UPC-A 格式的一维码,它使用数字 0 到 9。每一个条形码都有一个代表“数字系统”的数字,该数字后接 10 个代表“标识符”的数字。最后一个数字是“检查”位,用来验证代码是否被正确扫描:

    +

    +

    其他商品上标有 QR 码格式的二维码,它可以使用任何 ISO8859-1 字符,并且可以编码一个最多拥有 2,953 字符的字符串:

    -

    对于库存跟踪系统来说,能够把UPC-A码作为三个整型值的元组,和把QR码作为一个任何长度的字符串存储起来是方便的。

    -

    在Swift中,用来定义两种商品条码的枚举是这样子的:

    -
    enum Barcode {
    -    case UPCA(Int, Int, Int)
    -    case QRCode(String)
    +

    对于库存跟踪系统来说,能够把 UPC-A 码作为三个整型值的元组,和把 QR 码作为一个任何长度的字符串存储起来是方便的。

    +

    在 Swift 中,用来定义两种商品条码的枚举是这样子的:

    +
    enum Barcode {
    +  case UPCA(Int, Int, Int)
    +  case QRCode(String)
     }
    -

    以上代码可以这么理解:

    -

    “定义一个名为Barcode的枚举类型,它可以是UPCA的一个关联值(IntIntInt),或者QRCode的一个字符串类型(String)关联值。”

    -

    这个定义不提供任何IntString的实际值,它只是定义了,当Barcode常量和变量等于Barcode.UPCABarcode.QRCode时,关联值的类型。

    +
    +

    以上代码可以这么理解:

    +

    “定义一个名为Barcode的枚举类型,它可以是UPCA的一个相关值(IntIntInt),或者QRCode的一个字符串类型(String)相关值。”

    +

    这个定义不提供任何IntString的实际值,它只是定义了,当Barcode常量和变量等于Barcode.UPCABarcode.QRCode时,相关值的类型。

    然后可以使用任何一种条码类型创建新的条码,如:

    -
    var productBarcode = Barcode.UPCA(8, 85909_51226, 3)
    -

    以上例子创建了一个名为productBarcode的新变量,并且赋给它一个Barcode.UPCA的关联元组值(8, 8590951226, 3)。提供的“标识符”值在整数字中有一个下划线,使其便于阅读条形码。

    +
    var productBarcode = Barcode.UPCA(8, 85909_51226, 3)
    +
    +

    以上例子创建了一个名为productBarcode的新变量,并且赋给它一个Barcode.UPCA的相关元组值(8, 8590951226, 3)。提供的“标识符”值在整数字中有一个下划线,使其便于阅读条形码。

    同一个商品可以被分配给一个不同类型的条形码,如:

    -
    productBarcode = .QRCode("ABCDEFGHIJKLMNOP")
    -

    这时,原始的Barcode.UPCA和其整数值被新的Barcode.QRCode和其字符串值所替代。条形码的常量和变量可以存储一个.UPCA或者一个.QRCode(连同它的关联值),但是在任何指定时间只能存储其中之一。

    -

    像以前那样,不同的条形码类型可以使用一个switch语句来检查,然而这次关联值可以被提取作为switch语句的一部分。你可以在switch的case分支代码中提取每个关联值作为一个常量(用let前缀)或者作为一个变量(用var前缀)来使用:

    -
    switch productBarcode {
    +
    productBarcode = .QRCode("ABCDEFGHIJKLMNOP")
    +
    +

    这时,原始的Barcode.UPCA和其整数值被新的Barcode.QRCode和其字符串值所替代。条形码的常量和变量可以存储一个.UPCA或者一个.QRCode(连同它的相关值),但是在任何指定时间只能存储其中之一。

    +

    像以前那样,不同的条形码类型可以使用一个 switch 语句来检查,然而这次相关值可以被提取作为 switch 语句的一部分。你可以在switch的 case 分支代码中提取每个相关值作为一个常量(用let前缀)或者作为一个变量(用var前缀)来使用:

    +
    switch productBarcode {
     case .UPCA(let numberSystem, let identifier, let check):
         println("UPC-A with value of \(numberSystem), \(identifier), \(check).")
     case .QRCode(let productCode):
         println("QR code with value of \(productCode).")
     }
    -// prints "QR code with value of ABCDEFGHIJKLMNOP.”
    -

    如果一个枚举成员的所有关联值被提取为常量,或者它们全部被提取为变量,为了简洁,你可以只放置一个var或者let标注在成员名称前:

    -
    switch productBarcode {
    +// 输出 "QR code with value of ABCDEFGHIJKLMNOP.”
    +
    +

    如果一个枚举成员的所有相关值被提取为常量,或者它们全部被提取为变量,为了简洁,你可以只放置一个var或者let标注在成员名称前:

    +
    switch productBarcode {
     case let .UPCA(numberSystem, identifier, check):
         println("UPC-A with value of \(numberSystem), \(identifier), \(check).")
     case let .QRCode(productCode):
         println("QR code with value of \(productCode).")
     }
    -// prints "QR code with value of ABCDEFGHIJKLMNOP."
    -

    原始值(Raw Values)

    -

    在关联值小节的条形码例子中演示了一个枚举的成员如何声明它们存储不同类型的关联值。作为关联值的替代,枚举成员可以被默认值(称为原始值)预先填充,其中这些原始值具有相同的类型。

    -

    这里是一个枚举成员存储原始ASCII值的例子:

    -
    enum ASCIIControlCharacter: Character {
    +// 输出 "QR code with value of ABCDEFGHIJKLMNOP."
    +
    +

    +

    原始值(Raw Values)

    +

    Associated Values小节的条形码例子中演示了一个枚举的成员如何声明它们存储不同类型的相关值。作为相关值的替代,枚举成员可以被默认值(称为原始值)预先填充,其中这些原始值具有相同的类型。

    +

    这里是一个枚举成员存储原始 ASCII 值的例子:

    +
    enum ASCIIControlCharacter: Character {
         case Tab = "\t"
         case LineFeed = "\n"
         case CarriageReturn = "\r"
     }
    -

    在这里,称为ASCIIControlCharacter的枚举的原始值类型被定义为字符型Character,并被设置了一些比较常见的ASCII控制字符。字符值的描述请详见字符串和字符Strings and Characters部分。

    -

    注意,原始值和关联值是不相同的。当你开始在你的代码中定义枚举的时候原始值是被预先填充的值,像上述三个ASCII码。对于一个特定的枚举成员,它的原始值始终是相同的。关联值是当你在创建一个基于枚举成员的新常量或变量时才会被设置,并且每次当你这么做得时候,它的值可以是不同的。

    +
    +

    在这里,称为ASCIIControlCharacter的枚举的原始值类型被定义为字符型Character,并被设置了一些比较常见的 ASCII 控制字符。字符值的描述请详见字符串和字符Strings and Characters部分。

    +

    注意,原始值和相关值是不相同的。当你开始在你的代码中定义枚举的时候原始值是被预先填充的值,像上述三个 ASCII 码。对于一个特定的枚举成员,它的原始值始终是相同的。相关值是当你在创建一个基于枚举成员的新常量或变量时才会被设置,并且每次当你这么做得时候,它的值可以是不同的。

    原始值可以是字符串,字符,或者任何整型值或浮点型值。每个原始值在它的枚举声明中必须是唯一的。当整型值被用于原始值,如果其他枚举成员没有值时,它们会自动递增。

    -

    下面的枚举是对之前Planet这个枚举的一个细化,利用原始整型值来表示每个planet在太阳系中的顺序:

    -
    enum Planet: Int {
    +

    下面的枚举是对之前Planet这个枚举的一个细化,利用原始整型值来表示每个 planet 在太阳系中的顺序:

    +
    enum Planet: Int {
         case Mercury = 1, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune
     }
    -

    自动递增意味着Planet.Venus的原始值是2,依次类推。

    +
    +

    自动递增意味着Planet.Venus的原始值是2,依次类推。

    使用枚举成员的toRaw方法可以访问该枚举成员的原始值:

    -
    let earthsOrder = Planet.Earth.toRaw()
    +
    let earthsOrder = Planet.Earth.toRaw()
     // earthsOrder is 3
    -

    使用枚举的fromRaw方法来试图找到具有特定原始值的枚举成员。这个例子通过原始值7识别Uranus

    -
    let possiblePlanet = Planet.fromRaw(7)
    +
    +

    使用枚举的fromRaw方法来试图找到具有特定原始值的枚举成员。这个例子通过原始值7识别Uranus

    +
    let possiblePlanet = Planet.fromRaw(7)
     // possiblePlanet is of type Planet? and equals Planet.Uranus
    -

    然而,并非所有可能的Int值都可以找到一个匹配的行星。正因为如此,fromRaw方法可以返回一个可选的枚举成员。在上面的例子中,possiblePlanetPlanet?类型,或“可选的Planet”。

    +
    +

    然而,并非所有可能的Int值都可以找到一个匹配的行星。正因为如此,fromRaw方法可以返回一个可选的枚举成员。在上面的例子中,possiblePlanetPlanet?类型,或“可选的Planet”。

    如果你试图寻找一个位置为9的行星,通过fromRaw返回的可选Planet值将是nil

    -
    let positionToFind = 9
    +
    let positionToFind = 9
     if let somePlanet = Planet.fromRaw(positionToFind) {
         switch somePlanet {
         case .Earth:
    @@ -728,8 +759,9 @@ if let somePlanet = Planet.fromRaw(positionToFind) {
     } else {
         println("There isn't a planet at position \(positionToFind)")
     }
    -// prints "There isn't a planet at position 9
    -

    这个范例使用可选绑定(optional binding),通过原始值9试图访问一个行星。if let somePlanet = Planet.fromRaw(9)语句获得一个可选Planet,如果可选Planet可以被获得,把somePlanet设置成该可选Planet的内容。在这个范例中,无法检索到位置为9的行星,所以else分支被执行。

    +// 输出 "There isn't a planet at position 9 +
    +

    这个范例使用可选绑定(optional binding),通过原始值9试图访问一个行星。if let somePlanet = Planet.fromRaw(9)语句获得一个可选Planet,如果可选Planet可以被获得,把somePlanet设置成该可选Planet的内容。在这个范例中,无法检索到位置为9的行星,所以else分支被执行。

    @@ -748,16 +780,8 @@ if let somePlanet = Planet.fromRaw(positionToFind) {
    - - - - - - - - - - + + @@ -775,6 +799,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/09_Classes_and_Structures.html b/chapter2/09_Classes_and_Structures.html index ff336ebf..378dcea8 100644 --- a/chapter2/09_Classes_and_Structures.html +++ b/chapter2/09_Classes_and_Structures.html @@ -1,57 +1,45 @@ - - + - 类和结构体 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,17 +595,307 @@
    -
    +
    -

    类和结构体

    +
    +

    翻译:JaySurplus
    校对:sg552

    +
    +

    类和结构体

    本页包含内容:

    +

    类和结构体是人们构建代码所用的一种通用且灵活的构造体。为了在类和结构体中实现各种功能,我们必须要严格按照常量、变量以及函数所规定的语法规则来定义属性和添加方法。

    +

    与其他编程语言所不同的是,Swift 并不要求你为自定义类和结构去创建独立的接口和实现文件。你所要做的是在一个单一文件中定义一个类或者结构体,系统将会自动生成面向其它代码的外部接口。

    +
    +

    注意:
    通常一个的实例被称为对象。然而在Swift 中,类和结构体的关系要比在其他语言中更加的密切,本章中所讨论的大部分功能都可以用在类和结构体上。因此,我们会主要使用实例而不是对象

    +
    +

    +

    类和结构体对比

    +

    Swift 中类和结构体有很多共同点。共同处在于:

    +
      +
    • 定义属性用于存储值
    • +
    • 定义方法用于提供功能
    • +
    • 定义附属脚本用于访问值
    • +
    • 定义构造器用于生成初始化值
    • +
    • 通过扩展以增加默认实现的功能
    • +
    • 符合协议以对某类提供标准功能
    • +
    +

    更多信息请参见 属性方法下标脚本初始过程扩展,和协议

    +

    与结构体相比,类还有如下的附加功能:

    +
      +
    • 继承允许一个类继承另一个类的特征
    • +
    • 类型转换允许在运行时检查和解释一个类实例的类型
    • +
    • 解构器允许一个类实例释放任何其所被分配的资源
    • +
    • 引用计数允许对一个类的多次引用
    • +
    +

    更多信息请参见继承类型转换初始化,和自动引用计数

    +
    +

    注意:
    结构体总是通过被复制的方式在代码中传递,因此请不要使用引用计数。

    +
    +

    定义

    +

    类和结构体有着类似的定义方式。我们通过关键字classstruct来分别表示类和结构体,并在一对大括号中定义它们的具体内容:

    +
    class SomeClass {
    +    // class definition goes here
    +}
    +struct SomeStructure {
    +    // structure definition goes here
    +}
    +
    +
    +

    注意:
    在你每次定义一个新类或者结构体的时候,实际上你是有效地定义了一个新的 Swift 类型。因此请使用 UpperCamelCase 这种方式来命名(如 SomeClassSomeStructure等),以便符合标准Swift 类型的大写命名风格(如StringIntBool)。相反的,请使用lowerCamelCase这种方式为属性和方法命名(如framerateincrementCount),以便和类区分。

    +
    +

    以下是定义结构体和定义类的示例:

    +
    struct Resolution {
    +    var width = 0
    +    var heigth = 0
    +}
    +class VideoMode {
    +    var resolution = Resolution()
    +    var interlaced = false
    +    var frameRate = 0.0
    +    var name: String?
    +}
    +
    +

    在上面的示例中我们定义了一个名为Resolution的结构体,用来描述一个显示器的像素分辨率。这个结构体包含了两个名为widthheight的存储属性。存储属性是捆绑和存储在类或结构体中的常量或变量。当这两个属性被初始化为整数0的时候,它们会被推断为Int类型。

    +

    在上面的示例中我们还定义了一个名为VideoMode的类,用来描述一个视频显示器的特定模式。这个类包含了四个储存属性变量。第一个是分辨率,它被初始化为一个新的Resolution结构体的实例,具有Resolution的属性类型。新VideoMode实例同时还会初始化其它三个属性,它们分别是,初始值为false(意为“non-interlaced video”)的interlaced,回放帧率初始值为0.0frameRate和值为可选Stringnamename属性会被自动赋予一个默认值nil,意为“没有name值”,因为它是一个可选类型。

    +

    类和结构体实例

    +

    Resolution结构体和VideoMode类的定义仅描述了什么是ResolutionVideoMode。它们并没有描述一个特定的分辨率(resolution)或者视频模式(video mode)。为了描述一个特定的分辨率或者视频模式,我们需要生成一个它们的实例。

    +

    生成结构体和类实例的语法非常相似:

    +
    let someResolution = Resolution()
    +let someVideoMode = VideoMode()
    +
    +

    结构体和类都使用构造器语法来生成新的实例。构造器语法的最简单形式是在结构体或者类的类型名称后跟随一个空括弧,如Resolution()VideoMode()。通过这种方式所创建的类或者结构体实例,其属性均会被初始化为默认值。构造过程章节会对类和结构体的初始化进行更详细的讨论。

    +

    属性访问

    +

    通过使用点语法dot syntax),你可以访问实例中所含有的属性。其语法规则是,实例名后面紧跟属性名,两者通过点号(.)连接:

    +
    println("The width of someResolution is \(someResolution.width)")
    +// 输出 "The width of someResolution is 0"
    +
    +

    在上面的例子中,someResolution.width引用someResolutionwidth属性,返回width的初始值0

    +

    你也可以访问子属性,如何VideoModeResolution属性的width属性:

    +
    println("The width of someVideoMode is \(someVideoMode.resolution.width)")
    +// 输出 "The width of someVideoMode is 0"
    +
    +

    你也可以使用点语法为属性变量赋值:

    +
    someVideoMode.resolution.width = 12880
    +println("The width of someVideoMode is now \(someVideoMode.resolution.width)")
    +// 输出 "The width of someVideoMode is now 1280"
    +
    +
    +

    注意:
    与 Objective-C 语言不同的是,Swift 允许直接设置结构体属性的子属性。上面的最后一个例子,就是直接设置了someVideoModeresolution属性的width这个子属性,以上操作并不需要重新设置resolution属性。

    +
    +

    结构体类型的成员逐一构造器(Memberwise Initializers for structure Types)

    +

    所有结构体都有一个自动生成的成员逐一构造器,用于初始化新结构体实例中成员的属性。新实例中各个属性的初始值可以通过属性的名称传递到成员逐一构造器之中:

    +
    let vga = resolution(width:640, heigth: 480)
    +
    +

    与结构体不同,类实例没有默认的成员逐一构造器。构造过程章节会对构造器进行更详细的讨论。

    +

    +

    结构体和枚举是值类型

    +

    值类型被赋予给一个变量,常数或者本身被传递给一个函数的时候,实际上操作的是其的拷贝。

    +

    在之前的章节中,我们已经大量使用了值类型。实际上,在 Swift 中,所有的基本类型:整数(Integer)、浮点数(floating-point)、布尔值(Booleans)、字符串(string)、数组(array)和字典(dictionaries),都是值类型,并且都是以结构体的形式在后台所实现。

    +

    在 Swift 中,所有的结构体和枚举都是值类型。这意味着它们的实例,以及实例中所包含的任何值类型属性,在代码中传递的时候都会被复制。

    +

    请看下面这个示例,其使用了前一个示例中Resolution结构体:

    +
    let hd = Resolution(width: 1920, height: 1080)
    +var cinema = hd
    +
    +

    在以上示例中,声明了一个名为hd的常量,其值为一个初始化为全高清视频分辨率(1920 像素宽,1080 像素高)的Resolution实例。

    +

    然后示例中又声明了一个名为cinema的变量,其值为之前声明的hd。因为Resolution是一个结构体,所以cinema的值其实是hd的一个拷贝副本,而不是hd本身。尽管hdcinema有着相同的宽(width)和高(height)属性,但是在后台中,它们是两个完全不同的实例。

    +

    下面,为了符合数码影院放映的需求(2048 像素宽,1080 像素高),cinemawidth属性需要作如下修改:

    +
    cinema.width = 2048
    +
    +

    这里,将会显示cinemawidth属性确已改为了2048

    +
    println("cinema is now  \(cinema.width) pixels wide")
    +// 输出 "cinema is now 2048 pixels wide"
    +
    +

    然而,初始的hd实例中width属性还是1920

    +
    println("hd is still \(hd.width    ) pixels wide")
    +// 输出 "hd is still 1920 pixels wide"
    +
    +

    在将hd赋予给cinema的时候,实际上是将hd中所存储的值(values)进行拷贝,然后将拷贝的数据存储到新的cinema实例中。结果就是两个完全独立的实例碰巧包含有相同的数值。由于两者相互独立,因此将cinemawidth修改为2048并不会影响hd中的宽(width)。

    +

    枚举也遵循相同的行为准则:

    +
    enum CompassPoint {
    +    case North, South, East, West
    +}
    +var currentDirection = CompassPoint.West
    +let rememberedDirection = currentDirection
    +currentDirection = .East
    +if rememberDirection == .West {
    +    println("The remembered direction is still .West")
    +}
    +// 输出 "The remembered direction is still .West"
    +
    +

    上例中rememberedDirection被赋予了currentDirection的值(value),实际上它被赋予的是值(value)的一个拷贝。赋值过程结束后再修改currentDirection的值并不影响rememberedDirection所储存的原始值(value)的拷贝。

    +

    +

    类是引用类型

    +

    与值类型不同,引用类型在被赋予到一个变量、常量或者被传递到一个函数时,操作的是引用,其并不是拷贝。因此,引用的是已存在的实例本身而不是其拷贝。

    +

    请看下面这个示例,其使用了之前定义的VideoMode类:

    +
    let tenEighty = VideoMode()
    +tenEighty.resolution = hd
    +tenEighty.interlaced = true
    +tenEighty.name = "1080i"
    +tenEighty.frameRate = 25.0
    +
    +

    以上示例中,声明了一个名为tenEighty的常量,其引用了一个VideoMode类的新实例。在之前的示例中,这个视频模式(video mode)被赋予了HD分辨率(1920*1080)的一个拷贝(hd)。同时设置为交错(interlaced),命名为“1080i”。最后,其帧率是25.0帧每秒。

    +

    然后,tenEighty 被赋予名为alsoTenEighty的新常量,同时对alsoTenEighty的帧率进行修改:

    +
    let alsoTenEighty = tenEighty
    +alsoTenEighty.frameRate = 30.0
    +
    +

    因为类是引用类型,所以tenEightalsoTenEight实际上引用的是相同的VideoMode实例。换句话说,它们是同一个实例的两种叫法。

    +

    下面,通过查看tenEightyframeRate属性,我们会发现它正确的显示了基本VideoMode实例的新帧率,其值为30.0

    +
    println("The frameRate property of tenEighty is now \(tenEighty.frameRate)")
    +// 输出 "The frameRate property of theEighty is now 30.0"
    +
    +

    需要注意的是tenEightyalsoTenEighty被声明为常量((constants)而不是变量。然而你依然可以改变tenEighty.frameRatealsoTenEighty.frameRate,因为这两个常量本身不会改变。它们并不存储这个VideoMode实例,在后台仅仅是对VideoMode实例的引用。所以,改变的是被引用的基础VideoModeframeRate参数,而不改变常量的值。

    +

    恒等运算符

    +

    因为类是引用类型,有可能有多个常量和变量在后台同时引用某一个类实例。(对于结构体和枚举来说,这并不成立。因为它们作为值类型,在被赋予到常量、变量或者传递到函数时,其值总是会被拷贝。)

    +

    如果能够判定两个常量或者变量是否引用同一个类实例将会很有帮助。为了达到这个目的,Swift 内建了两个恒等运算符:

    +
      +
    • 等价于 ( === )
    • +
    • 不等价于 ( !== )
    • +
    +

    以下是运用这两个运算符检测两个常量或者变量是否引用同一个实例:

    +
    if tenEighty === alsoTenTighty {
    +    println("tenTighty and alsoTenEighty refer to the same Resolution instance.")
    +}
    +//输出 "tenEighty and alsoTenEighty refer to the same Resolution instance."
    +
    +

    请注意“等价于"(用三个等号表示,===) 与“等于"(用两个等号表示,==)的不同:

    +
      +
    • “等价于”表示两个类类型(class type)的常量或者变量引用同一个类实例。
    • +
    • “等于”表示两个实例的值“相等”或“相同”,判定时要遵照类设计者定义定义的评判标准,因此相比于“相等”,这是一种更加合适的叫法。
    • +
    +

    当你在定义你的自定义类和结构体的时候,你有义务来决定判定两个实例“相等”的标准。在章节运算符函数(Operator Functions)中将会详细介绍实现自定义“等于”和“不等于”运算符的流程。

    +

    指针

    +

    如果你有 C,C++ 或者 Objective-C 语言的经验,那么你也许会知道这些语言使用指针来引用内存中的地址。一个 Swift 常量或者变量引用一个引用类型的实例与 C 语言中的指针类似,不同的是并不直接指向内存中的某个地址,而且也不要求你使用星号(*)来表明你在创建一个引用。Swift 中这些引用与其它的常量或变量的定义方式相同。

    +

    +

    类和结构体的选择

    +

    在你的代码中,你可以使用类和结构体来定义你的自定义数据类型。

    +

    然而,结构体实例总是通过值传递,类实例总是通过引用传递。这意味两者适用不同的任务。当你在考虑一个工程项目的数据构造和功能的时候,你需要决定每个数据构造是定义成类还是结构体。

    +

    按照通用的准则,当符合一条或多条以下条件时,请考虑构建结构体:

    +
      +
    • 结构体的主要目的是用来封装少量相关简单数据值。
    • +
    • 有理由预计一个结构体实例在赋值或传递时,封装的数据将会被拷贝而不是被引用。
    • +
    • 任何在结构体中储存的值类型属性,也将会被拷贝,而不是被引用。
    • +
    • 结构体不需要去继承另一个已存在类型的属性或者行为。
    • +
    +

    合适的结构体候选者包括:

    +
      +
    • 几何形状的大小,封装一个width属性和height属性,两者均为Double类型。
    • +
    • 一定范围内的路径,封装一个start属性和length属性,两者均为Int类型。
    • +
    • 三维坐标系内一点,封装xyz属性,三者均为Double类型。
    • +
    +

    在所有其它案例中,定义一个类,生成一个它的实例,并通过引用来管理和传递。实际中,这意味着绝大部分的自定义数据构造都应该是类,而非结构体。

    +

    +

    集合(Collection)类型的赋值和拷贝行为

    +

    Swift 中数组(Array)字典(Dictionary)类型均以结构体的形式实现。然而当数组被赋予一个常量或变量,或被传递给一个函数或方法时,其拷贝行为与字典和其它结构体有些许不同。

    +

    以下对数组结构体的行为描述与对NSArrayNSDictionary的行为描述在本质上不同,后者是以类的形式实现,前者是以结构体的形式实现。NSArrayNSDictionary实例总是以对已有实例引用,而不是拷贝的方式被赋值和传递。

    +
    +

    注意:
    以下是对于数组,字典,字符串和其它值的拷贝的描述。 +在你的代码中,拷贝好像是确实是在有拷贝行为的地方产生过。然而,在 Swift 的后台中,只有确有必要,实际(actual)拷贝才会被执行。Swift 管理所有的值拷贝以确保性能最优化的性能,所以你也没有必要去避免赋值以保证最优性能。(实际赋值由系统管理优化)

    +
    +

    字典类型的赋值和拷贝行为

    +

    无论何时将一个字典实例赋给一个常量或变量,或者传递给一个函数或方法,这个字典会即会在赋值或调用发生时被拷贝。在章节结构体和枚举是值类型中将会对此过程进行详细介绍。

    +

    如果字典实例中所储存的键(keys)和/或值(values)是值类型(结构体或枚举),当赋值或调用发生时,它们都会被拷贝。相反,如果键(keys)和/或值(values)是引用类型,被拷贝的将会是引用,而不是被它们引用的类实例或函数。字典的键和值的拷贝行为与结构体所储存的属性的拷贝行为相同。

    +

    下面的示例定义了一个名为ages的字典,其中储存了四个人的名字和年龄。ages字典被赋予了一个名为copiedAges的新变量,同时ages在赋值的过程中被拷贝。赋值结束后,agescopiedAges成为两个相互独立的字典。

    +
    var ages = ["Peter": 23, "Wei": 35, "Anish": 65, "Katya": 19]
    +var copiedAges = ages
    +
    +

    这个字典的键(keys)是字符串(String)类型,值(values)是整(Int)类型。这两种类型在Swift 中都是值类型(value types),所以当字典被拷贝时,两者都会被拷贝。

    +

    我们可以通过改变一个字典中的年龄值(age value),检查另一个字典中所对应的值,来证明ages字典确实是被拷贝了。如果在copiedAges字典中将Peter的值设为24,那么ages字典仍然会返回修改前的值23

    +
    copiedAges["Peter"] = 24
    +println(ages["Peter"])
    +// 输出 "23"
    +
    +

    数组的赋值和拷贝行为

    +

    在Swift 中,数组(Arrays)类型的赋值和拷贝行为要比字典(Dictionary)类型的复杂的多。当操作数组内容时,数组(Array)能提供接近C语言的的性能,并且拷贝行为只有在必要时才会发生。

    +

    如果你将一个数组(Array)实例赋给一个变量或常量,或者将其作为参数传递给函数或方法调用,在事件发生时数组的内容会被拷贝。相反,数组公用相同的元素序列。当你在一个数组内修改某一元素,修改结果也会在另一数组显示。

    +

    对数组来说,拷贝行为仅仅当操作有可能修改数组长度时才会发生。这种行为包括了附加(appending),插入(inserting),删除(removing)或者使用范围下标(ranged subscript)去替换这一范围内的元素。只有当数组拷贝确要发生时,数组内容的行为规则与字典中键值的相同,参见章节[集合(collection)类型的赋值与复制行为](#assignment_and_copy_behavior_for_collection_types。

    +

    下面的示例将一个整数(Int)数组赋给了一个名为a的变量,继而又被赋给了变量bc

    +
    var a = [1, 2, 3]
    +var b = a
    +var c = a
    +
    +

    我们可以在a,b,c上使用下标语法以得到数组的第一个元素:

    +
    println(a[0])
    +// 1
    +println(b[0])
    +// 1
    +println(c[0])
    +// 1
    +
    +

    如果通过下标语法修改数组中某一元素的值,那么a,b,c中的相应值都会发生改变。请注意当你用下标语法修改某一值时,并没有拷贝行为伴随发生,因为下表语法修改值时没有改变数组长度的可能:

    +
    a[0] = 42
    +println(a[0])
    +// 42
    +println(b[0])
    +// 42
    +println(c[0])
    +// 42
    +
    +

    然而,当你给a附加新元素时,数组的长度改变。 +当附加元素这一事件发生时,Swift 会创建这个数组的一个拷贝。从此以后,a将会是原数组的一个独立拷贝。

    +

    拷贝发生后,如果再修改a中元素值的话,a将会返回与bc不同的结果,因为后两者引用的是原来的数组:

    +
    a.append(4)
    +a[0] = 777
    +println(a[0])
    +// 777
    +println(b[0])
    +// 42
    +println(c[0])
    +// 42
    +
    +

    确保数组的唯一性

    +

    在操作一个数组,或将其传递给函数以及方法调用之前是很有必要先确定这个数组是有一个唯一拷贝的。通过在数组变量上调用unshare方法来确定数组引用的唯一性。(当数组赋给常量时,不能调用unshare方法)

    +

    如果一个数组被多个变量引用,在其中的一个变量上调用unshare方法,则会拷贝此数组,此时这个变量将会有属于它自己的独立数组拷贝。当数组仅被一个变量引用时,则不会有拷贝发生。

    +

    在上一个示例的最后,bc都引用了同一个数组。此时在b上调用unshare方法则会将b变成一个唯一个拷贝:

    +
    b.unshare()
    +
    +

    unshare方法调用后再修改b中第一个元素的值,这三个数组(a,b,c)会返回不同的三个值:

    +
    b[0] = -105
    +println(a[0])
    +// 77
    +println(b[0])
    +// -105
    +println(c[0])
    +// 42
    +
    +

    判定两个数组是否共用相同元素

    +

    我们通过使用恒等运算符(identity operators)( === 和 !==)来判定两个数组或子数组共用相同的储存空间或元素。

    +

    下面这个示例使用了“等同(identical to)” 运算符(===) 来判定bc是否共用相同的数组元素:

    +
    if b === c {
    +    println("b and c still share the same array elements.")
    +} else {
    +    println("b and c now refer to two independent sets of array elements.")
    +}
    +
    +
    // 输出 "b and c now refer totwo independent sets of array elements."
    +
    +

    此外,我们还可以使用恒等运算符来判定两个子数组是否共用相同的元素。下面这个示例中,比较了b的两个相等的子数组,并且确定了这两个子数组都引用相同的元素:

    +
    if b[0...1] === b[0...1] {
    +    println("These two subarrays share the same elements.")
    +} else {
    +    println("These two subarrays do not share the same elements.")
    +}
    +// 输出 "These two subarrays share the same elements."
    +
    +

    强制复制数组

    +

    我们通过调用数组的copy方法进行强制显式复制。这个方法对数组进行了浅拷贝(shallow copy),并且返回一个包含此拷贝数组的新数组。

    +

    下面这个示例中定义了一个names数组,其包含了七个人名。还定义了一个copiedNames变量,用以储存在names上调用copy方法所返回的结果:

    +
    var names = ["Mohsen", "Hilary", "Justyn", "Amy", "Rich", "Graham", "Vic"]
    +var copiedNames = names.copy()
    +
    +

    我们可以通过修改数组中某一个元素,并且检查另一个数组中对应元素的方法来判定names数组确已被复制。如果你将copiedNames中第一个元素从"Mohsen"修改为"Mo",则names数组返回的仍是拷贝发生前的"Mohsen":

    +
    copiedName[0] = "Mo"
    +println(name[0])
    +// 输出 "Mohsen"
    +
    +
    +

    注意:
    如果你仅需要确保你对数组的引用是唯一引用,请调用unshare方法,而不是copy方法。unshare方法仅会在确有必要时才会创建数组拷贝。copy方法会在任何时候都创建一个新的拷贝,即使引用已经是唯一引用。

    +
    @@ -616,16 +914,8 @@
    - - - - - - - - - - + + @@ -643,6 +933,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/10_Properties.html b/chapter2/10_Properties.html index bed91019..0431b1ee 100644 --- a/chapter2/10_Properties.html +++ b/chapter2/10_Properties.html @@ -1,57 +1,45 @@ - - + - 属性 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,75 +595,95 @@
    -
    +
    -

    属性 (Properties)

    -

    属性将值跟特定的类、结构或枚举关联。一种是存储属性,把常量或变量的值作为实例的一部分,一种是计算属性,它计算一个值。计算属性可以用于类、结构和枚举里,存储属性只能用于类和结构。

    -

    存储属性和计算属性通常用于特定类型的实例,但是,属性也可以直接用于类型本身,这种属性称为类属性。

    +
    +

    翻译:shinyzhu
    校对:pp-prog

    +
    +

    属性 (Properties)

    +
    +

    本页包含内容:

    + +

    属性将值跟特定的类、结构或枚举关联。存储属性存储常量或变量作为实例的一部分,计算属性计算(而不是存储)一个值。计算属性可以用于类、结构体和枚举里,存储属性只能用于类和结构体。

    +

    存储属性和计算属性通常用于特定类型的实例,但是,属性也可以直接用于类型本身,这种属性称为类型属性。

    另外,还可以定义属性监视器来监控属性值的变化,以此来触发一个自定义的操作。属性监视器可以添加到自己写的存储属性上,也可以添加到从父类继承的属性上。

    +

    存储属性

    -

    简单来说,一个存储属性就是一个特定类型实例里表示常量或变量的部分,存储属性可以是变量存储属性(用关键字var定义),也可以是常量存储属性(用关键字let定义)。

    -

    可以在定义存储属性的时候指定默认值,详见默认属性值一节。也可以在初始化阶段设置或修改存储属性的值,甚至修改常量存储属性的值,详见在初始化阶段修改常量存储属性一节。

    -

    下面的例子定义了一个名为FixedLengthRange的结构体,表示一个在创建后无法修改整数范围的类型:

    -
    struct FixedLengthRange {
    +

    简单来说,一个存储属性就是存储在特定类或结构体的实例里的一个常量或变量,存储属性可以是变量存储属性(用关键字var定义),也可以是常量存储属性(用关键字let定义)。

    +

    可以在定义存储属性的时候指定默认值,请参考构造过程一章的默认属性值一节。也可以在构造过程中设置或修改存储属性的值,甚至修改常量存储属性的值,请参考构造过程一章的在初始化阶段修改常量存储属性一节。

    +

    下面的例子定义了一个名为FixedLengthRange的结构体,它描述了一个在创建后无法修改值域宽度的区间:

    +
    struct FixedLengthRange {
         var firstValue: Int
         let length: Int
     }
     var rangeOfThreeItems = FixedLengthRange(firstValue: 0, length: 3)
    -// the range represents integer values 0, 1, and 2
    +// 该区间表示整数0,1,2
     rangeOfThreeItems.firstValue = 6
    -// the range now represents integer values 6, 7, and 8
    -

    FixedLengthRange的实例包含一个名为firstValue的变量存储属性和一个名为length的常量存储属性。在上面的例子中,length在创建实例的时候被赋值,因为它是一个常量存储属性,所以再无法修改它的值。

    +// 该区间现在表示整数6,7,8 +
    +

    FixedLengthRange的实例包含一个名为firstValue的变量存储属性和一个名为length的常量存储属性。在上面的例子中,length在创建实例的时候被赋值,因为它是一个常量存储属性,所以之后无法修改它的值。

    +

    常量和存储属性

    如果创建了一个结构体的实例并赋值给一个常量,则无法修改实例的任何属性,即使定义了变量存储属性:

    -
    let rangeOfFourItems = FixedLengthRange(firstValue: 0, length: 4)
    -// this range represents integer values 0, 1, 2, and 3
    +
    let rangeOfFourItems = FixedLengthRange(firstValue: 0, length: 4)
    +// 该区间表示整数0,1,2,3
     rangeOfFourItems.firstValue = 6
    -// this will report an error, even thought firstValue is a variable property
    -

    因为rangeOfFourItems声明成了常量(用let关键字),即使firstValue是一个变量属性,也无法再修改属性它的值。

    +// 尽管 firstValue 是个变量属性,这里还是会报错 +
    +

    因为rangeOfFourItems声明成了常量(用let关键字),即使firstValue是一个变量属性,也无法再修改它了。

    这种行为是由于结构体(struct)属于值类型。当值类型的实例被声明为常量的时候,它的所有属性也就成了常量。

    属于引用类型的类(class)则不一样,把一个引用类型的实例赋给一个常量后,仍然可以修改实例的变量属性。

    +

    延迟存储属性

    -

    延迟存储属性是指当第一次被调用的时候才有初始值的属性。在属性声明前使用@lazy特性来表示一个延迟存储属性。

    +

    延迟存储属性是指当第一次被调用的时候才会计算其初始值的属性。在属性声明前使用@lazy来标示一个延迟存储属性。

    -

    注意

    -

    必须将延迟存储属性声明成变量(使用var关键字),因为可能在实例构造完成之前属性的值无法得到。常量属性在构造过程完成之前必须要有初始值,因此无法声明成延迟属性。

    +

    注意:
    必须将延迟存储属性声明成变量(使用var关键字),因为属性的值在实例构造完成之前可能无法得到。而常量属性在构造过程完成之前必须要有初始值,因此无法声明成延迟属性。

    延迟属性很有用,当属性的值依赖于在实例的构造过程结束前无法知道具体值的外部因素时,或者当属性的值需要复杂或大量计算时,可以只在需要的时候来计算它。

    -

    下面复合类的例子使用了延迟存储属性来避免不必要的初始化。例子中定义了DataImporterDataManager两个类,下面是部分代码:

    -
    class DataImporter {
    +

    下面的例子使用了延迟存储属性来避免复杂类的不必要的初始化。例子中定义了DataImporterDataManager两个类,下面是部分代码:

    +
    class DataImporter {
         /*
    -    DataImporter is a class to import data from an external file.
    -    The class is assumed to take a non-trivial amount of time to initialize.
    +    DataImporter 是一个将外部文件中的数据导入的类。
    +    这个类的初始化会消耗不少时间。
         */
         var fileName = "data.txt"
    -    // the DataImporter class would provide data importing functionality here
    +    // 这是提供数据导入功能
     }
     
     class DataManager {
         @lazy var importer = DataImporter()
         var data = String[]()
    -    // the DataManager class would provide data management functionality here
    +    // 这是提供数据管理功能
     }
     
     let manager = DataManager()
     manager.data += "Some data"
     manager.data += "Some more data"
    -// the DataImporter instance for the importer property has not yet been created
    -

    DataManager类包含一个名为data的存储属性,初始值是一个空的字符串(String)数组。虽然没有写出全部代码,DataManager类的目的是管理和提供对这个字符串数组的访问。

    -

    DataManager的一个功能是从文件导入数据,该功能由DataImporter类提供,它需要一定的时间来处理。因为它需要在实例化之后打开文件、读取文件内容到内存。

    -

    DataManager也可以不从文件中导入数据,所以当DataManager的实例被创建时,就没有必要创建一个DataImporter的实例。同时,更有意义的是当用到DataImporter的时候才去创建它。

    -

    由于使用了@lazy特性(Attribute),importer属性只有在第一次被访问的时候才被创建。比如访问它的属性fileName时:

    -
    println(manager.importer.fileName)
    -// the DataImporter instance for the importer property has now been created
    -// prints "data.txt”
    -

    存储属性和实例变量

    -

    如果您有过Objective-C经验,应该知道有2种方式在类实例存储值和引用。对于属性来说,也可以使用实例变量作为属性值的后端存储。

    -

    Swift编程语言中把这些理论统一用属性来实现。Swift中的属性没有对应的实例变量,属性的后端存储也无法直接访问。这就避免了不同场景下访问方式的困扰,同时也将属性的定义简化成一个语句。 -一个类型中属性的全部信息——包括命名、类型和内存管理特征——都在唯一一个地方定义。

    +// DataImporter 实例的 importer 属性还没有被创建 +
    +

    DataManager类包含一个名为data的存储属性,初始值是一个空的字符串(String)数组。虽然没有写出全部代码,DataManager类的目的是管理和提供对这个字符串数组的访问。

    +

    DataManager的一个功能是从文件导入数据,该功能由DataImporter类提供,DataImporter需要消耗不少时间完成初始化:因为它的实例在初始化时可能要打开文件,还要读取文件内容到内存。

    +

    DataManager也可能不从文件中导入数据。所以当DataManager的实例被创建时,没必要创建一个DataImporter的实例,更明智的是当用到DataImporter的时候才去创建它。

    +

    由于使用了@lazyimporter属性只有在第一次被访问的时候才被创建。比如访问它的属性fileName时:

    +
    println(manager.importer.fileName)
    +// DataImporter 实例的 importer 属性现在被创建了
    +// 输出 "data.txt”
    +
    +

    +

    存储属性和实例变量

    +

    如果您有过 Objective-C 经验,应该知道有两种方式在类实例存储值和引用。对于属性来说,也可以使用实例变量作为属性值的后端存储。

    +

    Swift 编程语言中把这些理论统一用属性来实现。Swift 中的属性没有对应的实例变量,属性的后端存储也无法直接访问。这就避免了不同场景下访问方式的困扰,同时也将属性的定义简化成一个语句。 +一个类型中属性的全部信息——包括命名、类型和内存管理特征——都在唯一一个地方(类型定义中)定义。

    +

    计算属性

    -

    除存储属性外,类、结构体和枚举可以定义计算属性,计算属性不直接存储值,而是提供一个getter来获取值,一个可选的setter来间接设置其他属性或变量的值。

    -
    struct Point {
    +

    除存储属性外,类、结构体和枚举可以定义计算属性,计算属性不直接存储值,而是提供一个 getter 来获取值,一个可选的 setter 来间接设置其他属性或变量的值。

    +
    struct Point {
         var x = 0.0, y = 0.0
     }
     struct Size {
    @@ -681,21 +709,23 @@ var square = Rect(origin: Point(x: 0.0, y: 0.0),
     let initialSquareCenter = square.center
     square.center = Point(x: 15.0, y: 15.0)
     println("square.origin is now at (\(square.origin.x), \(square.origin.y))")
    -// prints "square.origin is now at (10.0, 10.0)”
    -

    这个例子定义了3个几何形状的结构体:

    +// 输出 "square.origin is now at (10.0, 10.0)” +
    +

    这个例子定义了 3 个几何形状的结构体:

    • Point封装了一个(x, y)的坐标
    • Size封装了一个widthheight
    • Rect表示一个有原点和尺寸的矩形
    -

    Rect也提供了一个名为center的计算属性。一个矩形的中心点可以从原点和尺寸来算出,所以不需要将它以显式声明的Point来保存。Rect的计算属性center提供了自定义的getter和setter来获取和设置矩形的中心点,就像它有一个存储属性一样。

    +

    Rect也提供了一个名为center的计算属性。一个矩形的中心点可以从原点和尺寸来算出,所以不需要将它以显式声明的Point来保存。Rect的计算属性center提供了自定义的 getter 和 setter 来获取和设置矩形的中心点,就像它有一个存储属性一样。

    例子中接下来创建了一个名为squareRect实例,初始值原点是(0, 0),宽度高度都是10。如图所示蓝色正方形。

    -

    squarecenter属性可以通过点运算符(square.center)来访问,这会调用getter来获取属性的值。跟直接返回已经存在的值不同,getter实际上通过计算然后返回一个新的Point实例表示square的中心点。如代码所示,它正确返回了中心点(5, 5)

    -

    center属性之后被设置了一个新的值(15, 15),表示向右上方移动正方形到如图所示橙色正方形的位置。设置属性center的值会调用setter来修改属性originxy的值,从而实现移动正方形到新的位置。

    +

    squarecenter属性可以通过点运算符(square.center)来访问,这会调用 getter 来获取属性的值。跟直接返回已经存在的值不同,getter 实际上通过计算然后返回一个新的Point来表示square的中心点。如代码所示,它正确返回了中心点(5, 5)

    +

    center属性之后被设置了一个新的值(15, 15),表示向右上方移动正方形到如图所示橙色正方形的位置。设置属性center的值会调用 setter 来修改属性originxy的值,从而实现移动正方形到新的位置。

    Computed Properties sample

    -

    便捷Setter声明

    -

    如果计算属性的setter没有定义表示新值的参数名,则可以使用默认名称newValue。下面是使用了便捷Setter声明的Rect结构体代码:

    -
    struct AlternativeRect {
    +

    +

    便捷 setter 声明

    +

    如果计算属性的 setter 没有定义表示新值的参数名,则可以使用默认名称newValue。下面是使用了便捷 setter 声明的Rect结构体代码:

    +
    struct AlternativeRect {
         var origin = Point()
         var size = Size()
         var center: Point {
    @@ -710,14 +740,32 @@ println("square.origin is now at (\(square.origin.x), \(square.origin.y))&q
         }
         }
     }
    -

    只读计算属性

    -

    只有getter没有setter的计算属性就是只读计算属性。只读计算属性总是返回一个值,可以通过点运算符访问,但不能设置新的值。

    +
    +

    +

    只读计算属性

    +

    只有 getter 没有 setter 的计算属性就是只读计算属性。只读计算属性总是返回一个值,可以通过点运算符访问,但不能设置新的值。

    +

    <<<<<<< HEAD

    -

    注意

    -

    必须使用var关键字定义计算属性,包括只读计算属性,因为他们的值不是固定的。let关键字只用来声明常量属性,表示初始化后再也无法修改的值。

    +

    注意:

    +

    必须使用var关键字定义计算属性,包括只读计算属性,因为他们的值不是固定的。let关键字只用来声明常量属性,表示初始化后再也无法修改的值。

    +

    注意:

    +

    必须使用var关键字定义计算属性,包括只读计算属性,因为它们的值不是固定的。let关键字只用来声明常量属性,表示初始化后再也无法修改的值。

    +
    +
    +
    +
    +
    +
    +

    a516af6a531a104ec88da0d236ecf389a5ec72af

    +
    +
    +
    +
    +
    +

    只读计算属性的声明可以去掉get关键字和花括号:

    -
    struct Cuboid {
    +
    struct Cuboid {
         var width = 0.0, height = 0.0, depth = 0.0
         var volume: Double {
         return width * height * depth
    @@ -725,15 +773,15 @@ println("square.origin is now at (\(square.origin.x), \(square.origin.y))&q
     }
     let fourByFiveByTwo = Cuboid(width: 4.0, height: 5.0, depth: 2.0)
     println("the volume of fourByFiveByTwo is \(fourByFiveByTwo.volume)")
    -// prints "the volume of fourByFiveByTwo is 40.0"
    -

    这个例子定义了一个名为Cuboid的结构体,表示三维空间的立方体,包含widthheightdepth属性,还有一个名为volume的只读计算属性用来返回立方体的体积,设置volume的值毫无意义,因为无法确定widthheightdepth的值。

    -

    尽管如此,Cuboid提供一个只读计算属性来让外部用户直接获取体积是很有用的。

    +// 输出 "the volume of fourByFiveByTwo is 40.0" +
    +

    这个例子定义了一个名为Cuboid的结构体,表示三维空间的立方体,包含widthheightdepth属性,还有一个名为volume的只读计算属性用来返回立方体的体积。设置volume的值毫无意义,因为通过widthheightdepth就能算出volume。然而,Cuboid提供一个只读计算属性来让外部用户直接获取体积是很有用的。

    +

    属性监视器

    属性监视器监控和响应属性值的变化,每次属性被设置值的时候都会调用属性监视器,甚至新的值和现在的值相同的时候也不例外。

    -

    可以为除了延迟存储属性之外的其他存储属性添加属性监视器,也可以通过重载属性的方式为继承的属性(包括存储属性和计算属性)添加属性监视器。属性重载详见重载一节。

    +

    可以为除了延迟存储属性之外的其他存储属性添加属性监视器,也可以通过重载属性的方式为继承的属性(包括存储属性和计算属性)添加属性监视器。属性重载请参考继承一章的重载

    -

    注意

    -

    不需要为无法重载的计算属性添加属性监视器,因为可以通过setter直接监控和响应值的变化。

    +

    注意:
    不需要为无法重载的计算属性添加属性监视器,因为可以通过 setter 直接监控和响应值的变化。

    可以为属性添加如下的一个或全部监视器:

      @@ -742,12 +790,28 @@ println("the volume of fourByFiveByTwo is \(fourByFiveByTwo.volume)")

    willSet监视器会将新的属性值作为固定参数传入,在willSet的实现代码中可以为这个参数指定一个名称,如果不指定则参数仍然可用,这时使用默认名称newValue表示。

    类似地,didSet监视器会将旧的属性值作为参数传入,可以为该参数命名或者使用默认参数名oldValue

    +

    <<<<<<< HEAD

    -

    注意

    -

    willSetdidSet监视器在属性初始化过程中不会被调用,他们只会当属性的值在初始化之外的地方被设置时被调用。

    +

    注意:

    +

    willSetdidSet监视器在属性初始化过程中不会被调用,他们只会当属性的值在初始化之外的地方被设置时被调用。

    +

    注意:

    +

    willSetdidSet监视器在属性初始化过程中不会被调用,它们只会当属性的值在初始化之外的地方被设置时被调用。

    +
    +
    +
    +
    +
    +
    +

    a516af6a531a104ec88da0d236ecf389a5ec72af

    +
    +
    +
    +
    +
    +

    这里是一个willSetdidSet的实际例子,其中定义了一个名为StepCounter的类,用来统计当人步行时的总步数,可以跟计步器或其他日常锻炼的统计装置的输入数据配合使用。

    -
    class StepCounter {
    +
    class StepCounter {
         var totalSteps: Int = 0 {
         willSet(newTotalSteps) {
             println("About to set totalSteps to \(newTotalSteps)")
    @@ -769,89 +833,92 @@ stepCounter.totalSteps = 360
     stepCounter.totalSteps = 896
     // About to set totalSteps to 896
     // Added 536 steps
    -

    StepCounter类定义了一个Int类型的属性totalSteps,它是一个存储属性,包含willSetdidSet监视器。

    +
    +

    StepCounter类定义了一个Int类型的属性totalSteps,它是一个存储属性,包含willSetdidSet监视器。

    totalSteps设置新值的时候,它的willSetdidSet监视器都会被调用,甚至当新的值和现在的值完全相同也会调用。

    例子中的willSet监视器将表示新值的参数自定义为newTotalSteps,这个监视器只是简单的将新的值输出。

    didSet监视器在totalSteps的值改变后被调用,它把新的值和旧的值进行对比,如果总的步数增加了,就输出一个消息表示增加了多少步。didSet没有提供自定义名称,所以默认值oldValue表示旧值的参数名。

    -

    注意

    -

    如果在didSet监视器里为属性赋值,这个值会替换监视器之前设置的值。

    +

    注意:
    如果在didSet监视器里为属性赋值,这个值会替换监视器之前设置的值。

    +

    全局变量和局部变量

    -

    计算属性和属性监视器所描述的模式也可以用于全局变量和局部变量,全局变量是在函数、方法、闭包或任何类型之外定义的变量,局部变量是在函数、方法或闭包内部定义的变量。

    +

    计算属性和属性监视器所描述的模式也可以用于全局变量局部变量,全局变量是在函数、方法、闭包或任何类型之外定义的变量,局部变量是在函数、方法或闭包内部定义的变量。

    前面章节提到的全局或局部变量都属于存储型变量,跟存储属性类似,它提供特定类型的存储空间,并允许读取和写入。

    另外,在全局或局部范围都可以定义计算型变量和为存储型变量定义监视器,计算型变量跟计算属性一样,返回一个计算的值而不是存储值,声明格式也完全一样。

    -

    注意

    -

    全局的常量或变量都是延迟计算的,跟延迟存储属性相似,不同的地方在于,全局的常量或变量不需要标记@lazy特性。

    -

    局部范围的常量或变量不会延迟计算。

    +

    注意:
    全局的常量或变量都是延迟计算的,跟延迟存储属性相似,不同的地方在于,全局的常量或变量不需要标记@lazy特性。
    局部范围的常量或变量不会延迟计算。

    -

    类属性

    +

    +

    类型属性

    实例的属性属于一个特定类型实例,每次类型实例化后都拥有自己的一套属性值,实例之间的属性相互独立。

    -

    也可以为类型本身定义属性,不管类型有多少个实例,这些属性都只有唯一一份。这种属性就是类属性

    -

    类属性用于定义特定类型所有实例共享的数据,比如所有实例都能用的一个常量(就像 C 语言中的静态常量),或者所有实例都能访问的一个变量(就像 C 语言中的静态变量)。

    -

    对于值类型(指结构体和枚举)可以定义存储型和计算型类属性,对于类(class)则只能定义计算型类属性。

    -

    值类型的存储型类属性可以是变量或常量,计算型类属性跟实例的计算属性一样定义成变量属性。

    +

    也可以为类型本身定义属性,不管类型有多少个实例,这些属性都只有唯一一份。这种属性就是类型属性

    +

    类型属性用于定义特定类型所有实例共享的数据,比如所有实例都能用的一个常量(就像 C 语言中的静态常量),或者所有实例都能访问的一个变量(就像 C 语言中的静态变量)。

    +

    对于值类型(指结构体和枚举)可以定义存储型和计算型类型属性,对于类(class)则只能定义计算型类型属性。

    +

    值类型的存储型类型属性可以是变量或常量,计算型类型属性跟实例的计算属性一样定义成变量属性。

    -

    注意

    -

    跟实例的存储属性不同,必须给存储型类属性指定默认值,因为类型本身无法在初始化过程中使用构造器给类属性赋值。

    +

    注意:
    跟实例的存储属性不同,必须给存储型类型属性指定默认值,因为类型本身无法在初始化过程中使用构造器给类型属性赋值。

    -

    类属性语法

    -

    在 C 或 Objective-C 中,静态常量和静态变量的定义是通过特定类型加上global关键字。在 Swift 编程语言中,类属性是作为类型定义的一部分写在类型最外层的花括号内,因此它的作用范围也就在类型支持的范围内。

    -

    使用关键字static来定义值类型的类属性,关键字class来为类(class)定义类属性。下面的例子演示了存储型和计算型类属性的语法:

    -
    struct SomeStructure {
    +

    +

    类型属性语法

    +

    在 C 或 Objective-C 中,静态常量和静态变量的定义是通过特定类型加上global关键字。在 Swift 编程语言中,类型属性是作为类型定义的一部分写在类型最外层的花括号内,因此它的作用范围也就在类型支持的范围内。

    +

    使用关键字static来定义值类型的类型属性,关键字class来为类(class)定义类型属性。下面的例子演示了存储型和计算型类型属性的语法:

    +
    struct SomeStructure {
         static var storedTypeProperty = "Some value."
         static var computedTypeProperty: Int {
    -    // return an Int value here
    +    // 这里返回一个 Int 值
         }
     }
     enum SomeEnumeration {
         static var storedTypeProperty = "Some value."
         static var computedTypeProperty: Int {
    -    // return an Int value here
    +    // 这里返回一个 Int 值
         }
     }
     class SomeClass {
         class var computedTypeProperty: Int {
    -    // return an Int value here
    +    // 这里返回一个 Int 值
         }
     }
    -
    -

    注意

    -

    例子中的计算型类属性是只读的,但也可以定义可读可写的计算型类属性,跟实例计算属性的语法类似。

    +
    +
    +

    注意:
    例子中的计算型类型属性是只读的,但也可以定义可读可写的计算型类型属性,跟实例计算属性的语法类似。

    -

    获取和设置类属性的值

    -

    跟实例的属性一样,类属性的访问也是通过点运算符来进行,但是,类属性是通过类型本身来获取和设置,而不是通过实例。比如:

    -
    println(SomeClass.computedTypeProperty)
    -// prints "42"
    +

    +

    获取和设置类型属性的值

    +

    跟实例的属性一样,类型属性的访问也是通过点运算符来进行,但是,类型属性是通过类型本身来获取和设置,而不是通过实例。比如:

    +
    println(SomeClass.computedTypeProperty)
    +// 输出 "42"
     
     println(SomeStructure.storedTypeProperty)
    -// prints "Some value."
    +// 输出 "Some value."
     SomeStructure.storedTypeProperty = "Another value."
     println(SomeStructure.storedTypeProperty)
    -// prints "Another value.”
    -

    下面的例子定义了一个结构体,使用两个存储型类属性来表示多个声道的声音电平值,每个声道有一个 0 到 10 之间的整数表示声音电平值。

    +// 输出 "Another value.” +
    +

    下面的例子定义了一个结构体,使用两个存储型类型属性来表示多个声道的声音电平值,每个声道有一个 0 到 10 之间的整数表示声音电平值。

    后面的图表展示了如何联合使用两个声道来表示一个立体声的声音电平值。当声道的电平值是 0,没有一个灯会亮;当声道的电平值是 10,所有灯点亮。本图中,左声道的电平是 9,右声道的电平是 7。

    Static Properties VUMeter

    上面所描述的声道模型使用AudioChannel结构体来表示:

    -
    struct AudioChannel {
    +
    struct AudioChannel {
         static let thresholdLevel = 10
         static var maxInputLevelForAllChannels = 0
         var currentLevel: Int = 0 {
         didSet {
             if currentLevel > AudioChannel.thresholdLevel {
    -            // cap the new audio level to the threshold level
    +            // 将新电平值设置为阀值
                 currentLevel = AudioChannel.thresholdLevel
             }
             if currentLevel > AudioChannel.maxInputLevelForAllChannels {
    -            // store this as the new overall maximum input level
    +            // 存储当前电平值作为新的最大输入电平
                 AudioChannel.maxInputLevelForAllChannels = currentLevel
             }
         }
         }
     }
    -

    结构AudioChannel定义了 2 个存储型类属性来实现上述功能。第一个是thresholdLevel,表示声音电平的最大上限阈值,它是一个取值为 10 的常量,对所有实例都可见,如果声音电平高于 10,则取最大上限值 10(见后面描述)。

    -

    第二个类属性是变量存储型属性maxInputLevelForAllChannels,它用来表示所有AudioChannel实例的电平值的最大值,初始值是 0。

    +
    +

    结构AudioChannel定义了 2 个存储型类型属性来实现上述功能。第一个是thresholdLevel,表示声音电平的最大上限阈值,它是一个取值为 10 的常量,对所有实例都可见,如果声音电平高于 10,则取最大上限值 10(见后面描述)。

    +

    第二个类型属性是变量存储型属性maxInputLevelForAllChannels,它用来表示所有AudioChannel实例的电平值的最大值,初始值是 0。

    AudioChannel也定义了一个名为currentLevel的实例存储属性,表示当前声道现在的电平值,取值为 0 到 10。

    属性currentLevel包含didSet属性监视器来检查每次新设置后的属性值,有如下两个检查:

      @@ -859,25 +926,26 @@ println(SomeStructure.storedTypeProperty)
    • 如果修正后的currentLevel值大于任何之前任意AudioChannel实例中的值,属性监视器将新值保存在静态属性maxInputLevelForAllChannels中。
    -

    注意

    -

    在第一个检查过程中,didSet属性监视器将currentLevel设置成了不同的值,但这不会再次调用属性监视器。

    +

    注意:
    在第一个检查过程中,didSet属性监视器将currentLevel设置成了不同的值,但这时不会再次调用属性监视器。

    -

    可以使用结构AudioChannel来创建表示立体声系统的两个声道leftChannelrightChannel

    -
    var leftChannel = AudioChannel()
    +

    可以使用结构体AudioChannel来创建表示立体声系统的两个声道leftChannelrightChannel

    +
    var leftChannel = AudioChannel()
     var rightChannel = AudioChannel()
    -

    如果将左声道的电平设置成 7,类属性maxInputLevelForAllChannels也会更新成 7:

    -
    leftChannel.currentLevel = 7
    +
    +

    如果将左声道的电平设置成 7,类型属性maxInputLevelForAllChannels也会更新成 7:

    +
    leftChannel.currentLevel = 7
     println(leftChannel.currentLevel)
    -// prints "7"
    +// 输出 "7"
     println(AudioChannel.maxInputLevelForAllChannels)
    -// prints "7”
    -

    如果试图将右声道的电平设置成 11,则会将右声道的currentLevel修正到最大值 10,同时maxInputLevelForAllChannels的值也会更新到 10:

    -
    rightChannel.currentLevel = 11
    +// 输出 "7"
    +
    +

    如果试图将右声道的电平设置成 11,则会将右声道的currentLevel修正到最大值 10,同时maxInputLevelForAllChannels的值也会更新到 10:

    +
    rightChannel.currentLevel = 11
     println(rightChannel.currentLevel)
    -// prints "10"
    +// 输出 "10"
     println(AudioChannel.maxInputLevelForAllChannels)
    -// prints "10”
    -

    [本章完]

    +// 输出 "10" +
    @@ -896,16 +964,8 @@ println(AudioChannel.maxInputLevelForAllChannels)
    - - - - - - - - - - + + @@ -923,6 +983,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/11_Methods.html b/chapter2/11_Methods.html index 091056b5..82eb5504 100644 --- a/chapter2/11_Methods.html +++ b/chapter2/11_Methods.html @@ -1,57 +1,45 @@ - - + - 方法 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,16 +595,26 @@
    -
    +
    -

    方法(Methods)

    -

    方法是与某些特定类型相关联的功能/函数。类、结构体、枚举都可以定义实例方法;实例方法为指定类型的实例封装了特定的任务与功能。类、结构体、枚举也可以定义类(型)方法(type itself);类型方法与类型自身相关联。类型方法与Objective-C中的类方法(class methods)相似。

    -

    在Swift中,结构体和枚举能够定义方法;事实上这是Swift与C/Objective-C的主要区别之一。在Objective-C中,类是唯一能定义方法的类型。在Swift中,你能够选择是否定义一个类/结构体/枚举,并且你仍然享有在你创建的类型(类/结构体/枚举)上定义方法的灵活性。

    -

    实例方法(Instance Methods)

    -

    实例方法是某个特定类、结构体或者枚举类型的实例的方法。实例方法支撑实例的功能: 或者提供方法,以访问和修改实例属性;或者提供与实例的目的相关的功能。实例方法的语法与函数完全一致,参考函数说明

    -

    实例方法要写在它所属的类型的前后括号之间。实例方法能够访问他所属类型的所有的其他实例方法和属性。实例方法只能被它所属的类的特定实例调用。实例方法不能被孤立于现存的实例而被调用。

    -

    下面是定义一个很简单的类Counter的例子(Counter能被用来对一个动作发生的次数进行计数):

    -
    class Counter {
    +                        
    +

    翻译:pp-prog
    校对:zqp

    +
    +

    方法(Methods)

    +
    +

    本页包含内容:

    + +

    方法是与某些特定类型相关联的函数。类、结构体、枚举都可以定义实例方法;实例方法为给定类型的实例封装了具体的任务与功能。类、结构体、枚举也可以定义类型方法;类型方法与类型本身相关联。类型方法与 Objective-C 中的类方法(class methods)相似。

    +

    结构体和枚举能够定义方法是 Swift 与 C/Objective-C 的主要区别之一。在 Objective-C 中,类是唯一能定义方法的类型。但在 Swift 中,你不仅能选择是否要定义一个类/结构体/枚举,还能灵活的在你创建的类型(类/结构体/枚举)上定义方法。

    +

    +

    实例方法(Instance Methods)

    +

    实例方法是属于某个特定类、结构体或者枚举类型实例的方法。实例方法提供访问和修改实例属性的方法或提供与实例目的相关的功能,并以此来支撑实例的功能。实例方法的语法与函数完全一致,详情参见函数

    +

    实例方法要写在它所属的类型的前后大括号之间。实例方法能够隐式访问它所属类型的所有的其他实例方法和属性。实例方法只能被它所属的类的某个特定实例调用。实例方法不能脱离于现存的实例而被调用。

    +

    下面的例子,定义一个很简单的类CounterCounter能被用来对一个动作发生的次数进行计数:

    +
    class Counter {
       var count = 0
       func increment() {
         count++
    @@ -608,59 +626,65 @@
         count = 0
       }
     }
    -

    Counter类定理了三个实例方法:

    +
    +

    Counter类定义了三个实例方法:

    • increment让计数器按一递增;
    • incrementBy(amount: Int)让计数器按一个指定的整数值递增;
    • reset将计数器重置为0。

    Counter这个类还声明了一个可变属性count,用它来保持对当前计数器值的追踪。

    -

    和调用属性一样,用点语法(dot syntax)调用实例方法:

    -
     let counter = Counter()
    - // the initial counter value is 0
    +

    和调用属性一样,用点语法(dot syntax)调用实例方法:

    +
     let counter = Counter()
    + // 初始计数值是0
      counter.increment()
    - // the counter's value is now 1
    + // 计数值现在是1
      counter.incrementBy(5)
    - // the counter's value is now 6
    + // 计数值现在是6
      counter.reset()
    - // the counter's value is now 0
    -

    方法的局部参数名称和外部参数名称(Local and External Parameter Names for Methods)

    -

    函数参数有一个局部名称(在函数体内部使用)和一个外部名称(在调用函数时使用),参考External Parameter Names。对于方法参数也是这样,因为方法就是函数(只是这个函数与某个类型相关联了)。但是,方法和函数的局部名称和外部名称的默认行为是不一样的。

    -

    Swift中的方法和Objective-C中的方法极其相似。像在Objective-C中一样,Swift中方法的名称通常用一个介词指向方法的第一个参数,比如:with,for,by等等。前面的Counter类的例子中incrementBy方法就是这样的。介词的使用让方法在被调用时能像一个句子一样被解读。Swift这种方法命名约定很容易落实,因为它是用不同的默认处理方法参数的方式,而不是用函数参数(来实现的)。

    -

    具体来说,Swift默认仅给方法的第一个参数名称一个局部参数名称;但是默认同时给第二个和后续的参数名称局部参数名称和外部参数名称。 -这个约定与典型的命名和调用约定相匹配,这与你在写Objective-C的方法时很相似。这个约定还让expressive method调用不需要再检查/限定参数名。

    -

    看看下面这个Counter的替换版本(它定义了一个更复杂的incrementBy方法):

    -
    class Counter {
    + // 计数值现在是0
    +
    +

    +

    方法的局部参数名称和外部参数名称(Local and External Parameter Names for Methods)

    +

    函数参数可以同时有一个局部名称(在函数体内部使用)和一个外部名称(在调用函数时使用),详情参见函数的外部参数名。方法参数也一样(因为方法就是函数,只是这个函数与某个类型相关联了)。但是,方法和函数的局部名称和外部名称的默认行为是不一样的。

    +

    Swift 中的方法和 Objective-C 中的方法极其相似。像在 Objective-C 中一样,Swift 中方法的名称通常用一个介词指向方法的第一个参数,比如:withforby等等。前面的Counter类的例子中incrementBy方法就是这样的。介词的使用让方法在被调用时能像一个句子一样被解读。和函数参数不同,对于方法的参数,Swift 使用不同的默认处理方式,这可以让方法命名规范更容易写。

    +

    具体来说,Swift 默认仅给方法的第一个参数名称一个局部参数名称;默认同时给第二个和后续的参数名称局部参数名称和外部参数名称。这个约定与典型的命名和调用约定相适应,与你在写 Objective-C 的方法时很相似。这个约定还让表达式方法在调用时不需要再限定参数名称。

    +

    看看下面这个Counter的另一个版本(它定义了一个更复杂的incrementBy方法):

    +
    class Counter {
       var count: Int = 0
       func incrementBy(amount: Int, numberOfTimes: Int) {
         count += amount * numberOfTimes
       }
     }
    -

    incrementBy方法有两个参数: amountnumberOfTimes。默认地,Swift只把amount当作一个局部名称,但是把numberOfTimes即看作本地名称又看作外部名称。下面调用这个方法:

    -
    let counter = Counter()
    +
    +

    incrementBy方法有两个参数: amountnumberOfTimes。默认情况下,Swift 只把amount当作一个局部名称,但是把numberOfTimes即看作局部名称又看作外部名称。下面调用这个方法:

    +
    let counter = Counter()
     counter.incrementBy(5, numberOfTimes: 3)
     // counter value is now 15
    -

    你不必为第一个参数值再定义一个外部变量名:因为从函数名incrementBy已经能很清楚地看出它的目的/作用。但是第二个参数,就要被一个外部参数名称所限定,以便在方法被调用时让他目的/作用明确。

    -

    这种默认的行为能够有效的检查方法,比如你在参数numberOfTimes前写了个井号( # )时:

    -
    func incrementBy(amount: Int, #numberOfTimes: Int) {
    - count += amount * numberOfTimes
    +
    +

    你不必为第一个参数值再定义一个外部变量名:因为从函数名incrementBy已经能很清楚地看出它的作用。但是第二个参数,就要被一个外部参数名称所限定,以便在方法被调用时明确它的作用。

    +

    这种默认的行为能够有效的处理方法(method),类似于在参数numberOfTimes前写一个井号(#):

    +
    func incrementBy(amount: Int, #numberOfTimes: Int) {
    +  count += amount * numberOfTimes
     }
    -

    这种默认行为使上面代码意味着:在Swift中定义方法使用了与Objective-C同样的语法风格,并且方法将以自然表达式的方式被调用。

    -

    修改外部参数名称(Modifying External Parameter Name Behavior for Methods)

    -

    有时为方法的第一个参数提供一个外部参数名称是非常有用的,尽管这不是默认的行为。你可以自己添加一个明确的外部名称;你也可以用一个hash符号作为第一个参数的前缀,然后用这个局部名字作为外部名字。

    -

    相反,如果你不想为方法的第二个及后续的参数提供一个外部名称,你可以通过使用下划线(_)作为该参数的显式外部名称来覆盖默认行为。

    -

    self属性(The self Property)

    -

    类型的每一个实例都有一个隐含属性叫做self,它完全等同于这个实力变量本身。你可以在一个实例的实例方法中使用这个隐含的self属性来引用当前实例。

    -

    上面例子中的increment方法可以被写成这样:

    -
    func increment() {
    +
    +

    这种默认行为使上面代码意味着:在 Swift 中定义方法使用了与 Objective-C 同样的语法风格,并且方法将以自然表达式的方式被调用。

    +

    +

    修改方法的外部参数名称(Modifying External Parameter Name Behavior for Methods)

    +

    有时为方法的第一个参数提供一个外部参数名称是非常有用的,尽管这不是默认的行为。你可以自己添加一个显式的外部名称或者用一个井号(#)作为第一个参数的前缀来把这个局部名称当作外部名称使用。

    +

    相反,如果你不想为方法的第二个及后续的参数提供一个外部名称,可以通过使用下划线(_)作为该参数的显式外部名称,这样做将覆盖默认行为。

    +

    +

    self属性(The self Property)

    +

    类型的每一个实例都有一个隐含属性叫做selfself完全等同于该实例本身。你可以在一个实例的实例方法中使用这个隐含的self属性来引用当前实例。

    +

    上面例子中的increment方法还可以这样写:

    +
    func increment() {
       self.count++
     }
    -

    实际上,你不必在你的代码里面经常写self。不论何时,在一个方法中使用一个已知的属性或者方法名称,如果你没有明确的写self,Swift假定你是指当前实例的属性或者方法。这种假定在上面的Counter中已经示范了:Counter中的三个实例方法中都使用的是count(而不是self.count)

    -

    这条规则的主要例外发生在当实例方法的某个参数名称与实例的某个属性名称相同时。 -在这种情况下,参数名称享有优先权,并且在引用属性时必须使用一种更恰当(被限定更严格)的方式。 -你可以使用隐藏的self属性来区分参数名称和属性名称。

    -

    下面的例子演示了self消除方法参数x和实例属性x之间的歧义:

    -
    struct Point {
    +
    +

    实际上,你不必在你的代码里面经常写self。不论何时,只要在一个方法中使用一个已知的属性或者方法名称,如果你没有明确的写self,Swift 假定你是指当前实例的属性或者方法。这种假定在上面的Counter中已经示范了:Counter中的三个实例方法中都使用的是count(而不是self.count)。

    +

    使用这条规则的主要场景是实例方法的某个参数名称与实例的某个属性名称相同的时候。在这种情况下,参数名称享有优先权,并且在引用属性时必须使用一种更严格的方式。这时你可以使用self属性来区分参数名称和属性名称。

    +

    下面的例子中,self消除方法参数x和实例属性x之间的歧义:

    +
    struct Point {
       var x = 0.0, y = 0.0
       func isToTheRightOfX(x: Double) -> Bool {
         return self.x > x
    @@ -670,13 +694,15 @@ let somePoint = Point(x: 4.0, y: 5.0)
     if somePoint.isToTheRightOfX(1.0) {
       println("This point is to the right of the line where x == 1.0")
     }
    -// prints "This point is to the right of the line where x == 1.0"
    -

    如果不使用self前缀,Swift就认为两次使用的x都指的是名称为x的函数参数。

    +// 输出 "This point is to the right of the line where x == 1.0"(这个点在x等于1.0这条线的右边) +
    +

    如果不使用self前缀,Swift 就认为两次使用的x都指的是名称为x的函数参数。

    +

    在实例方法中修改值类型(Modifying Value Types from Within Instance Methods)

    -

    结构体和枚举是值类型Structures and Enumerations Are Value Types。一般情况下,值类型的属性不能在他的实例方法中被修改。

    -

    但是,如果你确实需要在某个具体的方法中修改结构体或者枚举的属性,你可以选择变异(mutating)这个方法。方法可以从内部变异它的属性;并且它做的任何改变在方法结束时都会回写到原始结构。方法会给它隐含的self属性赋值一个全新的实例,这个新实例在方法结束后将替换原来的实例。

    -

    变异方法, 将关键字mutating 放到方法的func关键字之前就可以了:

    -
    struct Point {
    +

    结构体和枚举是值类型。一般情况下,值类型的属性不能在它的实例方法中被修改。

    +

    但是,如果你确实需要在某个具体的方法中修改结构体或者枚举的属性,你可以选择变异(mutating)这个方法,然后方法就可以从方法内部改变它的属性;并且它做的任何改变在方法结束时还会保留在原始结构中。方法还可以给它隐含的self属性赋值一个全新的实例,这个新实例在方法结束后将替换原来的实例。

    +

    要使用变异方法, 将关键字mutating 放到方法的func关键字之前就可以了:

    +
    struct Point {
       var x = 0.0, y = 0.0
       mutating func moveByX(deltaX: Double, y deltaY: Double) {
         x += deltaX
    @@ -686,23 +712,27 @@ if somePoint.isToTheRightOfX(1.0) {
     var somePoint = Point(x: 1.0, y: 1.0)
     somePoint.moveByX(2.0, y: 3.0)
     println("The point is now at (\(somePoint.x), \(somePoint.y))")
    -// prints "The point is now at (3.0, 4.0)"
    -

    上面的Point结构体定义了一个变异方法(mutating method)moveByXmoveByX用来移动一个point。moveByX方法在被调用时修改了这个point,而不是返回一个新的point。方法定义是加上那个了mutating关键字,所以方法可以修改值类型的属性了。

    -

    注意:不能在结构体类型的常量上调用变异方法,因为常量的属性不能被改变,就算你想改变的是常量的可变属性也不行,参考Stored Properties of Constant Structure Instances

    -
    let fixedPoint = Point(x: 3.0, y: 3.0)
    +// 输出 "The point is now at (3.0, 4.0)"
    +
    +

    上面的Point结构体定义了一个变异方法(mutating method)moveByXmoveByX用来移动点。moveByX方法在被调用时修改了这个点,而不是返回一个新的点。方法定义时加上mutating关键字,这才让方法可以修改值类型的属性。

    +

    注意:不能在结构体类型常量上调用变异方法,因为常量的属性不能被改变,即使想改变的是常量的变量属性也不行,详情参见存储属性和实例变量

    +
    let fixedPoint = Point(x: 3.0, y: 3.0)
     fixedPoint.moveByX(2.0, y: 3.0)
     // this will report an error
    -

    在变异方法中给self赋值(Assigning to self Within a Mutating Method)

    +
    +

    +

    在变异方法中给self赋值(Assigning to self Within a Mutating Method)

    变异方法能够赋给隐含属性self一个全新的实例。上面Point的例子可以用下面的方式改写:

    -
    struct Point {
    +
    struct Point {
       var x = 0.0, y = 0.0
       mutating func moveByX(deltaX: Double, y deltaY: Double) {
         self = Point(x: x + deltaX, y: y + deltaY)
       }
     }
    -

    新版的变异方法moveByX创建了一个新的分支结构(他的x和y的值都被设定为目标值了)。调用这个版本的方法和调用上个版本的最终结果是一样的。

    -

    枚举的变异方法可以让self从相同的枚举设置为不同的成员。

    -
    enum TriStateSwitch {
    +
    +

    新版的变异方法moveByX创建了一个新的结构(它的 x 和 y 的值都被设定为目标值)。调用这个版本的方法和调用上个版本的最终结果是一样的。

    +

    枚举的变异方法可以把self设置为相同的枚举类型中不同的成员:

    +
    enum TriStateSwitch {
       case Off, Low, High
       mutating func next() {
         switch self {
    @@ -717,28 +747,30 @@ fixedPoint.moveByX(2.0, y: 3.0)
     }
     var ovenLight = TriStateSwitch.Low
     ovenLight.next()
    -// ovenLight is now equal to .High
    +// ovenLight 现在等于 .High
     ovenLight.next()
    -// ovenLight is now equal to .Off
    -

    上面的例子中定义了一个三态开关的枚举。每次调用next方法时,开关在不同的电源状态(Off,Low,High)之前循环切换。

    -

    类型方法(Type Methods)

    -

    实例方法是被类型的某个实例调用的方法。你也可以定义类列本身调用的方法,这种方法就叫做类型方法。声明类的类型方法,在方法的func关键字之前加上关键字class;声明结构体和枚举的类型方法,在方法的func关键字之前加上关键字static

    +// ovenLight 现在等于 .Off +
    +

    上面的例子中定义了一个三态开关的枚举。每次调用next方法时,开关在不同的电源状态(OffLowHigh)之前循环切换。

    +

    +

    类型方法(Type Methods)

    +

    实例方法是被类型的某个实例调用的方法。你也可以定义类型本身调用的方法,这种方法就叫做类型方法。声明类的类型方法,在方法的func关键字之前加上关键字class;声明结构体和枚举的类型方法,在方法的func关键字之前加上关键字static

    -

    注意:

    -

    在Objective-C里面,你只能为Objective-C的类定义类型方法(type-level methods)。在Swift中,你可以为所有的类、结构体和枚举定义类型方法:Each type method is explicitly scoped to the type it supports.

    +

    注意:
    在 Objective-C 里面,你只能为 Objective-C 的类定义类型方法(type-level methods)。在 Swift 中,你可以为所有的类、结构体和枚举定义类型方法:每一个类型方法都被它所支持的类型显式包含。

    -

    类型方法和实例方法一样用点语法调用。但是,你是在类型上调用这个方法,而不是在实例上调用。下面是如何在SomeClass类上调用类型方法的例子:

    -
    class SomeClass {
    +

    类型方法和实例方法一样用点语法调用。但是,你是在类型层面上调用这个方法,而不是在实例层面上调用。下面是如何在SomeClass类上调用类型方法的例子:

    +
    class SomeClass {
       class func someTypeMethod() {
         // type method implementation goes here
       }
     }
     SomeClass.someTypeMethod()
    -

    在类型方法的方法体(body)中,self指向这个类型本身,而不是类型的某个实例。对于结构体和枚举来说,这意味着你可以用self来消除静态属性和静态方法参数之间的二意性(类似于我们在前面处理实例属性和实例方法参数时做的那样)。

    -

    一般地,在类型方法里面所使用的任何未限定的方法和属性名称,将会指向其他的类型级别的方法和属性。一个类型方法可以用另一个类型方法的名称调用踏,而无需在方法名称前面加上类型名称的前缀。同样,结构体和枚举的类型方法也能够直接通过静态属性的名称访问静态属性,而不需要类型名称前缀。

    -

    下面的例子定义了一个名为LevelTracker结构体。它监测玩家的发展情况(游戏的不同层次或阶段)。这是一个单人游戏,但也可以用作多玩家游戏中单个设备上的信息存储。

    -

    游戏初始时,所有的游戏等级(除了等级1)都被锁定。每次有玩家完成一个等级,这个等级就对这个设备上的所有玩家解锁。LevelTracker结构体用静态属性和方法监测游戏的哪个等级已经被解锁。他还监测每个玩家的当前等级。

    -
    struct LevelTracker {
    +
    +

    在类型方法的方法体(body)中,self指向这个类型本身,而不是类型的某个实例。对于结构体和枚举来说,这意味着你可以用self来消除静态属性和静态方法参数之间的歧义(类似于我们在前面处理实例属性和实例方法参数时做的那样)。

    +

    一般来说,任何未限定的方法和属性名称,将会来自于本类中另外的类型级别的方法和属性。一个类型方法可以调用本类中另一个类型方法的名称,而无需在方法名称前面加上类型名称的前缀。同样,结构体和枚举的类型方法也能够直接通过静态属性的名称访问静态属性,而不需要类型名称前缀。

    +

    下面的例子定义了一个名为LevelTracker结构体。它监测玩家的游戏发展情况(游戏的不同层次或阶段)。这是一个单人游戏,但也可以存储多个玩家在同一设备上的游戏信息。

    +

    游戏初始时,所有的游戏等级(除了等级 1)都被锁定。每次有玩家完成一个等级,这个等级就对这个设备上的所有玩家解锁。LevelTracker结构体用静态属性和方法监测游戏的哪个等级已经被解锁。它还监测每个玩家的当前等级。

    +
    struct LevelTracker {
       static var highestUnlockedLevel = 1
       static func unlockLevel(level: Int) {
         if level > highestUnlockedLevel { highestUnlockedLevel = level }
    @@ -756,12 +788,13 @@ SomeClass.someTypeMethod()
         }
       }
     }
    -

    LevelTracker监测玩家的已解锁的最高等级。这个值被存储在静态属性highestUnlockedLevel中。

    -

    LevelTracker还定义了两个类型方法与highestUnlockedLevel配合工作。第一个类型方法是unlockLevel:一旦新等级被解锁,它会更新highestUnlockedLevel的值。第二个类型方法是levelIsUnlocked:如果某个给定的等级已经被解锁,他返回true。(注意:我们没用使用LevelTracker.highestUnlockedLevel,这个类型方法还是能够访问静态属性highestUnlockedLevel)

    -

    除了静态属性和类型方法,LevelTracker还监测每个玩家的进度。它用实例属性currentLevel来监测玩家当前正在进行的等级。

    -

    为了便于管理currentLevel属性,LevelTracker定义了实例方法advanceToLevel。这个方法会在更新currentLevel之前检查所请求的新等级是否已经解锁。advanceToLevel方法返回布尔值以指示是否确实能够设置currentLevel了。

    +
    +

    LevelTracker监测玩家的已解锁的最高等级。这个值被存储在静态属性highestUnlockedLevel中。

    +

    LevelTracker还定义了两个类型方法与highestUnlockedLevel配合工作。第一个类型方法是unlockLevel:一旦新等级被解锁,它会更新highestUnlockedLevel的值。第二个类型方法是levelIsUnlocked:如果某个给定的等级已经被解锁,它将返回true。(注意:尽管我们没有使用类似LevelTracker.highestUnlockedLevel的写法,这个类型方法还是能够访问静态属性highestUnlockedLevel

    +

    除了静态属性和类型方法,LevelTracker还监测每个玩家的进度。它用实例属性currentLevel来监测玩家当前的等级。

    +

    为了便于管理currentLevel属性,LevelTracker定义了实例方法advanceToLevel。这个方法会在更新currentLevel之前检查所请求的新等级是否已经解锁。advanceToLevel方法返回布尔值以指示是否能够设置currentLevel

    下面,Player类使用LevelTracker来监测和更新每个玩家的发展进度:

    -
    class Player {
    +
    class Player {
       var tracker = LevelTracker()
       let playerName: String
       func completedLevel(level: Int) {
    @@ -772,21 +805,24 @@ SomeClass.someTypeMethod()
         playerName = name
       }
     }
    -

    Player类创建一个新的LevelTracker实例来检测这个用户的发展进度。他提供了completedLevel方法:一旦玩家完成某个指定等级就调用它。这个方法为所有玩家解锁下一等级,并且将当前玩家的进度更新为下一等级。(我们忽略了advanceToLevel返回的布尔值,因为之前调用LevelTracker.unlockLevel时就知道了这个等级已经被解锁了)

    +
    +

    Player类创建一个新的LevelTracker实例来监测这个用户的发展进度。它提供了completedLevel方法:一旦玩家完成某个指定等级就调用它。这个方法为所有玩家解锁下一等级,并且将当前玩家的进度更新为下一等级。(我们忽略了advanceToLevel返回的布尔值,因为之前调用LevelTracker.unlockLevel时就知道了这个等级已经被解锁了)。

    你还可以为一个新的玩家创建一个Player的实例,然后看这个玩家完成等级一时发生了什么:

    -
    var player = Player(name: "Argyrios")
    +
    var player = Player(name: "Argyrios")
     player.completedLevel(1)
     println("highest unlocked level is now \(LevelTracker.highestUnlockedLevel)")
    -// prints "highest unlocked level is now 2"
    -

    如果你创建了第二个玩家,并尝试让他开始一个没有被任何玩家解锁的等级,你试图去设置玩家当前等级时会失败的:

    -
    player = Player(name: "Beto")
    -if player.tracker.advanceToLevel(6) {
    -println("player is now on level 6")
    -} else {
    -println("level 6 has not yet been unlocked")
    -}
    -// prints "level 6 has not yet been unlocked"
    +// 输出 "highest unlocked level is now 2"(最高等级现在是2)
     
    +

    如果你创建了第二个玩家,并尝试让它开始一个没有被任何玩家解锁的等级,那么这次设置玩家当前等级的尝试将会失败:

    +
    player = Player(name: "Beto")
    +if player.tracker.advanceToLevel(6) {
    +  println("player is now on level 6")
    +} else {
    +  println("level 6 has not yet been unlocked")
    +}
    +// 输出 "level 6 has not yet been unlocked"(等级6还没被解锁)
    +
    +
    @@ -798,22 +834,14 @@ println("level 6 has not yet been unlocked") - +
    - - - - - - - - - - + + @@ -831,6 +859,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/12_Subscripts.html b/chapter2/12_Subscripts.html index 67fd7a6a..e539b386 100644 --- a/chapter2/12_Subscripts.html +++ b/chapter2/12_Subscripts.html @@ -1,57 +1,45 @@ - - + - 附属脚本 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,68 +595,83 @@
    -
    +
    -

    下标 (Subscripts)

    -

    下标可以定义在类(Class)、结构体(structures)和枚举(enumerations)这些目标中,可以认为是访问对象、集合或序列的快捷方式。举例来说,用下标访问一个数组(Array)实例中的元素可以这样写 someArray[index] ,访问字典(Dictionary)实例中的元素可以这样写 someDictionary[key],而不需要再调用实例的某个方法来获得元素的值。

    -

    对于同一个目标可以定义多个下标,通过索引值类型的不同来进行重载,而且索引值的个数可以是多个。

    -
    -

    译者:这里下标重载在本小节中原文并没有任何演示

    +
    +

    翻译:siemenliu
    校对:zq54zquan

    -

    下标语法

    -

    下标允许你通过在实例后面的方括号中传入一个或者多个的索引值来对实例进行访问和赋值。语法类似于实例方法和实例属性的混合。与定义实例方法类似,定义下标使用subscript关键字,显式声明入参(一个或多个)和返回类型。与实例方法不同的是下标可以设定为读写或只读。这种方式又有点像实例属性的getter和setter:

    -
    subscript(index: Int) -> Int {
    +

    下标脚本(Subscripts)

    +
    +

    本页包含内容:

    + +

    下标脚本 可以定义在类(Class)、结构体(structure)和枚举(enumeration)这些目标中,可以认为是访问对象、集合或序列的快捷方式,不需要再调用实例的特定的赋值和访问方法。举例来说,用下标脚本访问一个数组(Array)实例中的元素可以这样写 someArray[index] ,访问字典(Dictionary)实例中的元素可以这样写 someDictionary[key]

    +

    对于同一个目标可以定义多个下标脚本,通过索引值类型的不同来进行重载,而且索引值的个数可以是多个。

    +
    +

    译者:这里附属脚本重载在本小节中原文并没有任何演示

    +
    +

    +

    下标脚本语法

    +

    下标脚本允许你通过在实例后面的方括号中传入一个或者多个的索引值来对实例进行访问和赋值。语法类似于实例方法和计算型属性的混合。与定义实例方法类似,定义下标脚本使用subscript关键字,显式声明入参(一个或多个)和返回类型。与实例方法不同的是下标脚本可以设定为读写或只读。这种方式又有点像计算型属性的getter和setter:

    +
    subscript(index: Int) -> Int {
         get {
    -        // 返回与入参匹配的Int类型的值
    +      // 返回与入参匹配的Int类型的值
         }
     
         set(newValue) {
    -        // 执行赋值操作
    +      // 执行赋值操作
         }
     }
    -

    newValue的类型必须和下标定义的返回类型相同。与实例属性相同的是set的入参声明newValue就算不写,在set代码块中依然可以使用newValue这个变量来访问新赋的值。

    -

    与只读实例属性一样,可以直接将原本应该写在get代码块中的代码写在subscript中即可:

    -
    subscript(index: Int) -> Int {
    +
    +

    newValue的类型必须和下标脚本定义的返回类型相同。与计算型属性相同的是set的入参声明newValue就算不写,在set代码块中依然可以使用默认的newValue这个变量来访问新赋的值。

    +

    与只读计算型属性一样,可以直接将原本应该写在get代码块中的代码写在subscript中:

    +
    subscript(index: Int) -> Int {
         // 返回与入参匹配的Int类型的值
     }
    -

    下面代码演示了一个在TimesTable结构体中使用只读下标的用法,该结构体用来展示传入整数的N倍。

    -
    struct TimesTable {
    +
    +

    下面代码演示了一个在TimesTable结构体中使用只读下标脚本的用法,该结构体用来展示传入整数的n倍。

    +
    struct TimesTable {
         let multiplier: Int
         subscript(index: Int) -> Int {
    -        return multiplier * index
    +      return multiplier * index
         }
     }
     let threeTimesTable = TimesTable(multiplier: 3)
     println("3的6倍是\(threeTimesTable[6])")
     // 输出 "3的6倍是18"
    -

    在上例中,通过TimesTable结构体创建了一个用来表示索引值三倍的实例。数值3作为结构体构造函数入参表示这个值将成为实例成员multiplier的值。

    -

    你可以通过下标来来得到结果,比如threeTimesTable[6]。这句话访问了threeTimesTable的第六个元素,返回18或者6的3倍。

    +
    +

    在上例中,通过TimesTable结构体创建了一个用来表示索引值三倍的实例。数值3作为结构体构造函数入参初始化实例成员multiplier

    +

    你可以通过下标脚本来得到结果,比如threeTimesTable[6]。这条语句访问了threeTimesTable的第六个元素,返回63倍即18

    -

    提示

    -

    TimesTable例子是基于一个固定的数学公式。它并不适合开放写权限来对threeTimesTable[someIndex]进行赋值操作,这也是为什么下标只定义为只读的原因。

    +

    注意:
    TimesTable例子是基于一个固定的数学公式。它并不适合开放写权限来对threeTimesTable[someIndex]进行赋值操作,这也是为什么附属脚本只定义为只读的原因。

    -

    下标用法

    -

    下标根据使用场景不同也具有不同的含义。通常下标是用来访问集合(collection),列表(list)或序列(sequence)中元素的快捷方式。你可以为特定的类或结构体中自由的实现下标来提供合适的功能。

    -

    例如,Swift的字典(Dictionary)实现了通过下标来对其实例中存放的值进行存取操作。在字典中设值可以通过给字典提供一个符合字典索引类型的索引值的表达式赋一个与字典存放值类型匹配的值来做到:

    -
    var numberOfLegs = ["spider": 8, "ant": 6, "cat": 4]
    +

    +

    下标脚本用法

    +

    根据使用场景不同下标脚本也具有不同的含义。通常下标脚本是用来访问集合(collection),列表(list)或序列(sequence)中元素的快捷方式。你可以在你自己特定的类或结构体中自由的实现下标脚本来提供合适的功能。

    +

    例如,Swift 的字典(Dictionary)实现了通过下标脚本来对其实例中存放的值进行存取操作。在下标脚本中使用和字典索引相同类型的值,并且把一个字典值类型的值赋值给这个下标脚本来为字典设值:

    +
    var numberOfLegs = ["spider": 8, "ant": 6, "cat": 4]
     numberOfLegs["bird"] = 2
    -

    上例定义一个名为numberOfLegs的变量并用一个字典表达式初始化出了包含三对键值的字典实例。numberOfLegs的字典存放值类型推断为Dictionary<String, Int>。字典实例创建完成之后通过下标的方式将整型值2赋值到字典实例的索引为bird的位置中。

    -

    更多关于字典(Dictionary)下标的信息请参考字典的访问与修改

    +
    +

    上例定义一个名为numberOfLegs的变量并用一个字典字面量初始化出了包含三对键值的字典实例。numberOfLegs的字典存放值类型推断为Dictionary<String, Int>。字典实例创建完成之后通过下标脚本的方式将整型值2赋值到字典实例的索引为bird的位置中。

    +

    更多关于字典(Dictionary)下标脚本的信息请参考读取和修改字典

    -

    提示

    -

    Swift中Dictionary的下标实现中,在get部分返回值是Int?,也就是说不是每个字典的索引都能得到一个整型值,对于没有设过值的索引的访问返回的结果就是nil;同样想要从字典实例中删除某个索引下的值也只需要给这个索引赋值为nil即可。

    +

    注意:
    Swift 中字典的附属脚本实现中,在get部分返回值是Int?,上例中的numberOfLegs字典通过附属脚本返回的是一个Int?或者说“可选的int”,不是每个字典的索引都能得到一个整型值,对于没有设过值的索引的访问返回的结果就是nil;同样想要从字典实例中删除某个索引下的值也只需要给这个索引赋值为nil即可。

    -

    下标选项

    -

    下标允许任意数量的入参索引,并且每个入参类型也没有限制。下标的返回值也可以是任何类型。下标可以使用变量参数和可变参数,但使用in-out参数或给参数设置默认值都是不允许的。

    -

    一个类或结构体可以根据自身需要提供多个下标实现,在定义下标时通过入参个类型进行区分,使用下标时会自动匹配合适的下标实现运行,这就是下标的重载。

    -

    一个下标入参是最常见的情况,但只要有合适的场景也可以定义多个下标入参。如下例定义了一个Matrix结构体,将呈现一个Double类型的二维数组。Matrix结构体的下标需要两个整型参数:

    -
    struct Matrix {
    +

    +

    下标脚本选项

    +

    下标脚本允许任意数量的入参索引,并且每个入参类型也没有限制。下标脚本的返回值也可以是任何类型。下标脚本可以使用变量参数和可变参数,但使用写入读出(in-out)参数或给参数设置默认值都是不允许的。

    +

    一个类或结构体可以根据自身需要提供多个下标脚本实现,在定义下标脚本时通过入参个类型进行区分,使用下标脚本时会自动匹配合适的下标脚本实现运行,这就是下标脚本的重载

    +

    一个下标脚本入参是最常见的情况,但只要有合适的场景也可以定义多个下标脚本入参。如下例定义了一个Matrix结构体,将呈现一个Double类型的二维矩阵。Matrix结构体的下标脚本需要两个整型参数:

    +
    struct Matrix {
         let rows: Int, columns: Int
         var grid: Double[]
         init(rows: Int, columns: Int) {
    -        self.rows = rows
    -        self.columns = columns
    -        grid = Array(count: rows * columns, repeatedValue: 0.0)
    +      self.rows = rows
    +      self.columns = columns
    +      grid = Array(count: rows * columns, repeatedValue: 0.0)
         }
         func indexIsValidForRow(row: Int, column: Int) -> Bool {
             return row >= 0 && row < rows && column >= 0 && column < columns
    @@ -664,32 +687,36 @@ numberOfLegs["bird"] = 2
             }
         }
     }
    -

    Matrix提供了一个两个入参的构造方法,入参分别是rowscolumns,创建了一个足够容纳rows * columns个数的Double类型数组。为了存储,将数组的大小和数组每个元素初始值0.0,都传入数组的构造方法中来创建一个正确大小的新数组。关于数组的构造方法和析构方法请参考Creating and Initializing an Array

    -

    你可以通过传入合适的row和column的数量来构造一个新的Matrix实例:

    -
    var matrix = Matrix(rows: 2, columns: 2)
    -

    上例中创建了一个新的两行两列的Matrix实例。在阅读顺序从左上到右下的Matrix实例中的数组实例grid是矩阵二维数组的扁平化存储:

    -
    // 示意图
    +
    +

    Matrix提供了一个两个入参的构造方法,入参分别是rowscolumns,创建了一个足够容纳rows * columns个数的Double类型数组。为了存储,将数组的大小和数组每个元素初始值0.0,都传入数组的构造方法中来创建一个正确大小的新数组。关于数组的构造方法和析构方法请参考创建并且构造一个数组

    +

    你可以通过传入合适的rowcolumn的数量来构造一个新的Matrix实例:

    +
    var matrix = Matrix(rows: 2, columns: 2)
    +
    +

    上例中创建了一个新的两行两列的Matrix实例。在阅读顺序从左上到右下的Matrix实例中的数组实例grid是矩阵二维数组的扁平化存储:

    +
    // 示意图
     grid = [0.0, 0.0, 0.0, 0.0]
     
    -        col0     col1
    +      col0  col1
     row0   [0.0,     0.0,
    -row1    0.0,     0.0]
    -

    将值赋给带有row和column下标的matrix实例表达式可以完成赋值操作,下标入参使用逗号分割

    -
    matrix[0, 1] = 1.5
    +row1    0.0,  0.0]
    +
    +

    将值赋给带有rowcolumn下标脚本的matrix实例表达式可以完成赋值操作,下标脚本入参使用逗号分割

    +
    matrix[0, 1] = 1.5
     matrix[1, 0] = 3.2
    -

    上面两句话分别让matrix的右上值为1.5,坐下值为3.2:

    -
    [0.0, 1.5,
    +
    +

    上面两条语句分别让matrix的右上值为 1.5,坐下值为 3.2:

    +
    [0.0, 1.5,
      3.2, 0.0]
    -

    Matrix下标的getter和setter中同时调用了下标入参的row和column是否有效的判断。为了方便进行断言,Matrix包含了一个名为indexIsValid的成员方法,用来确认入参的row或column值是否会造成数组越界:

    -
    func indexIsValidForRow(row: Int, column: Int) -> Bool {
    +
    +

    Matrix下标脚本的gettersetter中同时调用了下标脚本入参的rowcolumn是否有效的判断。为了方便进行断言,Matrix包含了一个名为indexIsValid的成员方法,用来确认入参的rowcolumn值是否会造成数组越界:

    +
    func indexIsValidForRow(row: Int, column: Int) -> Bool {
         return row >= 0 && row < rows && column >= 0 && column < columns
     }
    -

    断言在下标越界时触发:

    -
    let someValue = matrix[2, 2]
    +
    +

    断言在下标脚本越界时触发:

    +
    let someValue = matrix[2, 2]
     // 断言将会触发,因为 [2, 2] 已经超过了matrix的最大长度
    -
    -

    译者:这里有个词Computed Properties 这里统一翻译为实例属性了 微软术语引擎里没有这个词

    -
    +
    @@ -708,16 +735,8 @@ matrix[1, 0] = 3.2
    - - - - - - - - - - + + @@ -735,6 +754,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/13_Inheritance.html b/chapter2/13_Inheritance.html index 7f7c5e65..e74e2ec8 100644 --- a/chapter2/13_Inheritance.html +++ b/chapter2/13_Inheritance.html @@ -1,57 +1,45 @@ - - + - 继承 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,19 +595,31 @@
    -
    +
    -

    继承

    -

    一个类可以继承另一个类的方法,属性和其它特性。当一个类继承其它类,继承类叫子类,被继承类叫超类(或父类)。在Swift中,继承是区分「类」与其它类型的一个基本特征。

    -

    在Swift中,类可以调用和访问超类的方法,属性和下标,并且可以重写(override)这些方法,属性和下标来优化或修改它们的行为。Swift会检查你的重写定义在超类中是否有匹配的定义,以此确保你的重写行为是正确的。

    +
    +

    翻译:Hawstein
    校对:menlongsheng

    +
    +

    继承(Inheritance)

    +
    +

    本页包含内容:

    + +

    一个类可以继承(inherit)另一个类的方法(methods),属性(property)和其它特性。当一个类继承其它类时,继承类叫子类(subclass),被继承类叫超类(或父类,superclass)。在 Swift 中,继承是区分「类」与其它类型的一个基本特征。

    +

    在 Swift 中,类可以调用和访问超类的方法,属性和下标脚本(subscripts),并且可以重写(override)这些方法,属性和下标脚本来优化或修改它们的行为。Swift 会检查你的重写定义在超类中是否有匹配的定义,以此确保你的重写行为是正确的。

    可以为类中继承来的属性添加属性观察器(property observer),这样一来,当属性值改变时,类就会被通知到。可以为任何属性添加属性观察器,无论它原本被定义为存储型属性(stored property)还是计算型属性(computed property)。

    -

    定义一个基类

    -

    不继承于其它类的类,称之为基类。

    +

    +

    定义一个基类(Base class)

    +

    不继承于其它类的类,称之为基类(base calss)

    -

    注意:Swift中的类并不是从一个通用的基类继承而来。如果你不为你定义的类指定一个超类的话,这个类就自动成为基类。

    +

    注意:
    Swift 中的类并不是从一个通用的基类继承而来。如果你不为你定义的类指定一个超类的话,这个类就自动成为基类。

    下面的例子定义了一个叫Vehicle的基类。这个基类声明了两个对所有车辆都通用的属性(numberOfWheelsmaxPassengers)。这些属性在description方法中使用,这个方法返回一个String类型的,对车辆特征的描述:

    -
    class Vehicle {
    +
    class Vehicle {
         var numberOfWheels: Int
         var maxPassengers: Int
         func description() -> String {
    @@ -610,73 +630,84 @@
             maxPassengers = 1
         }
     }
    -

    Vehicle类定义了初始化器(initializer)来设置属性的值。初始化器会在构造函数一节中详细介绍,这里我们做一下简单介绍,以便于讲解子类中继承来的属性可以如何被修改。

    -

    初始化器用于创建某个类型的一个新实例。尽管初始化器并不是方法,但在语法上,两者很相似。初始化器的工作是准备新实例以供使用,并确保实例中的所有属性都拥有有效的初始化值。

    -

    初始化器的最简单形式就像一个没有参数的实例方法,使用init关键字:

    -
    init() {
    -    // perform some initialization here
    +
    +

    Vehicle类定义了构造器(initializer)来设置属性的值。构造器会在构造过程一节中详细介绍,这里我们做一下简单介绍,以便于讲解子类中继承来的属性如何被修改。

    +

    构造器用于创建某个类型的一个新实例。尽管构造器并不是方法,但在语法上,两者很相似。构造器的工作是准备新实例以供使用,并确保实例中的所有属性都拥有有效的初始化值。

    +

    构造器的最简单形式就像一个没有参数的实例方法,使用init关键字:

    +
    init() {
    +    // 执行构造过程
     }
    -

    如果要创建一个Vehicle类的新实例,使用初始化器语法调用上面的初始化器,即类名后面跟一个空的小括号:

    -
    let someVehicle = Vehicle()
    -

    这个Vehicle类的初始化器为任意的一辆车设置一些初始化属性值(numberOfWheels = 0maxPassengers = 1)。

    +
    +

    如果要创建一个Vehicle类的新实例,使用构造器语法调用上面的初始化器,即类名后面跟一个空的小括号:

    +
    let someVehicle = Vehicle()
    +
    +

    这个Vehicle类的构造器为任意的一辆车设置一些初始化属性值(numberOfWheels = 0maxPassengers = 1)。

    Vehicle类定义了车辆的共同特性,但这个类本身并没太大用处。为了使它更为实用,你需要进一步细化它来描述更具体的车辆。

    -

    Subclassing(子类化?待定)

    -

    subclassing指的是在一个已有类的基础上创建一个新的类。子类继承超类的特性,并且你可以优化或改变它。你还可以为子类添加新的特性。

    +

    +

    子类生成(Subclassing)

    +

    子类生成(Subclassing)指的是在一个已有类的基础上创建一个新的类。子类继承超类的特性,并且可以优化或改变它。你还可以为子类添加新的特性。

    为了指明某个类的超类,将超类名写在子类名的后面,用冒号分隔:

    -
    class SomeClass: SomeSuperclass {
    -    // class definition goes here
    +
    class SomeClass: SomeSuperclass {
    +    // 类的定义
     }
    -

    下一个例子,定义一个更具体的车辆类叫Bicycle。这个新类是在Vehicle类的基础上创建起来。因此你需要将Vehicle类放在Bicycle类后面,用冒号分隔。

    +
    +

    下一个例子,定义一个更具体的车辆类叫Bicycle。这个新类是在 Vehicle类的基础上创建起来。因此你需要将Vehicle类放在 Bicycle类后面,用冒号分隔。

    我们可以将这读作:

    “定义一个新的类叫Bicycle,它继承了Vehicle的特性”;

    -
    class Bicycle: Vehicle {
    +
    class Bicycle: Vehicle {
         init() {
             super.init()
             numberOfWheels = 2
         }
     }
    -

    BicycleVehicle的子类,VehicleBicycle的超类。新的Bicycle类自动获得Vehicle类的特性,比如maxPassengersnumberOfWheels属性。你可以在子类中定制这些特性,或添加新的特性来更好地描述Bicycle类。

    -

    Bicycle类定义了一个初始化器来设置它定制的特性(自行车只有2个轮子)。Bicycle的初始化器调用了它父类Vehicle的初始化器super.init(),以此确保在Bicycle类试图修改那些继承来的属性前,Vehicle类已经初始化过它们了。

    +
    +

    preview + BicycleVehicle的子类,VehicleBicycle的超类。新的Bicycle类自动获得Vehicle类的特性,比如 maxPassengersnumberOfWheels属性。你可以在子类中定制这些特性,或添加新的特性来更好地描述Bicycle类。

    +

    Bicycle类定义了一个构造器来设置它定制的特性(自行车只有2个轮子)。Bicycle的构造器调用了它父类Vehicle的构造器 super.init(),以此确保在Bicycle类试图修改那些继承来的属性前Vehicle类已经初始化过它们了。

    -

    注意:不像Objective-C,在Swift中,初始化器默认是不继承的,见初始化器的继承与重写

    +

    注意:
    不像 Objective-C,在 Swift 中,初始化器默认是不继承的,见初始化器的继承与重写

    -

    Vehicle类中maxPassengers的默认值对自行车来说已经是正确的,因此在Bicycle的初始化器中并没有改变它。而numberOfWheels原来的值对自行车来说是不正确的,因此在初始化器中将它更改为2。

    +

    Vehicle类中maxPassengers的默认值对自行车来说已经是正确的,因此在Bicycle的构造器中并没有改变它。而numberOfWheels原来的值对自行车来说是不正确的,因此在初始化器中将它更改为 2。

    Bicycle不仅可以继承Vehicle的属性,还可以继承它的方法。如果你创建了一个Bicycle类的实例,你就可以调用它继承来的description方法,并且可以看到,它输出的属性值已经发生了变化:

    -
    let bicycle = Bicycle()
    +
    let bicycle = Bicycle()
     println("Bicycle: \(bicycle.description())")
     // Bicycle: 2 wheels; up to 1 passengers
    -

    子类还可以继续被其它类继承:

    -
    class Tandem: Bicycle {
    +
    +

    子类还可以继续被其它类继承:

    +
    class Tandem: Bicycle {
         init() {
             super.init()
             maxPassengers = 2
         }
     }
    -

    上面的例子创建了Bicycle的一个子类:双人自行车(tandem)。TandemBicycle继承了两个属性,而这两个属性是BicycleVehicle继承而来的。Tandem并不修改轮子的数量,因为它仍是一辆自行车,有2个轮子。但它需要修改maxPassengers的值,因为双人自行车可以坐两个人。

    +
    +

    上面的例子创建了Bicycle的一个子类:双人自行车(tandem)。TandemBicycle继承了两个属性,而这两个属性是BicycleVehicle继承而来的。Tandem并不修改轮子的数量,因为它仍是一辆自行车,有 2 个轮子。但它需要修改maxPassengers的值,因为双人自行车可以坐两个人。

    -

    注意:子类只允许修改从超类继承来的变量属性,而不能修改继承来的常量属性。

    +

    注意:
    子类只允许修改从超类继承来的变量属性,而不能修改继承来的常量属性。

    创建一个Tandem类的实例,打印它的描述,即可看到它的属性已被更新:

    -
    let tandem = Tandem()
    +
    let tandem = Tandem()
     println("Tandem: \(tandem.description())")
     // Tandem: 2 wheels; up to 2 passengers
    -

    注意,Tandem类也继承了description方法。一个类的实例方法会被这个类的所有子类继承。

    +
    +

    注意,Tandem类也继承了description方法。一个类的实例方法会被这个类的所有子类继承。

    +

    重写(Overriding)

    -

    子类可以为继承来的实例方法(instance method),类方法(class method),实例属性(instance property),或下标(subscript)提供自己定制的实现(implementation)。我们把这种行为叫重写(overriding)。

    +

    子类可以为继承来的实例方法(instance method),类方法(class method),实例属性(instance property),或下标脚本(subscript)提供自己定制的实现(implementation)。我们把这种行为叫重写(overriding)

    如果要重写某个特性,你需要在重写定义的前面加上override关键字。这么做,你就表明了你是想提供一个重写版本,而非错误地提供了一个相同的定义。意外的重写行为可能会导致不可预知的错误,任何缺少override关键字的重写都会在编译时被诊断为错误。

    -

    override关键字会提醒Swift编译器去检查该类的超类(或其中一个父类)是否有匹配重写版本的声明。这个检查可以确保你的重写定义是正确的。

    -

    访问超类的方法,属性及下标

    -

    当你在子类中重写超类的方法,属性或下标时,有时在你的重写版本中使用已经存在的超类实现会大有裨益。比如,你可以优化已有实现的行为,或在一个继承来的变量中存储一个修改过的值。

    -

    在合适的地方,你可以通过使用super前缀来访问超类版本的方法,属性或下标:

    +

    override关键字会提醒 Swift 编译器去检查该类的超类(或其中一个父类)是否有匹配重写版本的声明。这个检查可以确保你的重写定义是正确的。

    +

    访问超类的方法,属性及下标脚本

    +

    当你在子类中重写超类的方法,属性或下标脚本时,有时在你的重写版本中使用已经存在的超类实现会大有裨益。比如,你可以优化已有实现的行为,或在一个继承来的变量中存储一个修改过的值。

    +

    在合适的地方,你可以通过使用super前缀来访问超类版本的方法,属性或下标脚本:

    • 在方法someMethod的重写实现中,可以通过super.someMethod()来调用超类版本的someMethod方法。
    • -
    • 在属性someProperty的getter或setter的重写实现中,可以通过super.someProperty来访问超类版本的someProperty属性。
    • -
    • 在下标的重写实现中,可以通过super[someIndex]来访问超类版本中的相同下标。
    • +
    • 在属性someProperty的 getter 或 setter 的重写实现中,可以通过super.someProperty来访问超类版本的someProperty属性。
    • +
    • 在下标脚本的重写实现中,可以通过super[someIndex]来访问超类版本中的相同下标脚本。

    重写方法

    在子类中,你可以重写继承来的实例方法或类方法,提供一个定制或替代的方法实现。

    -

    下面的例子定义了Vehicle的一个新的子类,叫Car,它重写了从Vehicle类继承来的'description'方法:

    -
    class Car: Vehicle {
    +

    下面的例子定义了Vehicle的一个新的子类,叫Car,它重写了从Vehicle类继承来的description方法:

    +
    class Car: Vehicle {
         var speed: Double = 0.0
         init() {
             super.init()
    @@ -688,23 +719,25 @@ println("Tandem: \(tandem.description())")
                 + "traveling at \(speed) mph"
         }
     }
    -

    Car声明了一个新的存储型属性speed,它是Double类型的,默认值是0.0,表示“时速是0英里”。'Car'有自己的初始化器,它将乘客的最大数量设为5,轮子数量设为4。

    +
    +

    Car声明了一个新的存储型属性speed,它是Double类型的,默认值是0.0,表示“时速是0英里”。Car有自己的初始化器,它将乘客的最大数量设为5,轮子数量设为4。

    Car重写了继承来的description方法,它的声明与Vehicle中的description方法一致,声明前面加上了override关键字。

    Car中的description方法并非完全自定义,而是通过super.description使用了超类Vehicle中的description方法,然后再追加一些额外的信息,比如汽车的当前速度。

    如果你创建一个Car的新实例,并打印description方法的输出,你就会发现描述信息已经发生了改变:

    -
    let car = Car()
    +
    let car = Car()
     println("Car: \(car.description())")
     // Car: 4 wheels; up to 5 passengers; traveling at 0.0 mph
    -

    重写属性

    +
    +

    重写属性

    你可以重写继承来的实例属性或类属性,提供自己定制的getter和setter,或添加属性观察器使重写的属性观察属性值什么时候发生改变。

    重写属性的Getters和Setters

    -

    你可以提供定制的getter(或setter)来重写任意继承来的属性,无论继承来的属性是存储型的还是计算型的属性。子类并不知道继承来的属性是存储型的还是计算型的,它只知道继承来的属性会有一个名字和类型。你在重写一个属性时,必需将它的名字和类型都写出来。这样才能使编译器去检查你重写的属性是与超类中同名同类型的属性相匹配的。

    -

    你可以将一个继承来的只读属性重写为一个读写属性,只需要你在重写版本的属性里提供getter和setter即可。但是,你不可以将一个继承来的读写属性重写为一个只读属性。

    +

    你可以提供定制的 getter(或 setter)来重写任意继承来的属性,无论继承来的属性是存储型的还是计算型的属性。子类并不知道继承来的属性是存储型的还是计算型的,它只知道继承来的属性会有一个名字和类型。你在重写一个属性时,必需将它的名字和类型都写出来。这样才能使编译器去检查你重写的属性是与超类中同名同类型的属性相匹配的。

    +

    你可以将一个继承来的只读属性重写为一个读写属性,只需要你在重写版本的属性里提供 getter 和 setter 即可。但是,你不可以将一个继承来的读写属性重写为一个只读属性。

    -

    注意:如果你在重写属性中提供了setter,那么你也一定要提供getter。如果你不想在重写版本中的getter里修改继承来的属性值,你可以直接返回super.someProperty来返回继承来的值。正如下面的SpeedLimitedCar的例子所示。

    +

    注意:
    如果你在重写属性中提供了 setter,那么你也一定要提供 getter。如果你不想在重写版本中的 getter 里修改继承来的属性值,你可以直接返回super.someProperty来返回继承来的值。正如下面的SpeedLimitedCar的例子所示。

    以下的例子定义了一个新类,叫SpeedLimitedCar,它是Car的子类。类SpeedLimitedCar表示安装了限速装置的车,它的最高速度只能达到40mph。你可以通过重写继承来的speed属性来实现这个速度限制:

    -
    class SpeedLimitedCar: Car {
    +
    class SpeedLimitedCar: Car {
         override var speed: Double  {
         get {
             return super.speed
    @@ -714,19 +747,21 @@ println("Car: \(car.description())")
         }
         }
     }
    -

    当你设置一个SpeedLimitedCar实例的speed属性时,属性setter的实现会去检查新值与限制值40mph的大小,它会将超类的speed设置为newValue40.0中较小的那个。这两个值哪个较小由min函数决定,它是Swift标准库中的一个全局函数。min函数接收两个或更多的数,返回其中最小的那个。

    +
    +

    当你设置一个SpeedLimitedCar实例的speed属性时,属性setter的实现会去检查新值与限制值40mph的大小,它会将超类的speed设置为newValue40.0中较小的那个。这两个值哪个较小由min函数决定,它是Swift标准库中的一个全局函数。min函数接收两个或更多的数,返回其中最小的那个。

    如果你尝试将SpeedLimitedCar实例的speed属性设置为一个大于40mph的数,然后打印description函数的输出,你会发现速度被限制在40mph:

    -
    let limitedCar = SpeedLimitedCar()
    +
    let limitedCar = SpeedLimitedCar()
     limitedCar.speed = 60.0
     println("SpeedLimitedCar: \(limitedCar.description())")
     // SpeedLimitedCar: 4 wheels; up to 5 passengers; traveling at 40.0 mph
    -

    重写属性观察器(Property Observer)

    -

    你可以在属性重写中为一个继承来的属性添加属性观察器。这样一来,当继承来的属性值发生改变时,你就会被通知到,无论那个属性原本是如何实现的。关于属性观察器的更多内容,请看属性观察器

    +
    +

    重写属性观察器(Property Observer)

    +

    你可以在属性重写中为一个继承来的属性添加属性观察器。这样一来,当继承来的属性值发生改变时,你就会被通知到,无论那个属性原本是如何实现的。关于属性观察器的更多内容,请看属性观察器

    -

    注意:你不可以为继承来的常量存储型属性或继承来的只读计算型属性添加属性观察器。这些属性的值是不可以被设置的,所以,为它们提供willSet或didSet实现是不恰当。此外还要注意,你不可以同时提供重写的setter和重写的属性观察器。如果你想观察属性值的变化,并且你已经为那个属性提供了定制的setter,那么你在setter中就可以观察到任何值变化了。

    +

    注意:
    你不可以为继承来的常量存储型属性或继承来的只读计算型属性添加属性观察器。这些属性的值是不可以被设置的,所以,为它们提供willSetdidSet实现是不恰当。此外还要注意,你不可以同时提供重写的 setter 和重写的属性观察器。如果你想观察属性值的变化,并且你已经为那个属性提供了定制的 setter,那么你在 setter 中就可以观察到任何值变化了。

    下面的例子定义了一个新类叫AutomaticCar,它是Car的子类。AutomaticCar表示自动挡汽车,它可以根据当前的速度自动选择合适的挡位。AutomaticCar也提供了定制的description方法,可以输出当前挡位。

    -
    class AutomaticCar: Car {
    +
    class AutomaticCar: Car {
         var gear = 1
         override var speed: Double {
         didSet {
    @@ -737,15 +772,18 @@ println("SpeedLimitedCar: \(limitedCar.description())")
             return super.description() + " in gear \(gear)"
         }
     }
    -

    当你设置AutomaticCarspeed属性,属性的didSet观察器就会自动地设置gear属性,为新的速度选择一个合适的挡位。具体来说就是,属性观察器将新的速度值除以10,然后向下取得最接近的整数值,最后加1来得到档位gear的值。例如,速度为10.0时,挡位为1;速度为35.0时,挡位为4:

    -
    let automatic = AutomaticCar()
    +
    +

    当你设置AutomaticCarspeed属性,属性的didSet观察器就会自动地设置gear属性,为新的速度选择一个合适的挡位。具体来说就是,属性观察器将新的速度值除以10,然后向下取得最接近的整数值,最后加1来得到档位gear的值。例如,速度为10.0时,挡位为1;速度为35.0时,挡位为4:

    +
    let automatic = AutomaticCar()
     automatic.speed = 35.0
     println("AutomaticCar: \(automatic.description())")
     // AutomaticCar: 4 wheels; up to 5 passengers; traveling at 35.0 mph in gear 4
    -

    防止重写

    -

    你可以通过把方法,属性或下标标记为final来防止它们被重写,只需要在声明关键字前加上@final特性即可。(例如:@final var, @final func, @final class func, 以及 @final subscript

    -

    如果你重写了final方法,属性或下标,在编译时会报错。在扩展中,你添加到类里的方法,属性或下标也可以在扩展的定义里标记为final。

    -

    你可以通过在关键字class前添加@final特性(@final class)来将整个类标记为final的,这样的类是不可被继承的,否则会报编译错误。

    +
    +

    +

    防止重写

    +

    你可以通过把方法,属性或下标脚本标记为final来防止它们被重写,只需要在声明关键字前加上@final特性即可。(例如:@final var, @final func, @final class func, 以及 @final subscript

    +

    如果你重写了final方法,属性或下标脚本,在编译时会报错。在扩展中,你添加到类里的方法,属性或下标脚本也可以在扩展的定义里标记为 final。

    +

    你可以通过在关键字class前添加@final特性(@final class)来将整个类标记为 final 的,这样的类是不可被继承的,否则会报编译错误。

    @@ -755,7 +793,7 @@ println("AutomaticCar: \(automatic.description())")
    - + @@ -764,16 +802,8 @@ println("AutomaticCar: \(automatic.description())")
    - - - - - - - - - - + + @@ -791,6 +821,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/14_Initialization.html b/chapter2/14_Initialization.html index d49e6ea6..47707e6a 100644 --- a/chapter2/14_Initialization.html +++ b/chapter2/14_Initialization.html @@ -1,57 +1,45 @@ - - + - 构造过程 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,6 +595,453 @@
    +
    + +
    +

    翻译:lifedim
    校对:lifedim

    +
    +

    构造过程(Initialization)

    +
    +

    本页包含内容:

    + +

    构造过程是为了使用某个类、结构体或枚举类型的实例而进行的准备过程。这个过程包含了为实例中的每个属性设置初始值和为其执行必要的准备和初始化任务。

    +

    构造过程是通过定义构造器(Initializers)来实现的,这些构造器可以看做是用来创建特定类型实例的特殊方法。与 Objective-C 中的构造器不同,Swift 的构造器无需返回值,它们的主要任务是保证新实例在第一次使用前完成正确的初始化。

    +

    类实例也可以通过定义析构器(deinitializer)在类实例释放之前执行特定的清除工作。想了解更多关于析构器的内容,请参考析构过程

    +

    +

    存储型属性的初始赋值

    +

    类和结构体在实例创建时,必须为所有存储型属性设置合适的初始值。存储型属性的值不能处于一个未知的状态。

    +

    你可以在构造器中为存储型属性赋初值,也可以在定义属性时为其设置默认值。以下章节将详细介绍这两种方法。

    +
    +

    注意:
    当你为存储型属性设置默认值或者在构造器中为其赋值时,它们的值是被直接设置的,不会触发任何属性观测器(property observers)。

    +
    +

    构造器

    +

    构造器在创建某特定类型的新实例时调用。它的最简形式类似于一个不带任何参数的实例方法,以关键字init命名。

    +

    下面例子中定义了一个用来保存华氏温度的结构体Fahrenheit,它拥有一个Double类型的存储型属性temperature

    +
    struct Fahrenheit {
    +    var temperature: Double
    +    init() {
    +        temperature = 32.0
    +    }
    +}
    +
    +
    var f = Fahrenheit()
    +println("The default temperature is \(f.temperature)° Fahrenheit")
    +// 输出 "The default temperature is 32.0° Fahrenheit”
    +
    +

    这个结构体定义了一个不带参数的构造器init,并在里面将存储型属性temperature的值初始化为32.0(华摄氏度下水的冰点)。

    +

    默认属性值

    +

    如前所述,你可以在构造器中为存储型属性设置初始值;同样,你也可以在属性声明时为其设置默认值。

    +
    +

    注意:
    如果一个属性总是使用同一个初始值,可以为其设置一个默认值。无论定义默认值还是在构造器中赋值,最终它们实现的效果是一样的,只不过默认值跟属性构造过程结合的更紧密。使用默认值能让你的构造器更简洁、更清晰,且能通过默认值自动推导出属性的类型;同时,它也能让你充分利用默认构造器、构造器继承(后续章节将讲到)等特性。

    +
    +

    你可以使用更简单的方式在定义结构体Fahrenheit时为属性temperature设置默认值:

    +
    struct Fahrenheit {
    +    var temperature = 32.0
    +}
    +
    +

    +

    定制化构造过程

    +

    你可以通过输入参数和可选属性类型来定制构造过程,也可以在构造过程中修改常量属性。这些都将在后面章节中提到。

    +

    构造参数

    +

    你可以在定义构造器时提供构造参数,为其提供定制化构造所需值的类型和名字。构造器参数的功能和语法跟函数和方法参数相同。

    +

    下面例子中定义了一个包含摄氏度温度的结构体Celsius。它定义了两个不同的构造器:init(fromFahrenheit:)init(fromKelvin:),二者分别通过接受不同刻度表示的温度值来创建新的实例:

    +
    struct Celsius {
    +    var temperatureInCelsius: Double = 0.0
    +    init(fromFahrenheit fahrenheit: Double) {
    +        temperatureInCelsius = (fahrenheit - 32.0) / 1.8
    +    }
    +    init(fromKelvin kelvin: Double) {
    +        temperatureInCelsius = kelvin - 273.15
    +    }
    +}
    +
    +
    let boilingPointOfWater = Celsius(fromFahrenheit: 212.0)
    +// boilingPointOfWater.temperatureInCelsius 是 100.0
    +let freezingPointOfWater = Celsius(fromKelvin: 273.15)
    +// freezingPointOfWater.temperatureInCelsius 是 0.0”
    +
    +

    第一个构造器拥有一个构造参数,其外部名字为fromFahrenheit,内部名字为fahrenheit;第二个构造器也拥有一个构造参数,其外部名字为fromKelvin,内部名字为kelvin。这两个构造器都将唯一的参数值转换成摄氏温度值,并保存在属性temperatureInCelsius中。

    +

    内部和外部参数名

    +

    跟函数和方法参数相同,构造参数也存在一个在构造器内部使用的参数名字和一个在调用构造器时使用的外部参数名字。

    +

    然而,构造器并不像函数和方法那样在括号前有一个可辨别的名字。所以在调用构造器时,主要通过构造器中的参数名和类型来确定需要调用的构造器。正因为参数如此重要,如果你在定义构造器时没有提供参数的外部名字,Swift 会为每个构造器的参数自动生成一个跟内部名字相同的外部名,就相当于在每个构造参数之前加了一个哈希符号。

    +
    +

    注意:
    如果你不希望为构造器的某个参数提供外部名字,你可以使用下划线_来显示描述它的外部名,以此覆盖上面所说的默认行为。

    +
    +

    以下例子中定义了一个结构体Color,它包含了三个常量:redgreenblue。这些属性可以存储0.0到1.0之间的值,用来指示颜色中红、绿、蓝成分的含量。

    +

    Color提供了一个构造器,其中包含三个Double类型的构造参数:

    +
    struct Color {
    +    let red = 0.0, green = 0.0, blue = 0.0
    +    init(red: Double, green: Double, blue: Double) {
    +        self.red   = red
    +        self.green = green
    +        self.blue  = blue
    +    }
    +}
    +
    +

    每当你创建一个新的Color实例,你都需要通过三种颜色的外部参数名来传值,并调用构造器。

    +
    let magenta = Color(red: 1.0, green: 0.0, blue: 1.0)
    +
    +

    注意,如果不通过外部参数名字传值,你是没法调用这个构造器的。只要构造器定义了某个外部参数名,你就必须使用它,忽略它将导致编译错误:

    +
    let veryGreen = Color(0.0, 1.0, 0.0)
    +// 报编译时错误,需要外部名称
    +
    +

    可选属性类型

    +

    如果你定制的类型包含一个逻辑上允许取值为空的存储型属性--不管是因为它无法在初始化时赋值,还是因为它可以在之后某个时间点可以赋值为空--你都需要将它定义为可选类型optional type。可选类型的属性将自动初始化为空nil,表示这个属性是故意在初始化时设置为空的。

    +

    下面例子中定义了类SurveyQuestion,它包含一个可选字符串属性response

    +
    class SurveyQuestion {
    +    var text: String
    +    var response: String?
    +    init(text: String) {
    +        self.text = text
    +    }
    +    func ask() {
    +        println(text)
    +    }
    +}
    +let cheeseQuestion = SurveyQuestion(text: "Do you like cheese?")
    +cheeseQuestion.ask()
    +// 输出 "Do you like cheese?"
    +cheeseQuestion.response = "Yes, I do like cheese.
    +
    +

    调查问题在问题提出之后,我们才能得到回答。所以我们将属性回答response声明为String?类型,或者说是可选字符串类型optional String。当SurveyQuestion实例化时,它将自动赋值为空nil,表明暂时还不存在此字符串。

    +

    构造过程中常量属性的修改

    +

    只要在构造过程结束前常量的值能确定,你可以在构造过程中的任意时间点修改常量属性的值。

    +
    +

    注意:
    对某个类实例来说,它的常量属性只能在定义它的类的构造过程中修改;不能在子类中修改。

    +
    +

    你可以修改上面的SurveyQuestion示例,用常量属性替代变量属性text,指明问题内容text在其创建之后不会再被修改。尽管text属性现在是常量,我们仍然可以在其类的构造器中修改它的值:

    +
    class SurveyQuestion {
    +    let text: String
    +    var response: String?
    +    init(text: String) {
    +        self.text = text
    +    }
    +    func ask() {
    +        println(text)
    +    }
    +}
    +let beetsQuestion = SurveyQuestion(text: "How about beets?")
    +beetsQuestion.ask()
    +// 输出 "How about beets?"
    +beetsQuestion.response = "I also like beets. (But not with cheese.)
    +
    +

    +

    默认构造器

    +

    Swift 将为所有属性已提供默认值的且自身没有定义任何构造器的结构体或基类,提供一个默认的构造器。这个默认构造器将简单的创建一个所有属性值都设置为默认值的实例。

    +

    下面例子中创建了一个类ShoppingListItem,它封装了购物清单中的某一项的属性:名字(name)、数量(quantity)和购买状态 purchase state

    +
    class ShoppingListItem {
    +    var name: String?
    +    var quantity = 1
    +    var purchased = false
    +}
    +var item = ShoppingListItem()
    +
    +

    由于ShoppingListItem类中的所有属性都有默认值,且它是没有父类的基类,它将自动获得一个可以为所有属性设置默认值的默认构造器(尽管代码中没有显式为name属性设置默认值,但由于name是可选字符串类型,它将默认设置为nil)。上面例子中使用默认构造器创造了一个ShoppingListItem类的实例(使用ShoppingListItem()形式的构造器语法),并将其赋值给变量item

    +

    结构体的逐一成员构造器

    +

    除上面提到的默认构造器,如果结构体对所有存储型属性提供了默认值且自身没有提供定制的构造器,它们能自动获得一个逐一成员构造器。

    +

    逐一成员构造器是用来初始化结构体新实例里成员属性的快捷方法。我们在调用逐一成员构造器时,通过与成员属性名相同的参数名进行传值来完成对成员属性的初始赋值。

    +

    下面例子中定义了一个结构体Size,它包含两个属性widthheight。Swift 可以根据这两个属性的初始赋值0.0自动推导出它们的类型Double

    +

    由于这两个存储型属性都有默认值,结构体Size自动获得了一个逐一成员构造器 init(width:height:)。 你可以用它来为Size创建新的实例:

    +
    struct Size {
    +    var width = 0.0, height = 0.0
    +}
    +let twoByTwo = Size(width: 2.0, height: 2.0)
    +
    +

    +

    值类型的构造器代理

    +

    构造器可以通过调用其它构造器来完成实例的部分构造过程。这一过程称为构造器代理,它能减少多个构造器间的代码重复。

    +

    构造器代理的实现规则和形式在值类型和类类型中有所不同。值类型(结构体和枚举类型)不支持继承,所以构造器代理的过程相对简单,因为它们只能代理任务给本身提供的其它构造器。类则不同,它可以继承自其它类(请参考继承),这意味着类有责任保证其所有继承的存储型属性在构造时也能正确的初始化。这些责任将在后续章节类的继承和构造过程中介绍。

    +

    对于值类型,你可以使用self.init在自定义的构造器中引用其它的属于相同值类型的构造器。并且你只能在构造器内部调用self.init

    +

    注意,如果你为某个值类型定义了一个定制的构造器,你将无法访问到默认构造器(如果是结构体,则无法访问逐一对象构造器)。这个限制可以防止你在为值类型定义了一个更复杂的,完成了重要准备构造器之后,别人还是错误的使用了那个自动生成的构造器。

    +
    +

    注意:
    假如你想通过默认构造器、逐一对象构造器以及你自己定制的构造器为值类型创建实例,我们建议你将自己定制的构造器写到扩展(extension)中,而不是跟值类型定义混在一起。想查看更多内容,请查看扩展章节。

    +
    +

    下面例子将定义一个结构体Rect,用来展现几何矩形。这个例子需要两个辅助的结构体SizePoint,它们各自为其所有的属性提供了初始值0.0

    +
    struct Size {
    +    var width = 0.0, height = 0.0
    +}
    +struct Point {
    +    var x = 0.0, y = 0.0
    +}
    +
    +

    你可以通过以下三种方式为Rect创建实例--使用默认的0值来初始化originsize属性;使用特定的originsize实例来初始化;使用特定的centersize来初始化。在下面Rect结构体定义中,我们为着三种方式提供了三个自定义的构造器:

    +
    struct Rect {
    +    var origin = Point()
    +    var size = Size()
    +    init() {}
    +    init(origin: Point, size: Size) {
    +        self.origin = origin
    +        self.size = size
    +    }
    +    init(center: Point, size: Size) {
    +        let originX = center.x - (size.width / 2)
    +        let originY = center.y - (size.height / 2)
    +        self.init(origin: Point(x: originX, y: originY), size: size)
    +    }
    +}
    +
    +

    第一个Rect构造器init(),在功能上跟没有自定义构造器时自动获得的默认构造器是一样的。这个构造器是一个空函数,使用一对大括号{}来描述,它没有执行任何定制的构造过程。调用这个构造器将返回一个Rect实例,它的originsize属性都使用定义时的默认值Point(x: 0.0, y: 0.0)Size(width: 0.0, height: 0.0)

    +
    let basicRect = Rect()
    +// basicRect 的原点是 (0.0, 0.0),尺寸是 (0.0, 0.0)
    +
    +

    第二个Rect构造器init(origin:size:),在功能上跟结构体在没有自定义构造器时获得的逐一成员构造器是一样的。这个构造器只是简单的将originsize的参数值赋给对应的存储型属性:

    +
    let originRect = Rect(origin: Point(x: 2.0, y: 2.0),
    +    size: Size(width: 5.0, height: 5.0))
    +// originRect 的原点是 (2.0, 2.0),尺寸是 (5.0, 5.0)
    +
    +

    第三个Rect构造器init(center:size:)稍微复杂一点。它先通过centersize的值计算出origin的坐标。然后再调用(或代理给)init(origin:size:)构造器来将新的originsize值赋值到对应的属性中:

    +

    let centerRect = Rect(center: Point(x: 4.0, y: 4.0),

    +
    size: Size(width: 3.0, height: 3.0))
    +
    +

    // centerRect 的原点是 (2.5, 2.5),尺寸是 (3.0, 3.0)

    +

    构造器init(center:size:)可以自己将originsize的新值赋值到对应的属性中。然而尽量利用现有的构造器和它所提供的功能来实现init(center:size:)的功能,是更方便、更清晰和更直观的方法。

    +
    +

    注意:
    如果你想用另外一种不需要自己定义init()init(origin:size:)的方式来实现这个例子,请参考扩展

    +
    +

    +

    类的继承和构造过程

    +

    类里面的所有存储型属性--包括所有继承自父类的属性--都必须在构造过程中设置初始值。

    +

    Swift 提供了两种类型的类构造器来确保所有类实例中存储型属性都能获得初始值,它们分别是指定构造器和便利构造器。

    +

    指定构造器和便利构造器

    +

    指定构造器是类中最主要的构造器。一个指定构造器将初始化类中提供的所有属性,并根据父类链往上调用父类的构造器来实现父类的初始化。

    +

    每一个类都必须拥有至少一个指定构造器。在某些情况下,许多类通过继承了父类中的指定构造器而满足了这个条件。具体内容请参考后续章节自动构造器的继承

    +

    便利构造器是类中比较次要的、辅助型的构造器。你可以定义便利构造器来调用同一个类中的指定构造器,并为其参数提供默认值。你也可以定义便利构造器来创建一个特殊用途或特定输入的实例。

    +

    你应当只在必要的时候为类提供便利构造器,比方说某种情况下通过使用便利构造器来快捷调用某个指定构造器,能够节省更多开发时间并让类的构造过程更清、晰明。

    +

    +

    构造器链

    +

    为了简化指定构造器和便利构造器之间的调用关系,Swift 采用以下三条规则来限制构造器之间的代理调用:

    +

    规则 1

    +

    指定构造器必须调用其直接父类的的指定构造器。

    +

    规则 2

    +

    便利构造器必须调用同一类中定义的其它构造器。

    +

    规则 3

    +

    便利构造器必须最终以调用一个指定构造器结束。

    +

    一个更方便记忆的方法是:

    +
      +
    • 指定构造器必须总是向上代理
    • +
    • 便利构造器必须总是横向代理
    • +
    +

    这些规则可以通过下面图例来说明:

    +

    构造器代理图

    +

    如图所示,父类中包含一个指定构造器和两个便利构造器。其中一个便利构造器调用了另外一个便利构造器,而后者又调用了唯一的指定构造器。这满足了上面提到的规则2和3。这个父类没有自己的父类,所以规则1没有用到。

    +

    子类中包含两个指定构造器和一个便利构造器。便利构造器必须调用两个指定构造器中的任意一个,因为它只能调用同一个类里的其他构造器。这满足了上面提到的规则2和3。而两个指定构造器必须调用父类中唯一的指定构造器,这满足了规则1。

    +
    +

    注意:
    这些规则不会影响使用时,如何用类去创建实例。任何上图中展示的构造器都可以用来完整创建对应类的实例。这些规则只在实现类的定义时有影响。

    +
    +

    下面图例中展示了一种更复杂的类层级结构。它演示了指定构造器是如果在类层级中充当“管道”的作用,在类的构造器链上简化了类之间的内部关系。

    +

    复杂构造器代理图

    +

    +

    两段式构造过程

    +

    Swift 中类的构造过程包含两个阶段。第一个阶段,每个存储型属性通过引入它们的类的构造器来设置初始值。当每一个存储型属性值被确定后,第二阶段开始,它给每个类一次机会在新实例准备使用之前进一步定制它们的存储型属性。

    +

    两段式构造过程的使用让构造过程更安全,同时在整个类层级结构中给予了每个类完全的灵活性。两段式构造过程可以防止属性值在初始化之前被访问;也可以防止属性被另外一个构造器意外地赋予不同的值。

    +
    +

    注意:
    Swift的两段式构造过程跟 Objective-C 中的构造过程类似。最主要的区别在于阶段 1,Objective-C 给每一个属性赋值0或空值(比如说0nil)。Swift 的构造流程则更加灵活,它允许你设置定制的初始值,并自如应对某些属性不能以0nil作为合法默认值的情况。

    +
    +

    Swift 编译器将执行 4 种有效的安全检查,以确保两段式构造过程能顺利完成:

    +

    安全检查 1

    +

    指定构造器必须保证它所在类引入的所有属性都必须先初始化完成,之后才能将其它构造任务向上代理给父类中的构造器。

    +

    如上所述,一个对象的内存只有在其所有存储型属性确定之后才能完全初始化。为了满足这一规则,指定构造器必须保证它所在类引入的属性在它往上代理之前先完成初始化。

    +

    安全检查 2

    +

    指定构造器必须先向上代理调用父类构造器,然后再为继承的属性设置新值。如果没这么做,指定构造器赋予的新值将被父类中的构造器所覆盖。

    +

    安全检查 3

    +

    便利构造器必须先代理调用同一类中的其它构造器,然后再为任意属性赋新值。如果没这么做,便利构造器赋予的新值将被同一类中其它指定构造器所覆盖。

    +

    安全检查 4

    +

    构造器在第一阶段构造完成之前,不能调用任何实例方法、不能读取任何实例属性的值,也不能引用self的值。

    +

    以下是两段式构造过程中基于上述安全检查的构造流程展示:

    +

    阶段 1

    +
      +
    • 某个指定构造器或便利构造器被调用;
    • +
    • 完成新实例内存的分配,但此时内存还没有被初始化;
    • +
    • 指定构造器确保其所在类引入的所有存储型属性都已赋初值。存储型属性所属的内存完成初始化;
    • +
    • 指定构造器将调用父类的构造器,完成父类属性的初始化;
    • +
    • 这个调用父类构造器的过程沿着构造器链一直往上执行,直到到达构造器链的最顶部;
    • +
    • 当到达了构造器链最顶部,且已确保所有实例包含的存储型属性都已经赋值,这个实例的内存被认为已经完全初始化。此时阶段1完成。
    • +
    +

    阶段 2

    +
      +
    • 从顶部构造器链一直往下,每个构造器链中类的指定构造器都有机会进一步定制实例。构造器此时可以访问self、修改它的属性并调用实例方法等等。
    • +
    • 最终,任意构造器链中的便利构造器可以有机会定制实例和使用self
    • +
    +

    下图展示了在假定的子类和父类之间构造的阶段1: +· +构造过程阶段1

    +

    在这个例子中,构造过程从对子类中一个便利构造器的调用开始。这个便利构造器此时没法修改任何属性,它把构造任务代理给同一类中的指定构造器。

    +

    如安全检查1所示,指定构造器将确保所有子类的属性都有值。然后它将调用父类的指定构造器,并沿着造器链一直往上完成父类的构建过程。

    +

    父类中的指定构造器确保所有父类的属性都有值。由于没有更多的父类需要构建,也就无需继续向上做构建代理。

    +

    一旦父类中所有属性都有了初始值,实例的内存被认为是完全初始化,而阶段1也已完成。

    +

    以下展示了相同构造过程的阶段2:

    +

    构建过程阶段2

    +

    父类中的指定构造器现在有机会进一步来定制实例(尽管它没有这种必要)。

    +

    一旦父类中的指定构造器完成调用,子类的构指定构造器可以执行更多的定制操作(同样,它也没有这种必要)。

    +

    最终,一旦子类的指定构造器完成调用,最开始被调用的便利构造器可以执行更多的定制操作。

    +

    构造器的继承和重载

    +

    跟 Objective-C 中的子类不同,Swift 中的子类不会默认继承父类的构造器。Swift 的这种机制可以防止一个父类的简单构造器被一个更专业的子类继承,并被错误的用来创建子类的实例。

    +

    假如你希望自定义的子类中能实现一个或多个跟父类相同的构造器--也许是为了完成一些定制的构造过程--你可以在你定制的子类中提供和重载与父类相同的构造器。

    +

    如果你重载的构造器是一个指定构造器,你可以在子类里重载它的实现,并在自定义版本的构造器中调用父类版本的构造器。

    +

    如果你重载的构造器是一个便利构造器,你的重载过程必须通过调用同一类中提供的其它指定构造器来实现。这一规则的详细内容请参考构造器链

    +
    +

    注意:
    与方法、属性和下标不同,在重载构造器时你没有必要使用关键字override

    +
    +

    +

    自动构造器的继承

    +

    如上所述,子类不会默认继承父类的构造器。但是如果特定条件可以满足,父类构造器是可以被自动继承的。在实践中,这意味着对于许多常见场景你不必重载父类的构造器,并且在尽可能安全的情况下以最小的代价来继承父类的构造器。

    +

    假设要为子类中引入的任意新属性提供默认值,请遵守以下2个规则:

    +

    规则 1

    +

    如果子类没有定义任何指定构造器,它将自动继承所有父类的指定构造器。

    +

    规则 2

    +

    如果子类提供了所有父类指定构造器的实现--不管是通过规则1继承过来的,还是通过自定义实现的--它将自动继承所有父类的便利构造器。

    +

    即使你在子类中添加了更多的便利构造器,这两条规则仍然适用。

    +
    +

    注意:
    子类可以通过部分满足规则2的方式,使用子类便利构造器来实现父类的指定构造器。

    +
    +

    指定构造器和便利构造器的语法

    +

    类的指定构造器的写法跟值类型简单构造器一样:

    +
    init(parameters) {
    +    statements
    +}
    +
    +

    便利构造器也采用相同样式的写法,但需要在init关键字之前放置convenience关键字,并使用空格将它们俩分开:

    +
    convenience init(parameters) {
    +    statements
    +}
    +
    +

    指定构造器和便利构造器实战

    +

    接下来的例子将在实战中展示指定构造器、便利构造器和自动构造器的继承。它定义了包含三个类FoodRecipeIngredient以及ShoppingListItem的类层次结构,并将演示它们的构造器是如何相互作用的。

    +

    类层次中的基类是Food,它是一个简单的用来封装食物名字的类。Food类引入了一个叫做nameString类型属性,并且提供了两个构造器来创建Food实例:

    +
    class Food {
    +    var name: String
    +    init(name: String) {
    +        self.name = name
    +    }
    +    convenience init() {
    +        self.init(name: "[Unnamed]")
    +    }
    +}
    +
    +

    下图中展示了Food的构造器链:

    +

    Food构造器链

    +

    类没有提供一个默认的逐一成员构造器,所以Food类提供了一个接受单一参数name的指定构造器。这个构造器可以使用一个特定的名字来创建新的Food实例:

    +
    let namedMeat = Food(name: "Bacon")
    +// namedMeat 的名字是 "Bacon”
    +
    +

    Food类中的构造器init(name: String)被定义为一个指定构造器,因为它能确保所有新Food实例的中存储型属性都被初始化。Food类没有父类,所以init(name: String)构造器不需要调用super.init()来完成构造。

    +

    Food类同样提供了一个没有参数的便利构造器 init()。这个init()构造器为新食物提供了一个默认的占位名字,通过代理调用同一类中定义的指定构造器init(name: String)并给参数name传值[Unnamed]来实现:

    +
    let mysteryMeat = Food()
    +// mysteryMeat 的名字是 [Unnamed]
    +
    +

    类层级中的第二个类是Food的子类RecipeIngredientRecipeIngredient类构建了食谱中的一味调味剂。它引入了Int类型的数量属性quantity(以及从Food继承过来的name属性),并且定义了两个构造器来创建RecipeIngredient实例:

    +
    class RecipeIngredient: Food {
    +    var quantity: Int
    +    init(name: String, quantity: Int) {
    +        self.quantity = quantity
    +        super.init(name: name)
    +    }
    +    convenience init(name: String) {
    +        self.init(name: name, quantity: 1)
    +    }
    +}
    +
    +

    下图中展示了RecipeIngredient类的构造器链:

    +

    RecipeIngredient构造器

    +

    RecipeIngredient类拥有一个指定构造器init(name: String, quantity: Int),它可以用来产生新RecipeIngredient实例的所有属性值。这个构造器一开始先将传入的quantity参数赋值给quantity属性,这个属性也是唯一在RecipeIngredient中新引入的属性。随后,构造器将任务向上代理给父类Foodinit(name: String)。这个过程满足两段式构造过程中的安全检查1。

    +

    RecipeIngredient也定义了一个便利构造器init(name: String),它只通过name来创建RecipeIngredient的实例。这个便利构造器假设任意RecipeIngredient实例的quantity为1,所以不需要显示指明数量即可创建出实例。这个便利构造器的定义可以让创建实例更加方便和快捷,并且避免了使用重复的代码来创建多个quantity为 1 的RecipeIngredient实例。这个便利构造器只是简单的将任务代理给了同一类里提供的指定构造器。

    +

    注意,RecipeIngredient的便利构造器init(name: String)使用了跟Food中指定构造器init(name: String)相同的参数。尽管RecipeIngredient这个构造器是便利构造器,RecipeIngredient依然提供了对所有父类指定构造器的实现。因此,RecipeIngredient也能自动继承了所有父类的便利构造器。

    +

    在这个例子中,RecipeIngredient的父类是Food,它有一个便利构造器init()。这个构造器因此也被RecipeIngredient继承。这个继承的init()函数版本跟Food提供的版本是一样的,除了它是将任务代理给RecipeIngredient版本的init(name: String)而不是Food提供的版本。

    +

    所有的这三种构造器都可以用来创建新的RecipeIngredient实例:

    +
    let oneMysteryItem = RecipeIngredient()
    +let oneBacon = RecipeIngredient(name: "Bacon")
    +let sixEggs = RecipeIngredient(name: "Eggs", quantity: 6)
    +
    +

    类层级中第三个也是最后一个类是RecipeIngredient的子类,叫做ShoppingListItem。这个类构建了购物单中出现的某一种调味料。

    +

    购物单中的每一项总是从unpurchased未购买状态开始的。为了展现这一事实,ShoppingListItem引入了一个布尔类型的属性purchased,它的默认值是falseShoppingListItem还添加了一个计算型属性description,它提供了关于ShoppingListItem实例的一些文字描述:

    +
    class ShoppingListItem: RecipeIngredient {
    +    var purchased = false
    +    var description: String {
    +    var output = "\(quantity) x \(name.lowercaseString)"
    +        output += purchased ? " ✔" : " ✘"
    +        return output
    +    }
    +}
    +
    +
    +

    注意:
    ShoppingListItem没有定义构造器来为purchased提供初始化值,这是因为任何添加到购物单的项的初始状态总是未购买。

    +
    +

    由于它为自己引入的所有属性都提供了默认值,并且自己没有定义任何构造器,ShoppingListItem将自动继承所有父类中的指定构造器和便利构造器。

    +

    下图种展示了所有三个类的构造器链:

    +

    三类构造器图

    +

    你可以使用全部三个继承来的构造器来创建ShoppingListItem的新实例:

    +
    var breakfastList = [
    +    ShoppingListItem(),
    +    ShoppingListItem(name: "Bacon"),
    +    ShoppingListItem(name: "Eggs", quantity: 6),
    +]
    +breakfastList[0].name = "Orange juice"
    +breakfastList[0].purchased = true
    +for item in breakfastList {
    +    println(item.description)
    +}
    +// 1 x orange juice ✔
    +// 1 x bacon ✘
    +// 6 x eggs ✘
    +
    +

    如上所述,例子中通过字面量方式创建了一个新数组breakfastList,它包含了三个新的ShoppingListItem实例,因此数组的类型也能自动推导为ShoppingListItem[]。在数组创建完之后,数组中第一个ShoppingListItem实例的名字从[Unnamed]修改为Orange juice,并标记为已购买。接下来通过遍历数组每个元素并打印它们的描述值,展示了所有项当前的默认状态都已按照预期完成了赋值。

    +

    +

    通过闭包和函数来设置属性的默认值

    +

    如果某个存储型属性的默认值需要特别的定制或准备,你就可以使用闭包或全局函数来为其属性提供定制的默认值。每当某个属性所属的新类型实例创建时,对应的闭包或函数会被调用,而它们的返回值会当做默认值赋值给这个属性。

    +

    这种类型的闭包或函数一般会创建一个跟属性类型相同的临时变量,然后修改它的值以满足预期的初始状态,最后将这个临时变量的值作为属性的默认值进行返回。

    +

    下面列举了闭包如何提供默认值的代码概要:

    +
    class SomeClass {
    +    let someProperty: SomeType = {
    +        // 在这个闭包中给 someProperty 创建一个默认值
    +        // someValue 必须和 SomeType 类型相同
    +        return someValue
    +        }()
    +}
    +
    +

    注意闭包结尾的大括号后面接了一对空的小括号。这是用来告诉 Swift 需要立刻执行此闭包。如果你忽略了这对括号,相当于是将闭包本身作为值赋值给了属性,而不是将闭包的返回值赋值给属性。

    +
    +

    注意:
    如果你使用闭包来初始化属性的值,请记住在闭包执行时,实例的其它部分都还没有初始化。这意味着你不能够在闭包里访问其它的属性,就算这个属性有默认值也不允许。同样,你也不能使用隐式的self属性,或者调用其它的实例方法。

    +
    +

    下面例子中定义了一个结构体Checkerboard,它构建了西洋跳棋游戏的棋盘:

    +

    西洋跳棋棋盘

    +

    西洋跳棋游戏在一副黑白格交替的 10x10 的棋盘中进行。为了呈现这副游戏棋盘,Checkerboard结构体定义了一个属性boardColors,它是一个包含 100 个布尔值的数组。数组中的某元素布尔值为true表示对应的是一个黑格,布尔值为false表示对应的是一个白格。数组中第一个元素代表棋盘上左上角的格子,最后一个元素代表棋盘上右下角的格子。

    +

    boardColor数组是通过一个闭包来初始化和组装颜色值的:

    +
    struct Checkerboard {
    +    let boardColors: Bool[] = {
    +        var temporaryBoard = Bool[]()
    +        var isBlack = false
    +        for i in 1...10 {
    +            for j in 1...10 {
    +                temporaryBoard.append(isBlack)
    +                isBlack = !isBlack
    +            }
    +            isBlack = !isBlack
    +        }
    +        return temporaryBoard
    +        }()
    +    func squareIsBlackAtRow(row: Int, column: Int) -> Bool {
    +        return boardColors[(row * 10) + column]
    +    }
    +}
    +
    +

    每当一个新的Checkerboard实例创建时,对应的赋值闭包会执行,一系列颜色值会被计算出来作为默认值赋值给boardColors。上面例子中描述的闭包将计算出棋盘中每个格子合适的颜色,将这些颜色值保存到一个临时数组temporaryBoard中,并在构建完成时将此数组作为闭包返回值返回。这个返回的值将保存到boardColors中,并可以通squareIsBlackAtRow这个工具函数来查询。

    +
    let board = Checkerboard()
    +println(board.squareIsBlackAtRow(0, column: 1))
    +// 输出 "true"
    +println(board.squareIsBlackAtRow(9, column: 9))
    +// 输出 "false"
    +
    + + +
    +
    @@ -601,16 +1056,8 @@
    - - - - - - - - - - + + @@ -628,6 +1075,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/15_Deinitialization.html b/chapter2/15_Deinitialization.html index a989daa7..ffb365e5 100644 --- a/chapter2/15_Deinitialization.html +++ b/chapter2/15_Deinitialization.html @@ -1,57 +1,45 @@ - - + - 析构过程 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,68 +595,85 @@
    -
    +
    -

    析构过程

    -

    在一个类的实例被释放之前,析构函数被立即调用。用关键字deinit来标示析构函数,类似于初始化函数用init来标示。析构函数只适用于类类型。

    +
    +

    翻译:bruce0505
    校对:fd5788

    +
    +

    析构过程(Deinitialization)

    +
    +

    本页包含内容:

    + +

    在一个类的实例被释放之前,析构函数被立即调用。用关键字deinit来标示析构函数,类似于初始化函数用init来标示。析构函数只适用于类类型。

    +

    析构过程原理

    -

    Swift会自动释放不再需要的实例以释放资源。如自动引用计数那一章描述,Swift通过自动引用计数(ARC)处理实例的内存管理。通常当你的实例被释放时不需要手动的去清理。但是,当使用自己的资源时,你可能需要进行一些额外的清理。例如,如果创建了一个自定义的类来打开一个文件,并写入一些数据,你可能需要在类实例被释放之前关闭该文件。

    -

    在类的定义中,每个类最多只能有一个析构函数。析构函数不带任何参数,在写法上不带括号:

    -
    1  deinit {
    -2       // 执行析构过程
    -3  }
    -

    析构函数是在实例释放发生前一步被自动调用。不允许主动调用自己的析构函数。子类继承了父类的析构函数,并且在子类析构函数实现的最后,父类的析构函数被自动调用。即使子类没有提供自己的析构函数,父类的析构函数也总是被调用。

    -

    因为直到实例的析构函数被调用时,实例才会被释放,所以析构函数可以访问所有请求实例的属性,并且根据那些属性可以修改它的行为(比如查找一个需要被关闭的文件的名称)。

    +

    Swift 会自动释放不再需要的实例以释放资源。如自动引用计数那一章描述,Swift 通过自动引用计数(ARC)处理实例的内存管理。通常当你的实例被释放时不需要手动地去清理。但是,当使用自己的资源时,你可能需要进行一些额外的清理。例如,如果创建了一个自定义的类来打开一个文件,并写入一些数据,你可能需要在类实例被释放之前关闭该文件。

    +

    在类的定义中,每个类最多只能有一个析构函数。析构函数不带任何参数,在写法上不带括号:

    +
    deinit {
    +    // 执行析构过程
    +}
    +
    +

    析构函数是在实例释放发生前一步被自动调用。不允许主动调用自己的析构函数。子类继承了父类的析构函数,并且在子类析构函数实现的最后,父类的析构函数被自动调用。即使子类没有提供自己的析构函数,父类的析构函数也总是被调用。

    +

    因为直到实例的析构函数被调用时,实例才会被释放,所以析构函数可以访问所有请求实例的属性,并且根据那些属性可以修改它的行为(比如查找一个需要被关闭的文件的名称)。

    +

    析构函数操作

    -

    这里是一个析构函数操作的例子。这个例子是一个简单的游戏,定义了两种新类型,Bank和Player。Bank结构体管理一个虚拟货币的流通,在这个流通中Bank永远不可能拥有超过10,000的硬币。在这个游戏中有且只能有一个Bank存在,因此Bank由带有静态属性和静态方法的结构体实现,从而存储和管理其当前的状态。

    -
    1  struct Bank {
    -2      static var coinsInBank = 10_000
    -3      static func vendCoins(var numberOfCoinsToVend: Int) -> Int {
    -4         numberOfCoinsToVend = min(numberOfCoinsToVend, coinsInBank)
    -5         coinsInBank -= numberOfCoinsToVend
    -6         return numberOfCoinsToVend
    -7      }
    -8       static func receiveCoins(coins: Int) {
    -9    coinsInBank += coins
    -10     }
    -11  }
    -

    Bank根据它的coinsInBank属性来跟踪当前它拥有的硬币数量。银行还提供两个方法—vendCoins和receiveCoins,用来处理硬币的分发和收集。

    -

    vendCoins方法在bank分发硬币之前检查是否有足够的硬币。如果没有足够多的硬币,bank返回一个比请求时小的数字(如果没有硬币留在bank中就返回0)。vendCoins方法声明numberOfCoinsToVend为一个变量参数,这样就可以在方法体的内部修改数字,而不需要定义一个新的变量。vendCoins方法返回一个整型值,表明了提供的硬币的实际数目。

    -

    receiveCoins方法只是将bank的硬币存储和接收到的硬币数目相加,再保存回bank。

    -

    Player类描述了游戏中的一个玩家。每一个player在任何时刻都有一定数量的硬币存储在他们的钱包中。这通过player的coinsInPurse属性来体现:

    -
        1  class Player {
    -    2     var coinsInPurse: Int
    -    3     init(coins: Int) {
    -    4         coinsInPurse = Bank.vendCoins(coins)
    -    5     }
    -    6     func winCoins(coins: Int) {
    -    7         coinsInPurse += Bank.vendCoins(coins)
    -    8     }
    -    9     deinit {
    -    10        Bank.receiveCoins(coinsInPurse)
    -    11    }
    -    12  }
    -

    每个Player实例都由一个指定数目硬币组成的启动额度初始化,这些硬币在bank初始化的过程中得到。如果没有足够的硬币可用,Player实例可能收到比指定数目少的硬币。

    -

    Player类定义了一个winCoins方法,该方法从bank获取一定数量的硬币,并把它们添加到player的钱包。Player类还实现了一个析构函数,这个析构函数在Player实例释放前一步被调用。这里析构函数只是将player的所有硬币都返回给bank:

    -
    1  var playerOne: Player? = Player(coins: 100)
    -2  println("A new player has joined the game with \    (playerOne!.coinsInPurse) coins")
    -3  // 输出 "A new player has joined the game with 100     coins"
    -4  println("There are now \(Bank.coinsInBank) coins left     in the bank")
    -5  // 输出 "There are now 9900 coins left in the bank"
    -

    一个新的Player实例随着一个100个硬币(如果有)的请求而被创建。这个Player实例存储在一个名为playerOne的可选Player变量中。这里使用一个可选变量,是因为players可以随时离开游戏。设置为可选使得你可以跟踪当前是否有player在游戏中。

    -

    因为playerOne是可选的,所以由一个感叹号(!)来修饰,每当其winCoins方法被调用时,coinsInPurse属性被访问并打印出它的默认硬币数目。

    -
    1  playerOne!.winCoins(2_000)
    -2  println("PlayerOne won 2000 coins & now has \    (playerOne!.coinsInPurse) coins")
    -3  // 输出 "PlayerOne won 2000 coins & now has 2100 coins"
    -4  println("The bank now only has \(Bank.coinsInBank) coins left")
    -5  // 输出 "The bank now only has 7900 coins left"
    -

    这里,player已经赢得了2,000硬币。player的钱包现在有2,100硬币,bank只剩余7,900硬币。

    -
    1  playerOne = nil
    -2  println("PlayerOne has left the game")
    -3  // 输出 "PlayerOne has left the game"
    -4  println("The bank now has \(Bank.coinsInBank) coins")
    -5  // 输出 "The bank now has 10000 coins"
    -

    player现在已经离开了游戏。这表明是要将可选的playerOne变量设置为nil,意思是"没有Player实例"。当这种情况发生的时候,playerOne变量对Player实例的引用被破坏了。没有其它属性或者变量引用Player实例,因此为了清空它占用的内存从而释放它。在这发生前一步,其析构函数被自动调用,其硬币被返回到bank。

    +

    这里是一个析构函数操作的例子。这个例子是一个简单的游戏,定义了两种新类型,BankPlayerBank结构体管理一个虚拟货币的流通,在这个流通中Bank永远不可能拥有超过 10,000 的硬币。在这个游戏中有且只能有一个Bank存在,因此Bank由带有静态属性和静态方法的结构体实现,从而存储和管理其当前的状态。

    +
    struct Bank {
    +    static var coinsInBank = 10_000
    +    static func vendCoins(var numberOfCoinsToVend: Int) -> Int {
    +          numberOfCoinsToVend = min(numberOfCoinsToVend, coinsInBank)
    +          coinsInBank -= numberOfCoinsToVend
    +         return numberOfCoinsToVend
    +    }
    +    static func receiveCoins(coins: Int) {
    +        coinsInBank += coins
    +    }
    +}
    +
    +

    Bank根据它的coinsInBank属性来跟踪当前它拥有的硬币数量。银行还提供两个方法——vendCoinsreceiveCoins——用来处理硬币的分发和收集。

    +

    vendCoins方法在 bank 分发硬币之前检查是否有足够的硬币。如果没有足够多的硬币,Bank返回一个比请求时小的数字(如果没有硬币留在 bank 中就返回 0)。vendCoins方法声明numberOfCoinsToVend为一个变量参数,这样就可以在方法体的内部修改数字,而不需要定义一个新的变量。vendCoins方法返回一个整型值,表明了提供的硬币的实际数目。

    +

    receiveCoins方法只是将 bank 的硬币存储和接收到的硬币数目相加,再保存回 bank。

    +

    Player类描述了游戏中的一个玩家。每一个 player 在任何时刻都有一定数量的硬币存储在他们的钱包中。这通过 player 的coinsInPurse属性来体现:

    +
    class Player {
    +    var coinsInPurse: Int
    +    init(coins: Int) {
    +        coinsInPurse = Bank.vendCoins(coins)
    +    }
    +    func winCoins(coins: Int) {
    +        coinsInPurse += Bank.vendCoins(coins)
    +    }
    +    deinit {
    +        Bank.receiveCoins(coinsInPurse)
    +    }
    +}
    +
    +

    每个Player实例都由一个指定数目硬币组成的启动额度初始化,这些硬币在 bank 初始化的过程中得到。如果没有足够的硬币可用,Player实例可能收到比指定数目少的硬币。

    +

    Player类定义了一个winCoins方法,该方法从银行获取一定数量的硬币,并把它们添加到玩家的钱包。Player类还实现了一个析构函数,这个析构函数在Player实例释放前一步被调用。这里析构函数只是将玩家的所有硬币都返回给银行:

    +
    var playerOne: Player? = Player(coins: 100)
    +println("A new player has joined the game with \(playerOne!.coinsInPurse) coins")
    +// 输出 "A new player has joined the game with 100  coins"
    +println("There are now \(Bank.coinsInBank) coins left   in the bank")
    +// 输出 "There are now 9900 coins left in the bank"
    +
    +

    一个新的Player实例随着一个 100 个硬币(如果有)的请求而被创建。这个Player实例存储在一个名为playerOne的可选Player变量中。这里使用一个可选变量,是因为玩家可以随时离开游戏。设置为可选使得你可以跟踪当前是否有玩家在游戏中。

    +

    因为playerOne是可选的,所以由一个感叹号(!)来修饰,每当其winCoins方法被调用时,coinsInPurse属性被访问并打印出它的默认硬币数目。

    +
    playerOne!.winCoins(2_000)
    +println("PlayerOne won 2000 coins & now has \ (playerOne!.coinsInPurse) coins")
    +// 输出 "PlayerOne won 2000 coins & now has 2100 coins"
    +println("The bank now only has \(Bank.coinsInBank) coins left")
    +// 输出 "The bank now only has 7900 coins left"
    +
    +

    这里,player 已经赢得了 2,000 硬币。player 的钱包现在有 2,100 硬币,bank 只剩余 7,900 硬币。

    +
    playerOne = nil
    +println("PlayerOne has left the game")
    +// 输出 "PlayerOne has left the game"
    +println("The bank now has \(Bank.coinsInBank) coins")
    +// 输出 "The bank now has 10000 coins"
    +
    +

    玩家现在已经离开了游戏。这表明是要将可选的playerOne变量设置为nil,意思是“没有Player实例”。当这种情况发生的时候,playerOne变量对Player实例的引用被破坏了。没有其它属性或者变量引用Player实例,因此为了清空它占用的内存从而释放它。在这发生前一步,其析构函数被自动调用,其硬币被返回到银行。

    @@ -667,16 +692,8 @@
    - - - - - - - - - - + + @@ -694,6 +711,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/16_Automatic_Reference_Counting.html b/chapter2/16_Automatic_Reference_Counting.html index 35d20388..9e8cc76b 100644 --- a/chapter2/16_Automatic_Reference_Counting.html +++ b/chapter2/16_Automatic_Reference_Counting.html @@ -1,57 +1,45 @@ - - + - 自动引用计数 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,131 +595,149 @@
    -
    +
    -

    自动引用计数

    +
    +

    翻译:TimothyYe
    校对:Hawstein

    +
    +

    自动引用计数

    +

    本页包含内容:

    -

    Swift使用自动引用计数(ARC)这一机制来跟踪和管理你的应用程序的内存。通常情况下,Swift的内存管理机制会一直起着作用,你无须自己来考虑内存的管理。ARC会在类的实例不再被使用时,自动释放其占用的内存。

    -

    然而,在少数情况下,ARC为了能帮助你管理内存,需要更多的关于你的代码之间关系的信息。本章描述了这些情况,并且为你示范怎样启用ARC来管理你的应用程序的内存。

    +

    Swift 使用自动引用计数(ARC)这一机制来跟踪和管理你的应用程序的内存。通常情况下,Swift 的内存管理机制会一直起着作用,你无须自己来考虑内存的管理。ARC 会在类的实例不再被使用时,自动释放其占用的内存。

    +

    然而,在少数情况下,ARC 为了能帮助你管理内存,需要更多的关于你的代码之间关系的信息。本章描述了这些情况,并且为你示范怎样启用 ARC 来管理你的应用程序的内存。

    -

    注意: 引用计数仅仅应用于类的实例。结构体和枚举类型是值类型,不是引用类型,也不是通过引用的方式存储和传递。

    +

    注意:
    引用计数仅仅应用于类的实例。结构体和枚举类型是值类型,不是引用类型,也不是通过引用的方式存储和传递。

    +

    自动引用计数的工作机制

    -

    当你每次创建一个类的新的实例的时候,ARC会分配一大块内存用来储存实例的信息。内存中会包含实例的类型信息,以及这个实例所有相关属性的值。此外,当实例不再被使用时,ARC释放实例所占用的内存,并让释放的内存能挪作他用。这确保了不再被使用的实例,不会一直占用内存空间。

    -

    然而,当ARC收回和释放了正在被使用中的实例,该实例的属性和方法将不能再被访问和调用。实际上,如果你试图访问这个实例,你的应用程序很可能会崩溃。

    -

    为了确保使用中的实例不会被销毁,ARC会跟踪和计算每一个实例正在被多少属性,常量和变量所引用。哪怕实例的引用数为一,ARC都不会销毁这个实例。

    +

    当你每次创建一个类的新的实例的时候,ARC 会分配一大块内存用来储存实例的信息。内存中会包含实例的类型信息,以及这个实例所有相关属性的值。此外,当实例不再被使用时,ARC 释放实例所占用的内存,并让释放的内存能挪作他用。这确保了不再被使用的实例,不会一直占用内存空间。

    +

    然而,当 ARC 收回和释放了正在被使用中的实例,该实例的属性和方法将不能再被访问和调用。实际上,如果你试图访问这个实例,你的应用程序很可能会崩溃。

    +

    为了确保使用中的实例不会被销毁,ARC 会跟踪和计算每一个实例正在被多少属性,常量和变量所引用。哪怕实例的引用数为一,ARC都不会销毁这个实例。

    为了使之成为可能,无论你将实例赋值给属性,常量或者是变量,属性,常量或者变量,都会对此实例创建强引用。之所以称之为强引用,是因为它会将实例牢牢的保持住,只要强引用还在,实例是不允许被销毁的。

    -

    自动引用计数实战

    -

    下面的例子展示了自动引用计数的工作机制。例子以一个简单的Person类开始,并定义了一个叫name的常量属性:

    -
        class Person {
    -        let name: String
    -
    -            init(name: String) {
    -            self.name = name
    -            println("\(name) is being initialized")
    -        }
    -
    -            deinit {
    -            println("\(name) is being deinitialized")
    -        }
    +

    +

    自动引用计数实践

    +

    下面的例子展示了自动引用计数的工作机制。例子以一个简单的Person类开始,并定义了一个叫name的常量属性:

    +
    class Person {
    +    let name: String
    +    init(name: String) {
    +        self.name = name
    +        println("\(name) is being initialized")
         }
    -

    Person类有一个构造函数,此构造函数为实例的name属性赋值并打印出信息,以表明初始化过程生效。Person类同时也拥有析构函数,同样会在实例被销毁的时候打印出信息。

    -

    接下来的代码片段定义了三个类型为Person?的变量,用来按照代码片段中的顺序,为新的Person实例建立多个引用。由于这些变量是被定义为可选类型(Person?,而不是Person),它们的值会被自动初始化为nil,目前还不会引用到Person类的实例。

    -
        var reference1: Person?
    -    var reference2: Person?
    -    var reference3: Person?
    -

    现在你可以创建Person类的新实例,并且将它赋值给三个变量其中的一个:

    -
        reference1 = Person(name: "John Appleseed")
    -    // prints "John Appleseed is being initialized”
    -

    应当注意到当你调用Person类的构造函数的时候,"John Appleseed is being initialized”会被打印出来。由此可以确定构造函数被执行。

    -

    由于Person类的新实例被赋值给了reference1变量,所以reference1到Person类的新实例之间建立了一个强引用。正是因为这个强引用,ARC会保证Person实例被保持在内存中不被销毁。

    -

    如果你将同样的Person实例也赋值给其他两个变量,该实例又会多出两个强引用:

    -
        reference2 = reference1
    -    reference3 = reference1
    -

    现在这个Person实例已经有三个强引用了。

    -

    如果你通过给两个变量赋值nil的方式断开两个强引用(包括最先的那个强引用),只留下一个强引用,Person实例不会被销毁:

    -
    reference2 = reference1
    +    deinit {
    +        println("\(name) is being deinitialized")
    +    }
    +}
    +
    +

    Person类有一个构造函数,此构造函数为实例的name属性赋值并打印出信息,以表明初始化过程生效。Person类同时也拥有析构函数,同样会在实例被销毁的时候打印出信息。

    +

    接下来的代码片段定义了三个类型为Person?的变量,用来按照代码片段中的顺序,为新的Person实例建立多个引用。由于这些变量是被定义为可选类型(Person?,而不是Person),它们的值会被自动初始化为nil,目前还不会引用到Person类的实例。

    +
    var reference1: Person?
    +var reference2: Person?
    +var reference3: Person?
    +
    +

    现在你可以创建Person类的新实例,并且将它赋值给三个变量其中的一个:

    +
    reference1 = Person(name: "John Appleseed")
    +// prints "John Appleseed is being initialized”
    +
    +

    应当注意到当你调用Person类的构造函数的时候,"John Appleseed is being initialized”会被打印出来。由此可以确定构造函数被执行。

    +

    由于Person类的新实例被赋值给了reference1变量,所以reference1Person类的新实例之间建立了一个强引用。正是因为这个强引用,ARC 会保证Person实例被保持在内存中不被销毁。

    +

    如果你将同样的Person实例也赋值给其他两个变量,该实例又会多出两个强引用:

    +
    reference2 = reference1
     reference3 = reference1
    -

    ARC会在第三个,也即最后一个强引用被断开的时候,销毁Person实例,这也意味着你不再使用这个Person实例:

    -
    reference3 = nil
    +
    +

    现在这个Person实例已经有三个强引用了。

    +

    如果你通过给两个变量赋值nil的方式断开两个强引用()包括最先的那个强引用),只留下一个强引用,Person实例不会被销毁:

    +
    reference2 = nil
    +reference3 = nil
    +
    +

    ARC 会在第三个,也即最后一个强引用被断开的时候,销毁Person实例,这也意味着你不再使用这个Person实例:

    +
    reference3 = nil
     // prints "John Appleseed is being deinitialized"
    -

    类实例之间的循环强引用

    -

    在上面的例子中,ARC会跟踪你所新创建的Person实例的引用数量,并且会在Person实例不再被需要时销毁它。

    +
    +

    +

    类实例之间的循环强引用

    +

    在上面的例子中,ARC 会跟踪你所新创建的Person实例的引用数量,并且会在Person实例不再被需要时销毁它。

    然而,我们可能会写出这样的代码,一个类永远不会有0个强引用。这种情况发生在两个类实例互相保持对方的强引用,并让对方不被销毁。这就是所谓的循环强引用。

    -

    你可以通过定义类之间的关系为弱引用或者无主引用,以此替代强引用,从而解决循环强引用的问题。具体的过程在解决类实例之间的循环强引用中有描述。不管怎样,在你学习怎样解决循环强引用之前,很有必要了解一下它是怎样产生的。

    -

    下面展示了一个不经意产生循环强引用的例子。例子定义了两个类:Person和Apartment,用来建模公寓和它其中的居民:

    -
    class Person {
    +

    你可以通过定义类之间的关系为弱引用或者无主引用,以此替代强引用,从而解决循环强引用的问题。具体的过程在解决类实例之间的循环强引用中有描述。不管怎样,在你学习怎样解决循环强引用之前,很有必要了解一下它是怎样产生的。

    +

    下面展示了一个不经意产生循环强引用的例子。例子定义了两个类:PersonApartment,用来建模公寓和它其中的居民:

    +
    class Person {
         let name: String
         init(name: String) { self.name = name }
         var apartment: Apartment?
         deinit { println("\(name) is being deinitialized") }
     }
    -
    -class Apartment {
    +
    +
    class Apartment {
         let number: Int
         init(number: Int) { self.number = number }
         var tenant: Person?
         deinit { println("Apartment #\(number) is being deinitialized") }
     }
    -

    每一个Person实例有一个类型为String,名字为name的属性,并有一个可选的初始化为nil的apartment属性。apartment属性是可选的,因为一个人并不总是拥有公寓。

    -

    类似的,每个Apartment实例有一个叫number,类型为Int的属性,并有一个可选的初始化为nil的tenant属性。tenant属性是可选的,因为一栋公寓并不总是有居民。

    -

    这两个类都定义了析构函数,用以在类实例被析构的时候输出信息。这让你能够知晓Person和Apartment的实例是否像预期的那样被销毁。

    -

    接下来的代码片段定义了两个可选类型的变量john和number73,并分别被设定为下面的Apartment和Person的实例。这两个变量都被初始化为nil,并为可选的:

    -
    var john: Person?
    +
    +

    每一个Person实例有一个类型为String,名字为name的属性,并有一个可选的初始化为nilapartment属性。apartment属性是可选的,因为一个人并不总是拥有公寓。

    +

    类似的,每个Apartment实例有一个叫number,类型为Int的属性,并有一个可选的初始化为niltenant属性。tenant属性是可选的,因为一栋公寓并不总是有居民。

    +

    这两个类都定义了析构函数,用以在类实例被析构的时候输出信息。这让你能够知晓PersonApartment的实例是否像预期的那样被销毁。

    +

    接下来的代码片段定义了两个可选类型的变量johnnumber73,并分别被设定为下面的ApartmentPerson的实例。这两个变量都被初始化为nil,并为可选的:

    +
    var john: Person?
     var number73: Apartment?
    -

    现在你可以创建特定的Person和Apartment实例并将类实例赋值给john和number73变量:

    -
    john = Person(name: "John Appleseed")
    +
    +

    现在你可以创建特定的PersonApartment实例并将类实例赋值给johnnumber73变量:

    +
    john = Person(name: "John Appleseed")
     number73 = Apartment(number: 73)
    -

    在两个实例被创建和赋值后,下图表面了强引用的关系。变量john现在有一个指向Person实例的强引用,而变量number73有一个指向Apartment实例的强引用:

    +
    +

    在两个实例被创建和赋值后,下图表现了强引用的关系。变量john现在有一个指向Person实例的强引用,而变量number73有一个指向Apartment实例的强引用:

    -

    现在你能够将这两个实例关联在一起,这样人就能有公寓住了,而公寓也有了房客。注意感叹号是用来展开和访问可选变量john和number73中的实例,这样实例的属性才能被赋值:

    -
    john!.apartment = number73
    +

    现在你能够将这两个实例关联在一起,这样人就能有公寓住了,而公寓也有了房客。注意感叹号是用来展开和访问可选变量johnnumber73中的实例,这样实例的属性才能被赋值:

    +
    john!.apartment = number73
     number73!.tenant = john
    -

    在将两个实例联系在一起之后,强引用的关系如图所示:

    +
    +

    在将两个实例联系在一起之后,强引用的关系如图所示:

    -

    不幸的是,将这两个实例关联在一起之后,一个循环强引用被创建了。Person实例现在有了一个指向Apartment实例的强引用,而Apartment实例也有了一个指向Person实例的强引用。因此,当你断开john和number73变量所持有的强引用时,引用计数并不会降为0,实例也不会被ARC销毁:

    -
    john = nil
    +

    不幸的是,将这两个实例关联在一起之后,一个循环强引用被创建了。Person实例现在有了一个指向Apartment实例的强引用,而Apartment实例也有了一个指向Person实例的强引用。因此,当你断开johnnumber73变量所持有的强引用时,引用计数并不会降为 0,实例也不会被 ARC 销毁:

    +
    john = nil
     number73 = nil
    -

    注意,当你把这两个变量设为nil时,没有任何一个析构函数被调用。强引用循环阻止了Person和Apartment类实例的销毁,并在你的应用程序中造成了内存泄漏。

    -

    在你将john和number73赋值为nil后,强引用关系如下图:

    +
    +

    注意,当你把这两个变量设为nil时,没有任何一个析构函数被调用。强引用循环阻止了PersonApartment类实例的销毁,并在你的应用程序中造成了内存泄漏。

    +

    在你将johnnumber73赋值为nil后,强引用关系如下图:

    -

    Person和Apartment实例之间的强引用关系保留了下来并且不会被断开。

    +

    PersonApartment实例之间的强引用关系保留了下来并且不会被断开。

    +

    解决实例之间的循环强引用

    -

    Swift提供了两种办法用来解决你在使用类的属性时所遇到的循环强引用问题:弱引用(weak reference)和无主引用(unowned reference)。

    +

    Swift 提供了两种办法用来解决你在使用类的属性时所遇到的循环强引用问题:弱引用(weak reference)和无主引用(unowned reference)。

    弱引用和无主引用允许循环引用中的一个实例引用另外一个实例而不保持强引用。这样实例能够互相引用而不产生循环强引用。

    -

    对于生命周期中会变为nil的实例使用弱引用。相反的,对于初始化赋值后再也不会被赋值为nil的实例,使用无主引用。

    -

    弱引用

    -

    弱引用不会牢牢保持住引用的实例,并且不会阻止ARC销毁被引用的实例。这种行为阻止了引用变为循环强引用。声明属性或者变量时,在前面加上weak关键字表明这是一个弱引用。

    -

    在实例的生命周期中,如果某些时候引用没有值,那么弱引用可以阻止循环强引用。如果引用总是有值,则可以使用无主引用,在无主引用中有描述。在上面Apartment的例子中,一个公寓的生命周期中,有时是没有“居民”的,因此适合使用弱引用来解决循环强引用。

    +

    对于生命周期中会变为nil的实例使用弱引用。相反的,对于初始化赋值后再也不会被赋值为nil的实例,使用无主引用。

    +

    弱引用

    +

    弱引用不会牢牢保持住引用的实例,并且不会阻止 ARC 销毁被引用的实例。这种行为阻止了引用变为循环强引用。声明属性或者变量时,在前面加上weak关键字表明这是一个弱引用。

    +

    在实例的生命周期中,如果某些时候引用没有值,那么弱引用可以阻止循环强引用。如果引用总是有值,则可以使用无主引用,在无主引用中有描述。在上面Apartment的例子中,一个公寓的生命周期中,有时是没有“居民”的,因此适合使用弱引用来解决循环强引用。

    -

    注意: 弱引用必须被声明为变量,表明其值能在运行时被修改。弱引用不能被声明为常量。

    +

    注意:
    弱引用必须被声明为变量,表明其值能在运行时被修改。弱引用不能被声明为常量。

    -

    因为弱引用可以没有值,你必须将每一个弱引用声明为可选类型。可选类型是在Swift语言中推荐的用来表示可能没有值的类型。

    -

    因为弱引用不会保持所引用的实例,即使引用存在,实例也有可能被销毁。因此,ARC会在引用的实例被销毁后自动将其赋值为nil。你可以像其他可选值一样,检查弱引用的值是否存在,你永远也不会遇到被销毁了而不存在的实例。

    -

    下面的例子跟上面Person和Apartment的例子一致,但是有一个重要的区别。这一次,Apartment的tenant属性被声明为弱引用:

    -
    class Person {
    +

    因为弱引用可以没有值,你必须将每一个弱引用声明为可选类型。可选类型是在 Swift 语言中推荐的用来表示可能没有值的类型。

    +

    因为弱引用不会保持所引用的实例,即使引用存在,实例也有可能被销毁。因此,ARC 会在引用的实例被销毁后自动将其赋值为nil。你可以像其他可选值一样,检查弱引用的值是否存在,你永远也不会遇到被销毁了而不存在的实例。

    +

    下面的例子跟上面PersonApartment的例子一致,但是有一个重要的区别。这一次,Apartmenttenant属性被声明为弱引用:

    +
    class Person {
         let name: String
         init(name: String) { self.name = name }
         var apartment: Apartment?
         deinit { println("\(name) is being deinitialized") }
     }
    -
    -class Apartment {
    +
    +
    class Apartment {
         let number: Int
         init(number: Int) { self.number = number }
         weak var tenant: Person?
         deinit { println("Apartment #\(number) is being deinitialized") }
     }
    -

    然后跟之前一样,建立两个变量(john和number73)之间的强引用,并关联两个实例:

    -
    var john: Person?
    +
    +

    然后跟之前一样,建立两个变量(john和number73)之间的强引用,并关联两个实例:

    +
    var john: Person?
     var number73: Apartment?
     
     john = Person(name: "John Appleseed")
    @@ -719,31 +745,34 @@ number73 = Apartment(number: 73)
     
     john!.apartment = number73
     number73!.tenant = john
    -

    现在,两个关联在一起的实例的引用关系如下图所示:

    +
    +

    现在,两个关联在一起的实例的引用关系如下图所示:

    -

    Person实例依然保持对Apartment实例的强引用,但是Apartment实例只是对Person实例的弱引用。这意味着当你断开john变量所保持的强引用时,再也没有指向Person实例的强引用了:

    +

    Person实例依然保持对Apartment实例的强引用,但是Apartment实例只是对Person实例的弱引用。这意味着当你断开john变量所保持的强引用时,再也没有指向Person实例的强引用了:

    -

    由于再也没有指向Person实例的强引用,该实例会被销毁:

    -
    john = nil
    +

    由于再也没有指向Person实例的强引用,该实例会被销毁:

    +
    john = nil
     // prints "John Appleseed is being deinitialized"
    -

    唯一剩下的指向Apartment实例的强引用来自于变量number73。如果你断开这个强引用,再也没有指向Apartment实例的强引用了:

    +
    +

    唯一剩下的指向Apartment实例的强引用来自于变量number73。如果你断开这个强引用,再也没有指向Apartment实例的强引用了:

    -

    由于再也没有指向Apartment实例的强引用,该实例也会被销毁:

    -
    number73 = nil
    +

    由于再也没有指向Apartment实例的强引用,该实例也会被销毁:

    +
    number73 = nil
     // prints "Apartment #73 is being deinitialized"
    -

    上面的两段代码展示了变量john和number73在被赋值为nil后,Person实例和Apartment实例的析构函数都打印出“销毁”的信息。这证明了引用循环被打破了。

    -

    无主引用

    -

    和弱引用类似,无主引用不会牢牢保持住引用的实例。和弱引用不同的是,无主引用是永远有值的。因此,无主引用总是被定义为非可选类型(non-optional type)。你可以在声明属性或者变量时,在前面加上关键字unowned表示这是一个无主引用。

    -

    由于无主引用是非可选类型,你不需要在使用它的时候将它展开。无主引用总是可以被直接访问。不过ARC无法在实例被销毁后将无主引用设为nil,因为非可选类型的变量不允许被赋值为nil。

    +
    +

    上面的两段代码展示了变量johnnumber73在被赋值为nil后,Person实例和Apartment实例的析构函数都打印出“销毁”的信息。这证明了引用循环被打破了。

    +

    +

    无主引用

    +

    和弱引用类似,无主引用不会牢牢保持住引用的实例。和弱引用不同的是,无主引用是永远有值的。因此,无主引用总是被定义为非可选类型(non-optional type)。你可以在声明属性或者变量时,在前面加上关键字unowned表示这是一个无主引用。

    +

    由于无主引用是非可选类型,你不需要在使用它的时候将它展开。无主引用总是可以被直接访问。不过 ARC 无法在实例被销毁后将无主引用设为nil,因为非可选类型的变量不允许被赋值为nil

    -

    注意: 如果你试图在实例被销毁后,访问该实例的无主引用,会触发运行时错误。使用无主引用,你必须确保引用始终指向一个未销毁的实例。

    -

    还需要注意的是如果你试图访问实例已经被销毁的无主引用,程序会直接崩溃,而不会发生无法预期的行为。所以你应当避免这样的事情发生。

    +

    注意:
    如果你试图在实例被销毁后,访问该实例的无主引用,会触发运行时错误。使用无主引用,你必须确保引用始终指向一个未销毁的实例。
    还需要注意的是如果你试图访问实例已经被销毁的无主引用,程序会直接崩溃,而不会发生无法预期的行为。所以你应当避免这样的事情发生。

    -

    下面的例子定义了两个类,Customer和CreditCard,模拟了银行客户和客户的信用卡。这两个类中,每一个都将另外一个类的实例作为自身的属性。这种关系会潜在的创造循环强引用。

    -

    Customer和CreditCard之间的关系与前面弱引用例子中Apartment和Person的关系截然不同。在这个数据模型中,一个客户可能有或者没有信用卡,但是一张信用卡总是关联着一个客户。为了表示这种关系,Customer类有一个可选类型的card属性,但是CreditCard类有一个非可选类型的customer属性。

    -

    此外,只能通过将一个number值和customer实例传递给CreditCard构造函数的方式来创建CreditCard实例。这样可以确保当创建CreditCard实例时总是有一个customer实例与之关联。

    -

    由于信用卡总是关联着一个客户,因此将customer属性定义为无主引用,用以避免循环强引用:

    -
    class Customer {
    +

    下面的例子定义了两个类,CustomerCreditCard,模拟了银行客户和客户的信用卡。这两个类中,每一个都将另外一个类的实例作为自身的属性。这种关系会潜在的创造循环强引用。

    +

    CustomerCreditCard之间的关系与前面弱引用例子中ApartmentPerson的关系截然不同。在这个数据模型中,一个客户可能有或者没有信用卡,但是一张信用卡总是关联着一个客户。为了表示这种关系,Customer类有一个可选类型的card属性,但是CreditCard类有一个非可选类型的customer属性。

    +

    此外,只能通过将一个number值和customer实例传递给CreditCard构造函数的方式来创建CreditCard实例。这样可以确保当创建CreditCard实例时总是有一个customer实例与之关联。

    +

    由于信用卡总是关联着一个客户,因此将customer属性定义为无主引用,用以避免循环强引用:

    +
    class Customer {
         let name: String
         var card: CreditCard?
         init(name: String) {
    @@ -751,8 +780,8 @@ number73!.tenant = john
         }
         deinit { println("\(name) is being deinitialized") }
     }
    -
    -class CreditCard {
    +
    +
    class CreditCard {
         let number: Int
         unowned let customer: Customer
         init(number: Int, customer: Customer) {
    @@ -761,29 +790,33 @@ class CreditCard {
         }
         deinit { println("Card #\(number) is being deinitialized") }
     }
    -

    下面的代码片段定义了一个叫john的可选类型Customer变量,用来保存某个特定客户的引用。由于是可选类型,所以变量被初始化为nil。

    -
    var john: Customer?
    -

    现在你可以创建Customer类的实例,用它初始化CreditCard实例,并将新创建的CreditCard实例赋值为客户的card属性。

    -
    john = Customer(name: "John Appleseed")
    +
    +

    下面的代码片段定义了一个叫john的可选类型Customer变量,用来保存某个特定客户的引用。由于是可选类型,所以变量被初始化为nil

    +
    var john: Customer?
    +
    +

    现在你可以创建Customer类的实例,用它初始化CreditCard实例,并将新创建的CreditCard实例赋值为客户的card属性。

    +
    john = Customer(name: "John Appleseed")
     john!.card = CreditCard(number: 1234_5678_9012_3456, customer: john!)
    -

    在你关联两个实例后,他们的引用关系如下图所示:

    +
    +

    在你关联两个实例后,它们的引用关系如下图所示:

    -

    Customer实例持有对CreditCard实例的强引用,而CreditCard实例持有对Customer实例的无主引用。

    -

    由于customer的无主引用,当你断开john变量持有的强引用时,再也没有指向Customer实例的强引用了:

    +

    Customer实例持有对CreditCard实例的强引用,而CreditCard实例持有对Customer实例的无主引用。

    +

    由于customer的无主引用,当你断开john变量持有的强引用时,再也没有指向Customer实例的强引用了:

    -

    由于再也没有指向Customer实例的强引用,该实例被销毁了。其后,再也没有指向CreditCard实例的强引用,该实例也随之被销毁了:

    -
    john = nil
    +

    由于再也没有指向Customer实例的强引用,该实例被销毁了。其后,再也没有指向CreditCard实例的强引用,该实例也随之被销毁了:

    +
    john = nil
     // prints "John Appleseed is being deinitialized"
     // prints "Card #1234567890123456 is being deinitialized"
    -

    最后的代码展示了在john变量被设为nil后Customer实例和CreditCard实例的构造函数都打印出了“销毁”的信息。

    -

    无主引用以及显式展开的可选属性

    +
    +

    最后的代码展示了在john变量被设为nilCustomer实例和CreditCard实例的构造函数都打印出了“销毁”的信息。

    +

    无主引用以及隐式解析可选属性

    上面弱引用和无主引用的例子涵盖了两种常用的需要打破循环强引用的场景。

    -

    Person和Apartment的例子展示了两个属性的值都允许为nil,并会潜在的产生循环强引用。这种场景最适合用弱引用来解决。

    -

    Customer和CreditCard的例子展示了一个属性的值允许为nil,而另一个属性的值不允许为nil,并会潜在的产生循环强引用。这种场景最适合通过无主引用来解决。

    -

    然而,存在着第三种场景,在这种场景中,两个属性都必须有值,并且初始化完成后不能为nil。在这种场景中,需要一个类使用无主属性,而另外一个类使用显示展开的可选属性。

    -

    这使两个属性在初始化完成后能被直接访问(不需要可选展开),同事避免了循环引用。这一节将为你展示如何建立这种关系。

    -

    下面的例子定义了两个类,Country和City,每个类将另外一个类的实例保存为属性。在这个模型中,每个国家必须有首都,而每一个城市必须属于一个国家。为了实现这种关系,Country类拥有一个capitalCity属性,而City类有一个country属性:

    -
    class Country {
    +

    PersonApartment的例子展示了两个属性的值都允许为nil,并会潜在的产生循环强引用。这种场景最适合用弱引用来解决。

    +

    CustomerCreditCard的例子展示了一个属性的值允许为nil,而另一个属性的值不允许为nil,并会潜在的产生循环强引用。这种场景最适合通过无主引用来解决。

    +

    然而,存在着第三种场景,在这种场景中,两个属性都必须有值,并且初始化完成后不能为nil。在这种场景中,需要一个类使用无主属性,而另外一个类使用隐式解析可选属性。

    +

    这使两个属性在初始化完成后能被直接访问(不需要可选展开),同时避免了循环引用。这一节将为你展示如何建立这种关系。

    +

    下面的例子定义了两个类,CountryCity,每个类将另外一个类的实例保存为属性。在这个模型中,每个国家必须有首都,而每一个城市必须属于一个国家。为了实现这种关系,Country类拥有一个capitalCity属性,而City类有一个country属性:

    +
    class Country {
         let name: String
         let capitalCity: City!
         init(name: String, capitalName: String) {
    @@ -791,8 +824,8 @@ john!.card = CreditCard(number: 1234_5678_9012_3456, customer: john!)
             self.capitalCity = City(name: capitalName, country: self)
         }
     }
    -
    -class City {
    +
    +
    class City {
         let name: String
         unowned let country: Country
         init(name: String, country: Country) {
    @@ -800,22 +833,25 @@ class City {
             self.country = country
         }
     }
    -

    为了建立两个类的依赖关系,City的构造函数有一个Country实例的参数,并且将实例保存为country属性。

    -

    Country的构造函数调用了City的构造函数。然而,只有Country的实例完全初始化完后,Country的构造函数才能把self传给City的构造函数。(在两阶段构造函数中有具体描述)

    -

    为了满足这种需求,通过在类型结尾处加上感叹号(City!)的方式,将Country的capitalCity属性声明为显示展开的可选类型属性。这表示像其他可选类型一样,capitalCity属性的默认值为nil,但是不需要展开他的值就能访问它。(在显示展开的可选类型中有描述)

    -

    由于capitalCity默认值为nil,一旦Country的实例在构造函数中给name属性赋值后,整个初始化过程就完成了。这代表一旦name属性被后,Country的构造函数就能引用并传递显式的self。Country的构造函数在赋值capitalCity时,就能将self作为参数传递给City的构造函数。

    -

    以上的意义在于你可以通过一条语句同时创建Country和City的实例,而不产生循环强引用,并且capitalCity的属性能被直接访问,而不需要通过感叹号来展开它的可选值:

    -
    var country = Country(name: "Canada", capitalName: "Ottawa")
    +
    +

    为了建立两个类的依赖关系,City的构造函数有一个Country实例的参数,并且将实例保存为country属性。

    +

    Country的构造函数调用了City的构造函数。然而,只有Country的实例完全初始化完后,Country的构造函数才能把self传给City的构造函数。(在两段式构造过程中有具体描述

    +

    为了满足这种需求,通过在类型结尾处加上感叹号(City!)的方式,将CountrycapitalCity属性声明为隐式解析可选类型的属性。这表示像其他可选类型一样,capitalCity属性的默认值为nil,但是不需要展开它的值就能访问它。(在隐式解析可选类型中有描述

    +

    由于capitalCity默认值为nil,一旦Country的实例在构造函数中给name属性赋值后,整个初始化过程就完成了。这代表一旦name属性被赋值后,Country的构造函数就能引用并传递隐式的selfCountry的构造函数在赋值capitalCity时,就能将self作为参数传递给City的构造函数。

    +

    以上的意义在于你可以通过一条语句同时创建CountryCity的实例,而不产生循环强引用,并且capitalCity的属性能被直接访问,而不需要通过感叹号来展开它的可选值:

    +
    var country = Country(name: "Canada", capitalName: "Ottawa")
     println("\(country.name)'s capital city is called \(country.capitalCity.name)")
     // prints "Canada's capital city is called Ottawa"
    -

    在上面的例子中,使用显示展开可选值的意义在于满足了两个类构造函数的需求。capitalCity属性在初始化完成后,能作为非可选值使用同事还避免了循环强引用。

    +
    +

    在上面的例子中,使用隐式解析可选值的意义在于满足了两个类构造函数的需求。capitalCity属性在初始化完成后,能像非可选值一样使用和存取同时还避免了循环强引用。

    +

    闭包引起的循环强引用

    前面我们看到了循环强引用环是在两个类实例属性互相保持对方的强引用时产生的,还知道了如何用弱引用和无主引用来打破循环强引用。

    -

    循环强引用还会发生在当你将一个闭包赋值给类实例的某个属性,并且这个闭包体中又使用了实例。这个闭包体中可能访问了实例的某个属性,例如self.someProperty,或者闭包中调用了实例的某个方法,例如self.someMethod。这两种情况都导致了闭包 “捕获" self,从而产生了循环强引用。

    +

    循环强引用还会发生在当你将一个闭包赋值给类实例的某个属性,并且这个闭包体中又使用了实例。这个闭包体中可能访问了实例的某个属性,例如self.someProperty,或者闭包中调用了实例的某个方法,例如self.someMethod。这两种情况都导致了闭包 “捕获" self,从而产生了循环强引用。

    循环强引用的产生,是因为闭包和类相似,都是引用类型。当你把一个闭包赋值给某个属性时,你也把一个引用赋值给了这个闭包。实质上,这跟之前的问题是一样的-两个强引用让彼此一直有效。但是,和两个类实例不同,这次一个是类实例,另一个是闭包。

    -

    Swift提供了一种优雅的方法来解决这个问题,称之为闭包占用列表(closuer capture list)。同样的,在学习如何用闭包占用列表破坏循环强引用之前,先来了解一下循环强引用是如何产生的,这对我们是很有帮助的。

    -

    下面的例子为你展示了当一个闭包引用了self后是如何产生一个循环强引用的。例子中定义了一个叫HTMLElement的类,用一种简单的模型表示HTML中的一个单独的元素:

    -
    class HTMLElement {
    +

    Swift 提供了一种优雅的方法来解决这个问题,称之为闭包占用列表(closuer capture list)。同样的,在学习如何用闭包占用列表破坏循环强引用之前,先来了解一下循环强引用是如何产生的,这对我们是很有帮助的。

    +

    下面的例子为你展示了当一个闭包引用了self后是如何产生一个循环强引用的。例子中定义了一个叫HTMLElement的类,用一种简单的模型表示 HTML 中的一个单独的元素:

    +
    class HTMLElement {
     
         let name: String
         let text: String?
    @@ -838,55 +874,61 @@ println("\(country.name)'s capital city is called \(country.capitalCity
         }
     
     }
    -

    HTMLElement类定义了一个name属性来表示这个元素的名称,例如代表段落的"p",或者代表换行的"br"。HTMLElement还定义了一个可选属性text,用来设置和展现HTML元素的文本。

    -

    除了上面的两个属性,HTMLElement还定义了一个lazy属性asHTML。这个属性引用了一个闭包,将name和text组合成HTML字符串片段。该属性是() -> String类型,或者可以理解为“一个没有参数,返回String的函数”。

    -

    默认情况下,闭包赋值给了asHTML属性,这个闭包返回一个代表HTML标签的字符串。如果text值存在,该标签就包含可选值text;如果text不存在,该标签就不包含文本。对于段落元素,根据text是"some text"还是nil,闭包会返回"<p>some text</p>"或者"<p />"。

    -

    可以像实例方法那样去命名、使用asHTML属性。然而,由于asHTML是闭包而不是实例方法,如果你想改变特定元素的HTML处理的话,可以用自定义的闭包来取代默认值。

    +
    +

    HTMLElement类定义了一个name属性来表示这个元素的名称,例如代表段落的"p",或者代表换行的"br"。HTMLElement还定义了一个可选属性text,用来设置和展现 HTML 元素的文本。

    +

    除了上面的两个属性,HTMLElement还定义了一个lazy属性asHTML。这个属性引用了一个闭包,将nametext组合成 HTML 字符串片段。该属性是() -> String类型,或者可以理解为“一个没有参数,返回String的函数”。

    +

    默认情况下,闭包赋值给了asHTML属性,这个闭包返回一个代表 HTML 标签的字符串。如果text值存在,该标签就包含可选值text;如果text不存在,该标签就不包含文本。对于段落元素,根据text是"some text"还是nil,闭包会返回"<p>some text</p>"或者"<p />"。

    +

    可以像实例方法那样去命名、使用asHTML属性。然而,由于asHTML是闭包而不是实例方法,如果你想改变特定元素的 HTML 处理的话,可以用自定义的闭包来取代默认值。

    -

    注意: asHTML声明为lazy属性,因为只有当元素确实需要处理为HTML输出的字符串时,才需要使用asHTML。也就是说,在默认的闭包中可以使用self,因为只有当初始化完成以及self确实存在后,才能访问lazy属性。

    +

    注意:
    asHTML声明为lazy属性,因为只有当元素确实需要处理为HTML输出的字符串时,才需要使用asHTML。也就是说,在默认的闭包中可以使用self,因为只有当初始化完成以及self确实存在后,才能访问lazy属性。

    -

    HTMLElement类只提供一个构造函数,通过name和text(如果有的话)参数来初始化一个元素。该类也定义了一个析构函数,当HTMLElement实例被销毁时,打印一条消息。

    -

    下面的代码展示了如何用HTMLElement类创建实例并打印消息。

    -
    var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world")
    +

    HTMLElement类只提供一个构造函数,通过nametext(如果有的话)参数来初始化一个元素。该类也定义了一个析构函数,当HTMLElement实例被销毁时,打印一条消息。

    +

    下面的代码展示了如何用HTMLElement类创建实例并打印消息。

    +
    var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world")
     println(paragraph!.asHTML())
     // prints"hello, world"
    -
    -

    注意: 上面的paragraph变量定义为可选HTMLElement,因此我们可以赋值nil给它来演示循环强引用。

    +
    +
    +

    注意:
    上面的paragraph变量定义为可选HTMLElement,因此我们可以赋值nil给它来演示循环强引用。

    -

    不幸的是,上面写的HTMLElement类产生了类实例和asHTML默认值的闭包之间的循环强引用。循环强引用如下图所示:

    +

    不幸的是,上面写的HTMLElement类产生了类实例和asHTML默认值的闭包之间的循环强引用。循环强引用如下图所示:

    -

    实例的asHTML属性持有闭包的强引用。但是,闭包在其闭包体内使用了self(引用了self.name和self.text),因此闭包占有了self,这意味着闭包又反过来持有了HTMLElement实例的强引用。这样两个对象就产生了循环强引用。(更多关于闭包占有值的信息,请参考Capturing Values)。

    +

    实例的asHTML属性持有闭包的强引用。但是,闭包在其闭包体内使用了self(引用了self.nameself.text),因此闭包捕获了self,这意味着闭包又反过来持有了HTMLElement实例的强引用。这样两个对象就产生了循环强引用。(更多关于闭包捕获值的信息,请参考值捕获)。

    -

    注意: 虽然闭包多次使用了self,它只占有HTMLElement实例的一个强引用。

    +

    注意:
    虽然闭包多次使用了self,它只捕获HTMLElement实例的一个强引用。

    -

    如果设置paragraph变量为nil,打破它持有的HTMLElement实例的强引用,HTMLElement实例和它的闭包都不会被销毁,也是因为循环强引用:

    -
    paragraph = nil
    -

    注意HTMLElementdeinitializer中的消息并没有别打印,证明了HTMLElement实例并没有被销毁。

    +

    如果设置paragraph变量为nil,打破它持有的HTMLElement实例的强引用,HTMLElement实例和它的闭包都不会被销毁,也是因为循环强引用:

    +
    paragraph = nil
    +
    +

    注意HTMLElementdeinitializer中的消息并没有别打印,证明了HTMLElement实例并没有被销毁。

    +

    解决闭包引起的循环强引用

    -

    在定义闭包时同时定义占有列表作为闭包的一部分,通过这种方式可以解决闭包和类实例之间的循环强引用。占有列表定义了闭包体内占有一个或者多个引用类型的规则。跟解决两个类实例间的循环强引用一样,声明每个占有的引用为弱引用或无主引用,而不是强引用。应当根据代码关系来决定使用弱引用还是无主引用。

    +

    在定义闭包时同时定义捕获列表作为闭包的一部分,通过这种方式可以解决闭包和类实例之间的循环强引用。捕获列表定义了闭包体内捕获一个或者多个引用类型的规则。跟解决两个类实例间的循环强引用一样,声明每个捕获的引用为弱引用或无主引用,而不是强引用。应当根据代码关系来决定使用弱引用还是无主引用。

    -

    注意: Swift有如下要求:只要在闭包内使用self的成员,就要用self.someProperty或者self.someMethod(而不只是someProperty或someMethod)。这提醒你可能会不小心就占有了self。

    +

    注意:
    Swift 有如下要求:只要在闭包内使用self的成员,就要用self.someProperty或者self.someMethod(而不只是somePropertysomeMethod)。这提醒你可能会不小心就捕获了self

    -

    定义占有列表

    -

    占有列表中的每个元素都是由weak或者unowned关键字和实例的引用(如self或someInstance)成对组成。每一对都在花括号中,通过逗号分开。

    -

    占有列表放置在闭包参数列表和返回类型之前:

    -
    @lazy var someClosure: (Int, String) -> String = {
    +

    定义捕获列表

    +

    捕获列表中的每个元素都是由weak或者unowned关键字和实例的引用(如selfsomeInstance)成对组成。每一对都在方括号中,通过逗号分开。

    +

    捕获列表放置在闭包参数列表和返回类型之前:

    +
    @lazy var someClosure: (Int, String) -> String = {
         [unowned self] (index: Int, stringToProcess: String) -> String in
         // closure body goes here
     }
    -

    如果闭包没有指定参数列表或者返回类型,则可以通过上下文推断,那么可以占有列表放在闭包开始的地方,跟着是关键字in:

    -
    @lazy var someClosure: () -> String = {
    +
    +

    如果闭包没有指定参数列表或者返回类型,则可以通过上下文推断,那么可以捕获列表放在闭包开始的地方,跟着是关键字in

    +
    @lazy var someClosure: () -> String = {
         [unowned self] in
         // closure body goes here
     }
    -

    弱引用和无主引用

    -

    当闭包和占有的实例总是互相引用时并且总是同时销毁时,将闭包内的占有定义为无主引用。

    -

    相反的,当占有引用有时可能会是nil时,将闭包内的占有定义为弱引用。弱引用总是可选类型,并且当引用的实例被销毁后,弱引用的值会自动置为nil。这使我们可以在闭包内检查他们是否存在。

    +
    +

    弱引用和无主引用

    +

    当闭包和捕获的实例总是互相引用时并且总是同时销毁时,将闭包内的捕获定义为无主引用。

    +

    相反的,当捕获引用有时可能会是nil时,将闭包内的捕获定义为弱引用。弱引用总是可选类型,并且当引用的实例被销毁后,弱引用的值会自动置为nil。这使我们可以在闭包内检查它们是否存在。

    -

    注意: 如果占有的引用绝对不会置为nil,应该用无主引用,而不是弱引用。

    +

    注意:
    如果捕获的引用绝对不会置为nil,应该用无主引用,而不是弱引用。

    -

    前面的HTMLElement例子中,无主引用是正确的解决循环强引用的方法。这样这样编写HTMLElement类来避免循环强引用:

    -
    class HTMLElement {
    +

    前面的HTMLElement例子中,无主引用是正确的解决循环强引用的方法。这样编写HTMLElement类来避免循环强引用:

    +
    class HTMLElement {
     
         let name: String
         let text: String?
    @@ -910,17 +952,20 @@ println(paragraph!.asHTML())
         }
     
     }
    -

    上面的HTMLElement实现和之前的实现一致,只是在asHTML闭包中多了一个占有列表。这里,占有列表是[unowned self],表示“用无主引用而不是强引用来占有self”。

    -

    和之前一样,我们可以创建并打印HTMLElement实例:

    -
    var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world")
    +
    +

    上面的HTMLElement实现和之前的实现一致,只是在asHTML闭包中多了一个捕获列表。这里,捕获列表是[unowned self],表示“用无主引用而不是强引用来捕获self”。

    +

    和之前一样,我们可以创建并打印HTMLElement实例:

    +
    var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world")
     println(paragraph!.asHTML())
     // prints "<p>hello, world</p>"
    -

    使用占有列表后引用关系如下图所示:

    +
    +

    使用捕获列表后引用关系如下图所示:

    -

    这一次,闭包以无主引用的形式占有self,并不会持有HTMLElement实例的强引用。如果将paragraph赋值为nil,HTMLElement实例将会被销毁,并能看到它的析构函数打印出的消息。

    -
    paragraph = nil
    +

    这一次,闭包以无主引用的形式捕获self,并不会持有HTMLElement实例的强引用。如果将paragraph赋值为nilHTMLElement实例将会被销毁,并能看到它的析构函数打印出的消息。

    +
    paragraph = nil
     // prints "p is being deinitialized"
     
    +
    @@ -938,16 +983,8 @@ println(paragraph!.asHTML())
    - - - - - - - - - - + + @@ -965,6 +1002,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/17_Optional_Chaining.html b/chapter2/17_Optional_Chaining.html index ebf505ed..42d203f6 100644 --- a/chapter2/17_Optional_Chaining.html +++ b/chapter2/17_Optional_Chaining.html @@ -1,57 +1,45 @@ - - + - 可选链 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,63 +595,84 @@
    -
    +
    -

    Optional Chaining

    -

    可选链(Optional Chaining)是一种可以请求和调用属性、方法及子脚本的过程,它的自判断性体现于请求或调用的目标当前可能为空(nil)。如果自判断的目标有值,那么调用就会成功;相反,如果选择的目标为空(nil),则这种调用将返回空(nil)。多次请求或调用可以被链接在一起形成一个链,如果任何一个节点为空(nil)将导致整个链失效。

    -
    -

    笔记: -Swift的自判断链和Objective-C中的消息为空有些相像,但是Swift可以使用在任意类型中,并且失败与否可以被检测到。

    +
    +

    翻译:Jasonbroker
    校对:numbbbbb, stanzhai

    +

    Optional Chaining

    +
    +

    本页包含内容:

    + +

    可选链(Optional Chaining)是一种可以请求和调用属性、方法及子脚本的过程,它的可选性体现于请求或调用的目标当前可能为空(nil)。如果可选的目标有值,那么调用就会成功;相反,如果选择的目标为空(nil),则这种调用将返回空(nil)。多次请求或调用可以被链接在一起形成一个链,如果任何一个节点为空(nil)将导致整个链失效。

    +
    +

    注意:
    Swift 的可选链和 Objective-C 中的消息为空有些相像,但是 Swift 可以使用在任意类型中,并且失败与否可以被检测到。

    +
    +

    可选链可替代强制解析

    -

    通过在想调用的属性、方法、或子脚本的自判断值(optional value)(非空)后面放一个问号,可以定义一个可选链。这一点很像在自判断值后面放一个声明符号来强制拆得其封包内的值。他们的主要的区别在于当自判断值为空时可选链即刻失败,然而一般的强制解析将会引发运行时错误。

    -

    为了反映可选链可以调用空(nil),不论你调用的属性、方法、子脚本等返回的值是不是自判断值,它的返回结果都是一个自判断值。你可以利用这个返回值来检测你的可选链是否调用成功,有返回值即成功,返回nil则失败。

    -

    调用可选链的返回结果与原本的返回结果具有相同的类型,但是原本的返回结果被包装成了一个自判断值,当可选链调用成功时,一个应该返回Int的属性将会返回Int?

    +

    通过在想调用的属性、方法、或子脚本的可选值(optional value)(非空)后面放一个问号,可以定义一个可选链。这一点很像在可选值后面放一个叹号来强制拆得其封包内的值。它们的主要的区别在于当可选值为空时可选链即刻失败,然而一般的强制解析将会引发运行时错误。

    +

    为了反映可选链可以调用空(nil),不论你调用的属性、方法、子脚本等返回的值是不是可选值,它的返回结果都是一个可选值。你可以利用这个返回值来检测你的可选链是否调用成功,有返回值即成功,返回nil则失败。

    +

    调用可选链的返回结果与原本的返回结果具有相同的类型,但是原本的返回结果被包装成了一个可选值,当可选链调用成功时,一个应该返回Int的属性将会返回Int?

    下面几段代码将解释可选链和强制解析的不同。

    首先定义两个类PersonResidence

    -
    class Person {
    -var residence: Residence?
    +
    class Person {
    +    var residence: Residence?
     }
     
     class Residence {
    -var numberOfRooms = 1
    +    var numberOfRooms = 1
     }
    -

    Residence具有一个Int类型的numberOfRooms,其值为1。Person具有一个自判断residence属性,它的类型是Residence?

    -

    如果你创建一个新的Person实例,它的residence属性由于是被定义为自判断型的,此属性将默认初始化为空:

    -
    let john = Person()
    -

    如果你想使用声明符!强制解析获得这个人residence属性numberOfRooms属性值,将会引发运行时错误,因为这时没有可以供解析的residence值。

    -
    let roomCount = john.residence!.numberOfRooms
    -// this triggers a runtime error”
    +
    +

    Residence具有一个Int类型的numberOfRooms,其值为 1。Person具有一个可选residence属性,它的类型是Residence?

    +

    如果你创建一个新的Person实例,它的residence属性由于是被定义为可选型的,此属性将默认初始化为空:

    +
    let john = Person()
    +
    +

    如果你想使用感叹号(!)强制解析获得这个人residence属性numberOfRooms属性值,将会引发运行时错误,因为这时没有可以供解析的residence值。

    +
    let roomCount = john.residence!.numberOfRooms
     //将导致运行时错误
    -

    john.residence不是nil时,会运行通过,且会将roomCount 设置为一个int类型的合理值。然而,如上所述,当residence为空时,这个代码将会导致运行时错误。

    -

    可选链提供了一种另一种获得numberOfRooms的方法。利用可选链,使用问号来代替原来的位置:

    -
    if let roomCount = john.residence?.numberOfRooms {
    +
    +

    john.residence不是nil时,会运行通过,且会将roomCount 设置为一个int类型的合理值。然而,如上所述,当residence为空时,这个代码将会导致运行时错误。

    +

    可选链提供了一种另一种获得numberOfRooms的方法。利用可选链,使用问号来代替原来!的位置:

    +
    if let roomCount = john.residence?.numberOfRooms {
         println("John's residence has \(roomCount) room(s).")
     } else {
         println("Unable to retrieve the number of rooms.")
     }
     // 打印 "Unable to retrieve the number of rooms.
    -

    这告诉Swift来链接自判断residence?属性,如果residence存在则取回numberOfRooms的值。

    -

    因为这种尝试获得numberOfRooms的操作有可能失败,可选链会返回Int?类型值,或者称作“自判断Int”。当residence是空的时候(上例),选择Int将会为空,因此会出先无法访问numberOfRooms的情况。

    -

    要注意的是,即使numberOfRooms是非自判断IntInt?)时这一点也成立。只要是通过可选链的请求就意味着最后numberOfRooms总是返回一个Int?而不是Int

    +
    +

    这告诉 Swift 来链接可选residence?属性,如果residence存在则取回numberOfRooms的值。

    +

    因为这种尝试获得numberOfRooms的操作有可能失败,可选链会返回Int?类型值,或者称作“可选Int”。当residence是空的时候(上例),选择Int将会为空,因此会出先无法访问numberOfRooms的情况。

    +

    要注意的是,即使numberOfRooms是非可选IntInt?)时这一点也成立。只要是通过可选链的请求就意味着最后numberOfRooms总是返回一个Int?而不是Int

    你可以自己定义一个Residence实例给john.residence,这样它就不再为空了:

    -
    john.residence = Residence()
    -

    john.residence 现在有了实际存在的实例而不是nil了。如果你想使用和前面一样的可选链来获得numberOfRoooms,它将返回一个包含默认值1的Int?

    -
    if let roomCount = john.residence?.numberOfRooms {
    -println("John's residence has \(roomCount) room(s).")
    +
    john.residence = Residence()
    +
    +

    john.residence 现在有了实际存在的实例而不是nil了。如果你想使用和前面一样的可选链来获得numberOfRoooms,它将返回一个包含默认值 1 的Int?

    +
    if let roomCount = john.residence?.numberOfRooms {
    +    println("John's residence has \(roomCount) room(s).")
     } else {
         println("Unable to retrieve the number of rooms.")
     }
     // 打印 "John's residence has 1 room(s)"。
    -

    为可选链定义模型类

    +
    +

    +

    为可选链定义模型类

    你可以使用可选链来多层调用属性,方法,和子脚本。这让你可以利用它们之间的复杂模型来获取更底层的属性,并检查是否可以成功获取此类底层属性。

    后面的代码定义了四个将在后面使用的模型类,其中包括多层可选链。这些类是由上面的PersonResidence模型通过添加一个Room和一个Address类拓展来。

    Person类定义与之前相同。

    -
    class Person {
    -var residence: Residence?
    +
    class Person {
    +    var residence: Residence?
     }
    -

    Residence类比之前复杂些。这次,它定义了一个变量 rooms,它被初始化为一个Room[]类型的空数组:

    -
    class Residence {
    +
    +

    Residence类比之前复杂些。这次,它定义了一个变量 rooms,它被初始化为一个Room[]类型的空数组:

    +
    class Residence {
         var rooms = Room[]()
         var numberOfRooms: Int {
         return rooms.count
    @@ -656,17 +685,19 @@ var residence: Residence?
         }
         var address: Address?
     }
    -

    因为Residence存储了一个Room实例的数组,它的numberOfRooms属性值不是一个固定的存储值,而是通过计算而来的。numberOfRooms属性值是由返回rooms数组的count属性值得到的。

    +
    +

    因为Residence存储了一个Room实例的数组,它的numberOfRooms属性值不是一个固定的存储值,而是通过计算而来的。numberOfRooms属性值是由返回rooms数组的count属性值得到的。

    为了能快速访问rooms数组,Residence定义了一个只读的子脚本,通过插入数组的元素角标就可以成功调用。如果该角标存在,子脚本则将该元素返回。

    Residence中也提供了一个printNumberOfRooms的方法,即简单的打印房间个数。

    -

    最后,Residence定义了一个自判断属性叫addressaddress?)。Address类的属性将在后面定义。 +

    最后,Residence定义了一个可选属性叫addressaddress?)。Address类的属性将在后面定义。 用于rooms数组的Room类是一个很简单的类,它只有一个name属性和一个设定room名的初始化器。

    -
    class Room {
    +
    class Room {
         let name: String
         init(name: String) { self.name = name }
     }
    -

    这个模型中的最终类叫做Address。它有三个自判断属性他们额类型是String?。前面两个自判断属性buildingNamebuildingNumber作为地址的一部分,是定义某个建筑物的两种方式。第三个属性street,用于命名地址的街道名:

    -
    class Address {
    +
    +

    这个模型中的最终类叫做Address。它有三个类型是String?的可选属性。前面两个可选属性buildingNamebuildingNumber作为地址的一部分,是定义某个建筑物的两种方式。第三个属性street,用于命名地址的街道名:

    +
    class Address {
         var buildingName: String?
         var buildingNumber: String?
         var street: String?
    @@ -680,48 +711,55 @@ var residence: Residence?
             }
         }
     }
    -

    Address类还提供了一个buildingIdentifier的方法,它的返回值类型为String?。这个方法检查buildingNamebuildingNumber的属性,如果buildingName有值则将其返回,或者如果buildingNumber有值则将其返回,再或如果没有一个属性有值,返回空。

    +
    +

    Address类还提供了一个buildingIdentifier的方法,它的返回值类型为String?。这个方法检查buildingNamebuildingNumber的属性,如果buildingName有值则将其返回,或者如果buildingNumber有值则将其返回,再或如果没有一个属性有值,返回空。

    +

    通过可选链调用属性

    -

    正如上面“ 可选链可替代强制解析”中所述,你可以利用可选链的自判断值获取属性,并且检查属性是否获取成功。然而,你不能使用可选链为属性赋值。

    +

    正如上面“ 可选链可替代强制解析”中所述,你可以利用可选链的可选值获取属性,并且检查属性是否获取成功。然而,你不能使用可选链为属性赋值。

    使用上述定义的类来创建一个人实例,并再次尝试后去它的numberOfRooms属性:

    -
    let john = Person()
    +
    let john = Person()
     if let roomCount = john.residence?.numberOfRooms {
         println("John's residence has \(roomCount) room(s).")
     } else {
         println("Unable to retrieve the number of rooms.")
     }
     // 打印 "Unable to retrieve the number of rooms。
    -

    由于john.residence是空,所以这个可选链和之前一样失败了,但是没有运行时错误。

    +
    +

    由于john.residence是空,所以这个可选链和之前一样失败了,但是没有运行时错误。

    +

    通过可选链调用方法

    -

    你可以使用可选链的来调用自判断值的方法并检查方法调用是否成功。即使这个方法没有返回值,你依然可以使用可选链来达成这一目的。

    -

    Residence的printNumberOfRooms方法会打印numberOfRooms的当前值。方法如下:

    -
    func printNumberOfRooms(){
    +

    你可以使用可选链的来调用可选值的方法并检查方法调用是否成功。即使这个方法没有返回值,你依然可以使用可选链来达成这一目的。

    +

    ResidenceprintNumberOfRooms方法会打印numberOfRooms的当前值。方法如下:

    +
    func printNumberOfRooms(){
         println(“The number of rooms is \(numberOfRooms)”)
     }
    -

    这个方法没有返回值。但是,没有返回值类型的函数和方法有一个隐式的返回值类型Void(参见Function Without Return Values)。

    -

    如果你利用可选链调用此方法,这个方法的返回值类型将是Void?,而不是Void,因为当通过可选链调用方法时返回值总是自判断类型(optional type)。,即使是这个方法本是没有定义返回值,你也可以使用if语句来检查是否能成功调用printNumberOfRooms方法:如果方法通过可选链调用成功,printNumberOfRooms的隐式返回值将会是Void,如果没有成功,将返回nil

    -
    if john.residence?.printNumberOfRooms() {
    +
    +

    这个方法没有返回值。但是,没有返回值类型的函数和方法有一个隐式的返回值类型Void(参见Function Without Return Values)。

    +

    如果你利用可选链调用此方法,这个方法的返回值类型将是Void?,而不是Void,因为当通过可选链调用方法时返回值总是可选类型(optional type)。即使这个方法本身没有定义返回值,你也可以使用if语句来检查是否能成功调用printNumberOfRooms方法:如果方法通过可选链调用成功,printNumberOfRooms的隐式返回值将会是Void,如果没有成功,将返回nil

    +
    if john.residence?.printNumberOfRooms() {
         println("It was possible to print the number of rooms.")
     } else {
         println("It was not possible to print the number of rooms.")
     }
     // 打印 "It was not possible to print the number of rooms."。
    -

    使用可选链调用子脚本

    +
    +

    +

    使用可选链调用子脚本

    你可以使用可选链来尝试从子脚本获取值并检查子脚本的调用是否成功,然而,你不能通过可选链来设置子代码。

    -

    注意: -当你使用可选链来获取子脚本的时候,你应该将问号放在子脚本括号的前面而不是后面。可选链的问号一般直接跟在自判断表达语句的后面。

    +

    注意:
    当你使用可选链来获取子脚本的时候,你应该将问号放在子脚本括号的前面而不是后面。可选链的问号一般直接跟在表达语句的后面。

    下面这个例子用在Residence类中定义的子脚本来获取john.residence数组中第一个房间的名字。因为john.residence现在是nil,子脚本的调用失败了。

    -
    if let firstRoomName = john.residence?[0].name {
    +
    if let firstRoomName = john.residence?[0].name {
         println("The first room name is \(firstRoomName).")
     } else {
         println("Unable to retrieve the first room name.")
     }
     // 打印 "Unable to retrieve the first room name."。
    -

    在子代码调用中可选链的问号直接跟在john.residence的后面,在子脚本括号的前面,因为john.residence是可选链试图获得的自判断值。

    +
    +

    在子代码调用中可选链的问号直接跟在john.residence的后面,在子脚本括号的前面,因为john.residence是可选链试图获得的可选值。

    如果你创建一个Residence实例给john.residence,且在他的rooms数组中有一个或多个Room实例,那么你可以使用可选链通过Residence子脚本来获取在rooms数组中的实例了:

    -
    let johnsHouse = Residence()
    +
    let johnsHouse = Residence()
     johnsHouse.rooms += Room(name: "Living Room")
     johnsHouse.rooms += Room(name: "Kitchen")
     john.residence = johnsHouse
    @@ -732,51 +770,57 @@ if let firstRoomName = john.residence?[0].name {
         println("Unable to retrieve the first room name.")
     }
     // 打印 "The first room name is Living Room."。
    -

    连接多层链接

    -

    你可以将多层可选链连接在一起,可以掘取模型内更下层的属性方法和子脚本。然而多层可选链不能再添加比已经返回的自判断值更多的层。 +

    +

    +

    连接多层链接

    +

    你可以将多层可选链连接在一起,可以掘取模型内更下层的属性方法和子脚本。然而多层可选链不能再添加比已经返回的可选值更多的层。 也就是说:

    -

    如果你试图获得的类型不是自判断类型,由于使用了可选链它将变成自判断类型。 -如果你试图获得的类型已经是自判断类型,由于可选链它也不会提高自判断性。

    +

    如果你试图获得的类型不是可选类型,由于使用了可选链它将变成可选类型。 +如果你试图获得的类型已经是可选类型,由于可选链它也不会提高可选性。

    因此:

    -

    如果你试图通过可选链获得Int值,不论使用了多少层链接返回的总是Int?。 -相似的,如果你试图通过可选链获得Int?值,不论使用了多少层链接返回的总是Int?

    -

    下面的例子试图获取johnresidence属性里的addressstreet属性。这里使用了两层可选链来联系residenceaddress属性,他们两者都是自判断类型:

    -
    if let johnsStreet = john.residence?.address?.street {
    +

    如果你试图通过可选链获得Int值,不论使用了多少层链接返回的总是Int?。 +相似的,如果你试图通过可选链获得Int?值,不论使用了多少层链接返回的总是Int?

    +

    下面的例子试图获取johnresidence属性里的addressstreet属性。这里使用了两层可选链来联系residenceaddress属性,它们两者都是可选类型:

    +
    if let johnsStreet = john.residence?.address?.street {
         println("John's street name is \(johnsStreet).")
     } else {
         println("Unable to retrieve the address.")
     }
     // 打印 "Unable to retrieve the address.”。
    -

    john.residence的值现在包含一个Residence实例,然而john.residence.address现在是nil,因此john.residence?.address?.street调用失败。

    -

    从上面的例子发现,你试图获得street属性值。这个属性的类型是String?。因此尽管在自判断类型属性前使用了两层可选链,john.residence?.address?.street的返回值类型也是String?

    +
    +

    john.residence的值现在包含一个Residence实例,然而john.residence.address现在是nil,因此john.residence?.address?.street调用失败。

    +

    从上面的例子发现,你试图获得street属性值。这个属性的类型是String?。因此尽管在可选类型属性前使用了两层可选链,john.residence?.address?.street的返回值类型也是String?

    如果你为Address设定一个实例来作为john.residence.address的值,并为addressstreet属性设定一个实际值,你可以通过多层可选链来得到这个属性值。

    -
    let johnsAddress = Address()
    +
    let johnsAddress = Address()
     johnsAddress.buildingName = "The Larches"
     johnsAddress.street = "Laurel Street"
     john.residence!.address = johnsAddress
    -
    -if let johnsStreet = john.residence?.address?.street {
    +
    +
    if let johnsStreet = john.residence?.address?.street {
         println("John's street name is \(johnsStreet).")
     } else {
         println("Unable to retrieve the address.")
     }
     // 打印 "John's street name is Laurel Street."。
    -

    值得注意的是,“!”符的在定义address实例时的使用(john.residence.address)。john.residence属性是一个自判断类型,因此你需要在它获取address属性之前使用解析以获得它的实际值。

    -

    链接自判断返回值的方法

    -

    前面的例子解释了如何通过可选链来获得自判断类型属性值。你也可以通过调用返回自判断类型值的方法并按需链接方法的返回值。

    -

    下面的例子通过可选链调用了Address类中的buildingIdentifier 方法。这个方法的返回值类型是String?。如上所述,这个方法在可选链调用后最终的返回值类型依然是String?

    -
    if let buildingIdentifier = john.residence?.address?.buildingIdentifier() {
    +
    +

    值得注意的是,“!”符号在给john.residence.address分配address实例时的使用。john.residence属性是一个可选类型,因此你需要在它获取address属性之前使用!解析以获得它的实际值。

    +

    +

    链接可选返回值的方法

    +

    前面的例子解释了如何通过可选链来获得可选类型属性值。你也可以通过可选链调用一个返回可选类型值的方法并按需链接该方法的返回值。

    +

    下面的例子通过可选链调用了Address类中的buildingIdentifier 方法。这个方法的返回值类型是String?。如上所述,这个方法在可选链调用后最终的返回值类型依然是String?

    +
    if let buildingIdentifier = john.residence?.address?.buildingIdentifier() {
         println("John's building identifier is \(buildingIdentifier).")
     }
     // 打印 "John's building identifier is The Larches."。
    -

    如果你还想进一步对方法返回值执行可选链,将可选链问号符放在方法括号的后面:

    -
    if let upper = john.residence?.address?.buildingIdentifier()?.uppercaseString {
    +
    +

    如果你还想进一步对方法返回值执行可选链,将可选链问号符放在方法括号的后面:

    +
    if let upper = john.residence?.address?.buildingIdentifier()?.uppercaseString {
         println("John's uppercase building identifier is \(upper).")
     }
     // 打印 "John's uppercase building identifier is THE LARCHES."。
    -
    -

    注意: -在上面的例子中,你将可选链问号符放在括号后面是因为你想要链接的自判断值是buildingIdentifier方法的返回值,不是buildingIdentifier方法本身。

    +
    +
    +

    注意:
    在上面的例子中,你将可选链问号符放在括号后面是因为你想要链接的可选值是buildingIdentifier方法的返回值,不是buildingIdentifier方法本身。

    @@ -796,16 +840,8 @@ if let johnsStreet = john.residence?.address?.street {
    - - - - - - - - - - + + @@ -823,6 +859,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/18_Type_Casting.html b/chapter2/18_Type_Casting.html index 7d1a41a3..63f43831 100644 --- a/chapter2/18_Type_Casting.html +++ b/chapter2/18_Type_Casting.html @@ -1,57 +1,45 @@ - - + - 类型检查 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,30 +595,36 @@
    -
    +
    -

    类型检查(Type Casting)

    -

    (ps:为了方便各位检验所以保留了英文,可删。) - 类型检查是一种检查类实例的方式,并且哦或者也是让实例作为它的父类或者子类的一种方式。

    -

    Type casting is a way to check the type of an instance, and/or to treat that instance as if it is a different superclass or subclass from somewhere else in its own class hierarchy.

    -

    类型检查在Swift中使用isas操作符实现。这两个操作符提供了一种简单达意的方式去检查值的类型或者转换它的类型。

    -

    Type casting in Swift is implemented with the is and as operators. These two operators provide a simple and expressive way to check the type of a value or cast a value to a different type.

    -

    你也可以用来检查一个类是否实现了某个协议,就像在 Protocols》Checking for Protocol Conformance部分讲述的一样。

    -

    You can also use type casting to check whether a type conforms to a protocol, as described in Checking for Protocol Conformance.

    -

    定义一个类层次作为例子Defining a Class Hierarchy for Type Casting

    -

    你可以将它用在类和子类的层次结构上,检查特定类实例的类型并且转换这个类实例的类型成为这个层次结构中的其他类型。这下面的三个代码段定义了一个类层次和一个array包含了几个这些类的实例,作为类型检查的例子。

    -

    You can use type casting with a hierarchy of classes and subclasses to check the type of a particular class instance and to cast that instance to another class within the same hierarchy. The three code snippets below define a hierarchy of classes and an array containing instances of those classes, for use in an example of type casting.

    -

    第一个代码片段定义了一个新的基础类MediaItem。这个类为任何出现在数字媒体库的项提供基础功能。特别的,它声明了一个 String 类型的 name 属性,和一个init name初始化器。(它假定所有的媒体项都有个名称。)

    -

    The first snippet defines a new base class called MediaItem. This class provides basic functionality for any kind of item that appears in a digital media library. Specifically, it declares a name property of type String, and an init name initializer. (It is assumed that all media items, including all movies and songs, will have a name.)

    -
    class MediaItem {
    +                        
    +

    翻译:xiehurricane
    校对:happyming

    +
    +

    类型转换(Type Casting)

    +
    +

    本页包含内容:

    + +

    类型转换是一种检查类实例的方式,并且或者也是让实例作为它的父类或者子类的一种方式。

    +

    类型转换在 Swift 中使用isas操作符实现。这两个操作符提供了一种简单达意的方式去检查值的类型或者转换它的类型。

    +

    你也可以用来检查一个类是否实现了某个协议,就像在 Checking for Protocol Conformance部分讲述的一样。

    +

    +

    定义一个类层次作为例子

    +

    你可以将它用在类和子类的层次结构上,检查特定类实例的类型并且转换这个类实例的类型成为这个层次结构中的其他类型。这下面的三个代码段定义了一个类层次和一个包含了几个这些类实例的数组,作为类型转换的例子。

    +

    第一个代码片段定义了一个新的基础类MediaItem。这个类为任何出现在数字媒体库的媒体项提供基础功能。特别的,它声明了一个 String 类型的 name 属性,和一个init name初始化器。(它假定所有的媒体项都有个名称。)

    +
    class MediaItem {
         var name: String
         init(name: String) {
             self.name = name
         }
     }
    -

    下一个代码段定义了 MediaItem 的两个子类。第一个子类Movie,在父类(或者说基类)的基础上增加了一个 director(导演) 属性,和相应的初始化器。第二个类在父类的基础上增加了一个 artist(艺术家) 属性,和相应的初始化器:

    -

    The next snippet defines two subclasses of MediaItem. The first subclass, Movie, encapsulates additional information about a movie or film. It adds a director property on top of the base MediaItem class, with a corresponding initializer. The second subclass, Song, adds an artist property and initializer on top of the base class:

    -
    class Movie: MediaItem {
    +
    +

    下一个代码段定义了 MediaItem 的两个子类。第一个子类Movie,在父类(或者说基类)的基础上增加了一个 director(导演) 属性,和相应的初始化器。第二个类在父类的基础上增加了一个 artist(艺术家) 属性,和相应的初始化器:

    +
    class Movie: MediaItem {
         var director: String
         init(name: String, director: String) {
             self.director = director
    @@ -625,24 +639,23 @@ class Song: MediaItem {
             super.init(name: name)
         }
     }
    -

    最后一个代码段创建了一个array常量 library ,包含两个Movie实例和三个Song实例。library的类型是在它被初始化时根据它的array标记符和里面的内容(ps: literal: 标记符其实就是指“[”和“]”,虽然苹果官方的翻译里翻译为字面当总感觉不好理解,有点奇怪。不如翻译为标记符)推断来的。Swift的类型检测器能够演绎出MovieSong 有共同的父类 MediaItem ,所以它推断出 MediaItem[] 类作为 library 的类型。

    -

    The final snippet creates a constant array called library, which contains two Movie instances and three Song instances. The type of the library array is inferred by initializing it with the contents of an array literal. Swift’s type checker is able to deduce that Movie and Song have a common superclass of MediaItem, and so it infers a type of MediaItem[] for the library array:

    -
    let library = [
    -Movie(name: "Casablanca", director: "Michael Curtiz"),
    -Song(name: "Blue Suede Shoes", artist: "Elvis Presley"),
    -Movie(name: "Citizen Kane", director: "Orson Welles"),
    -Song(name: "The One And Only", artist: "Chesney Hawkes"),
    -Song(name: "Never Gonna Give You Up", artist: "Rick Astley")
    +
    +

    最后一个代码段创建了一个数组常量 library,包含两个Movie实例和三个Song实例。library的类型是在它被初始化时根据它数组中所包含的内容推断来的。Swift 的类型检测器能够演绎出MovieSong 有共同的父类 MediaItem ,所以它推断出 MediaItem[] 类作为 library 的类型。

    +
    let library = [
    +    Movie(name: "Casablanca", director: "Michael Curtiz"),
    +    Song(name: "Blue Suede Shoes", artist: "Elvis Presley"),
    +    Movie(name: "Citizen Kane", director: "Orson Welles"),
    +    Song(name: "The One And Only", artist: "Chesney Hawkes"),
    +    Song(name: "Never Gonna Give You Up", artist: "Rick Astley")
     ]
     // the type of "library" is inferred to be MediaItem[]
    -

    在幕后library 里存储的项依然是 MovieSong 类型的,但是,若你迭代它,取出的实例会是 MediaItem 类型的,而不是 MovieSong 类型的。为了让它们作为它们本来的类型工作,你需要检查它们的类型或者向下转换它们的类型到其它类型,就像下面描述的一样。

    -

    The items stored in library are still Movie and Song instances behind the scenes. However, if you iterate over the contents of this array, the items you receive back are typed as MediaItem, and not as Movie or Song. In order to work with them as their native type, you need to check their type, or downcast them to a different type, as described below.

    -

    检查类型 Checking Type

    -

    用类型检查操作符(is)来检查一个实例是否属于特定子类型。类型检查操作符返回 true 若实例属于那个子类型,若不属于返回 false

    -

    Use the type check operator (is) to check whether an instance is of a certain subclass type. The type check operator returns true if the instance is of that subclass type and false if it is not.

    -

    下面的例子定义了连个变量,movieCountsongCount,用来计算数组libraryMovieSong 类型的实例数量。

    -

    The example below defines two variables, movieCount and songCount, which count the number of Movie and Song instances in the library array:

    -
    var movieCount = 0
    +
    +

    在幕后library 里存储的媒体项依然是 MovieSong 类型的,但是,若你迭代它,取出的实例会是 MediaItem 类型的,而不是 MovieSong 类型的。为了让它们作为它们本来的类型工作,你需要检查它们的类型或者向下转换它们的类型到其它类型,就像下面描述的一样。

    +

    +

    检查类型(Checking Type)

    +

    用类型检查操作符(is)来检查一个实例是否属于特定子类型。若实例属于那个子类型,类型检查操作符返回 true ,否则返回 false

    +

    下面的例子定义了两个变量,movieCountsongCount,用来计算数组libraryMovieSong 类型的实例数量。

    +
    var movieCount = 0
     var songCount = 0
     
     for item in library {
    @@ -655,25 +668,21 @@ for item in library {
     
     println("Media library contains \(movieCount) movies and \(songCount) songs")
     // prints "Media library contains 2 movies and 3 songs"
    -

    示例迭代了数组 library 中的所有项。每一次, for-in 循环设置 - item 常量的值为数组中的下一个 MediaItem

    -

    This example iterates through all items in the library array. On each pass, the for-in loop sets the item constant to the next MediaItem in the array.

    -

    若当前 MediaItem 是一个 Movie 类型的实例, item is Movie 返回 true,相反返回 false。同样的,item is Song检查item是否为Song类型的实例。在循环末尾,movieCountsongCount的值就是被找到属于各自的类型的实例数量。

    -

    item is Movie returns true if the current MediaItem is a Movie instance and false if it is not. Similarly, item is Song checks whether the item is a Song instance. At the end of the for-in loop, the values of movieCount and songCount contain a count of how many MediaItem instances were found of each type.

    -

    向下转型(简称下转) Downcasting

    -

    某类型的一个常量或变量可能在幕后实际上属于一个子类。你可以相信,上面就是这种情况。你可以尝试向下转到它的子类型,用类型检查操作符(as)

    -

    A constant or variable of a certain class type may actually refer to an instance of a subclass behind the scenes. Where you believe this is the case, you can try to downcast to the subclass type with the type cast operator (as).

    -

    因为向下转型可能会失败,类型检查操作符带有两种不同形式。可选形式( optional form) as? 返回一个你试图下转成的类型的可选值(optional value)。强制形式 as 把试图向下转型和强制解包(force-unwraps)结果作为一个混合动作。

    -

    Because downcasting can fail, the type cast operator comes in two different forms. The optional form, as?, returns an optional value of the type you are trying to downcast to. The forced form, as, attempts the downcast and force-unwraps the result as a single compound action.

    -

    当你不确定下转可以成功时,用类型检查的可选形式(as?)。可选形式的类型检查总是返回一个可选值(optional value),并且若下转是不可能的,可选值将是 nil 。这使你能够检查下转是否成功。

    -

    Use the optional form of the type cast operator (as?) when you are not sure if the downcast will succeed. This form of the operator will always return an optional value, and the value will be nil if the downcast was not possible. This enables you to check for a successful downcast.

    -

    只有你可以确定下转一定会成功时,才使用强制形式。当你试图下转为一个不正确的类型时,强制形式的类型检查会触发一个runtime error。

    -

    Use the forced form of the type cast operator (as) only when you are sure that the downcast will always succeed. This form of the operator will trigger a runtime error if you try to downcast to an incorrect class type.

    -

    下面的例子,迭代了library里的每一个 MediaItem ,并打印出适当的描述。要这样做,item需要真正作为MovieSong的类型来使用。不仅仅是作为 MediaItem。为了能够使用MovieSongdirectorartist属性,这是必要的。

    -

    The example below iterates over each MediaItem in library, and prints an appropriate description for each item. To do this, it needs to access each item as a true Movie or Song, and not just as a MediaItem. This is necessary in order for it to be able to access the director or artist property of a Movie or Song for use in the description.

    -

    在这个示例中,数组中的每一个item可能是 MovieSong。 事前你不知道每个item的真实类型,所以这里使用可选形式的类型检查 (as?)去检查循环里的每次下转。

    -

    In this example, each item in the array might be a Movie, or it might be a Song. You don’t know in advance which actual class to use for each item, and so it is appropriate to use the optional form of the type cast operator (as?) to check the downcast each time through the loop:

    -
    for item in library {
    +
    +

    示例迭代了数组 library 中的所有项。每一次, for-in 循环设置 +item 为数组中的下一个 MediaItem

    +

    若当前 MediaItem 是一个 Movie 类型的实例, item is Movie 返回 +true,相反返回 false。同样的,item is +Song检查item是否为Song类型的实例。在循环结束后,movieCountsongCount的值就是被找到属于各自的类型的实例数量。

    +

    +

    向下转型(Downcasting)

    +

    某类型的一个常量或变量可能在幕后实际上属于一个子类。你可以相信,上面就是这种情况。你可以尝试向下转到它的子类型,用类型转换操作符(as)

    +

    因为向下转型可能会失败,类型转型操作符带有两种不同形式。可选形式( optional form) as? 返回一个你试图下转成的类型的可选值(optional value)。强制形式 as 把试图向下转型和强制解包(force-unwraps)结果作为一个混合动作。

    +

    当你不确定向下转型可以成功时,用类型转换的可选形式(as?)。可选形式的类型转换总是返回一个可选值(optional value),并且若下转是不可能的,可选值将是 nil 。这使你能够检查向下转型是否成功。

    +

    只有你可以确定向下转型一定会成功时,才使用强制形式。当你试图向下转型为一个不正确的类型时,强制形式的类型转换会触发一个运行时错误。

    +

    下面的例子,迭代了library里的每一个 MediaItem ,并打印出适当的描述。要这样做,item需要真正作为MovieSong的类型来使用。不仅仅是作为 MediaItem。为了能够使用MovieSongdirectorartist属性,这是必要的。

    +

    在这个示例中,数组中的每一个item可能是 MovieSong。 事前你不知道每个item的真实类型,所以这里使用可选形式的类型转换 (as?)去检查循环里的每次下转。

    +
    for item in library {
         if let movie = item as? Movie {
             println("Movie: '\(movie.name)', dir. \(movie.director)")
         } else if let song = item as? Song {
    @@ -686,75 +695,57 @@ println("Media library contains \(movieCount) movies and \(songCount) songs
     // Movie: 'Citizen Kane', dir. Orson Welles
     // Song: 'The One And Only', by Chesney Hawkes
     // Song: 'Never Gonna Give You Up', by Rick Astley
    -

    示例首先试图将 item 下转为 Movie。因为 item 是一个 MediaItem 类型的实例,它可能是一个Movie;同样,它可能是一个 Song,或者仅仅是基类 MediaItem。因为不确定,as?形式试图下转时返还一个可选值。 item as Movie 的返回值是Movie?类型或 “optional Movie”。

    -

    The example starts by trying to downcast the current item as a Movie. Because item is a MediaItem instance, it’s possible that it might be a Movie; equally, it’s also possible that it might a Song, or even just a base MediaItem. Because of this uncertainty, the as? form of the type cast operator returns an optional value when attempting to downcast to a subclass type. The result of item as Movie is of type Movie?, or “optional Movie”.

    -

    当应用在两个Song实例时,下转为 Movie 失败。为了处理这种情况,上面的实例使用了可选绑定(optional binding)来检查optional Movie真的包含一个值(这个是为了判断下转是否成功。)可选绑定是这样写的“if let movie = item as? Movie”,可以这样解读:

    -

    Downcasting to Movie fails when applied to the two Song instances in the library array. To cope with this, the example above uses optional binding to check whether the optional Movie actually contains a value (that is, to find out whether the downcast succeeded.) This optional binding is written “if let movie = item as? Movie”, which can be read as:

    -

    “尝试将 item 转为 Movie类型。若成功,设置一个新的临时常量 movie 来存储返回的optional Movie

    -

    “Try to access item as a Movie. If this is successful, set a new temporary constant called movie to the value stored in the returned optional Movie.”

    -

    若下转成功,然后movie的属性将用于打印一个Movie实例的描述,包括它的导演的名字director。当Song被找到时,一个相近的原理被用来检测 Song 实例和打印它的描述。

    -

    If the downcasting succeeds, the properties of movie are then used to print a description for that Movie instance, including the name of its director. A similar principle is used to check for Song instances, and to print an appropriate description (including artist name) whenever a Song is found in the library.

    -
    注意
    -
    -转换没有真的改变实例或它的值。潜在的根本的实例保持不变;只是简单地把它作为它被转换成的类来使用。
    -
    -NOTE
    -
    -Casting does not actually modify the instance or change its values. The underlying instance remains the same; it is simply treated and accessed as an instance of the type to which it has been cast.
    -

    Any和AnyObject的转换 Type Casting for Any and AnyObject

    -

    Swift为不确定类型提供了两种特殊类型别名:

    +
    +

    示例首先试图将 item 下转为 Movie。因为 item 是一个 MediaItem +类型的实例,它可能是一个Movie;同样,它可能是一个 Song,或者仅仅是基类 +MediaItem。因为不确定,as?形式在试图下转时将返还一个可选值。 item as Movie 的返回值是Movie?类型或 “optional Movie”。

    +

    当向下转型为 Movie 应用在两个 Song +实例时将会失败。为了处理这种情况,上面的例子使用了可选绑定(optional binding)来检查可选 Movie真的包含一个值(这个是为了判断下转是否成功。)可选绑定是这样写的“if let movie = item as? Movie”,可以这样解读:

    +

    “尝试将 item 转为 Movie类型。若成功,设置一个新的临时常量 movie 来存储返回的可选Movie

    +

    若向下转型成功,然后movie的属性将用于打印一个Movie实例的描述,包括它的导演的名字director。当Song被找到时,一个相近的原理被用来检测 Song 实例和打印它的描述。

    +
    +

    注意:
    转换没有真的改变实例或它的值。潜在的根本的实例保持不变;只是简单地把它作为它被转换成的类来使用。

    +
    +

    +

    AnyAnyObject的类型转换

    +

    Swift为不确定类型提供了两种特殊类型别名:

      -
    • AnyObject可以代表任何class类型的实例。

      -
    • -
    • Any可以表示任何类型,除了方法类型(function types)。

      -

      Swift provides two special type aliases for working with non-specific types:

      -
    • +
    • AnyObject可以代表任何class类型的实例。
    • +
    • Any可以表示任何类型,除了方法类型(function types)。
    -
      -
    • AnyObject can represent an instance of any class type.
    • -
    • Any can represent an instance of any type at all, apart from function types.

      -
      注意
      -
      -只有当你明确的需要它的行为和功能时才使用Any和AnyObject。在你的代码里使用你期望的明确的类型总是更好的。
      -
      -NOTE
      -
      -Use Any and AnyObject only when you explicitly need the behavior and capabilities they provide. It is always better to be specific about the types you expect to work with in your code.
      -
    • -
    -

    AnyObject类型

    -

    当需要在工作中使用Cocoa APIs,它一般接收一个AnyObject[]类型的数组,或者说“一个任何对象类型的数组”。这是因为OC没有明确的类型化数组。但是,你常常可以确定包含在仅从你知道的API信息提供的这样一个数组中的对象的类型。

    -

    When working with Cocoa APIs, it is common to receive an array with a type of AnyObject[], or “an array of values of any object type”. This is because Objective-C does not have explicitly typed arrays. However, you can often be confident about the type of objects contained in such an array just from the information you know about the API that provided the array.

    -

    在这些情况下,你可以使用强制形式的类型检查(as)来下转在数组中的每一项到比 AnyObject 更明确的类型,不需要可选解包(optional unwrapping)。

    -

    In these situations, you can use the forced version of the type cast operator (as) to downcast each item in the array to a more specific class type than AnyObject, without the need for optional unwrapping.

    -

    下面的示例定义了一个 AnyObject[] 类型的数组并填入三个Movie类型的实例:

    -

    The example below defines an array of type AnyObject[] and populates this array with three instances of the Movie class:

    -
    let someObjects: AnyObject[] = [
    +
    +

    注意:
    只有当你明确的需要它的行为和功能时才使用AnyAnyObject。在你的代码里使用你期望的明确的类型总是更好的。

    +
    +

    AnyObject类型

    +

    当需要在工作中使用 Cocoa APIs,它一般接收一个AnyObject[]类型的数组,或者说“一个任何对象类型的数组”。这是因为 Objective-C 没有明确的类型化数组。但是,你常常可以确定包含在仅从你知道的 API 信息提供的这样一个数组中的对象的类型。

    +

    在这些情况下,你可以使用强制形式的类型转换(as)来下转在数组中的每一项到比 AnyObject 更明确的类型,不需要可选解析(optional unwrapping)。

    +

    下面的示例定义了一个 AnyObject[] 类型的数组并填入三个Movie类型的实例:

    +
    let someObjects: AnyObject[] = [
         Movie(name: "2001: A Space Odyssey", director: "Stanley Kubrick"),
         Movie(name: "Moon", director: "Duncan Jones"),
         Movie(name: "Alien", director: "Ridley Scott")
     ]
    -

    因为知道这个数组只包含 Movie 实例,你可以直接用(as)下转并解包到不可选的Movie类型(ps:其实就是我们常用的正常类型,这里是为了和可选类型相对比)。

    -

    Because this array is known to contain only Movie instances, you can downcast and unwrap directly to a non-optional Movie with the forced version of the type cast operator (as):

    -
    for object in someObjects {
    +
    +

    因为知道这个数组只包含 Movie 实例,你可以直接用(as)下转并解包到不可选的Movie类型(ps:其实就是我们常用的正常类型,这里是为了和可选类型相对比)。

    +
    for object in someObjects {
         let movie = object as Movie
         println("Movie: '\(movie.name)', dir. \(movie.director)")
     }
     // Movie: '2001: A Space Odyssey', dir. Stanley Kubrick
     // Movie: 'Moon', dir. Duncan Jones
     // Movie: 'Alien', dir. Ridley Scott
    -

    为了变为一个更短的形式,下转someObjects类型成功 Movie[] 类型代替下转每一项。

    -

    For an even shorter form of this loop, downcast the someObjects array to a type of Movie[] instead of downcasting each item:

    -
    for movie in someObjects as Movie[] {
    +
    +

    为了变为一个更短的形式,下转someObjects数组为Movie[]类型来代替下转每一项方式。

    +
    for movie in someObjects as Movie[] {
         println("Movie: '\(movie.name)', dir. \(movie.director)")
     }
     // Movie: '2001: A Space Odyssey', dir. Stanley Kubrick
     // Movie: 'Moon', dir. Duncan Jones
     // Movie: 'Alien', dir. Ridley Scott
    -

    Any类型

    -

    这里有个示例,使用 Any 类型来和混合的不同类型一起工作,包括非class类型。它创建了一个可以存储Any类型的数组 things

    -

    Here’s an example of using Any to work with a mix of different types, including non-class types. The example creates an array called things, which can store values of type Any:

    -
    var things = Any[]()
    +
    +

    Any类型

    +

    这里有个示例,使用 Any 类型来和混合的不同类型一起工作,包括非class类型。它创建了一个可以存储Any类型的数组 things

    +
    var things = Any[]()
     
     things.append(0)
     things.append(0.0)
    @@ -763,11 +754,10 @@ things.append(3.14159)
     things.append("hello")
     things.append((3.0, 5.0))
     things.append(Movie(name: "Ghostbusters", director: "Ivan Reitman"))
    -

    things 数组包含两个 Int 值,2个 Double 值,1个 String 值,一个元组 (Double, Double) ,Ivan Reitman导演的电影“Ghostbusters”。

    -

    The things array contains two Int values, two Double values, a String value, a tuple of type (Double, Double), and the movie “Ghostbusters”, directed by Ivan Reitman.

    -

    你可以在 switch cases里用isas 操作符来发觉只知道是 AnyAnyObject的常量或变量的类型。 下面的示例迭代 things数组中的每一项的并用switch语句查找每一项的类型。这几种switch语句的情形绑定它们匹配的值到一个规定类型的常量,让它们可以打印它们的值:

    -

    You can use the is and as operators in a switch statement’s cases to discover the specific type of a constant or variable that is known only to be of type Any or AnyObject. The example below iterates over the items in the things array and queries the type of each item with a switch statement. Several of the switch statement’s cases bind their matched value to a constant of the specified type to enable its value to be printed:

    -
    for thing in things {
    +
    +

    things 数组包含两个 Int 值,2个 Double 值,1个 String 值,一个元组 (Double, Double) ,Ivan Reitman 导演的电影“Ghostbusters”。

    +

    你可以在 switch cases里用isas 操作符来发觉只知道是 AnyAnyObject的常量或变量的类型。 下面的示例迭代 things数组中的每一项的并用switch语句查找每一项的类型。这几种switch语句的情形绑定它们匹配的值到一个规定类型的常量,让它们可以打印它们的值:

    +
    for thing in things {
         switch thing {
         case 0 as Int:
             println("zero as an Int")
    @@ -797,15 +787,11 @@ things.append(Movie(name: "Ghostbusters", director: "Ivan Reitman
     // a string value of "hello"
     // an (x, y) point at 3.0, 5.0
     // a movie called 'Ghostbusters', dir. Ivan Reitman
    -

    -
    注意
    -
    -在一个switch语句的case中使用强制形式的类型检查操作符(as, 而不是 as?) 来检查和转换到一个规定的类型。在switch case 语句的内容中这种检查总是安全的。
    -
    -NOTE
    -
    -The cases of a switch statement use the forced version of the type cast operator (as, not as?) to check and cast to a specific type. This check is always safe within the context of a switch case statement.
     
    +
    +

    注意:
    在一个switch语句的case中使用强制形式的类型转换操作符(as, 而不是 as?)来检查和转换到一个明确的类型。在 switch case 语句的内容中这种检查总是安全的。

    +
    +
    @@ -823,16 +809,8 @@ The cases of a switch statement use the forced version of the type cast operator
    - - - - - - - - - - + + @@ -850,6 +828,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/19_Nested_Types.html b/chapter2/19_Nested_Types.html index fc217711..43dabf4f 100644 --- a/chapter2/19_Nested_Types.html +++ b/chapter2/19_Nested_Types.html @@ -1,57 +1,45 @@ - - + - 嵌套类型 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,24 +595,30 @@
    -
    +
    -

    类型嵌套

    +
    +

    翻译:Lin-H
    校对:shinyzhu

    +
    +

    嵌套类型

    +

    本页包含内容:

    -

    枚举类型常被用于实现特定类或结构体的功能。也能够在有多种变量类型的环境中,方便地定义通用类或结构体来使用,为了实现这种功能,Swift允许你定义类型嵌套,可以在枚举类型、类和结构体中定义支持嵌套的类型。

    +

    枚举类型常被用于实现特定类或结构体的功能。也能够在有多种变量类型的环境中,方便地定义通用类或结构体来使用,为了实现这种功能,Swift允许你定义嵌套类型,可以在枚举类型、类和结构体中定义支持嵌套的类型。

    要在一个类型中嵌套另一个类型,将需要嵌套的类型的定义写在被嵌套类型的区域{}内,而且可以根据需要定义多级嵌套。

    -

    类型嵌套实例

    +

    +

    嵌套类型实例

    下面这个例子定义了一个结构体BlackjackCard(二十一点),用来模拟BlackjackCard中的扑克牌点数。BlackjackCard结构体包含2个嵌套定义的枚举类型SuitRank

    BlackjackCard规则中,Ace牌可以表示1或者11,Ace牌的这一特征用一个嵌套在枚举型Rank的结构体Values来表示。

    -
    struct BlackjackCard {
    +
    struct BlackjackCard {
         // 嵌套定义枚举型Suit
         enum Suit: Character {
            case Spades = "♠", Hearts = "♡", Diamonds = "♢", Clubs = "♣"
    -   }
    +    }
    +
         // 嵌套定义枚举型Rank
         enum Rank: Int {
            case Two = 2, Three, Four, Five, Six, Seven, Eight, Nine, Ten
    @@ -623,6 +637,7 @@
                 }
            }
         }
    +
         // BlackjackCard 的属性和方法
         let rank: Rank, suit: Suit
         var description: String {
    @@ -634,7 +649,8 @@
             return output
         }
     }
    -

    枚举型的Suit用来描述扑克牌的四种花色,并分别用一个Character类型的值代表花色符号。

    +
    +

    枚举型的Suit用来描述扑克牌的四种花色,并分别用一个Character类型的值代表花色符号。

    枚举型的Rank用来描述扑克牌从Ace~10,J,Q,K,13张牌,并分别用一个Int类型的值表示牌的面值。(这个Int类型的值不适用于Ace,J,Q,K的牌)。

    如上文所提到的,枚举型Rank在自己内部定义了一个嵌套结构体Values。这个结构体包含两个变量,只有Ace有两个数值,其余牌都只有一个数值。结构体Values中定义的两个属性:

    first, 为Int @@ -642,15 +658,19 @@

    Rank定义了一个计算属性values,这个计算属性会根据牌的面值,用适当的数值去初始化Values实例,并赋值给values。对于J,Q,K,Ace会使用特殊数值,对于数字面值的牌使用Int类型的值。

    BlackjackCard结构体自身有两个属性—ranksuit,也同样定义了一个计算属性descriptiondescription属性用ranksuit的中内容来构建对这张扑克牌名字和数值的描述,并用可选类型second来检查是否存在第二个值,若存在,则在原有的描述中增加对第二数值的描述。

    因为BlackjackCard是一个没有自定义构造函数的结构体,在Memberwise Initializers for Structure Types中知道结构体有默认的成员构造函数,所以你可以用默认的initializer去初始化新的常量theAceOfSpades:

    -
    let theAceOfSpades = BlackjackCard(rank: .Ace, suit: .Spades)
    +
    let theAceOfSpades = BlackjackCard(rank: .Ace, suit: .Spades)
     println("theAceOfSpades: \(theAceOfSpades.description)")
     // 打印出 "theAceOfSpades: suit is ♠, value is 1 or 11"
    -

    尽管RankSuit嵌套在BlackjackCard中,但仍可被引用,所以在初始化实例时能够通过枚举类型中的成员名称单独引用。在上面的例子中description属性能正确得输出对Ace牌有1和11两个值。

    -

    类型嵌套的引用

    +
    +

    尽管RankSuit嵌套在BlackjackCard中,但仍可被引用,所以在初始化实例时能够通过枚举类型中的成员名称单独引用。在上面的例子中description属性能正确得输出对Ace牌有1和11两个值。

    +

    +

    嵌套类型的引用

    在外部对嵌套类型的引用,以被嵌套类型的名字为前缀,加上所要引用的属性名:

    -
    let heartsSymbol = BlackjackCard.Suit.Hearts.toRaw()
    +
    let heartsSymbol = BlackjackCard.Suit.Hearts.toRaw()
     // 红心的符号 为 "♡"
    -

    对于上面这个例子,这样可以使Suit, Rank, 和 Values的名字尽可能的短,因为它们的名字会自然的由被定义的上下文来限定。

    +
    +

    对于上面这个例子,这样可以使Suit, Rank, 和 Values的名字尽可能的短,因为它们的名字会自然的由被定义的上下文来限定。

    +

    preview

    @@ -669,16 +689,8 @@ println("theAceOfSpades: \(theAceOfSpades.description)")
    - - - - - - - - - - + + @@ -696,6 +708,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/20_Extensions.html b/chapter2/20_Extensions.html index 80f9e58d..618294e7 100644 --- a/chapter2/20_Extensions.html +++ b/chapter2/20_Extensions.html @@ -1,57 +1,45 @@ - - + - 扩展 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,120 +595,123 @@
    -
    +
    -

    扩展(Extensions)

    +
    +

    翻译:lyuka
    校对:Hawstein

    +
    +

    扩展(Extensions)


    本页包含内容:

    -

    扩展就是向一个已有的类、结构体或枚举类型添加新功能(functionality)。这包括在没有权限获取原始源代码的情况下扩展类型的能力(即逆向建模)。扩展和Objective-C中的分类(categories)类似。(不过与Objective-C不同的是,Swift的扩展没有名字。)

    -

    Swift中的扩展可以:

    +

    扩展就是向一个已有的类、结构体或枚举类型添加新功能(functionality)。这包括在没有权限获取原始源代码的情况下扩展类型的能力(即逆向建模)。扩展和 Objective-C 中的分类(categories)类似。(不过与Objective-C不同的是,Swift 的扩展没有名字。)

    +

    Swift 中的扩展可以:

      -
    • 添加计算属性和计算静态属性
    • +
    • 添加计算型属性和计算静态属性
    • 定义实例方法和类型方法
    • 提供新的构造器
    • 定义下标
    • 定义和使用新的嵌套类型
    • -
    • 使一个已有类型符合某个接口
    • +
    • 使一个已有类型符合某个协议
    -

    注意 -如果你定义了一个扩展向一个已有类型添加新功能,那么这个新功能对该类型的所有已有实例中都是可用的,即使它们是在你的这个扩展的前面定义的。

    +

    注意:
    如果你定义了一个扩展向一个已有类型添加新功能,那么这个新功能对该类型的所有已有实例中都是可用的,即使它们是在你的这个扩展的前面定义的。

    -

    扩展语法

    +

    +

    扩展语法(Extension Syntax)

    声明一个扩展使用关键字extension

    -
    extension SomeType{
    -    // new functionality to add to SomeType goes here
    +
    extension SomeType {
    +    // 加到SomeType的新功能写到这里
     }
     
    -

    一个扩展可以扩展一个已有类型,使其能够适配一个或多个接口。当这种情况发生时,接口的名字应该完全按照类或结构体的名字的方式进行书写:

    -
    extension SomeType: SomeProtocol, AnotherProctocol{
    -    // implementation of protocol requirments goes here
    +

    一个扩展可以扩展一个已有类型,使其能够适配一个或多个协议(protocol)。当这种情况发生时,协议的名字应该完全按照类或结构体的名字的方式进行书写:

    +
    extension SomeType: SomeProtocol, AnotherProctocol {
    +    // 协议实现写到这里
     }
     
    -

    按照这种方式添加的接口一致性被称之为给扩展添加接口一致性(Protocal Conformance)

    -

    计算属性

    -

    扩展可以向已有类型添加计算实例属性和计算类型属性。下面的例子向Swift的内建Double类型添加了5个计算实例属性,从而提供与距离单位协作的基本支持。

    -
    extension Double{
    -    var km: Double { return self * 1_000.0 }
    -    var m : Double { return self }
    -    var cm: Double { return self / 100.0 }
    -    var mm: Double { return self / 1_000.0 }
    -    var ft: Double { return self / 3.28084 }
    +

    按照这种方式添加的协议遵循者(protocol conformance)被称之为在扩展中添加协议遵循者

    +

    +

    计算型属性(Computed Properties)

    +

    扩展可以向已有类型添加计算型实例属性和计算型类型属性。下面的例子向 Swift 的内建Double类型添加了5个计算型实例属性,从而提供与距离单位协作的基本支持。

    +
    extension Double {
    +    var km: Double { return self * 1_000.0 }
    +    var m : Double { return self }
    +    var cm: Double { return self / 100.0 }
    +    var mm: Double { return self / 1_000.0 }
    +    var ft: Double { return self / 3.28084 }
     }
    -let oneInch = 25.4.mm
    -println("One inch is \(oneInch) meters")
    -// prints "One inch is 0.0254 meters"
    -let threeFeet = 3.ft
    -println("Three feet is \(threeFeet) meters")
    -// prints "Three feet is 0.914399970739201 meters"
    +let oneInch = 25.4.mm
    +println("One inch is \(oneInch) meters")
    +// 打印输出:"One inch is 0.0254 meters"
    +let threeFeet = 3.ft
    +println("Three feet is \(threeFeet) meters")
    +// 打印输出:"Three feet is 0.914399970739201 meters"
     
    -

    这些计算属性表达的含义是把一个Double型的值看作是某单位下的长度值。即使它们被实现为计算属性,但这些属性仍可以接一个带有dot语法的浮点型字面值,而这恰恰是使用这些浮点型字面量实现距离转换的方式。

    -

    在上述例子中,一个Double型的值1.0被用来表示“1米”。这就是为什么m计算属性返回self——表达式1.m被认为是计算1.0Double值。

    -

    其它单位则需要一些转换来表示在米下测量的值。1千米等于1,000米,所以km计算属性要把值乘以1_000.00来转化成单位米下的数值。类似地,1米有3.28024英尺,所以ft计算属性要把对应的Double值除以3.28024来实现英尺到米的单位换算。

    -

    这些属性是只读的计算属性,所有从简考虑它们不用get关键字表示。它们的返回值是Double型,而且可以用于所有接受Double的数学计算中:

    -
    let aMarathon = 42.km + 195.m
    -println("A marathon is \(aMarathon) meters long")
    -// prints "A marathon is 42495.0 meters long"
    +

    这些计算属性表达的含义是把一个Double型的值看作是某单位下的长度值。即使它们被实现为计算型属性,但这些属性仍可以接一个带有dot语法的浮点型字面值,而这恰恰是使用这些浮点型字面量实现距离转换的方式。

    +

    在上述例子中,一个Double型的值1.0被用来表示“1米”。这就是为什么m计算型属性返回self——表达式1.m被认为是计算1.0Double值。

    +

    其它单位则需要一些转换来表示在米下测量的值。1千米等于1,000米,所以km计算型属性要把值乘以1_000.00来转化成单位米下的数值。类似地,1米有3.28024英尺,所以ft计算型属性要把对应的Double值除以3.28024来实现英尺到米的单位换算。

    +

    这些属性是只读的计算型属性,所有从简考虑它们不用get关键字表示。它们的返回值是Double型,而且可以用于所有接受Double的数学计算中:

    +
    let aMarathon = 42.km + 195.m
    +println("A marathon is \(aMarathon) meters long")
    +// 打印输出:"A marathon is 42495.0 meters long"
     
    -

    注意 -扩展可以添加新的计算属性,但是不可以添加存储属性,也不可以向已有属性添加属性观测器(property observers)。

    +

    注意:
    扩展可以添加新的计算属性,但是不可以添加存储属性,也不可以向已有属性添加属性观测器(property observers)。

    -

    构造器

    -

    扩展可以向已有类型添加新的构造器。这可以让你扩展其它类型,将你自己的定制类型作为构造器参数,或者提供该类型的原始实现中没有包含的额外初始化选项。

    +

    +

    构造器(Initializers)

    +

    扩展可以向已有类型添加新的构造器。这可以让你扩展其它类型,将你自己的定制类型作为构造器参数,或者提供该类型的原始实现中没有包含的额外初始化选项。

    +

    扩展能向类中添加新的便利构造器,但是它们不能向类中添加新的指定构造器或析构函数。指定构造器和析构函数必须总是由原始的类实现来提供。

    -

    注意 -如果你使用扩展向一个值类型添加一个构造器,该构造器向所有的存储属性提供默认值,而且没有定义任何定制构造器(custom initializers),那么对于来自你的扩展构造器中的值类型,你可以调用默认构造器(default initializers)和成员级构造器(memberwise initializers)。 -正如在值类型的构造器授权中描述的,如果你已经把构造器写成值类型原始实现的一部分,上述规则不再适用。

    +

    注意:
    如果你使用扩展向一个值类型添加一个构造器,该构造器向所有的存储属性提供默认值,而且没有定义任何定制构造器(custom initializers),那么对于来自你的扩展构造器中的值类型,你可以调用默认构造器(default initializers)和逐一成员构造器(memberwise initializers)。
    正如在值类型的构造器授权中描述的,如果你已经把构造器写成值类型原始实现的一部分,上述规则不再适用。

    下面的例子定义了一个用于描述几何矩形的定制结构体Rect。这个例子同时定义了两个辅助结构体SizePoint,它们都把0.0作为所有属性的默认值:

    -
    struct Size{
    -    var width = 0.0, height = 0.0
    +
    struct Size {
    +    var width = 0.0, height = 0.0
     }
    -struct Point{
    -    var x = 0.0, y = 0.0
    +struct Point {
    +    var x = 0.0, y = 0.0
     }
    -struct Rect{
    -    var origin = Point()
    -    var size = Size()
    +struct Rect {
    +    var origin = Point()
    +    var size = Size()
     }
     

    因为结构体Rect提供了其所有属性的默认值,所以正如默认构造器中描述的,它可以自动接受一个默认的构造器和一个成员级构造器。这些构造器可以用于构造新的Rect实例:

    -
    let defaultRect = Rect()
    -let memberwiseRect = Rect(origin: Point(x: 2.0, y: 2.0), 
    -    size: Size(width: 5.0, height: 5.0))
    +
    let defaultRect = Rect()
    +let memberwiseRect = Rect(origin: Point(x: 2.0, y: 2.0),
    +    size: Size(width: 5.0, height: 5.0))
     

    你可以提供一个额外的使用特殊中心点和大小的构造器来扩展Rect结构体:

    -
    extension Rect{
    -    init(center: Point, size: Size){
    -        let originX = center.x - (size.width / 2)
    -        let originY = center.y - (size.height / 2)
    +
    extension Rect {
    +    init(center: Point, size: Size) {
    +        let originX = center.x - (size.width / 2)
    +        let originY = center.y - (size.height / 2)
             self.init(origin: Point(x: originX, y: originY), size: size)
         }
     }
     

    这个新的构造器首先根据提供的centersize值计算一个合适的原点。然后调用该结构体自动的成员构造器init(origin:size:),该构造器将新的原点和大小存到了合适的属性中:

    -
    let centerRect = Rect(center: Point(x: 4.0, y: 4.0),
    -    size: Size(width: 3.0, height: 3.0))
    -// centerRect's origin is (2.5, 2.5) and its size is (3.0, 3.0)
    +
    let centerRect = Rect(center: Point(x: 4.0, y: 4.0),
    +    size: Size(width: 3.0, height: 3.0))
    +// centerRect的原点是 (2.5, 2.5),大小是 (3.0, 3.0)
     
    -

    注意 -如果你使用扩展提供了一个新的构造器,你依旧有责任保证构造过程能够让所有实例完全初始化。

    +

    注意:
    如果你使用扩展提供了一个新的构造器,你依旧有责任保证构造过程能够让所有实例完全初始化。

    -

    方法

    +

    +

    方法(Methods)

    扩展可以向已有类型添加新的实例方法和类型方法。下面的例子向Int类型添加一个名为repetitions的新实例方法:

    -
    extension Int{
    -    func repetitions(task: () -> ()){
    -        for i in 0..self{
    +
    extension Int {
    +    func repetitions(task: () -> ()) {
    +        for i in 0..self {
                 task()
             }
         }
    @@ -708,78 +719,81 @@ struct Rect{
     

    这个repetitions方法使用了一个() -> ()类型的单参数(single argument),表明函数没有参数而且没有返回值。

    定义该扩展之后,你就可以对任意整数调用repetitions方法,实现的功能则是多次执行某任务:

    -
    3.repetitions({
    -    println("Hello!")
    +
    3.repetitions({
    +    println("Hello!")
         })
    -// Hello!
    -// Hello!
    -// Hello!
    +// Hello!
    +// Hello!
    +// Hello!
     
    -

    可以使用trailing闭包使调用更加简洁:

    -
    3.repetitions{
    -    println("Goodbye!")
    +

    可以使用 trailing 闭包使调用更加简洁:

    +
    3.repetitions{
    +    println("Goodbye!")
     }
    -// Goodbye!
    -// Goodbye!
    -// Goodbye!
    +// Goodbye!
    +// Goodbye!
    +// Goodbye!
     
    -

    修改实例方法

    +

    +

    修改实例方法(Mutating Instance Methods)

    通过扩展添加的实例方法也可以修改该实例本身。结构体和枚举类型中修改self或其属性的方法必须将该实例方法标注为mutating,正如来自原始实现的修改方法一样。

    下面的例子向Swift的Int类型添加了一个新的名为square的修改方法,来实现一个原始值的平方计算:

    -
    extension Int{
    -    mutating func square(){
    +
    extension Int {
    +    mutating func square() {
             self = self * self
         }
     }
    -var someInt = 3
    +var someInt = 3
     someInt.square()
    -// someInt is now 9
    +// someInt 现在值是 9
     
    -

    下标

    +

    +

    下标(Subscripts)

    扩展可以向一个已有类型添加新下标。这个例子向Swift内建类型Int添加了一个整型下标。该下标[n]返回十进制数字从右向左数的第n个数字

    • 123456789[0]返回9
    • 123456789[1]返回8
    -

    等等

    -
    extension Int{
    +

    ...等等

    +
    extension Int {
         subscript(digitIndex: Int) -> Int {
    -        var decimalBase = 1
    -            for _ in 1...digitIndex{
    -                decimalBase *= 10
    +        var decimalBase = 1
    +            for _ in 1...digitIndex {
    +                decimalBase *= 10
                 }
    -        return (self / decimalBase) % 10
    +        return (self / decimalBase) % 10
         }
     }
    -746381295[0]
    -// returns 5
    -746381295[1]
    -// returns 9
    -746381295[2]
    -// returns 2
    -746381295[8]
    -// returns 7
    +746381295[0]
    +// returns 5
    +746381295[1]
    +// returns 9
    +746381295[2]
    +// returns 2
    +746381295[8]
    +// returns 7
     

    如果该Int值没有足够的位数,即下标越界,那么上述实现的下标会返回0,因为它会在数字左边自动补0:

    -
    746381295[9]
    -//returns 0, 即等同于:
    -0746381295[9]
    +
    746381295[9]
    +//returns 0, 即等同于:
    +0746381295[9]
     
    -

    嵌套类型

    +

    +

    嵌套类型(Nested Types)

    扩展可以向已有的类、结构体和枚举添加新的嵌套类型:

    -
    extension Character {
    +
    extension Character {
         enum Kind {
    -        case Vowel, Consonant, Other
    +        case Vowel, Consonant, Other
         }
    -    var kind: Kind {
    -        switch String(self).lowercaseString {
    -        case "a", "e", "i", "o", "u":
    -            return .Vowel
    -        case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m",
    -             "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z":
    -            return .Consonant
    -        default:
    -            return .Other
    +    var kind: Kind {
    +        switch String(self).lowercaseString {
    +        case "a", "e", "i", "o", "u":
    +            return .Vowel
    +        case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m",
    +             "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z":
    +            return .Consonant
    +        default:
    +            return .Other
             }
         }
     }
    @@ -787,28 +801,27 @@ someInt.square()
     

    该例子向Character添加了新的嵌套枚举。这个名为Kind的枚举表示特定字符的类型。具体来说,就是表示一个标准的拉丁脚本中的字符是元音还是辅音(不考虑口语和地方变种),或者是其它类型。

    这个类子还向Character添加了一个新的计算实例属性,即kind,用来返回合适的Kind枚举成员。

    现在,这个嵌套枚举可以和一个Character值联合使用了:

    -
    func printLetterKinds(word: String) {
    -    println("'\\(word)' is made up of the following kinds   of letters:")
    -    for character in word {
    -        switch character.kind {
    -        case .Vowel:
    -            print("vowel ")
    -        case .Consonant:
    -            print("consonant ")
    -        case .Other:
    -            print("other ")
    +
    func printLetterKinds(word: String) {
    +    println("'\\(word)' is made up of the following kinds of letters:")
    +    for character in word {
    +        switch character.kind {
    +        case .Vowel:
    +            print("vowel ")
    +        case .Consonant:
    +            print("consonant ")
    +        case .Other:
    +            print("other ")
             }
         }
    -    print("\n")
    +    print("\n")
     }
    -printLetterKinds("Hello")
    -// 'Hello' is made up of the following kinds of letters:
    -// consonant vowel consonant consonant vowel
    +printLetterKinds("Hello")
    +// 'Hello' is made up of the following kinds of letters:
    +// consonant vowel consonant consonant vowel
     

    函数printLetterKinds的输入是一个String值并对其字符进行迭代。在每次迭代过程中,考虑当前字符的kind计算属性,并打印出合适的类别描述。所以printLetterKinds就可以用来打印一个完整单词中所有字母的类型,正如上述单词"hello"所展示的。

    -

    注意 -由于已知character.kindCharacter.Kind型,所以Character.Kind中的所有成员值都可以使用switch语句里的形式简写,比如使用 .Vowel代替Character.Kind.Vowel

    +

    注意:
    由于已知character.kindCharacter.Kind型,所以Character.Kind中的所有成员值都可以使用switch语句里的形式简写,比如使用 .Vowel代替Character.Kind.Vowel

    @@ -828,16 +841,8 @@ printLetterKinds("Hello")
    - - - - - - - - - - + + @@ -855,6 +860,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/21_Protocols.html b/chapter2/21_Protocols.html index e15b7b1c..dbb7fe85 100644 --- a/chapter2/21_Protocols.html +++ b/chapter2/21_Protocols.html @@ -1,57 +1,45 @@ - - + - 协议 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,53 +595,80 @@
    -
    +
    -

    协议

    -

    Protocol(协议)定义了用于完成某项任务或功能的方法,属性等,它不具备任何功能的细节实现,只用来统一方法,属性等的名称和其类型.(译者注: 其他语言中也把 Portocol 称为 Interface(接口) ).协议可以被类,枚举,结构体采纳并实现,任意满足了协议要求的类,枚举,结构体被称之为协议遵循者.

    -

    协议可以要求其遵循者必须具备的某些特定的属性,方法,操作符,下标.

    +
    +

    翻译:geek5nan
    校对:dabing1022

    +
    +

    协议

    +
    +

    本页包含内容:

    + +

    Protocol(协议)用于统一方法和属性的名称,而不实现任何功能。协议能够被类,枚举,结构体实现,满足协议要求的类,枚举,结构体被称为协议的遵循者

    +

    遵循者需要提供协议指定的成员,如属性,方法,操作符,下标等。

    +

    协议的语法

    -

    协议的定义和类,结构体,枚举的定义非常相似:

    -
    protocol SomeProtocol {
    -    // 此处书写协议的内容
    +

    协议的定义与类,结构体,枚举的定义非常相似,如下所示:

    +
    protocol SomeProtocol {
    +    // 协议内容
     }
    -

    类型名称后加上协议名称 ,并用冒号:分隔,从而实现协议;当实现多个协议时,各协议之间用逗号,分隔.

    -
    struct SomeStructure: FirstProtocol, AnotherProtocol{
    -    // 此处书写结构体的定义
    +
    +

    在类,结构体,枚举的名称后加上协议名称,中间以冒号:分隔即可实现协议;实现多个协议时,各协议之间用逗号,分隔,如下所示:

    +
    struct SomeStructure: FirstProtocol, AnotherProtocol {
    +    // 结构体内容
     }
    -

    当某个类实现了协议,并含有父类时,应当把父类名放在所有的协议名称之前

    -
    class SomeClass: SomeSuperClass, FirstProtocol, AnotherProtocol{
    -    // 此处书写类的定义
    +
    +

    当某个类含有父类的同时并实现了协议,应当把父类放在所有的协议之前,如下所示:

    +
    class SomeClass: SomeSuperClass, FirstProtocol, AnotherProtocol {
    +    // 类的内容
     }
    -

    属性要求

    -

    协议能够要求其遵循者必须拥有特定名称和类型实例属性(instance property)类属性 (type property),也可以指定协议中的属性的settablegettable,但它并不要求属性存储型属性(stored property)还是计算型属性(calculate property).

    -

    当协议要求其中的某个属性gettable时,即使实现了它的setter也不会出错. (译者注:此小节术语较多,可参阅属性章节).

    -

    属性通常被声明为变量,通过前置var关键字. 在属性声明后写上{ get set }指定属性为可读写的.{ get }用来描述属性为可读的.

    -
    protocol SomeProtocol {
    +
    +

    +

    属性要求

    +

    协议能够要求其遵循者必须含有一些特定名称和类型实例属性(instance property)类属性 (type property),也能够要求属性具有(设置权限)settable(访问权限)gettable,但它不要求属性存储型属性(stored property)还是计算型属性(calculate property)

    +

    如果协议要求属性具有设置权限和访问权限,那常量存储型属性或者只读计算型属性都无法满足此要求。如果协议只要求属性具有访问权限,那任何类型的属性都可以满足此要求,无论这些属性是否具有设置权限。

    +

    通常前置var关键字将属性声明为变量。在属性声明后写上{ get set }表示属性为可读写的。{ get }用来表示属性为可读的。即使你为可读的属性实现了setter方法,它也不会出错。

    +
    protocol SomeProtocol {
         var musBeSettable : Int { get set }
         var doesNotNeedToBeSettable: Int { get }
     }
    -

    当协议用来被类实现时,使用class关键字来说明该属性为类成员 ; 当协议被结构体或枚举实现时,则使用static关键字来说明

    -
    protocol AnotherProtocol {
    +
    +

    用类来实现协议时,使用class关键字来表示该属性为类成员;用结构体或枚举实现协议时,则使用static关键字来表示:

    +
    protocol AnotherProtocol {
         class var someTypeProperty: Int { get set }
     }
    -

    下边的协议包含了一个实例属性.

    -
    protocol FullyNamed {
    -    var fullName: string { get }
    -}    
    -

    FullyNamed 定义了一个拥有 fullName 属性的协议. 该协议要求其 遵循者 必须拥有一个名为 fullName, 类型为 String 的可读属性.

    -

    下例是一个遵循FullyNamed 协议的简单结构体

    -
    struct Person: FullyNamed{
    +
    +protocol FullyNamed {
    +    var fullName: String { get }
    +}
    +
    +

    FullyNamed协议含有fullName属性。因此其遵循者必须含有一个名为fullName,类型为String的可读属性。

    +
    struct Person: FullyNamed{
         var fullName: String
     }
     let john = Person(fullName: "John Appleseed")
     //john.fullName 为 "John Appleseed"
    -

    定义一个名为Person并实现了FullyNamed协议的结构体. 每一个Person实例都拥有一个String类型,名为fullName存储型属性,它满足了FullyNamed协议的要求,也就是说 Person完整的遵循了该协议.(如果协议未被完整遵循,Swift编译时会报出错误).

    -

    下例是一个遵循了FullyNamed协议的类:

    -
    class Starship: FullyNamed {
    +
    +

    Person结构体含有一个名为fullName存储型属性,完整的遵循了协议。(若协议未被完整遵循,编译时则会报错)。

    +

    如下所示,Startship遵循FullyNamed协议:

    +
    class Starship: FullyNamed {
         var prefix: String?
         var name: String
    -    init(name: String, prefix: Stirng? = nil ) {
    +    init(name: String, prefix: String? = nil ) {
             self.anme = name
             self.prefix = prefix
         }
    @@ -643,23 +678,27 @@ let john = Person(fullName: "John Appleseed")
     }
     var ncc1701 = Starship(name: "Enterprise", prefix: "USS")
     // ncc1701.fullName == "USS Enterprise"
    -

    该类将fullName实现为计算型只读属性.它的每一个实例都有一个名为name的必备属性和一个名为prefix的可选属性. 当prefix存在时,将prefix插入到name之前来为Starship构建fullName

    +
    +

    Starship类将fullName实现为可读的计算型属性。它的每一个实例都有一个名为name的必备属性和一个名为prefix的可选属性。 当prefix存在时,将prefix插入到name之前来为Starship构建fullName

    +

    方法要求

    -

    协议可以要求其遵循者必备某些特定的实例方法类方法. 这些方法作为协议的一部分,像普通的方法一样写在协议体中,但却不需要方法体.而且,协议中的方法同样支持可变参数.

    +

    协议能够要求其遵循者必备某些特定的实例方法类方法。协议方法的声明与普通方法声明相似,但它不需要方法内容。

    -

    笔记: 协议中的方法的语法同普通方法一样,但是不支持默认参数.

    +

    注意: +协议方法支持变长参数(variadic parameter),不支持默认参数(default parameter)

    -

    在协议中定义类方法类属性一样,只需在方法前加上class关键字; 当协议用于被枚举结构体遵循时,类方法的关键字需要换为static:

    -
    protocol SomeProtocol {
    +

    前置class关键字表示协议中的成员为类成员;当协议用于被枚举结构体遵循时,则使用static关键字。如下所示:

    +
    protocol SomeProtocol {
         class func someTypeMethod()
     }
    -

    下边是拥有一个实例方法的协议的例子

    -
    protocol RandomNumberGenerator {
    +
    +protocol RandomNumberGenerator {
         func random() -> Double
     }
    -

    RandomNumberGenerator 协议要求其遵循者必须拥有一个名为random, 返回值类型为Double 的实例方法. (这里假设随机数在 [0,1] 之间). 该协议只为生成随机数提供了一个统一的函数名称,而不去做具体的实现工作.

    -

    这里有一个名为LinearCongruentialGenerator遵循RandomNumberGenerator协议的类. 该类实现了名为 linear congruential generator(线性同余生成器) 的假随机数算法

    -
    class LinearCongruentialGenerator: RandomNumberGenerator {
    +
    +

    RandomNumberGenerator协议要求其遵循者必须拥有一个名为random, 返回值类型为Double的实例方法。(我们假设随机数在[0,1]区间内)。

    +

    LinearCongruentialGenerator遵循RandomNumberGenerator协议,并提供了一个叫做线性同余生成器(linear congruential generator)的伪随机数算法。

    +
    class LinearCongruentialGenerator: RandomNumberGenerator {
         var lastRandom = 42.0
         let m = 139968.0
         let a = 3877.0
    @@ -674,19 +713,23 @@ println("Here's a random number: \(generator.random())")
     // 输出 : "Here's a random number: 0.37464991998171"
     println("And another one: \(generator.random())")
     // 输出 : "And another one: 0.729023776863283"
    -

    突变方法要求

    -

    有时不得不在方法中改变实例的所属的类型.在基于Value Type的实例方法(译者注:指结构体和枚举中的方法)的func前加上mutating关键字来表明该方法允许改变该实例和其属性的所属类型. 这一突变过程在 [Modifyting Value Types from Within Instance Methods][1] 一节中有详细描述.

    -

    如果你打算在协议中定义一个能够改变实例所属类型的实例方法,只需要在方法前加上mutating关键字.使得结构体和枚举遵循该协议.(译者注:类中的变量为 Reference Type ,可以轻易的改变实例及其属性的类型 . 而结构体和枚举中的变量都为 Value Type, 因此需要加上mutating关键字才能更改它们的所属类型)

    +
    +

    +

    突变方法要求

    +

    能在方法函数内部改变实例类型的方法称为突变方法。在值类型(Value Type)(译者注:特指结构体和枚举)中的的函数前缀加上mutating关键字来表示该函数允许改变该实例和其属性的类型。 这一变换过程在实例方法(Instance Methods)章节中有详细描述。

    +

    (译者注:类中的成员为引用类型(Reference Type),可以方便的修改实例及其属性的值而无需改变类型;而结构体枚举中的成员均为值类型(Value Type),修改变量的值就相当于修改变量的类型,而Swift默认不允许修改类型,因此需要前置mutating关键字用来表示该函数中能够修改类型)

    -

    当协议的实例方法标记为mutating时,在结构体或枚举的实现该方法时中,mutating关键字是不必可少的;当使用类遵循该协议时,则不需要为这个实例方法前加 mutating 关键字.

    +

    注意: +用class实现协议中的mutating方法时,不用写mutating关键字;用结构体枚举实现协议中的mutating方法时,必须写mutating关键字。

    -

    下例定义了一个名为Togglable,含有一个toggle方法的协议.通过名称猜测,toggle方法应该是用来 切换或恢复 某个属性的状态使用的.toggle方法前含有mutating关键字,用以标识其可以更改其遵循者的实例及其属性的所属类型.

    -
    protocol Togglable {
    +

    如下所示,Togglable协议含有toggle函数。根据函数名称推测,toggle可能用于切换或恢复某个属性的状态。mutating关键字表示它为突变方法

    +
    protocol Togglable {
         mutating func toggle()
     }
    -

    如果你使用枚举或结构体来实现Togglabl协议时,必须在枚举或接头体的toggle方法前加上mutating关键字.

    -

    下例定义了一个名为OnOffSwitch的枚举. 这个枚举可以切换On,Off两种状态. 该枚举中的 toggle含有mutating标记,用以匹配Togglable协议的方法要求:

    -
    enum OnOffSwitch: Togglable {
    +
    +

    当使用枚举结构体来实现Togglabl协议时,必须在toggle方法前加上mutating关键字。

    +

    如下所示,OnOffSwitch枚举遵循Togglable协议,OnOff两个成员用于表示当前状态

    +
    enum OnOffSwitch: Togglable {
         case Off, On
         mutating func toggle() {
             switch self {
    @@ -700,22 +743,24 @@ println("And another one: \(generator.random())")
     var lightSwitch = OnOffSwitch.Off
     lightSwitch.toggle()
     //lightSwitch 现在的值为 .On
    -

    协议作为类型

    -

    尽管协议本身不实现任何功能,但你可以将它当做类型来使用.

    -

    包括:

    +
    +

    +

    协议类型

    +

    协议本身不实现任何功能,但你可以将它当做类型来使用。

    +

    使用场景:

      -
    • 作为函数,方法或构造器中的参数类型,返回值类型
    • -
    • 作为常量,变量,属性的类型
    • -
    • 作为数组,字典或其他容器中的元素类型
    • +
    • 作为函数,方法或构造器中的参数类型,返回值类型
    • +
    • 作为常量,变量,属性的类型
    • +
    • 作为数组,字典或其他容器中的元素类型
    -

    Note: 协议是一种类型,因此你应该向其他类型那样(Int,Double,String),使用驼峰式写法来书写协议

    +

    注意: +协议类型应与其他类型(Int,Double,String)的写法相同,使用驼峰式

    -

    这里有一个使用协议类型的例子:

    -
    class Dice {
    +
    class Dice {
         let sides: Int
         let generator: RandomNumberGenerator
    -    init(sides: Int, generator: RandomNumberGenerator) { 
    +    init(sides: Int, generator: RandomNumberGenerator) {
             self.sides = sides
             self.generator = generator
         }
    @@ -723,13 +768,13 @@ lightSwitch.toggle()
             return Int(generator.random() * Double(sides)) +1
         }
     }
    -

    这里定义了一个名为 Dice的类,用来代表桌游中的N个面的骰子.

    -

    Dice拥有名为sidesgenerator的两个属性,前者用来表示骰子有几个面,后者用来为骰子提供一个随机数的生成器

    -

    generator是一个RandomNumberGenerator协议类型的属性.因此,你可以为它赋值任何遵循该协议的类型.

    -

    Dice也拥有一个构造器(initializer)用来设置它的初始状态.构造器中含有一个名为generator,类型为RandomNumberGenerator的形参.你可以在此传入任意遵循RandomNumberGenerator协议的类型.

    -

    roll是一个用以返回骰子面值的实例方法.该方法先调用generatorrandom方法来创建一个 [0-1] 之间的随机数,然后使用这个随机数来生成骰子的面值. 这里的generator 被声明为采纳了RandomNumberGenerator协议,用以确保random方法能够被调用

    -

    下例展示了一个使用LinearCongruentialGenerator实例作为随机数生成器的六面骰子

    -
    var d6 = Dice(sides: 6,generator: LinearCongruentialGenerator())
    +
    +

    这里定义了一个名为 Dice的类,用来代表桌游中的N个面的骰子。

    +

    Dice含有sidesgenerator两个属性,前者用来表示骰子有几个面,后者为骰子提供一个随机数生成器。由于后者为RandomNumberGenerator的协议类型。所以它能够被赋值为任意遵循该协议的类型。

    +

    此外,使用构造器(init)来代替之前版本中的setup操作。构造器中含有一个名为generator,类型为RandomNumberGenerator的形参,使得它可以接收任意遵循RandomNumberGenerator协议的类型。

    +

    roll方法用来模拟骰子的面值。它先使用generatorrandom方法来创建一个[0-1]区间内的随机数种子,然后加工这个随机数种子生成骰子的面值。

    +

    如下所示,LinearCongruentialGenerator的实例作为随机数生成器传入Dice构造器

    +
    var d6 = Dice(sides: 6,generator: LinearCongruentialGenerator())
     for _ in 1...5 {
         println("Random dice roll is \(d6.roll())")
     }
    @@ -739,23 +784,27 @@ for _ in 1...5 {
     //Random dice roll is 4
     //Random dice roll is 5
     //Random dice roll is 4
    -

    委托(代理)

    -

    委托是一种设计模式(译者注:想起了那年 UITableViewDelegate 中的奔跑,那是我逝去的Objective-C...),它允许类或结构体将一些需要它们负责的功能或任务交由(委托)给其他的类型.

    -

    代理设计模式的实现很简单,首先定义一个协议封装那些需要被委托的功能的函数和方法, 然后确保其遵循者拥有这些被委托的函数和方法. -委托模式可以用来响应特定的动作,或接收外部数据源提供的数据而无需要知道外部数据源的类型.

    -

    下边这个例子展示了两个基于骰子游戏的两个协议:

    -
    protocol DiceGame {
    +
    +

    +

    委托(代理)模式

    +

    委托是一种设计模式,它允许类或结构体将一些需要它们负责的功能交由(委托)给其他的类型。

    +

    委托模式的实现很简单: 定义协议封装那些需要被委托的函数和方法, 使其遵循者拥有这些被委托的函数和方法

    +

    委托模式可以用来响应特定的动作或接收外部数据源提供的数据,而无需要知道外部数据源的类型。

    +

    下文是两个基于骰子游戏的协议:

    +
    protocol DiceGame {
         var dice: Dice { get }
         func play()
     }
    +
     protocol DiceGameDelegate {
         func gameDidStart(game: DiceGame)
         func game(game: DiceGame, didStartNewTurnWithDiceRoll diceRoll:Int)
         func gameDidEnd(game: DiceGame)
     }
    -

    DiceGame协议可以被任何包含骰子的游戏采纳.DiceGameDelegate协议可以用来追踪DiceGame的游戏过程

    -

    下边是一个 Snakes and Ladders 游戏的新版本(Control Flow含有关于该游戏的介绍).新版本使用Dice中的骰子,实现DiceGameDiceGameDelegate协议

    -
    class SnakesAndLadders: DiceGame {
    +
    +

    DiceGame协议可以在任意含有骰子的游戏中实现,DiceGameDelegate协议可以用来追踪DiceGame的游戏过程。

    +

    如下所示,SnakesAndLaddersSnakes and Ladders(译者注:控制流章节有该游戏的详细介绍)游戏的新版本。新版本使用Dice作为骰子,并且实现了DiceGameDiceGameDelegate协议

    +
    class SnakesAndLadders: DiceGame {
         let finalSquare = 25
         let dic = Dice(sides: 6, generator: LinearCongruentialGenerator())
         var square = 0
    @@ -777,7 +826,7 @@ protocol DiceGameDelegate {
                      break gameLoop
                  case let newSquare where newSquare > finalSquare:
                      continue gameLoop
    -             default: 
    +             default:
                  square += diceRoll
                  square += board[square]
                  }
    @@ -785,13 +834,16 @@ protocol DiceGameDelegate {
              delegate?.gameDIdEnd(self)
          }
     }
    -

    更详细的Shakes and Ladders游戏描述,请在 Control Flow -> Break 章节查看.
    这个版本的游戏被包装到了名为SnakeAndLadders并实现了DiceGame协议的类中. 该类含有一个可读的dice属性和一个play方法用来遵循协议.

    -

    游戏的初始化设置(setup)被为类的构造器(init())来实现.所有的游戏逻辑被转移到了协议方法play中.

    -

    注意:delegate 被定义为遵循DiceGameDelegate协议的可选属性,因为委托并不是该游戏的必备条件.

    -

    DicegameDelegate 提供了三个方法用来追踪游戏过程.被放置于游戏的逻辑中,即play()方法内.分别在游戏开始时,新一轮开始时,游戏结束时被调用.

    -

    因为delegate是一个遵循DiceGameDelegate的可选属性,因此在play()方法中使用了可选链来调用委托方法. 如果delegate属性为nil, 则委托调用优雅的,不含错误的失败.如果delegate不为nil, 则这些委托方法被调用,并且把SnakesAndLadders的这个实例当做参数一并传递

    -

    下边的这个例子展示了一个名为DiceGameTracker,实现DiceGameDelegate协议的类

    -
    class DiceGameTracker: DiceGameDelegate {
    +
    +

    游戏的初始化设置(setup)SnakesAndLadders类的构造器(initializer)实现。所有的游戏逻辑被转移到了play方法中。

    +
    +

    注意: +因为delegate并不是该游戏的必备条件,delegate被定义为遵循DiceGameDelegate协议的可选属性

    +
    +

    DicegameDelegate协议提供了三个方法用来追踪游戏过程。被放置于游戏的逻辑中,即play()方法内。分别在游戏开始时,新一轮开始时,游戏结束时被调用。

    +

    因为delegate是一个遵循DiceGameDelegate的可选属性,因此在play()方法中使用了可选链来调用委托方法。 若delegate属性为nil, 则委托调用优雅地失效。若delegate不为nil,则委托方法被调用

    +

    如下所示,DiceGameTracker遵循了DiceGameDelegate协议

    +
    class DiceGameTracker: DiceGameDelegate {
         var numberOfTurns = 0
         func gameDidStart(game: DiceGame) {
             numberOfTurns = 0
    @@ -808,10 +860,11 @@ protocol DiceGameDelegate {
             println("The game lasted for \(numberOfTurns) turns")
         }
     }
    -

    DiceGameTracker实现了DiceGameDelegate协议中要求的全部方法.用来记录游戏已经进行的轮数. 当游戏开始时,numberOfTurns属性被赋值为0; 在每新一轮中递加; 游戏结束后,输出打印游戏的总轮数.

    -

    gameDidStart使用game参数来打印游戏的一些介绍信息.game的类型是DiceGame而不是 SnakeAndLadders, 因此gameDidStart只能访问和使用DiceGame协议中的成员. 但是仍然可以使用类型转换来访问其实例. 在gameDidStart中,当gameSnakesAndLadders的实例时,会打印出适当的信息. 因为game是被视为遵循了DiceGame协议的属性,也就是说它拥有dice属性,所以gameDidStart方法可以访问和打印dicesides属性,而无需知道这是一场什么游戏....

    -

    这是DiceGameTracker的运行实例:

    -
    “let tracker = DiceGameTracker()
    +
    +

    DiceGameTracker实现了DiceGameDelegate协议的方法要求,用来记录游戏已经进行的轮数。 当游戏开始时,numberOfTurns属性被赋值为0;在每新一轮中递加;游戏结束后,输出打印游戏的总轮数。

    +

    gameDidStart方法从game参数获取游戏信息并输出。game在方法中被当做DiceGame类型而不是SnakeAndLadders类型,所以方法中只能访问DiceGame协议中的成员。

    +

    DiceGameTracker的运行情况,如下所示:

    +
    let tracker = DiceGameTracker()
     let game = SnakesAndLadders()
     game.delegate = tracker
     game.play()
    @@ -821,74 +874,91 @@ game.play()
     // Rolled a 5
     // Rolled a 4
     // Rolled a 5
    -// The game lasted for 4 turns”
    -

    在延展(Extension)中添加协议成员

    -

    即使无法修改源代码,依然可以通过延展(Extension)来扩展已存在类型(译者注: 类,结构体,枚举等).延展中可以为已存在的类型添加属性,方法,下标,协议等成员. 详情请在延展章节中查看.

    +// The game lasted for 4 turns +
    +

    +

    在扩展中添加协议成员

    +

    即便无法修改源代码,依然可以通过扩展(Extension)来扩充已存在类型(译者注: 类,结构体,枚举等)。扩展可以为已存在的类型添加属性方法下标协议等成员。详情请在扩展章节中查看。

    -

    笔记: 通过延展为已存在的类型增加协议时,该类型的实例会自动添加协议中的方法

    +

    注意: +通过扩展为已存在的类型遵循协议时,该类型的所有实例也会随之添加协议中的方法

    -

    下例中TextRepresentable协议含有一个asText 方法,可以被任何类型遵循

    -
    protocol TextRepresentable {
    +

    TextRepresentable协议含有一个asText,如下所示:

    +
    protocol TextRepresentable {
         func asText() -> String
     }
    -

    通过延展为为上一节中的Dice类实现并遵循TextRepresentable协议

    -
    extension Dice: TextRepresentable {
    +
    +

    通过扩展为上一节中提到的Dice类遵循TextRepresentable协议

    +
    extension Dice: TextRepresentable {
         cun asText() -> String {
             return "A \(sides)-sided dice"
         }
     }
    -

    Dice类型的实例现在可以被视为TextRepresentable类型:

    -
    let d12 = Dice(sides: 12,generator: LinearCongruentialGenerator())
    +
    +

    从现在起,Dice类型的实例可被当作TextRepresentable类型:

    +
    let d12 = Dice(sides: 12,generator: LinearCongruentialGenerator())
     println(d12.asText())
     // 输出 "A 12-sided dice"
    -

    SnakesAndLadders 类也可通过延展来遵循协议:

    -
    extension SnakeAndLadders: TextRepresentable {
    +
    +

    SnakesAndLadders类也可以通过扩展的方式来遵循协议:

    +
    extension SnakeAndLadders: TextRepresentable {
         func asText() -> String {
             return "A game of Snakes and Ladders with \(finalSquare) squares"
         }
     }
     println(game.asText())
     // 输出 "A game of Snakes and Ladders with 25 squares"
    -

    通过延展声明协议

    -

    如果一个类型已经实现了协议中的所有要求,却没有声明时,可以通过声明空延展来采纳协议:

    -
    struct Hamster {
    +
    +

    +

    通过扩展补充协议声明

    +

    当一个类型已经实现了协议中的所有要求,却没有声明时,可以通过扩展来补充协议声明:

    +
    struct Hamster {
         var name: String
         func asText() -> String {
             return "A hamster named \(name)"
    -    }    
    +    }
     }
     extension Hamster: TextRepresentabl {}
    -

    现在开始,Hamster的实例可以被当做TextRepresentable类型使用

    -
    let simonTheHamster = Hamster(name: "Simon")
    +
    +

    从现在起,Hamster的实例可以作为TextRepresentable类型使用

    +
    let simonTheHamster = Hamster(name: "Simon")
     let somethingTextRepresentable: TextRepresentabl = simonTheHamester
     println(somethingTextRepresentable.asText())
     // 输出 "A hamster named Simon"
    -
    -

    注意: 类型不会因为满足了某协议而直接改变,你必须为它做出明显的实现协议声明

    +
    +
    +

    注意: +即时满足了协议的所有要求,类型也不会自动转变,因此你必须为它做出明显的协议声明

    +

    集合中的协议类型

    -

    协议类型可以被集合使用,表示集合中的元素均为协议类型:

    -
    let things: TextRepresentable[] = [game,d12,simoTheHamster]
    -

    things数组可以被直接遍历,并调用其中元素的asText()函数:

    -
    for thing in things {
    +

    协议类型可以被集合使用,表示集合中的元素均为协议类型:

    +
    let things: TextRepresentable[] = [game,d12,simoTheHamster]
    +
    +

    如下所示,things数组可以被直接遍历,并调用其中元素的asText()函数:

    +
    for thing in things {
         println(thing.asText())
     }
     // A game of Snakes and Ladders with 25 squares
     // A 12-sided dice
     // A hamster named Simon
    -

    上文代码中,thing被认为是TextRepresentable类型而不是Dice,DiceGame,Hamster等类型.因此,可以在循环中调用它们的asText方法

    +
    +

    thing被当做是TextRepresentable类型而不是DiceDiceGameHamster等类型。因此能且仅能调用asText方法

    +

    协议的继承

    -

    协议可以通过继承一个或多个其他协议.继承协议的语法和继承类的语法相似,多个协议间用逗号,分隔

    -
    protocol InheritingProtocol: SomeProtocol, AnotherProtocol {
    +

    协议能够继承一到多个其他协议。语法与类的继承相似,多个协议间用逗号,分隔

    +
    protocol InheritingProtocol: SomeProtocol, AnotherProtocol {
         // 协议定义
     }
    -

    下边是一个继承了TextRepresentable的协议

    -
    protocol PrettyTextRepresentable: TextRepresentable {
    -    func asPrettyText() -> String 
    +
    +

    如下所示,PrettyTextRepresentable协议继承了TextRepresentable协议

    +
    protocol PrettyTextRepresentable: TextRepresentable {
    +    func asPrettyText() -> String
     }
    -

    PrettyTextRepresentable协议继承自TextRepresentable协议.任何实现PrettyTextRepresentable协议的类型,也需要遵循TextRepresentable`协议.

    -

    用延展为SnakesAndLadders遵循PrettyTextRepresentable协议:

    -
    extension SnakesAndLadders: PrettyTextRepresentable {
    +
    +

    遵循``PrettyTextRepresentable协议的同时,也需要遵循TextRepresentable`协议。

    +

    如下所示,用扩展SnakesAndLadders遵循PrettyTextRepresentable协议:

    +
    extension SnakesAndLadders: PrettyTextRepresentable {
         func asPrettyText() -> String {
             var output = asText() + ":\n"
             for index in 1...finalSquare {
    @@ -904,21 +974,24 @@ println(somethingTextRepresentable.asText())
             return output
         }
     }
    -

    上边的延展为SnakesAndLadders遵循了PrettyTextRepresentabel协议.在for in中迭代出了board数组中的每一个元素:

    +
    +

    for in中迭代出了board数组中的每一个元素:

      -
    • 当数组中元素的值大于0时,用表示
    • -
    • 当数组中元素的值小于0时,用表示
    • -
    • 当数组中元素的值等于0时,用表示
    • +
    • 当从数组中迭代出的元素的值大于0时,用表示
    • +
    • 当从数组中迭代出的元素的值小于0时,用表示
    • +
    • 当从数组中迭代出的元素的值等于0时,用表示
    -

    任意SankesAndLadders的实例都可以使用asPrettyText()方法.

    -
    println(game.asPrettyText())
    +

    任意SankesAndLadders的实例都可以使用asPrettyText()方法。

    +
    println(game.asPrettyText())
     // A game of Snakes and Ladders with 25 squares:
     // ○ ○ ▲ ○ ○ ▲ ○ ○ ▲ ▲ ○ ○ ○ ▼ ○ ○ ○ ○ ▼ ○ ○ ▼ ○ ▼ ○
    -

    协议合成

    -

    一个协议可由多个协议组成,称为协议合成(protocol composition),采用protocol<SomeProtocol, AnotherProtocol>这样的语法.当有多个协议时,中间以,分隔.

    -

    举个栗子:

    -
    protocol Named {
    -var name: String { get }
    +
    +

    +

    协议合成

    +

    一个协议可由多个协议采用protocol<SomeProtocol, AnotherProtocol>这样的格式进行组合,称为协议合成(protocol composition)

    +

    举个例子:

    +
    protocol Named {
    +    var name: String { get }
     }
     protocol Aged {
         var age: Int { get }
    @@ -928,55 +1001,61 @@ struct Person: Named, Aged {
         var age: Int
     }
     func wishHappyBirthday(celebrator: protocol<Named, Aged>) {
    -println("Happy birthday \(celebrator.name) - you're \(celebrator.age)!")
    +    println("Happy birthday \(celebrator.name) - you're \(celebrator.age)!")
     }
     let birthdayPerson = Person(name: "Malcolm", age: 21)
     wishHappyBirthday(birthdayPerson)
     // 输出 "Happy birthday Malcolm - you're 21!
    -

    上例中,Named协议中含有String类型的name属性;Aged协议中含有Int类型的age属性.Person结构体遵循了这两个协议.

    -

    此外还定义了wishHappyBirthday函数,该函数的形参celebrator的类型为protocol<Named,Aged>,也就是说可以接受任意遵循了这两个协议的类型.

    +
    +

    Named协议包含String类型的name属性;Aged协议包含Int类型的age属性。Person结构体遵循了这两个协议。

    +

    wishHappyBirthday函数的形参celebrator的类型为protocol<Named,Aged>。可以传入任意遵循这两个协议的类型的实例

    -

    笔记: 协议合成并不会生成一个新协议,而是将多个协议合成为一个临时的协议.

    +

    注意: +协议合成并不会生成一个新协议类型,而是将多个协议合成为一个临时的协议,超出范围后立即失效。

    +

    检验协议的一致性

    -

    使用isas可以检验协议一致性,也可以将协议转换为特定的其他协议类型.检验与转换的语法和之前相同(详情查看Typy Casting章节):

    +

    使用is检验协议一致性,使用as将协议类型向下转换(downcast)为的其他协议类型。检验与转换的语法和之前相同(详情查看类型检查):

      -
    • is操作符用来检查实例是否遵循了某个协议.
    • -
    • as?返回一个可选值,当实例遵循协议时,返回该协议类型;否则返回nil
    • -
    • as可以用来强制向下转型.

      -

      @objc protocol HasArea {

      -
        var area: Double { get }
      -

      }

      -
    • +
    • is操作符用来检查实例是否遵循了某个协议
    • +
    • as?返回一个可选值,当实例遵循协议时,返回该协议类型;否则返回nil
    • +
    • as用以强制向下转换型。
    +
    @objc protocol HasArea {
    +    var area: Double { get }
    +}
    +
    -

    笔记: @objc用来表示协议是可选的,也可以用来表示暴露给Objective-C的代码,在[Using Siwft with Cocoa and Objectivei-c](6)一节中有详细介绍. -@objc型协议只对有效,因此只能在中检查协议的一致性.

    +

    注意: +@objc用来表示协议是可选的,也可以用来表示暴露给Objective-C的代码,此外,@objc型协议只对有效,因此只能在中检查协议的一致性。详情查看Using Siwft with Cocoa and Objectivei-c

    -
    class Circle: HasArea {
    -let pi = 3.1415927
    -var radius: Double
    -var area: Double { return pi * radius * radius }
    -init(radius: Double) { self.radius = radius }
    +
    class Circle: HasArea {
    +    let pi = 3.1415927
    +    var radius: Double
    +    var area:≈radius }
    +    init(radius: Double) { self.radius = radius }
     }
     class Country: HasArea {
    -var area: Double
    -init(area: Double) { self.area = area }
    +    var area: Double
    +    init(area: Double) { self.area = area }
     }
    -

    CircleCountry都遵循了HasArea协议,前者把area写为计算型属性,后者则把area写为存储型属性

    -

    下边是一个没事实现HasArea协议的Animal类:

    -
    class Animal {
    +
    +

    CircleCountry都遵循了HasArea协议,前者把area写为计算型属性(computed property),后者则把area写为存储型属性(stored property)。

    +

    如下所示,Animal类没有实现任何协议

    +
    class Animal {
         var legs: Int
         init(legs: Int) { self.legs = legs }
     }
    -

    Circle,Country,Animal并没有一个相同的基础类,可以使用AnyObject类型的数组来装在他们的实例:

    -
    let objects: AnyObject[] = [
    +
    +

    Circle,Country,Animal并没有一个相同的基类,所以采用AnyObject类型的数组来装载在它们的实例,如下所示:

    +
    let objects: AnyObject[] = [
         Circle(radius: 2.0),
         Country(area: 243_610),
         Animal(legs: 4)
     ]
    -

    在迭代时可以检查object数组的元素是否遵循HasArea协议:

    -
    for object in objects {
    +
    +

    如下所示,在迭代时检查object数组的元素是否遵循HasArea协议:

    +
    for object in objects {
         if let objectWithArea = object as? HasArea {
             println("Area is \(objectWithArea.area)")
         } else {
    @@ -986,26 +1065,31 @@ init(area: Double) { self.area = area }
     // Area is 12.5663708
     // Area is 243610.0
     // Something that doesn't have an area
    -

    当数组中的元素遵循HasArea协议时,通过as?操作符将其可选绑定(optional binding)objectWithArea常量上.

    -

    objects数组中元素的类型并不会被改变,但是当它们被赋值给objectWithArea时只被视为HasArea类型,并且只有area属性可以被访问.

    +
    +

    当数组中的元素遵循HasArea协议时,通过as?操作符将其可选绑定(optional binding)objectWithArea常量上。

    +

    objects数组中元素的类型并不会因为向下转型而改变,当它们被赋值给objectWithArea时只被视为HasArea类型,因此只有area属性能够被访问。

    +

    可选协议要求

    -

    可选协议含有可选成员,其遵循者可以选择是否实现这些成员.在协议中使用@optional关键字作为前缀来定义可选成员.

    -

    可选协议在调用时使用可选链,详细内容在Optional Chaning章节中查看.

    -

    someOptionalMethod?(someArgument)一样,你可以在可选方法名称后加上?来检查该方法是否被实现.可选方法可选属性都会返回一个可选值(optional value),当其不可访问时,?之后语句不会执行,并返回nil

    +

    可选协议含有可选成员,其遵循者可以选择是否实现这些成员。在协议中使用@optional关键字作为前缀来定义可选成员。

    +

    可选协议在调用时使用可选链,详细内容在可选链章节中查看。

    +

    someOptionalMethod?(someArgument)一样,你可以在可选方法名称后加上?来检查该方法是否被实现。可选方法可选属性都会返回一个可选值(optional value),当其不可访问时,?之后语句不会执行,并返回nil

    -

    笔记: 可选协议只能在含有@objc前缀的协议中生效.且@objc的协议只能被遵循

    +

    注意: +可选协议只能在含有@objc前缀的协议中生效。且@objc的协议只能被遵循。

    -

    下问定义了整型计数器Counter类,该类使用外部的数据源来提供增量值(increment amount). 数据源定义为CounterDataSource类型的协议,如下所示

    -
    @objc protocol CounterDataSource {
    +

    Counter类使用CounterDataSource类型的外部数据源来提供增量值(increment amount),如下所示:

    +
    @objc protocol CounterDataSource {
         @optional func incrementForCount(count: Int) -> Int
         @optional var fixedIncrement: Int { get }
     }
    -

    CounterDataSource含有incrementForCount可选方法fiexdIncrement可选属性.

    +
    +

    CounterDataSource含有incrementForCount可选方法fiexdIncrement可选属性

    -

    笔记: CounterDataSource中的属性和方法都是可选的,因此可以不提供所需要的属性或方法来实现它.尽管技术上允许,但这并不提倡这样用.

    +

    注意: +CounterDataSource中的属性和方法都是可选的,因此可以在类中声明但不实现这些成员,尽管技术上允许这样做,不过最好不要这样写。

    -

    Counter类的定义在下边,它含有一个名为dataSource,CounterDataSource?类型的可选属性:

    -
    @objc class Counter {
    +

    Counter类含有CounterDataSource?类型的可选属性dataSource,如下所示:

    +
    @objc class Counter {
         var count = 0
         var dataSource: CounterDataSource?
         func increment() {
    @@ -1016,20 +1100,22 @@ init(area: Double) { self.area = area }
             }
         }
     }
    -

    count属性用于存储当前的值,increment方法用来为count赋值.

    -

    increment方法通过可选链,尝试从两种可选成员中获取count.

    +
    +

    count属性用于存储当前的值,increment方法用来为count赋值。

    +

    increment方法通过可选链,尝试从两种可选成员中获取count

      -
    1. 由于dataSource可能为nil,因此在dataSource后边加上了?标记来表明只在dataSource非空时才去调用incrementForCount`方法.
    2. -
    3. 即使dataSource存在,但是也无法保证其是否实现了incrementForCount方法,因此在incrementForCount方法后边也加有?标记
    4. +
    5. 由于dataSource可能为nil,因此在dataSource后边加上了?标记来表明只在dataSource非空时才去调用incrementForCount`方法。
    6. +
    7. 即使dataSource存在,但是也无法保证其是否实现了incrementForCount方法,因此在incrementForCount方法后边也加有?标记。
    -

    在调用incrementForCount方法后,Int可选值通过可选绑定(optional binding)自动拆包并赋值给常量amount.

    -

    incrementForCount不能被调用时,尝试使用可选属性``fixedIncrement来代替.

    -

    下边是一个简单的CounterDataSource协议的实现.

    -
    class ThreeSource: CounterDataSource {
    +

    在调用incrementForCount方法后,Int可选值通过可选绑定(optional binding)自动拆包并赋值给常量amount

    +

    incrementForCount不能被调用时,尝试使用可选属性``fixedIncrement来代替。

    +

    ThreeSource实现了CounterDataSource协议,如下所示:

    +
    class ThreeSource: CounterDataSource {
         let fixedIncrement = 3
     }
    -

    可以使用ThreeSource作为数据源开实例化一个Counter:

    -
    var counter = Counter()
    +
    +

    使用ThreeSource作为数据源开实例化一个Counter

    +
    var counter = Counter()
     counter.dataSource = ThreeSource()
     for _ in 1...4 {
         counter.increment()
    @@ -1039,8 +1125,9 @@ for _ in 1...4 {
     // 6
     // 9
     // 12
    -

    下边是一个更为复杂的数据源实现:

    -
    class TowardsZeroSource: CounterDataSource {
    +
    +

    TowardsZeroSource实现了CounterDataSource协议中的incrementForCount方法,如下所示:

    +
    class TowardsZeroSource: CounterDataSource {
     func incrementForCount(count: Int) -> Int {
             if count == 0 {
                 return 0
    @@ -1051,9 +1138,9 @@ func incrementForCount(count: Int) -> Int {
             }
         }
     }
    -

    TowardZeroSource类实现了CounterDataSource可选方法``incrementForCount.

    -

    下边是执行的代码:

    -
    counter.count = -4
    +
    +

    下边是执行的代码:

    +
    counter.count = -4
     counter.dataSource = TowardsZeroSource()
     for _ in 1...5 {
         counter.increment()
    @@ -1065,6 +1152,7 @@ for _ in 1...5 {
     // 0
     // 0
     
    +
    @@ -1082,16 +1170,8 @@ for _ in 1...5 {
    - - - - - - - - - - + + @@ -1109,6 +1189,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/22_Generics.html b/chapter2/22_Generics.html index eb8765b2..4c7255d1 100644 --- a/chapter2/22_Generics.html +++ b/chapter2/22_Generics.html @@ -1,57 +1,45 @@ - - + - 泛型 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,110 +595,112 @@
    -
    +
    -

    泛型

    +
    +

    翻译:takalard
    校对:lifedim

    +
    +

    泛型


    本页包含内容:

    -

    泛型代码可以确保你写出灵活的,可重用的函数和定义出任何你所确定好的需求的类型。你的可以写出避免重复的代码,并且用一种清晰的,抽象的方式表达出来。

    -

    泛型是Swift需要强大特征中的其中一个,许多Swift标准库是通过泛型代码构建出来的。事实上,你已经使用泛型贯穿着整个Language Guide,即便你没有实现它。例如:Swift的Array和Dictionary类型都是泛型集。你可以创建一个Int数组,也可创建一个String数组,或者甚至于可以是任何其他Swift的类型数据数组。同样的,你也可以创建存储任何指定类型的字典(dictionary),而且这些类型可以是没有限制的。

    -
    +

    泛型代码可以让你写出根据自我需求定义、适用于任何类型的,灵活且可重用的函数和类型。它的可以让你避免重复的代码,用一种清晰和抽象的方式来表达代码的意图。

    +

    泛型是 Swift 强大特征中的其中一个,许多 Swift 标准库是通过泛型代码构建出来的。事实上,泛型的使用贯穿了整本语言手册,只是你没有发现而已。例如,Swift 的数组和字典类型都是泛型集。你可以创建一个Int数组,也可创建一个String数组,或者甚至于可以是任何其他 Swift 的类型数据数组。同样的,你也可以创建存储任何指定类型的字典(dictionary),而且这些类型可以是没有限制的。

    +

    泛型所解决的问题

    -

    这里是一个标准的,非泛型函数swapTwoInts,用来交换两个Int值:

    -
        func swapTwoInts(inout a: Int, inout b: Int) 
    -        let temporaryA = a
    -        a = b
    -        b = temporaryA
    -    }
    +

    这里是一个标准的,非泛型函数swapTwoInts,用来交换两个Int值:

    +
    func swapTwoInts(inout a: Int, inout b: Int)
    +  let temporaryA = a
    +  a = b
    +  b = temporaryA
    +}
     
    -

    这个函数使用in-out参数交换a和b的值,这两个参数被描述为[In-Out类型参数][1]。

    -

    swapTwoInts函数可以交换b的原始值到a,也可以交换a的原始值到b,你可以调用这个函数交换两个Int变量值:

    -
        var someInt = 3
    -    var anotherInt = 107
    -    swapTwoInts(&someInt, &anotherInt)
    -    println("someInt is now \(someInt), and anotherInt is now \(anotherInt)")
    -    // prints "someInt is now 107, and anotherInt is now 3"
    +

    这个函数使用写入读出(in-out)参数来交换ab的值,请参考写入读出参数

    +

    swapTwoInts函数可以交换b的原始值到a,也可以交换a的原始值到b,你可以调用这个函数交换两个Int变量值:

    +
    var someInt = 3
    +var anotherInt = 107
    +swapTwoInts(&someInt, &anotherInt)
    +println("someInt is now \(someInt), and anotherInt is now \(anotherInt)")
    +// 输出 "someInt is now 107, and anotherInt is now 3"
     
    -

    swapTwoInts函数是非常有用的,但是它只能交换Int值,如果你想要交换两个String或者Double,就不得不写更多的函数,如 swapTwoStringsswapTwoDoublesfunctions,如同如下所示:

    -
        func swapTwoStrings(inout a: String, inout b: String) {
    -        let temporaryA = a
    -        a = b
    -        b = temporaryA
    -    }
    +

    swapTwoInts函数是非常有用的,但是它只能交换Int值,如果你想要交换两个String或者Double,就不得不写更多的函数,如 swapTwoStringsswapTwoDoublesfunctions,如同如下所示:

    +
    func swapTwoStrings(inout a: String, inout b: String) {
    +    let temporaryA = a
    +    a = b
    +    b = temporaryA
    +}
     
    -    func swapTwoDoubles(inout a: Double, inout b: Double) {
    -        let temporaryA = a
    -        a = b
    -        b = temporaryA
    -    }
    +func swapTwoDoubles(inout a: Double, inout b: Double) {
    +    let temporaryA = a
    +    a = b
    +    b = temporaryA
    +}
     
    -

    你可能注意到 swapTwoIntsswapTwoStringsswapTwoDoubles函数主题都是相同的,唯一不同之处就在于传入的变量不同,分别是Int、String和Double。

    +

    你可能注意到 swapTwoIntsswapTwoStringsswapTwoDoubles函数功能都是相同的,唯一不同之处就在于传入的变量类型不同,分别是IntStringDouble

    但实际应用中通常需要一个用处更强大并且尽可能的考虑到更多的灵活性单个函数,可以用来交换两个任何类型值,很幸运的是,泛型代码帮你解决了这种问题。(一个这种泛型函数后面已经定义好了。)

    -

    NOTE

    -

    In all three functions, it is important that the types of a and b are defined to be the same as each other. If a and b were not of the same type, it would not be possible to swap their values. Swift is a type-safe language, and does not allow (for example) a variable of type String and a variable of type Double to swap values with each other. Attempting to do so would be reported as a compile-time error.

    +

    注意:
    在所有三个函数中,ab的类型是一样的。如果ab不是相同的类型,那它们俩就不能互换值。Swift 是类型安全的语言,所以它不允许一个String类型的变量和一个Double类型的变量互相交换值。如果一定要做,Swift 将报编译错误。

    +

    泛型函数

    -

    泛型函数可以工作于任何类型,这里是一个上面swapTwoInts函数的泛型版本,用于交换两个值:

    -
        func swapTwoValues<T>(inout a: T, inout b: T) {
    -        let temporaryA = a
    -        a = b
    -        b = temporaryA
    -    }
    +

    泛型函数可以工作于任何类型,这里是一个上面swapTwoInts函数的泛型版本,用于交换两个值:

    +
    func swapTwoValues<T>(inout a: T, inout b: T) {
    +    let temporaryA = a
    +    a = b
    +    b = temporaryA
    +}
     
    -

    swapTwoValues函数主体和swapTwoInts函数是一样,而且,只在第一行稍微有那么一点点不同于swapTwoInts,如下所示:

    -
        func swapTwoInts(inout a: Int, inout b: Int)
    -    func swapTwoValues<T>(inout a: T, inout b: T)
    +

    swapTwoValues函数主体和swapTwoInts函数是一样的,它只在第一行稍微有那么一点点不同于swapTwoInts,如下所示:

    +
    func swapTwoInts(inout a: Int, inout b: Int)
    +func swapTwoValues<T>(inout a: T, inout b: T)
     
    -

    这个函数的泛型版本使用了节点类型命名(通常此情况下用字母T来表示)来代替实际类型名(如Int、String或Double)。节点类型名并不是表示T必须是任何类型,但是其规定a和b必须是同一类型的T,而不管T表示任何类型。只有swapTwoValues函数在每次调用时所传入的实际类型决定了T所代表的类型。

    -

    另外一个不同之处在于这个泛型函数名后面跟着的节点类型名(T)是用尖括号括起来的()。这个尖括号告诉Swift那个T是swapTwoValues函数所定义的一个节点类型。因为T是一个节点,Swift不会去查找每一个命名为T的实际类型。

    -

    swapTwoValues函数除了只要传入的两个任何类型值是同一类型外,也可以作为swapTwoInts函数被调用。每次swapTwoValues被调用,T所代表的类型值都会传给函数。

    -

    在下面的两个例子中,T分别代表Tnt和String:

    -
        var someInt = 3
    -    var anotherInt = 107
    -    swapTwoValues(&someInt, &anotherInt)
    -    // someInt is now 107, and anotherInt is now 3
    -
    -    var someString = "hello"
    -    var anotherString = "world"
    -    swapTwoValues(&someString, &anotherString)
    -    // someString is now "world", and anotherString is now "hello"
    +

    这个函数的泛型版本使用了占位类型名字(通常此情况下用字母T来表示)来代替实际类型名(如InStringDoubl)。占位类型名没有提示T必须是什么类型,但是它提示了ab必须是同一类型T,而不管T表示什么类型。只有swapTwoValues函数在每次调用时所传入的实际类型才能决定T所代表的类型。

    +

    另外一个不同之处在于这个泛型函数名后面跟着的展位类型名字(T)是用尖括号括起来的(<T>)。这个尖括号告诉 Swift 那个TswapTwoValues函数所定义的一个类型。因为T是一个占位命名类型,Swift 不会去查找命名为T的实际类型。

    +

    swapTwoValues函数除了要求传入的两个任何类型值是同一类型外,也可以作为swapTwoInts函数被调用。每次swapTwoValues被调用,T所代表的类型值都会传给函数。

    +

    在下面的两个例子中,T分别代表IntString

    +
    var someInt = 3
    +var anotherInt = 107
    +swapTwoValues(&someInt, &anotherInt)
    +// someInt is now 107, and anotherInt is now 3
    +
    +
    var someString = "hello"
    +var anotherString = "world"
    +swapTwoValues(&someString, &anotherString)
    +// someString is now "world", and anotherString is now "hello"
     
    -

    NOTE

    -

    The swapTwoValues function defined above is inspired by a generic function called swap, which is part of the Swift standard library, and is automatically made available for you to use in your apps. If you need the behavior of the swapTwoValues function in your own code, you can use Swift’s existing swap function rather than providing your own implementation.

    +

    注意
    上面定义的函数swapTwoValues是受swap函数启发而实现的。swap函数存在于 Swift 标准库,并可以在其它类中任意使用。如果你在自己代码中需要类似swapTwoValues函数的功能,你可以使用已存在的交换函数swap函数。

    -

    Type Parameters

    +

    类型参数

    -

    在上面的swapTwoValues例子中,节点类型T是一种类型参数的示例。类型参数指定并命名为一个节点类型,并且紧随在函数名后面,并用一对尖括号括起来(如)。

    -

    一旦一个类型参数被指定,那么其可以被使用来定义一个函数的参数类型(如swapTwoValues函数中的参数a和b),或作为一个函数返回类型,或用作函数主体中的注释类型。在这种情况下,被类型参数所代表的节点类型不管函数任何时候被调用,都会被实际类型所替换(在上面swapTwoValues例子中,当函数第一次被调用时,T被Int替换,第二次调用时,被String替换。)。

    +

    在上面的swapTwoValues例子中,占位类型T是一种类型参数的示例。类型参数指定并命名为一个占位类型,并且紧随在函数名后面,使用一对尖括号括起来(如<T>)。

    +

    一旦一个类型参数被指定,那么其可以被使用来定义一个函数的参数类型(如swapTwoValues函数中的参数ab),或作为一个函数返回类型,或用作函数主体中的注释类型。在这种情况下,被类型参数所代表的占位类型不管函数任何时候被调用,都会被实际类型所替换(在上面swapTwoValues例子中,当函数第一次被调用时,TInt替换,第二次调用时,被String替换。)。

    你可支持多个类型参数,命名在尖括号中,用逗号分开。

    +

    命名类型参数

    -

    在简单的情况下,泛型函数或泛型类型需要指定一个节点类型(如上面的swapTwoValues泛型函数,或一个存储单一类型的泛型集,如Array),通常用一单个字母T来命名类型参数。不过,你可以使用任何有效的标识符来作为类型参数名。

    -

    如果你使用多个参数定义更复杂的泛型函数或泛型类型,那么使用更多的描述类型参数是非常有用的。例如,Swift字典(Dictionary)类型有两个类型参数,一个是key,另外一个是值。如果你自己写字典,你或许会定义这两个类型参数为KeyType和ValueType,用来记住它们在你的泛型代码中的作用。

    +

    在简单的情况下,泛型函数或泛型类型需要指定一个占位类型(如上面的swapTwoValues泛型函数,或一个存储单一类型的泛型集,如数组),通常用一单个字母T来命名类型参数。不过,你可以使用任何有效的标识符来作为类型参数名。

    +

    如果你使用多个参数定义更复杂的泛型函数或泛型类型,那么使用更多的描述类型参数是非常有用的。例如,Swift 字典(Dictionary)类型有两个类型参数,一个是键,另外一个是值。如果你自己写字典,你或许会定义这两个类型参数为KeyTypeValueType,用来记住它们在你的泛型代码中的作用。

    -

    NOTE

    -

    Always give type parameters UpperCamelCase names (such as T and KeyType) to indicate that they are a placeholder for a type, not a value.

    +

    注意
    请始终使用大写字母开头的驼峰式命名法(例如TKeyType)来给类型参数命名,以表明它们是类型的占位符,而非类型值。

    +

    泛型类型

    -

    通常在泛型函数中,Swift允许你定义你自己的泛型类型。这些自定义类、结构体和枚举作用于任何类型,如同ArrayDictionary的用法。

    -

    这部分向你展示如何写一个泛型集类型-Stack(栈)。一个栈是一系列值域的集合,和array(数组)相似,但其是一个比Swift的Array类型更多限制的集合。一个数组可以允许其里面任何位置的插入/删除操作,而栈,只允许,只允许在集合的末端添加新的项(如同push一个新值进栈)。同样的一个栈也只能从末端移除项(如同pop一个值出栈)。

    +

    通常在泛型函数中,Swift 允许你定义你自己的泛型类型。这些自定义类、结构体和枚举作用于任何类型,如同ArrayDictionary的用法。

    +

    这部分向你展示如何写一个泛型集类型--Stack(栈)。一个栈是一系列值域的集合,和Array(数组)类似,但其是一个比 Swift 的Array类型更多限制的集合。一个数组可以允许其里面任何位置的插入/删除操作,而栈,只允许在集合的末端添加新的项(如同push一个新值进栈)。同样的一个栈也只能从末端移除项(如同pop一个值出栈)。

    -

    NOTE

    -

    The concept of a stack is used by the UINavigationController class to model the view controllers in its navigation hierarchy. You call the UINavigationController class pushViewController:animated: method to add (or push) a view controller on to the navigation stack, and its popViewControllerAnimated: method to remove (or pop) a view controller from the navigation stack. A stack is a useful collection model whenever you need a strict “last in, first out” approach to managing a collection.

    +

    注意
    栈的概念已被UINavigationController类使用来模拟试图控制器的导航结构。你通过调用UINavigationControllerpushViewController:animated:方法来为导航栈添加(add)新的试图控制器;而通过popViewControllerAnimated:的方法来从导航栈中移除(pop)某个试图控制器。每当你需要一个严格的后进先出方式来管理集合,堆栈都是最实用的模型。

    -

    下图展示了一个栈的压栈(push)/出栈(pop)的行为:

    -

    ![此处输入图片的描述][2]

    +

    下图展示了一个栈的压栈(push)/出栈(pop)的行为:

    +

    此处输入图片的描述

    1. 现在有三个值在栈中;
    2. 第四个值“pushed”到栈的顶部;
    3. @@ -699,118 +709,119 @@
    4. 移除掉一个值后,现在栈又重新只有三个值。

    这里展示了如何写一个非泛型版本的栈,Int值型的栈:

    -
    struct IntStack {
    +
    struct IntStack {
         var items = Int[]()
         mutating func push(item: Int) {
             items.append(item)
         }
         mutating func pop() -> Int {
    -        return items.removeLast()
    +        return items.removeLast()
         }
     }
     
    -

    这个结构体在栈中使用一个Array性质的items存储值。Stack提供两个方法:pushpop,从栈中压进一个值和移除一个值。这些方法标记为可变的,因为他们需要修改(或转换)结构体的items数组。

    +

    这个结构体在栈中使用一个Array性质的items存储值。Stack提供两个方法:pushpop,从栈中压进一个值和移除一个值。这些方法标记为可变的,因为它们需要修改(或转换)结构体的items数组。

    上面所展现的IntStack类型只能用于Int值,不过,其对于定义一个泛型Stack类(可以处理任何类型值的栈)是非常有用的。

    这里是一个相同代码的泛型版本:

    -
    struct Stack<T> {
    +
    struct Stack<T> {
         var items = T[]()
         mutating func push(item: T) {
             items.append(item)
         }
         mutating func pop() -> T {
    -        return items.removeLast()
    +        return items.removeLast()
         }
     }
     
    -

    注意到Stack的泛型版本基本上和非泛型版本相同,但是泛型版本的节点类型参数为T代替了实际Int类型。这种类型参数包含在一对尖括号里(<T>),紧随在结构体名字后面。

    -

    T定义了一个名为“某种类型T”的节点提供给后来用。这种将来类型可以在结构体的定义里任何地方表示为“T”。在这种情况下,T在如下三个地方被用作节点:

    +

    注意到Stack的泛型版本基本上和非泛型版本相同,但是泛型版本的占位类型参数为T代替了实际Int类型。这种类型参数包含在一对尖括号里(<T>),紧随在结构体名字后面。

    +

    T定义了一个名为“某种类型T”的节点提供给后来用。这种将来类型可以在结构体的定义里任何地方表示为“T”。在这种情况下,T在如下三个地方被用作节点:

    • 创建一个名为items的属性,使用空的T类型值数组对其进行初始化;
    • 指定一个包含一个参数名为itempush方法,该参数必须是T类型;
    • 指定一个pop方法的返回值,该返回值将是一个T类型值。

    当创建一个新单例并初始化时, 通过用一对紧随在类型名后的尖括号里写出实际指定栈用到类型,创建一个Stack实例,同创建ArrayDictionary一样:

    -
    var stackOfStrings = Stack<String>()
    -stackOfStrings.push("uno")
    -stackOfStrings.push("dos")
    -stackOfStrings.push("tres")
    -stackOfStrings.push("cuatro")
    -// 现在栈已经有4个string了
    +
    var stackOfStrings = Stack<String>()
    +stackOfStrings.push("uno")
    +stackOfStrings.push("dos")
    +stackOfStrings.push("tres")
    +stackOfStrings.push("cuatro")
    +// 现在栈已经有4个string了
     
    -

    下图将展示stackOfStrings如何push这四个值进栈的过程:

    -

    ![此处输入图片的描述][3]

    -

    从栈中pop并移除值"cuatro":

    -
    let fromTheTop = stackOfStrings.pop()
    -// fromTheTop is equal to "cuatro", and the stack now contains 3 strings
    +

    下图将展示stackOfStrings如何push这四个值进栈的过程:

    +

    此处输入图片的描述

    +

    从栈中pop并移除值"cuatro":

    +
    let fromTheTop = stackOfStrings.pop()
    +// fromTheTop is equal to "cuatro", and the stack now contains 3 strings
     
    -

    下图展示了如何从栈中pop一个值的过程: -![此处输入图片的描述][4]

    -

    由于Stack是泛型类型,所以在Swift中其可以用来创建任何有效类型的栈,这种方式如同ArrayDictionary

    +

    下图展示了如何从栈中pop一个值的过程:
    此处输入图片的描述

    +

    由于Stack是泛型类型,所以在 Swift 中其可以用来创建任何有效类型的栈,这种方式如同ArrayDictionary

    +

    类型约束

    swapTwoValues函数和Stack类型可以作用于任何类型,不过,有的时候对使用在泛型函数和泛型类型上的类型强制约束为某种特定类型是非常有用的。类型约束指定了一个必须继承自指定类的类型参数,或者遵循一个特定的协议或协议构成。

    -

    例如,Swift的Dictionary类型对作用于其keys的类型做了些限制。在[Dictionaries][5]的描述中,字典的keys类型必须是hashable,也就是说,必须有一种方法可以使其是唯一的表示。Dictionary之所以需要其keys是hashable是为了以便于其检查其是否包含某个特定key的值。如无此需求,Dictionary即不会告诉是否插入或者替换了某个特定key的值,也不能查找到已经存储在字典里面的给定key值。

    -

    这个需求强制加上一个类型约束作用于Dictionary的key上,当然其key类型必须遵循Hashable协议(Swift标准库中定义的一个特定协议)。所有的Swift基本类型(如StringIntDoubleBool)默认都是hashable。

    -

    当你创建自定义泛型类型时,你可以定义你自己的类型约束,当然,这些约束要支持泛型编程的强力特征中的多数。抽象概念如Hashtable具有的类型特征是根据他们概念特征来界定的,而不是他们的直接类型特征。

    +

    例如,Swift 的Dictionary类型对作用于其键的类型做了些限制。在字典的描述中,字典的键类型必须是可哈希,也就是说,必须有一种方法可以使其被唯一的表示。Dictionary之所以需要其键是可哈希是为了以便于其检查其是否已经包含某个特定键的值。如无此需求,Dictionary既不会告诉是否插入或者替换了某个特定键的值,也不能查找到已经存储在字典里面的给定键值。

    +

    这个需求强制加上一个类型约束作用于Dictionary的键上,当然其键类型必须遵循Hashable协议(Swift 标准库中定义的一个特定协议)。所有的 Swift 基本类型(如StringIntDoubleBool)默认都是可哈希。

    +

    当你创建自定义泛型类型时,你可以定义你自己的类型约束,当然,这些约束要支持泛型编程的强力特征中的多数。抽象概念如可哈希具有的类型特征是根据它们概念特征来界定的,而不是它们的直接类型特征。

    类型约束语法

    你可以写一个在一个类型参数名后面的类型约束,通过冒号分割,来作为类型参数链的一部分。这种作用于泛型函数的类型约束的基础语法如下所示(和泛型类型的语法相同):

    -
    func someFunction<T: SomeClass, U: SomeProtocol>(someT: T, someU: U) {
    -    // function body goes here
    +
    func someFunction<T: SomeClass, U: SomeProtocol>(someT: T, someU: U) {
    +    // function body goes here
     }
     

    上面这个假定函数有两个类型参数。第一个类型参数T,有一个需要T必须是SomeClass子类的类型约束;第二个类型参数U,有一个需要U必须遵循SomeProtocol协议的类型约束。

    类型约束行为

    这里有个名为findStringIndex的非泛型函数,该函数功能是去查找包含一给定String值的数组。若查找到匹配的字符串,findStringIndex函数返回该字符串在数组中的索引值(Int),反之则返回nil

    -
    func findStringIndex(array: String[], valueToFind: String) -> Int? {
    -    for (index, value) in enumerate(array) {
    -        if value == valueToFind {
    -            return index
    +
    func findStringIndex(array: String[], valueToFind: String) -> Int? {
    +    for (index, value) in enumerate(array) {
    +        if value == valueToFind {
    +            return index
             }
         }
    -    return nil
    +    return nil
     }
     

    findStringIndex函数可以作用于查找一字符串数组中的某个字符串:

    -
    let strings = ["cat", "dog", "llama", "parakeet", "terrapin"]
    -if let foundIndex = findStringIndex(strings, "llama") {
    -    println("The index of llama is \(foundIndex)")
    +
    let strings = ["cat", "dog", "llama", "parakeet", "terrapin"]
    +if let foundIndex = findStringIndex(strings, "llama") {
    +    println("The index of llama is \(foundIndex)")
     }
    -// prints "The index of llama is 2"
    +// 输出 "The index of llama is 2"
     

    如果只是针对字符串而言查找在数组中的某个值的索引,用处不是很大,不过,你可以写出相同功能的泛型函数findIndex,用某个类型T值替换掉提到的字符串。

    这里展示如何写一个你或许期望的findStringIndex的泛型版本findIndex。请注意这个函数仍然返回Int,是不是有点迷惑呢,而不是泛型类型?那是因为函数返回的是一个可选的索引数,而不是从数组中得到的一个可选值。需要提醒的是,这个函数不会编译,原因在例子后面会说明:

    -
    func findIndex<T>(array: T[], valueToFind: T) -> Int? {
    -    for (index, value) in enumerate(array) {
    -        if value == valueToFind {
    -            return index
    +
    func findIndex<T>(array: T[], valueToFind: T) -> Int? {
    +    for (index, value) in enumerate(array) {
    +        if value == valueToFind {
    +            return index
             }
         }
    -    return nil
    +    return nil
     }
     
    -

    上面所写的函数不会编译。这个问题的位置在等式的检查上,“if value == valueToFind”。不是所有的Swift中的类型都可以用等式符(==)进行比较。例如,如果你创建一个你自己的类或结构体来表示一个复杂的数据模型,那么Swift没法猜到对于这个类或结构体而言“等于”的意思。正因如此,这部分代码不能可能保证工作于每个可能的类型T,当你试图编译这部分代码时估计会出现相应的错误。

    -

    不过,所有的这些并不会让我们无从下手。Swift标准库中定义了一个Equatable协议,该协议要求任何遵循的类型实现等式符(==)和不等符(!=)对任何两个该类型进行比较。所有的Swift标准类型自动支持Equatable协议。

    +

    上面所写的函数不会编译。这个问题的位置在等式的检查上,“if value == valueToFind”。不是所有的 Swift 中的类型都可以用等式符(==)进行比较。例如,如果你创建一个你自己的类或结构体来表示一个复杂的数据模型,那么 Swift 没法猜到对于这个类或结构体而言“等于”的意思。正因如此,这部分代码不能可能保证工作于每个可能的类型T,当你试图编译这部分代码时估计会出现相应的错误。

    +

    不过,所有的这些并不会让我们无从下手。Swift 标准库中定义了一个Equatable协议,该协议要求任何遵循的类型实现等式符(==)和不等符(!=)对任何两个该类型进行比较。所有的 Swift 标准类型自动支持Equatable协议。

    任何Equatable类型都可以安全的使用在findIndex函数中,因为其保证支持等式操作。为了说明这个事实,当你定义一个函数时,你可以写一个Equatable类型约束作为类型参数定义的一部分:

    -
    func findIndex<T: Equatable>(array: T[], valueToFind: T) -> Int? {
    -    for (index, value) in enumerate(array) {
    -        if value == valueToFind {
    -            return index
    +
    func findIndex<T: Equatable>(array: T[], valueToFind: T) -> Int? {
    +    for (index, value) in enumerate(array) {
    +        if value == valueToFind {
    +            return index
             }
         }
    -    return nil
    +    return nil
     }
     

    findIndex中这个单个类型参数写做:T: Equatable,也就意味着“任何T类型都遵循Equatable协议”。

    -

    findIndex函数现在则可以成功的编译过,并且作用于任何遵循Equatable的类型,如Double或String:

    -
    let doubleIndex = findIndex([3.14159, 0.1, 0.25], 9.3)
    -// doubleIndex is an optional Int with no value, because 9.3 is not in the array
    -let stringIndex = findIndex(["Mike", "Malcolm", "Andrea"], "Andrea")
    -// stringIndex is an optional Int containing a value of 2
    +

    findIndex函数现在则可以成功的编译过,并且作用于任何遵循Equatable的类型,如DoubleString:

    +
    let doubleIndex = findIndex([3.14159, 0.1, 0.25], 9.3)
    +// doubleIndex is an optional Int with no value, because 9.3 is not in the array
    +let stringIndex = findIndex(["Mike", "Malcolm", "Andrea"], "Andrea")
    +// stringIndex is an optional Int containing a value of 2
     
    +

    关联类型

    当定义一个协议时,有的时候声明一个或多个关联类型作为协议定义的一部分是非常有用的。一个关联类型给定作用于协议部分的类型一个节点名(或别名)。作用于关联类型上实际类型是不需要指定的,直到该协议接受。关联类型被指定为typealias关键字。

    关联类型行为

    这里是一个Container协议的例子,定义了一个ItemType关联类型:

    -
    protocol Container {
    +
    protocol Container {
         typealias ItemType
         mutating func append(item: ItemType)
         var count: Int { get }
    @@ -826,27 +837,27 @@ let stringIndex = findIndex(["Mike", 这个协议没有指定容器里item是如何存储的或何种类型是允许的。这个协议只指定三个任何遵循Container类型所必须支持的功能点。一个遵循的类型也可以提供其他额外的功能,只要满足这三个条件。

    任何遵循Container协议的类型必须指定存储在其里面的值类型,必须保证只有正确类型的items可以加进容器里,必须明确可以通过其下标返回item类型。

    为了定义这三个条件,Container协议需要一个方法指定容器里的元素将会保留,而不需要知道特定容器的类型。Container协议需要指定任何通过append方法添加到容器里的值和容器里元素是相同类型,并且通过容器下标返回的容器元素类型的值的类型是相同类型。

    -

    为了达到此目的,Container协议声明了一个ItemType的关联类型,写作typealias ItemType。The protocol does not define what ItemType is an alias for—that information is left for any conforming type to provide(这个协议不会定义ItemType是遵循类型所提供的何种信息的别名)。尽管如此,ItemType别名支持一种方法识别在一个容器里的items类型,以及定义一种使用在append方法和下标中的类型,以便保证任何期望的Container的行为是强制性的。

    +

    为了达到此目的,Container协议声明了一个ItemType的关联类型,写作typealias ItemType。这个协议不会定义ItemType是什么的别名,这个信息留给了任何遵循协议的类型来提供。尽管如此,ItemType别名支持一种方法识别在一个容器里的items类型,以及定义一种使用在append方法和下标中的类型,以便保证任何期望的Container的行为是强制性的。

    这里是一个早前IntStack类型的非泛型版本,适用于遵循Container协议:

    -
    struct IntStack: Container {
    -    // original IntStack implementation
    +
    struct IntStack: Container {
    +    // original IntStack implementation
         var items = Int[]()
         mutating func push(item: Int) {
             items.append(item)
         }
         mutating func pop() -> Int {
    -        return items.removeLast()
    +        return items.removeLast()
         }
    -    // conformance to the Container protocol
    +    // conformance to the Container protocol
         typealias ItemType = Int
         mutating func append(item: Int) {
             self.push(item)
         }
         var count: Int {
    -    return items.count
    +    return items.count
         }
         subscript(i: Int) -> Int {
    -        return items[i]
    +        return items[i]
         }
     }
     
    @@ -854,62 +865,63 @@ let stringIndex = findIndex(["Mike", 此外,IntStack指定了Container的实现,适用的ItemType被用作Int类型。对于这个Container协议实现而言,定义 typealias ItemType = Int,将抽象的ItemType类型转换为具体的Int类型。

    感谢Swift类型参考,你不用在IntStack定义部分声明一个具体的IntItemType。由于IntStack遵循Container协议的所有要求,只要通过简单的查找append方法的item参数类型和下标返回的类型,Swift就可以推断出合适的ItemType来使用。确实,如果上面的代码中你删除了 typealias ItemType = Int这一行,一切仍旧可以工作,因为它清楚的知道ItemType使用的是何种类型。

    你也可以生成遵循Container协议的泛型Stack类型:

    -
    struct Stack<T>: Container {
    -    // original Stack<T> implementation
    +
    struct Stack<T>: Container {
    +    // original Stack<T> implementation
         var items = T[]()
         mutating func push(item: T) {
             items.append(item)
         }
         mutating func pop() -> T {
    -        return items.removeLast()
    +        return items.removeLast()
         }
    -    // conformance to the Container protocol
    +    // conformance to the Container protocol
         mutating func append(item: T) {
             self.push(item)
         }
         var count: Int {
    -    return items.count
    +    return items.count
         }
         subscript(i: Int) -> T {
    -        return items[i]
    +        return items[i]
         }
     }
     
    -

    这个时候,节点类型参数T被用作append方法的item参数和下标的返回类型。Swift因此可以推断出被用作这个特定容器的ItemTypeT的合适类型。

    +

    这个时候,占位类型参数T被用作append方法的item参数和下标的返回类型。Swift 因此可以推断出被用作这个特定容器的ItemTypeT的合适类型。

    扩展一个存在的类型为一指定关联类型

    -

    在[Adding Protocol Conformance with an Extension][6]中有描述扩展一个存在的类型添加遵循一个协议。这个类型包含一个关联类型的协议。

    -

    Swift的Array已经提供append方法,一个count属性和通过下标来查找一个自己的元素。这三个功能都达到Container协议的要求。也就意味着你可以扩展Array去遵循Container协议,只要通过简单声明Array适用于该协议而已。如何实践这样一个空扩展,在[Declaring Protocol Adoption with an Extension][7]中有描述这样一个实现一个空扩展的行为:

    -
    extension Array: Container {}
    +

    使用扩展来添加协议兼容性中有描述扩展一个存在的类型添加遵循一个协议。这个类型包含一个关联类型的协议。

    +

    Swift的Array已经提供append方法,一个count属性和通过下标来查找一个自己的元素。这三个功能都达到Container协议的要求。也就意味着你可以扩展Array去遵循Container协议,只要通过简单声明Array适用于该协议而已。如何实践这样一个空扩展,在使用扩展来声明协议的采纳中有描述这样一个实现一个空扩展的行为:

    +
    extension Array: Container {}
     

    如同上面的泛型Stack类型一样,Array的append方法和下标保证Swift可以推断出ItemType所使用的适用的类型。定义了这个扩展后,你可以将任何Array当作Container来使用。

    +

    Where 语句

    -

    [Type Constraints][8]中描述的类型约束确保你定义关于类型参数的需求和一泛型函数或类型有关联。

    -

    对于关联类型的定义需求也是非常有用的。你可以通过这样去定义where语句作为一个类型参数队列的一部分。一个where语句使你能够要求一个关联类型遵循一个特定的协议,以及(或)那个特定的类型参数和关联类型可以是相同的。你可写一个where语句,通过紧随放置where关键字在类型参数队列后面,其后跟着一个或者多个针对关联类型的约束,以及(或)一个或多个类型和关联类型的等于关系。

    -

    下面的列子定义了一个名为allItemsMatch的泛型函数,用来检查是否两个Container单例包含具有相同顺序的相同items。如果匹配到所有的items,那么返回一个为true的Boolean值,反之,则相反。

    -

    这两个容器可以被检查出是否是相同类型的容器(虽然它们可以是),但他们确实拥有相同类型的items。这个需求通过一个类型约束和where语句结合来表示:

    -
    func allItemsMatch<
    +

    类型约束中描述的类型约束确保你定义关于类型参数的需求和一泛型函数或类型有关联。

    +

    对于关联类型的定义需求也是非常有用的。你可以通过这样去定义where语句作为一个类型参数队列的一部分。一个where语句使你能够要求一个关联类型遵循一个特定的协议,以及(或)那个特定的类型参数和关联类型可以是相同的。你可写一个where语句,通过紧随放置where关键字在类型参数队列后面,其后跟着一个或者多个针对关联类型的约束,以及(或)一个或多个类型和关联类型的等于关系。

    +

    下面的列子定义了一个名为allItemsMatch的泛型函数,用来检查是否两个Container单例包含具有相同顺序的相同元素。如果匹配到所有的元素,那么返回一个为trueBoolean值,反之,则相反。

    +

    这两个容器可以被检查出是否是相同类型的容器(虽然它们可以是),但它们确实拥有相同类型的元素。这个需求通过一个类型约束和where语句结合来表示:

    +
    func allItemsMatch<
         C1: Container, C2: Container
         where C1.ItemType == C2.ItemType, C1.ItemType: Equatable>
         (someContainer: C1, anotherContainer: C2) -> Bool {
     
    -        // check that both containers contain the same number of items
    -        if someContainer.count != anotherContainer.count {
    -            return false
    +        // check that both containers contain the same number of items
    +        if someContainer.count != anotherContainer.count {
    +            return false
             }
     
    -        // check each pair of items to see if they are equivalent
    -        for i in 0..someContainer.count {
    -            if someContainer[i] != anotherContainer[i] {
    -                return false
    +        // check each pair of items to see if they are equivalent
    +        for i in 0..someContainer.count {
    +            if someContainer[i] != anotherContainer[i] {
    +                return false
                 }
             }
     
    -        // all items match, so return true
    -        return true
    +        // all items match, so return true
    +        return true
     
     }
     
    -

    这个函数用了两个参数:someContaineranotherContainersomeContainer参数是类型C1anotherContainer参数是类型C2C1C2是容器的两个节点类型参数,决定了这个函数何时被调用。

    +

    这个函数用了两个参数:someContaineranotherContainersomeContainer参数是类型C1anotherContainer参数是类型C2C1C2是容器的两个占位类型参数,决定了这个函数何时被调用。

    这个函数的类型参数列紧随在两个类型参数需求的后面:

    • C1必须遵循Container协议 (写作 C1: Container)。
    • @@ -917,34 +929,33 @@ let stringIndex = findIndex(["Mike", C1ItemType同样是C2的ItemType(写作 C1.ItemType == C2.ItemType)。
    • C1ItemType必须遵循Equatable协议 (写作 C1.ItemType: Equatable)。
    -

    第三个和第四个要求被定义为一个where语句的一部分,写在关键字where后面,作为函数类型参数链的一部分。

    +

    第三个和第四个要求被定义为一个where语句的一部分,写在关键字where后面,作为函数类型参数链的一部分。

    这些要求意思是:

    someContainer是一个C1类型的容器。 anotherContainer是一个C2类型的容器。 -someContaineranotherContainer包含相同的items类型。 -someContainer中的items可以通过不等于操作(!=)来检查它们是否彼此不同。

    -

    第三个和第四个要求结合起来的意思是anotherContainer中的items也可以通过 != 操作来检查,因为他们在someContainer中items确实是相同的类型。

    -

    这些要求能够使allItemsMatch函数比较两个容器,即便他们是不同的容器类型。

    -

    allItemsMatch首先检查两个容器是否拥有同样数目的items,如果他们的items数目不同,没有办法进行匹配,函数就会false

    -

    检查完之后,函数通过for-in循环和半闭区间操作(..)来迭代someContainer中的所有items。对于每个item,函数检查是否someContainer中的item不等于对应的anotherContainer中的item,如果这两个items不等,则这两个容器不匹配,返回false

    -

    如果循环体结束后未发现没有任何的不匹配,那表明两个容器匹配,函数返回true。

    -

    Here’s how the allItemsMatch function looks in action: -这里演示了allItemsMatch函数运算的过程:

    -
    var stackOfStrings = Stack<String>()
    -stackOfStrings.push("uno")
    -stackOfStrings.push("dos")
    -stackOfStrings.push("tres")
    +someContaineranotherContainer包含相同的元素类型。
    +someContainer中的元素可以通过不等于操作(!=)来检查它们是否彼此不同。

    +

    第三个和第四个要求结合起来的意思是anotherContainer中的元素也可以通过 != 操作来检查,因为它们在someContainer中元素确实是相同的类型。

    +

    这些要求能够使allItemsMatch函数比较两个容器,即便它们是不同的容器类型。

    +

    allItemsMatch首先检查两个容器是否拥有同样数目的items,如果它们的元素数目不同,没有办法进行匹配,函数就会false

    +

    检查完之后,函数通过for-in循环和半闭区间操作(..)来迭代someContainer中的所有元素。对于每个元素,函数检查是否someContainer中的元素不等于对应的anotherContainer中的元素,如果这两个元素不等,则这两个容器不匹配,返回false

    +

    如果循环体结束后未发现没有任何的不匹配,那表明两个容器匹配,函数返回true

    +

    这里演示了allItemsMatch函数运算的过程:

    +
    var stackOfStrings = Stack<String>()
    +stackOfStrings.push("uno")
    +stackOfStrings.push("dos")
    +stackOfStrings.push("tres")
     
    -var arrayOfStrings = ["uno", "dos", "tres"]
    +var arrayOfStrings = ["uno", "dos", "tres"]
     
    -if allItemsMatch(stackOfStrings, arrayOfStrings) {
    -    println("All items match.")
    -} else {
    -    println("Not all items match.")
    +if allItemsMatch(stackOfStrings, arrayOfStrings) {
    +    println("All items match.")
    +} else {
    +    println("Not all items match.")
     }
    -// prints "All items match."
    +// 输出 "All items match."
     
    -

    上面的例子创建一个Stack单例来存储String,然后压了三个字符串进栈。这个例子也创建了一个Array单例,并初始化包含三个同栈里一样的原始字符串。即便栈和数组否是不同的类型,但他们都遵循Container协议,而且他们都包含同样的类型值。你因此可以调用allItemsMatch函数,用这两个容器作为它的参数。在上面的例子中,allItemsMatch函数正确的显示了所有的这两个容器的items匹配。

    +

    上面的例子创建一个Stack单例来存储String,然后压了三个字符串进栈。这个例子也创建了一个Array单例,并初始化包含三个同栈里一样的原始字符串。即便栈和数组否是不同的类型,但它们都遵循Container协议,而且它们都包含同样的类型值。你因此可以调用allItemsMatch函数,用这两个容器作为它的参数。在上面的例子中,allItemsMatch函数正确的显示了所有的这两个容器的items匹配。

    @@ -963,16 +974,8 @@ var arrayOfStrings = ["uno", - - - - - - - - + + @@ -990,6 +993,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/23_Advanced_Operators.html b/chapter2/23_Advanced_Operators.html index 1a54d7b0..c458d68c 100644 --- a/chapter2/23_Advanced_Operators.html +++ b/chapter2/23_Advanced_Operators.html @@ -1,57 +1,45 @@ - - + - 高级操作符 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,6 +595,311 @@
    +
    + +
    +

    翻译:xielingwang
    校对:numbbbbb

    +
    +

    高级运算符

    +
    +

    本页内容包括:

    + +

    除了基本操作符中所讲的运算符,Swift还有许多复杂的高级运算符,包括了C语和Objective-C中的位运算符和移位运算。

    +

    不同于C语言中的数值计算,Swift的数值计算默认是不可溢出的。溢出行为会被捕获并报告为错误。你是故意的?好吧,你可以使用Swift为你准备的另一套默认允许溢出的数值运算符,如可溢出加&+。所有允许溢出的运算符都是以&开始的。

    +

    自定义的结构,类和枚举,是否可以使用标准的运算符来定义操作?当然可以!在Swift中,你可以为你创建的所有类型定制运算符的操作。

    +

    可定制的运算符并不限于那些预设的运算符,自定义有个性的中置,前置,后置及赋值运算符,当然还有优先级和结合性。这些运算符的实现可以运用预设的运算符,也可以运用之前定制的运算符。

    +

    +

    位运算符

    +

    位操作符通常在诸如图像处理和创建设备驱动等底层开发中使用,使用它可以单独操作数据结构中原始数据的比特位。在使用一个自定义的协议进行通信的时候,运用位运算符来对原始数据进行编码和解码也是非常有效的。

    +

    Swift支持如下所有C语言的位运算符:

    +

    按位取反运算符

    +

    按位取反运算符~对一个操作数的每一位都取反。

    +

    Art/bitwiseNOT_2x.png

    +

    这个运算符是前置的,所以请不加任何空格地写着操作数之前。

    +
    let initialBits: UInt8 = 0b00001111
    +let invertedBits = ~initialBits  // 等于 0b11110000
    +
    +

    UInt8是8位无符整型,可以存储0~255之间的任意数。这个例子初始化一个整型为二进制值00001111(前4位为0,后4位为1),它的十进制值为15

    +

    使用按位取反运算~initialBits操作,然后赋值给invertedBits这个新常量。这个新常量的值等于所有位都取反的initialBits,即1变成00变成1,变成了11110000,十进制值为240

    +

    按位与运算符

    +

    按位与运算符对两个数进行操作,然后返回一个新的数,这个数的每个位都需要两个输入数的同一位都为1时才为1。

    +

    Art/bitwiseAND_2x.png

    +

    以下代码,firstSixBitslastSixBits中间4个位都为1。对它俩进行按位与运算后,就得到了00111100,即十进制的60

    +
    let firstSixBits: UInt8 = 0b11111100
    +let lastSixBits: UInt8  = 0b00111111
    +let middleFourBits = firstSixBits & lastSixBits  // 等于 00111100
    +
    +

    按位或运算

    +

    按位或运算符|比较两个数,然后返回一个新的数,这个数的每一位设置1的条件是两个输入数的同一位都不为0(即任意一个为1,或都为1)。

    +

    Art/bitwiseOR_2x.png

    +

    如下代码,someBitsmoreBits在不同位上有1。按位或运行的结果是11111110,即十进制的254

    +
    let someBits: UInt8 = 0b10110010
    +let moreBits: UInt8 = 0b01011110
    +let combinedbits = someBits | moreBits  // 等于 11111110
    +
    +

    按位异或运算符

    +

    按位异或运算符^比较两个数,然后返回一个数,这个数的每个位设为1的条件是两个输入数的同一位不同,如果相同就设为0

    +

    Art/bitwiseXOR_2x.png

    +

    以下代码,firstBitsotherBits都有一个1跟另一个数不同的。所以按位异或的结果是把它这些位置为1,其他都置为0

    +
    let firstBits: UInt8 = 0b00010100
    +let otherBits: UInt8 = 0b00000101
    +let outputBits = firstBits ^ otherBits  // 等于 00010001
    +
    +

    按位左移/右移运算符

    +

    左移运算符<<和右移运算符>>会把一个数的所有比特位按以下定义的规则向左或向右移动指定位数。

    +

    按位左移和按位右移的效果相当把一个整数乘于或除于一个因子为2的整数。向左移动一个整型的比特位相当于把这个数乘于2,向右移一位就是除于2

    +

    无符整型的移位操作

    +

    对无符整型的移位的效果如下:

    +

    已经存在的比特位向左或向右移动指定的位数。被移出整型存储边界的的位数直接抛弃,移动留下的空白位用零0来填充。这种方法称为逻辑移位。

    +

    以下这张把展示了 11111111 << 1(11111111向左移1位),和 11111111 >> 1(11111111向右移1位)。蓝色的是被移位的,灰色是被抛弃的,橙色的0是被填充进来的。

    +

    Art/bitshiftUnsigned_2x.png

    +
    let shiftBits: UInt8 = 4   // 即二进制的00000100
    +shiftBits << 1             // 00001000
    +shiftBits << 2             // 00010000
    +shiftBits << 5             // 10000000
    +shiftBits << 6             // 00000000
    +shiftBits >> 2             // 00000001
    +
    +

    你可以使用移位操作进行其他数据类型的编码和解码。

    +
    let pink: UInt32 = 0xCC6699
    +let redComponent = (pink & 0xFF0000) >> 16    // redComponent 是 0xCC, 即 204
    +let greenComponent = (pink & 0x00FF00) >> 8   // greenComponent 是 0x66, 即 102
    +let blueComponent = pink & 0x0000FF           // blueComponent 是 0x99, 即 153
    +
    +

    这个例子使用了一个UInt32的命名为pink的常量来存储层叠样式表CSS中粉色的颜色值,CSS颜色#CC6699在Swift用十六进制0xCC6699来表示。然后使用按位与(&)和按位右移就可以从这个颜色值中解析出红(CC),绿(66),蓝(99)三个部分。

    +

    0xCC66990xFF0000进行按位与&操作就可以得到红色部分。0xFF0000中的0了遮盖了OxCC6699的第二和第三个字节,这样6699被忽略了,只留下0xCC0000

    +

    然后,按向右移动16位,即 >> 16。十六进制中每两个字符是8比特位,所以移动16位的结果是把0xCC0000变成0x0000CC。这和0xCC是相等的,都是十进制的204

    +

    同样的,绿色部分来自于0xCC66990x00FF00的按位操作得到0x006600。然后向右移动8們,得到0x66,即十进制的102

    +

    最后,蓝色部分对0xCC66990x0000FF进行按位与运算,得到0x000099,无需向右移位了,所以结果就是0x99,即十进制的153

    +

    有符整型的移位操作

    +

    有符整型的移位操作相对复杂得多,因为正负号也是用二进制位表示的。(这里举的例子虽然都是8位的,但它的原理是通用的。)

    +

    有符整型通过第1个比特位(称为符号位)来表达这个整数是正数还是负数。0代表正数,1代表负数。

    +

    其余的比特位(称为数值位)存储其实值。有符正整数和无符正整数在计算机里的存储结果是一样的,下来我们来看+4内部的二进制结构。

    +

    Art/bitshiftSignedFour_2x.png

    +

    符号位为0,代表正数,另外7比特位二进制表示的实际值就刚好是4

    +

    负数呢,跟正数不同。负数存储的是2的n次方减去它的绝对值,n为数值位的位数。一个8比特的数有7个数值位,所以是2的7次方,即128。

    +

    我们来看-4存储的二进制结构。

    +

    Art/bitshiftSignedMinusFour_2x.png

    +

    现在符号位为1,代表负数,7个数值位要表达的二进制值是124,即128 - 4。

    +

    Art/bitshiftSignedMinusFourValue_2x.png

    +

    负数的编码方式称为二进制补码表示。这种表示方式看起来很奇怪,但它有几个优点。

    +

    首先,只需要对全部8个比特位(包括符号)做标准的二进制加法就可以完成 -1 + -4 的操作,忽略加法过程产生的超过8个比特位表达的任何信息。

    +

    Art/bitshiftSignedAddition_2x.png

    +

    第二,由于使用二进制补码表示,我们可以和正数一样对负数进行按位左移右移的,同样也是左移1位时乘于2,右移1位时除于2。要达到此目的,对有符整型的右移有一个特别的要求:

    +

    对有符整型按位右移时,使用符号位(正数为0,负数为1)填充空白位。

    +

    Art/bitshiftSigned_2x.png

    +

    这就确保了在右移的过程中,有符整型的符号不会发生变化。这称为算术移位。

    +

    正因为正数和负数特殊的存储方式,向右移位使它接近于0。移位过程中保持符号会不变,负数在接近0的过程中一直是负数。

    +

    +

    溢出运算符

    +

    默认情况下,当你往一个整型常量或变量赋于一个它不能承载的大数时,Swift不会让你这么干的,它会报错。这样,在操作过大或过小的数的时候就很安全了。

    +

    例如,Int16整型能承载的整数范围是-3276832767,如果给它赋上超过这个范围的数,就会报错:

    +
    var potentialOverflow = Int16.max
    +// potentialOverflow 等于 32767, 这是 Int16 能承载的最大整数
    +potentialOverflow += 1
    +// 噢, 出错了
    +
    +

    对过大或过小的数值进行错误处理让你的数值边界条件更灵活。

    +

    当然,你有意在溢出时对有效位进行截断,你可采用溢出运算,而非错误处理。Swfit为整型计算提供了5个&符号开头的溢出运算符。

    +
      +
    • 溢出加法 &+
    • +
    • 溢出减法 &-
    • +
    • 溢出乘法 &*
    • +
    • 溢出除法 &/
    • +
    • 溢出求余 &%
    • +
    +

    值的上溢出

    +

    下面例子使用了溢出加法&+来解剖的无符整数的上溢出

    +
    var willOverflow = UInt8.max
    +// willOverflow 等于UInt8的最大整数 255
    +willOverflow = willOverflow &+ 1
    +// 这时候 willOverflow 等于 0
    +
    +

    willOverflowInt8所能承载的最大值255(二进制11111111),然后用&+加1。然后UInt8就无法表达这个新值的二进制了,也就导致了这个新值上溢出了,大家可以看下图。溢出后,新值在UInt8的承载范围内的那部分是00000000,也就是0

    +

    Art/overflowAddition_2x.png

    +

    值的下溢出

    +

    数值也有可能因为太小而越界。举个例子:

    +

    UInt8的最小值是0(二进制为00000000)。使用&-进行溢出减1,就会得到二进制的11111111即十进制的255

    +

    Art/overflowUnsignedSubtraction_2x.png

    +

    Swift代码是这样的:

    +
    var willUnderflow = UInt8.min
    +// willUnderflow 等于UInt8的最小值0
    +willUnderflow = willUnderflow &- 1
    +// 此时 willUnderflow 等于 255
    +
    +

    有符整型也有类似的下溢出,有符整型所有的减法也都是对包括在符号位在内的二进制数进行二进制减法的,这在 "按位左移/右移运算符" 一节提到过。最小的有符整数是-128,即二进制的10000000。用溢出减法减去去1后,变成了01111111,即UInt8所能承载的最大整数127

    +

    Art/overflowSignedSubtraction_2x.png

    +

    来看看Swift代码:

    +
    var signedUnderflow = Int8.min
    +// signedUnderflow 等于最小的有符整数 -128
    +signedUnderflow = signedUnderflow &- 1
    +// 如今 signedUnderflow 等于 127
    +
    +

    除零溢出

    +

    一个数除于0 i / 0,或者对0求余数 i % 0,就会产生一个错误。

    +
    let x = 1
    +let y = x / 0
    +
    +

    使用它们对应的可溢出的版本的运算符&/&%进行除0操作时就会得到0值。

    +
    let x = 1
    +let y = x &/ 0
    +// y 等于 0
    +
    +

    +

    优先级和结合性

    +

    运算符的优先级使得一些运算符优先于其他运算符,高优先级的运算符会先被计算。

    +

    结合性定义相同优先级的运算符在一起时是怎么组合或关联的,是和左边的一组呢,还是和右边的一组。意思就是,到底是和左边的表达式结合呢,还是和右边的表达式结合?

    +

    在混合表达式中,运算符的优先级和结合性是非常重要的。举个例子,为什么下列表达式的结果为4

    +
    2 + 3 * 4 % 5
    +// 结果是 4
    +
    +

    如果严格地从左计算到右,计算过程会是这样:

    +
      +
    • 2 + 3 = 5
    • +
    • 5 * 4 = 20
    • +
    • 20 / 5 = 4 余 0
    • +
    +

    但是正确答案是4而不是0。优先级高的运算符要先计算,在Swift和C语言中,都是先乘除后加减的。所以,执行完乘法和求余运算才能执行加减运算。

    +

    乘法和求余拥有相同的优先级,在运算过程中,我们还需要结合性,乘法和求余运算都是左结合的。这相当于在表达式中有隐藏的括号让运算从左开始。

    +
    2 + ((3 * 4) % 5)
    +
    +

    3 * 4 = 12,所以这相当于:

    +
    2 + (12 % 5)
    +
    +

    12 % 5 = 2,所这又相当于

    +
    2 + 2
    +
    +

    计算结果为 4。

    +

    查阅Swift运算符的优先级和结合性的完整列表,请看表达式

    +
    +

    注意:
    Swift的运算符较C语言和Objective-C来得更简单和保守,这意味着跟基于C的语言可能不一样。所以,在移植已有代码到Swift时,注意去确保代码按你想的那样去执行。

    +
    +

    +

    运算符函数

    +

    让已有的运算符也可以对自定义的类和结构进行运算,这称为运算符重载。

    +

    这个例子展示了如何用+让一个自定义的结构做加法。算术运算符+是一个两目运算符,因为它有两个操作数,而且它必须出现在两个操作数之间。

    +

    例子中定义了一个名为Vector2D的二维坐标向量 (x,y) 的结构,然后定义了让两个Vector2D的对象相加的运算符函数。

    +
    struct Vector2D {
    +    var x = 0.0, y = 0.0
    +}
    +@infix func + (left: Vector2D, right: Vector2D) -> Vector2D {
    +    return Vector2D(x: left.x + right.x, y: left.y + right.y)
    +}
    +
    +

    该运算符函数定义了一个全局的+函数,这个函数需要两个Vector2D类型的参数,返回值也是Vector2D类型。需要定义和实现一个中置运算的时候,在关键字func之前写上属性 @infix 就可以了。

    +

    在这个代码实现中,参数被命名为了leftright,代表+左边和右边的两个Vector2D对象。函数返回了一个新的Vector2D的对象,这个对象的xy分别等于两个参数对象的xy的和。

    +

    这个函数是全局的,而不是Vector2D结构的成员方法,所以任意两个Vector2D对象都可以使用这个中置运算符。

    +
    let vector = Vector2D(x: 3.0, y: 1.0)
    +let anotherVector = Vector2D(x: 2.0, y: 4.0)
    +let combinedVector = vector + anotherVector
    +// combinedVector 是一个新的Vector2D, 值为 (5.0, 5.0)
    +
    +

    这个例子实现两个向量 (3.0,1.0)(2.0,4.0) 相加,得到向量 (5.0,5.0) 的过程。如下图示:

    +

    Art/vectorAddition_2x.png

    +

    前置和后置运算符

    +

    上个例子演示了一个双目中置运算符的自定义实现,同样我们也可以玩标准单目运算符的实现。单目运算符只有一个操作数,在操作数之前就是前置的,如-a; 在操作数之后就是后置的,如i++

    +

    实现一个前置或后置运算符时,在定义该运算符的时候于关键字func之前标注 @prefix@postfix 属性。

    +
    @prefix func - (vector: Vector2D) -> Vector2D {
    +    return Vector2D(x: -vector.x, y: -vector.y)
    +}
    +
    +

    这段代码为Vector2D类型提供了单目减运算-a@prefix属性表明这是个前置运算符。

    +

    对于数值,单目减运算符可以把正数变负数,把负数变正数。对于Vector2D,单目减运算将其xy都进进行单目减运算。

    +
    let positive = Vector2D(x: 3.0, y: 4.0)
    +let negative = -positive
    +// negative 为 (-3.0, -4.0)
    +let alsoPositive = -negative
    +// alsoPositive 为 (3.0, 4.0)
    +
    +

    组合赋值运算符

    +

    组合赋值是其他运算符和赋值运算符一起执行的运算。如+=把加运算和赋值运算组合成一个操作。实现一个组合赋值符号需要使用@assignment属性,还需要把运算符的左参数设置成inout,因为这个参数会在运算符函数内直接修改它的值。

    +
    @assignment func += (inout left: Vector2D, right: Vector2D) {
    +    left = left + right
    +}
    +
    +

    因为加法运算在之前定义过了,这里无需重新定义。所以,加赋运算符函数使用已经存在的高级加法运算符函数来执行左值加右值的运算。

    +
    var original = Vector2D(x: 1.0, y: 2.0)
    +let vectorToAdd = Vector2D(x: 3.0, y: 4.0)
    +original += vectorToAdd
    +// original 现在为 (4.0, 6.0)
    +
    +

    你可以将 @assignment 属性和 @prefix@postfix 属性起来组合,实现一个Vector2D的前置运算符。

    +
    @prefix @assignment func ++ (inout vector: Vector2D) -> Vector2D {
    +    vector += Vector2D(x: 1.0, y: 1.0)
    +    return vector
    +}
    +
    +

    这个前置使用了已经定义好的高级加赋运算,将自己加上一个值为 (1.0,1.0) 的对象然后赋给自己,然后再将自己返回。

    +
    var toIncrement = Vector2D(x: 3.0, y: 4.0)
    +let afterIncrement = ++toIncrement
    +// toIncrement 现在是 (4.0, 5.0)
    +// afterIncrement 现在也是 (4.0, 5.0)
    +
    +
    +

    注意:
    默认的赋值符是不可重载的。只有组合赋值符可以重载。三目条件运算符 a?b:c 也是不可重载。

    +
    +

    比较运算符

    +

    Swift无所知道自定义类型是否相等或不等,因为等于或者不等于由你的代码说了算了。所以自定义的类和结构要使用比较符==!=就需要重载。

    +

    定义相等运算符函数跟定义其他中置运算符雷同:

    +
    @infix func == (left: Vector2D, right: Vector2D) -> Bool {
    +    return (left.x == right.x) && (left.y == right.y)
    +}
    +
    +@infix func != (left: Vector2D, right: Vector2D) -> Bool {
    +    return !(left == right)
    +}
    +
    +

    上述代码实现了相等运算符==来判断两个Vector2D对象是否有相等的值,相等的概念就是它们有相同的x值和相同的y值,我们就用这个逻辑来实现。接着使用==的结果实现了不相等运算符!=

    +

    现在我们可以使用这两个运算符来判断两个Vector2D对象是否相等。

    +
    let twoThree = Vector2D(x: 2.0, y: 3.0)
    +let anotherTwoThree = Vector2D(x: 2.0, y: 3.0)
    +if twoThree == anotherTwoThree {
    +    println("这两个向量是相等的.")
    +}
    +// prints "这两个向量是相等的."
    +
    +

    自定义运算符

    +

    标准的运算符不够玩,那你可以声明一些个性的运算符,但个性的运算符只能使用这些字符 / = - + * % < >!& | ^。~

    +

    新的运算符声明需在全局域使用operator关键字声明,可以声明为前置,中置或后置的。

    +
    operator prefix +++ {}
    +
    +

    这段代码定义了一个新的前置运算符叫+++,此前Swift并不存在这个运算符。此处为了演示,我们让+++Vector2D对象的操作定义为 双自增 这样一个独有的操作,这个操作使用了之前定义的加赋运算实现了自已加上自己然后返回的运算。

    +
    @prefix @assignment func +++ (inout vector: Vector2D) -> Vector2D {
    +    vector += vector
    +    return vector
    +}
    +
    +

    Vector2D+++ 的实现和 ++ 的实现很接近, 唯一不同的前者是加自己, 后者是加值为 (1.0, 1.0) 的向量.

    +
    var toBeDoubled = Vector2D(x: 1.0, y: 4.0)
    +let afterDoubling = +++toBeDoubled
    +// toBeDoubled 现在是 (2.0, 8.0)
    +// afterDoubling 现在也是 (2.0, 8.0)
    +
    +

    自定义中置运算符的优先级和结合性

    +

    可以为自定义的中置运算符指定优先级和结合性。可以回头看看优先级和结合性解释这两个因素是如何影响多种中置运算符混合的表达式的计算的。

    +

    结合性(associativity)的值可取的值有leftrightnone。左结合运算符跟其他优先级相同的左结合运算符写在一起时,会跟左边的操作数结合。同理,右结合运算符会跟右边的操作数结合。而非结合运算符不能跟其他相同优先级的运算符写在一起。

    +

    结合性(associativity)的值默认为none,优先级(precedence)默认为100

    +

    以下例子定义了一个新的中置符+-,是左结合的left,优先级为140

    +
    operator infix +- { associativity left precedence 140 }
    +func +- (left: Vector2D, right: Vector2D) -> Vector2D {
    +    return Vector2D(x: left.x + right.x, y: left.y - right.y)
    +}
    +let firstVector = Vector2D(x: 1.0, y: 2.0)
    +let secondVector = Vector2D(x: 3.0, y: 4.0)
    +let plusMinusVector = firstVector +- secondVector
    +// plusMinusVector 此时的值为 (4.0, -2.0)
    +
    +

    这个运算符把两个向量的x相加,把向量的y相减。因为他实际是属于加减运算,所以让它保持了和加法一样的结合性和优先级(left140)。查阅完整的Swift默认结合性和优先级的设置,请移步表达式;

    + + +
    +
    @@ -601,16 +914,8 @@
    - - - - - - - - - - + + @@ -628,6 +933,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter2/chapter2.html b/chapter2/chapter2.html index f84e2250..26cfb019 100644 --- a/chapter2/chapter2.html +++ b/chapter2/chapter2.html @@ -1,57 +1,45 @@ - - + - Swift 教程 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,7 +595,7 @@
    -
    +

    Swift 教程

    本章介绍了 Swift 的各种特性及其使用方法,是全书的核心部分。

    @@ -609,16 +617,8 @@
    - - - - - - - - - - + + @@ -636,6 +636,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/01_About_the_Language_Reference.html b/chapter3/01_About_the_Language_Reference.html index 8a43494f..821f4a44 100644 --- a/chapter3/01_About_the_Language_Reference.html +++ b/chapter3/01_About_the_Language_Reference.html @@ -1,57 +1,45 @@ - - + - 关于语言参考 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,15 +595,24 @@
    -
    +
    -

    关于语言附注

    +
    +

    翻译:dabing1022
    校对:numbbbbb

    +
    +

    关于语言附注

    +
    +

    本页内容包括:

    +

    本书的这一节描述了Swift编程语言的形式语法。这里描述的语法是为了帮助您更详细的了解该语言,而不是让您直接实现一个解析器或编译器。

    Swift语言相对小点,这是由于在Swift代码中几乎无处不在的许多常见的的类型,函数以及运算符都由Swift标准库来定义。虽然这些类型,函数和运算符不是Swift语言本身的一部分,但是它们被广泛用于这本书的讨论和代码范例。

    -

    如何阅读语法

    +

    +

    如何阅读语法

    用来描述Swift编程语言形式语法的记法遵循下面几个约定:

    +

    -](https://github.com/numbbbbb)箭头(→)用来标记语法产式,可以被理](https://github.com/numbbbbb)解为“可以包含”。

      -
    • 箭头(→)用来标记语法产式,可以被理解为“可以包含”。
    • 句法范畴由斜体文字表示,并出现在一个语法产式规则两侧。
    • 义词和标点符号由粗体固定宽度的文本显示和只出现在一个语法产式规则的右边。
    • 选择性的语法产式由竖线(|)分隔。当可选用的语法产式太多时,为了阅读方便,它们将被拆分为多行语法产式规则。
    • @@ -604,18 +621,12 @@

    举个例子,getter-setter的语法块的定义如下:

    -

    GRAMMAR OF A GETTER-SETTER BLOCK

    -

    getter-setter-block → {­ getter-clause ­setter-clause­opt ­}­ | {­ setter-clause ­getter-clause­}­

    +

    GRAMMAR OF A GETTER-SETTER BLOCK
    getter-setter-block → {­ getter-clause ­setter-clause­opt ­}­ | {­ setter-clause ­getter-clause­}­

    这个定义表明,一个getter-setter方法​​块可以由一个getter子句后跟一个可选的setter子句构成,用大括号括起来,或者由一个setter子句后跟一个getter子句构成,用大括号括起来。上述的文法产生等价于下面的两个产生,明确阐明如何二中择一:

    -

    GRAMMAR OF A GETTER-SETTER BLOCK

    -

    getter-setter-block → {­ getter-clause ­setter-clause­opt ­}­­

    -

    getter-setter-block → {­ setter-clause ­getter-clause­}­

    +

    GRAMMAR OF A GETTER-SETTER BLOCK
    getter-setter-block → {­ getter-clause ­setter-clause­opt ­}­­
    getter-setter-block → {­ setter-clause ­getter-clause­}­

    -

    ================================================================ -上篇:高级操作符

    -

    下篇:词法结构

    @@ -634,16 +645,8 @@
    - - - - - - - - - - + + @@ -661,6 +664,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/02_Lexical_Structure.html b/chapter3/02_Lexical_Structure.html index 35de5cda..c51f771b 100644 --- a/chapter3/02_Lexical_Structure.html +++ b/chapter3/02_Lexical_Structure.html @@ -1,57 +1,45 @@ - - + - 词法结构 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,105 +595,66 @@
    -
    +
    -

    语法结构

    +
    +

    翻译:superkam
    校对:numbbbbb

    +
    +

    词法结构

    +

    本页包含内容:

    -

    Swift 的“语法结构(lexical structure)”描述了如何在该语言中用字符序列构建合法标记,组成该语言中最底层的代码块,并在之后的章节中用于描述语言的其他部分。

    +

    Swift 的“词法结构(lexical structure)”描述了如何在该语言中用字符序列构建合法标记,组成该语言中最底层的代码块,并在之后的章节中用于描述语言的其他部分。

    通常,标记在随后介绍的语法约束下,由 Swift 源文件的输入文本中提取可能的最长子串生成。这种方法称为“最长匹配项(longest match)”,或者“最大适合”(maximal munch)。

    +

    空白与注释

    空白(whitespace)有两个用途:分隔源文件中的标记和区分运算符属于前缀还是后缀,(参见 运算符)在其他情况下则会被忽略。以下的字符会被当作空白:空格(space)(U+0020)、换行符(line feed)(U+000A)、回车符(carriage return)(U+000D)、水平 tab(horizontal tab)(U+0009)、垂直 tab(vertical tab)(U+000B)、换页符(form feed)(U+000C)以及空(null)(U+0000)。

    注释(comments)被编译器当作空白处理。单行注释由 // 开始直到该行结束。多行注释由 /* 开始,以 */ 结束。可以嵌套注释,但注意注释标记必须匹配。

    +

    标识符

    标识符(identifiers)可以由以下的字符开始:大写或小写的字母 AZ、下划线 _、基本多语言面(Basic Multilingual Plane)中的 Unicode 非组合字符以及基本多语言面以外的非专用区(Private Use Area)字符。首字符之后,标识符允许使用数字和 Unicode 字符组合。

    使用保留字(reserved word)作为标识符,需要在其前后增加反引号 `。例如,class 不是合法的标识符,但可以使用 `class`。反引号不属于标识符的一部分,`x`x 表示同一标识符。

    闭包(closure)中如果没有明确指定参数名称,参数将被隐式命名为 $0$1$2... 这些命名在闭包作用域内是合法的标识符。

    -

    标识符语法

    -

    identifieridentifier-head­ identifier-characters­ opt

    -

    identifier → `­ identifier-head­ identifier-characters­ opt­

    -

    identifierimplicit-parameter-name­

    -

    identifier-listidentifier­ | identifier­ , ­identifier-list­

    -

    identifier-head → A 到 Z 大写或小写字母

    -

    identifier-head → U+00A8, U+00AA, U+00AD, U+00AF, U+00B2–U+00B5, 或 U+00B7–U+00BA

    -

    identifier-head → U+00BC–U+00BE, U+00C0–U+00D6, U+00D8–U+00F6, 或 U+00F8–U+00FF

    -

    identifier-head → U+0100–U+02FF, U+0370–U+167F, U+1681–U+180D, 或 U+180F–U+1DBF

    -

    identifier-head → U+1E00–U+1FFF

    -

    identifier-head → U+200B–U+200D, U+202A–U+202E, U+203F–U+2040, U+2054, 或 U+2060–U+206F

    -

    identifier-head → U+2070–U+20CF, U+2100–U+218F, U+2460–U+24FF, 或 U+2776–U+2793

    -

    identifier-head → U+2C00–U+2DFF 或 U+2E80–U+2FFF

    -

    identifier-head → U+3004–U+3007, U+3021–U+302F, U+3031–U+303F, 或 U+3040–U+D7FF

    -

    identifier-head → U+F900–U+FD3D, U+FD40–U+FDCF, U+FDF0–U+FE1F, 或 U+FE30–U+FE44

    -

    identifier-head → U+FE47–U+FFFD

    -

    identifier-head → U+10000–U+1FFFD, U+20000–U+2FFFD, U+30000–U+3FFFD, 或 U+40000–U+4FFFD

    -

    identifier-head → U+50000–U+5FFFD, U+60000–U+6FFFD, U+70000–U+7FFFD, 或 U+80000–U+8FFFD

    -

    identifier-head → U+90000–U+9FFFD, U+A0000–U+AFFFD, U+B0000–U+BFFFD, 或 U+C0000–U+CFFFD

    -

    identifier-head → U+D0000–U+DFFFD 或 U+E0000–U+EFFFD

    -

    identifier-character → 数字 0 到 9

    -

    identifier-character → U+0300–U+036F, U+1DC0–U+1DFF, U+20D0–U+20FF, or U+FE20–U+FE2F

    -

    identifier-characteridentifier-head­

    -

    identifier-charactersidentifier-character ­identifier-characters­ opt­

    -

    implicit-parameter-name decimal-digits­

    +

    标识符语法
    标识符标识符头(Head) 标识符字符列表 可选
    标识符` 标识符头(Head) 标识符字符列表 可选 `
    标识符隐式参数名
    标识符列表标识符 | 标识符 , 标识符列表
    标识符头(Head) → Upper- or lowercase letter A through Z
    标识符头(Head) → U+00A8, U+00AA, U+00AD, U+00AF, U+00B2–U+00B5, or U+00B7–U+00BA
    标识符头(Head) → U+00BC–U+00BE, U+00C0–U+00D6, U+00D8–U+00F6, or U+00F8–U+00FF
    标识符头(Head) → U+0100–U+02FF, U+0370–U+167F, U+1681–U+180D, or U+180F–U+1DBF
    标识符头(Head) → U+1E00–U+1FFF
    标识符头(Head) → U+200B–U+200D, U+202A–U+202E, U+203F–U+2040, U+2054, or U+2060–U+206F
    标识符头(Head) → U+2070–U+20CF, U+2100–U+218F, U+2460–U+24FF, or U+2776–U+2793
    标识符头(Head) → U+2C00–U+2DFF or U+2E80–U+2FFF
    标识符头(Head) → U+3004–U+3007, U+3021–U+302F, U+3031–U+303F, or U+3040–U+D7FF
    标识符头(Head) → U+F900–U+FD3D, U+FD40–U+FDCF, U+FDF0–U+FE1F, or U+FE30–U+FE44
    标识符头(Head) → U+FE47–U+FFFD
    标识符头(Head) → U+10000–U+1FFFD, U+20000–U+2FFFD, U+30000–U+3FFFD, or U+40000–U+4FFFD
    标识符头(Head) → U+50000–U+5FFFD, U+60000–U+6FFFD, U+70000–U+7FFFD, or U+80000–U+8FFFD
    标识符头(Head) → U+90000–U+9FFFD, U+A0000–U+AFFFD, U+B0000–U+BFFFD, or U+C0000–U+CFFFD
    标识符头(Head) → U+D0000–U+DFFFD or U+E0000–U+EFFFD
    标识符字符 → 数值 0 到 9
    标识符字符 → U+0300–U+036F, U+1DC0–U+1DFF, U+20D0–U+20FF, or U+FE20–U+FE2F
    标识符字符标识符头(Head)
    标识符字符列表标识符字符 标识符字符列表 可选
    隐式参数名$ 十进制数字列表

    +

    关键字

    被保留的关键字(keywords)不允许用作标识符,除非被反引号转义,参见 标识符

      -
    • 用作声明的关键字: classdeinitenumextensionfuncimportinitletprotocolstaticstructsubscripttypealiasvar

      -
    • -
    • 用作语句的关键字: breakcasecontinuedefaultdoelsefallthroughifinforreturnswitchwherewhile

      -
    • -
    • 用作表达和类型的关键字: asdynamicTypeisnewsuperselfSelfType__COLUMN____FILE____FUNCTION____LINE__

      -
    • -
    • 特定上下文中被保留的关键字: associativitydidSetgetinfixinoutleftmutatingnonenonmutatingoperatoroverridepostfixprecedenceprefixrightsetunownedunowned(safe)unowned(unsafe)weakwillSet,这些关键字在特定上下文之外可以被用于标识符。

      -
    • +
    • 用作声明的关键字: classdeinitenumextensionfuncimportinitletprotocolstaticstructsubscripttypealiasvar
    • +
    • 用作语句的关键字: breakcasecontinuedefaultdoelsefallthroughifinforreturnswitchwherewhile
    • +
    • 用作表达和类型的关键字: asdynamicTypeisnewsuperselfSelfType__COLUMN____FILE____FUNCTION____LINE__
    • +
    • 特定上下文中被保留的关键字: associativitydidSetgetinfixinoutleftmutatingnonenonmutatingoperatoroverridepostfix、 +precedenceprefixrightsetunownedunowned(safe)unowned(unsafe)weakwillSet,这些关键字在特定上下文之外可以被用于标识符。
    +

    字面量

    字面值表示整型、浮点型数字或文本类型的值,举例如下:

    -
    42                 // 整型字面量
    +
    42                 // 整型字面量
     3.14159            // 浮点型字面量
     "Hello, world!"    // 文本型字面量
    -
    -

    字面量语法

    -

    literalinteger-literal­ | floating-point-literal­ | string-literal­

    +
    +
    +

    字面量语法
    字面量整型字面量 | 浮点数字面量 | 字符串字面量

    整型字面量

    整型字面量(integer literals)表示未指定精度整型数的值。整型字面量默认用十进制表示,可以加前缀来指定其他的进制,二进制字面量加 0b,八进制字面量加 0o,十六进制字面量加 0x

    十进制字面量包含数字 09。二进制字面量只包含 01,八进制字面量包含数字 07,十六进制字面量包含数字 09 以及字母 AF (大小写均可)。

    负整数的字面量在数字前加减号 -,比如 -42

    允许使用下划线 _ 来增加数字的可读性,下划线不会影响字面量的值。整型字面量也可以在数字前加 0,同样不会影响字面量的值。

    -
    1000_000     // 等于 1000000
    +
    1000_000     // 等于 1000000
     005          // 等于 5
    -

    除非特殊指定,整型字面量的默认类型为 Swift 标准库类型中的 Int。Swift 标准库还定义了其他不同长度以及是否带符号的整数类型,请参考 整数类型

    +
    +

    除非特殊指定,整型字面量的默认类型为 Swift 标准库类型中的 Int。Swift 标准库还定义了其他不同长度以及是否带符号的整数类型,请参考 整数类型

    -

    整型字面量语法

    -

    integer-literalbinary-literal­

    -

    integer-literaloctal-literal­

    -

    integer-literaldecimal-literal­

    -

    integer-literalhexadecimal-literal­

    -

    binary-literal0b­ binary-digit ­binary-literal-characters­ opt­

    -

    binary-digit → 数字 0 或 1

    -

    binary-literal-characterbinary-digit­ | _­

    -

    binary-literal-charactersbinary-literal-character ­binary-literal-characters­ opt­

    -

    octal-literal0o­ octal-digit ­octal-literal-characters­ opt­

    -

    octal-digit → 数字 0 至 7

    -

    octal-literal-characteroctal-digit­ | _­

    -

    octal-literal-charactersoctal-literal-character ­octal-literal-characters­ opt­

    -

    decimal-literaldecimal-digit ­decimal-literal-characters­ opt­

    -

    decimal-digit → 数字 0 至 9

    -

    decimal-digitsdecimal-digit­ decimal-digits­ opt­

    -

    decimal-literal-characterdecimal-digit­ | _­

    -

    decimal-literal-charactersdecimal-literal-character ­decimal-literal-characters­ opt­

    -

    hexadecimal-literal0x ­hexadecimal-digit ­hexadecimal-literal-characters­ opt­

    -

    hexadecimal-digit → 数字 0 到 9, a 到 f, 或 A 到 F

    -

    hexadecimal-literal-characterhexadecimal-digit­ | _­

    -

    hexadecimal-literal-charactershexadecimal-literal-character­ hexadecimal-literal-characters ­opt­

    +

    整型字面量语法
    整型字面量二进制字面量
    整型字面量八进制字面量
    整型字面量十进制字面量
    整型字面量十六进制字面量
    二进制字面量0b 二进制数字 二进制字面量字符列表 可选
    二进制数字 → 数值 0 到 1
    二进制字面量字符二进制数字 | _
    二进制字面量字符列表二进制字面量字符 二进制字面量字符列表 可选
    八进制字面量0o 八进字数字 八进制字符列表 可选
    八进字数字 → 数值 0 到 7
    八进制字符八进字数字 | _
    八进制字符列表八进制字符 八进制字符列表 可选
    十进制字面量十进制数字 十进制字符列表 可选
    十进制数字 → 数值 0 到 9
    十进制数字列表十进制数字 十进制数字列表 可选
    十进制字符十进制数字 | _
    十进制字符列表十进制字符 十进制字符列表 可选
    十六进制字面量0x 十六进制数字 十六进制字面量字符列表 可选
    十六进制数字 → 数值 0 到 9, a through f, or A through F
    十六进制字符十六进制数字 | _
    十六进制字面量字符列表十六进制字符 十六进制字面量字符列表 可选

    浮点型字面量

    浮点型字面量(floating-point literals)表示未指定精度浮点数的值。

    @@ -694,25 +663,18 @@

    十六进制浮点型字面量(hexadecimal floating-point literals)由前缀 0x 后跟可选的十六进制小数部分以及十六进制指数部分组成。十六进制小数部分由小数点后跟十六进制数字串组成。指数部分由大写或小写字母 p 后跟十进制数字串组成,这串数字表示 p 之前的数量乘以 2 的几次方。例如:0xFp2 表示 15 ⨉ 2^2,也就是 60;同样,0xFp-2 表示 15 ⨉ 2^-2,也就是 3.75

    与整型字面量不同,负的浮点型字面量由一元运算符减号 - 和浮点型字面量组成,例如 -42.0。这代表一个表达式,而不是一个浮点整型字面量。

    允许使用下划线 _ 来增强可读性,下划线不会影响字面量的值。浮点型字面量也可以在数字前加 0,同样不会影响字面量的值。

    -
    10_000.56     // 等于 10000.56
    +
    10_000.56     // 等于 10000.56
     005000.76     // 等于 5000.76
    -

    除非特殊指定,浮点型字面量的默认类型为 Swift 标准库类型中的 Double,表示64位浮点数。Swift 标准库也定义 Float 类型,表示32位浮点数。

    +
    +

    除非特殊指定,浮点型字面量的默认类型为 Swift 标准库类型中的 Double,表示64位浮点数。Swift 标准库也定义 Float 类型,表示32位浮点数。

    -

    浮点型字面量语法

    -

    floating-point-literaldecimal-literal ­decimal-fraction­ opt ­decimal-exponent­ opt­

    -

    floating-point-literalhexadecimal-literal ­hexadecimal-fraction ­opt­ hexadecimal-exponent­

    -

    decimal-fraction → . ­decimal-literal­

    -

    decimal-exponentfloating-point-e ­sign­ opt­ decimal-literal­

    -

    hexadecimal-fraction → . ­hexadecimal-literal­ opt­

    -

    hexadecimal-exponentfloating-point-p­ sign­ opt­ hexadecimal-literal­

    -

    floating-point-e | E­

    -

    floating-point-pp­ | P­

    -

    sign+­ | -­

    +

    浮点型字面量语法
    浮点数字面量十进制字面量 十进制分数 可选 十进制指数 可选
    浮点数字面量十六进制字面量 十六进制分数 可选 十六进制指数
    十进制分数. 十进制字面量
    十进制指数浮点数e 正负号 可选 十进制字面量
    十六进制分数. 十六进制字面量 可选
    十六进制指数浮点数p 正负号 可选 十六进制字面量
    浮点数ee | E
    浮点数pp | P
    正负号+ | -

    文本型字面量

    文本型字面量(string literal)由双引号中的字符串组成,形式如下:

    -
    "characters"
    -

    文本型字面量中不能包含未转义的双引号 "、未转义的反斜线\、回车符(carriage return)或换行符(line feed)。

    +
    "characters"
    +
    +

    文本型字面量中不能包含未转义的双引号 "、未转义的反斜线\、回车符(carriage return)或换行符(line feed)。

    可以在文本型字面量中使用的转义特殊符号如下:

    • 空字符(Null Character)\0
    • @@ -732,49 +694,33 @@

      后跟的数字表示一个 Unicode 码点。

      文本型字面量允许在反斜线小括号 \() 中插入表达式的值。插入表达式(interpolated expression)不能包含未转义的双引号 "、反斜线 \、回车符或者换行符。表达式值的类型必须在 String 类中有对应的初始化方法。

      例如,以下所有文本型字面量的值相同:

      -
      "1 2 3"
      +
      "1 2 3"
       "1 2 \(3)"
       "1 2 \(1 + 2)"
       var x = 3; "1 2 \(x)"
      -

      文本型字面量的默认类型为 String。组成字符串的字符类型为 Character。更多有关 StringCharacter 的信息请参照 字符串和字符

      +
      +

      文本型字面量的默认类型为 String。组成字符串的字符类型为 Character。更多有关 StringCharacter 的信息请参照 字符串和字符

      -

      文本型字面量语法

      -

      string-literal quoted-text ­"­

      -

      quoted-textquoted-text-item­ quoted-text ­opt­

      -

      quoted-text-itemescaped-character­

      -

      quoted-text-item(­ expression­ )­

      -

      quoted-text-item → 除 "\­、U+000AU+000D 以外的任何 Unicode 扩展字符集

      -

      escaped-character\0­ | \­ | \t­ | \n­ | \r­ | \"­ | \'­

      -

      escaped-character\x­ hexadecimal-digit­ hexadecimal-digit­

      -

      escaped-character\u ­hexadecimal-digit­ hexadecimal-digit ­hexadecimal-digit­ hexadecimal-digit­

      -

      escaped-character\U­ hexadecimal-digit­ hexadecimal-digit­ hexadecimal-digit­ hexadecimal-digit­ hexadecimal-digit­ hexadecimal-digit­ hexadecimal-digit­ hexadecimal-digit­

      +

      字符型字面量语法
      字符串字面量" 引用文本 "
      引用文本引用文本条目 引用文本 可选
      引用文本条目转义字符
      引用文本条目( 表达式 )
      引用文本条目 → 除了"­, \­, U+000A, or U+000D的所有Unicode的字符
      转义字符\0 | \ | \t | \n | \r | \" | \'
      转义字符\x 十六进制数字 十六进制数字
      转义字符\u 十六进制数字 十六进制数字 十六进制数字 十六进制数字
      转义字符\U 十六进制数字 十六进制数字 十六进制数字 十六进制数字 十六进制数字 十六进制数字 十六进制数字 十六进制数字

      +

      运算符

      Swift 标准库定义了许多可供使用的运算符,其中大部分在 基础运算符高级运算符 中进行了阐述。这里将描述哪些字符能用作运算符。

      运算符由一个或多个以下字符组成: /=-+!*%<>&|^~.。也就是说,标记 =, ->///**/. 以及一元前缀运算符 & 属于保留字,这些标记不能被重写或用于自定义运算符。

      运算符两侧的空白被用来区分该运算符是否为前缀运算符(prefix operator)、后缀运算符(postfix operator)或二元运算符(binary operator)。规则总结如下:

        -
      • 如果运算符两侧都有空白或两侧都无空白,将被看作二元运算符。例如:a+ba + b 中的运算符 + 被看作二元运算符。

        -
      • -
      • 如果运算符只有左侧空白,将被看作前缀一元运算符。例如 a ++b 中的 ++ 被看作前缀一元运算符。

        -
      • -
      • 如果运算符只有右侧空白,将被看作后缀一元运算符。例如 a++ b 中的 ++ 被看作后缀一元运算符。

        -
      • -
      • 如果运算符左侧没有空白并紧跟 .,将被看作后缀一元运算符。例如 a++.b 中的 ++ 被看作后缀一元运算符(同理, a++ . b 中的 ++ 是后缀一元运算符而 a ++ .b 中的 ++ 不是).

        -
      • +
      • 如果运算符两侧都有空白或两侧都无空白,将被看作二元运算符。例如:a+ba + b 中的运算符 + 被看作二元运算符。
      • +
      • 如果运算符只有左侧空白,将被看作前缀一元运算符。例如 a ++b 中的 ++ 被看作前缀一元运算符。
      • +
      • 如果运算符只有右侧空白,将被看作后缀一元运算符。例如 a++ b 中的 ++ 被看作后缀一元运算符。
      • +
      • 如果运算符左侧没有空白并紧跟 .,将被看作后缀一元运算符。例如 a++.b 中的 ++ 被看作后缀一元运算符(同理, a++ . b 中的 ++ 是后缀一元运算符而 a ++ .b 中的 ++ 不是).

      鉴于这些规则,运算符前的字符 ([{ ;运算符后的字符 )]} 以及字符 ,;: 都将用于空白检测。

      -

      以上规则需注意一点,如果运算符 !? 左侧没有空白,则不管右侧是否有空白都将被看作后缀运算符。如果将 ? 用作可选类型(optional type)修饰,左侧必须无空白。如果用于条件运算符 ? :,必须两侧都有空白。

      +

      以上规则需注意一点,如果运算符 !? 左侧没有空白,则不管右侧是否有空白都将被看作后缀运算符。如果将 ? 用作可选类型(optional type)修饰,左侧必须无空白。如果用于条件运算符 ? :,必须两侧都有空白。

      在特定构成中 ,以 <> 开头的运算符会被分离成两个或多个标记,剩余部分以同样的方式会被再次分离。因此,在 Dictionary<String, Array<Int>> 中没有必要添加空白来消除闭合字符 > 的歧义。在这个例子中, 闭合字符 > 被看作单字符标记,而不会被误解为移位运算符 >>

      要学习如何自定义新的运算符,请参考 自定义操作符运算符声明。学习如何重写现有运算符,请参考 运算符方法

      -

      运算符语法

      -

      operatoroperator-character­ operator­ opt­

      -

      operator-character | | | | | | | | | | | | |

      -

      binary-operatoroperator­

      -

      prefix-operatoroperator­

      -

      postfix-operatoroperator­

      +

      运算符语法语法
      运算符运算符字符 运算符 可选
      运算符字符/ | = | - | + | ! | * | % | < | > | & | | | ^ | ~ | .
      二元运算符运算符
      前置运算符运算符
      后置运算符运算符

      @@ -794,16 +740,8 @@ var x = 3; "1 2 \(x)"
    - - - - - - - - - - + + @@ -821,6 +759,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/03_Types.html b/chapter3/03_Types.html index 7abd8a42..de06817a 100644 --- a/chapter3/03_Types.html +++ b/chapter3/03_Types.html @@ -1,57 +1,45 @@ - - + - 类型 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,70 +595,68 @@
    -
    +
    -

    类型(Types)

    +
    +

    翻译:lyuka
    校对:numbbbbb, stanzhai

    +
    +

    类型(Types)


    本页包含内容:

    -

    Swift语言存在两种类型:命名型类型和复合型类型。命名型类型是指定义时可以给定名字的类型。命名型类型包括类、结构体、枚举和协议。比如,一个用户定义的类MyClass的实例拥有类型MyClass。除了用户定义的命名型类型,Swift标准库也定义了很多常用的命名型类型,包括那些表示数组、字典和可选值的类型。

    -

    那些通常被其它语言认为是基本或初级的数据型类型(Data types)——比如表示数字、字符和字符串——实际上就是命名型类型,Swift标准库是使用结构体定义和实现它们的。因为它们是命名型类型,因此你可以按照“扩展和扩展声明”章节里讨论的那样,声明一个扩展来增加它们的行为以适应你程序的需求。

    -

    复合型类型是没有名字的类型,它由Swift本身定义。Swift存在两种复合型类型:函数类型和元组类型。一个复合型类型可以包含命名型类型和其它复合型类型。例如,元组类型(Int, (Int, Int))包含两个元素:第一个是命名型类型Int,第二个是另一个复合型类型(Int, Int).

    -

    本节讨论Swift语言本身定义的类型,并描述Swift中的类型推断行为。

    +

    Swift 语言存在两种类型:命名型类型和复合型类型。命名型类型是指定义时可以给定名字的类型。命名型类型包括类、结构体、枚举和协议。比如,一个用户定义的类MyClass的实例拥有类型MyClass。除了用户定义的命名型类型,Swift 标准库也定义了很多常用的命名型类型,包括那些表示数组、字典和可选值的类型。

    +

    那些通常被其它语言认为是基本或初级的数据型类型(Data types)——比如表示数字、字符和字符串——实际上就是命名型类型,Swift 标准库是使用结构体定义和实现它们的。因为它们是命名型类型,因此你可以按照“扩展和扩展声明”章节里讨论的那样,声明一个扩展来增加它们的行为以适应你程序的需求。

    +

    复合型类型是没有名字的类型,它由 Swift 本身定义。Swift 存在两种复合型类型:函数类型和元组类型。一个复合型类型可以包含命名型类型和其它复合型类型。例如,元组类型(Int, (Int, Int))包含两个元素:第一个是命名型类型Int,第二个是另一个复合型类型(Int, Int).

    +

    本节讨论 Swift 语言本身定义的类型,并描述 Swift 中的类型推断行为。

    -

    类型的语法: -typearray-type | function-type | type-identifier | tuple-type | optional-type | implicitly-unwrapped-optional-type | protocol-composition-type | metatype-type

    +

    类型语法
    类型数组类型 | 函数类型 | 类型标识 | 元组类型 | 可选类型 | 隐式解析可选类型 | 协议合成类型 | 元型类型

    -

    类型标注

    -

    类型标注显式地指定一个变量或表达式的值。类型标注始于冒号:终于类型,比如下面两个例子:

    -
    let someTuple:(Double, Double) = (3.14159, 2.71828)
    -func someFunction(a: Int){ /* ... */ }
    +

    +

    类型注解

    +

    类型注解显式地指定一个变量或表达式的值。类型注解始于冒号:终于类型,比如下面两个例子:

    +
    let someTuple: (Double, Double) = (3.14159, 2.71828)
    +func someFunction(a: Int){ /* ... */ }
     

    在第一个例子中,表达式someTuple的类型被指定为(Double, Double)。在第二个例子中,函数someFunction的参数a的类型被指定为Int

    -

    类型标注可以在类型之前包含一个类型特性(type attributes)的可选列表。

    +

    类型注解可以在类型之前包含一个类型特性(type attributes)的可选列表。

    -

    类型标注的语法: -type-annotation → :attributes[opt] type

    +

    类型注解语法
    类型注解: 特性(Attributes)列表 可选 类型

    +

    类型标识符

    类型标识符引用命名型类型或者是命名型/复合型类型的别名。

    大多数情况下,类型标识符引用的是同名的命名型类型。例如类型标识符Int引用命名型类型Int,同样,类型标识符Dictionary<String, Int>引用命名型类型Dictionary<String, Int>

    在两种情况下类型标识符引用的不是同名的类型。情况一,类型标识符引用的是命名型/复合型类型的类型别名。比如,在下面的例子中,类型标识符使用Point来引用元组(Int, Int)

    -
    typealias Point = (Int, Int)
    -let origin: Point = (0, 0)
    +
    typealias Point = (Int, Int)
    +let origin: Point = (0, 0)
     

    情况二,类型标识符使用dot(.)语法来表示在其它模块(modules)或其它类型嵌套内声明的命名型类型。例如,下面例子中的类型标识符引用在ExampleModule模块中声明的命名型类型MyType

    -
    var someValue: ExampleModule.MyType
    +
    var someValue: ExampleModule.MyType
     
    -

    类型标识符的语法: -type-identifiertype-name generic-argument-clause[opt] | type-name generic-argument-clause[opt].type-identifier -type-nameidentifier

    +

    类型标识语法
    类型标识类型名称 泛型参数子句 可选 | 类型名称 泛型参数子句 可选 . 类型标识
    类名标识符

    +

    元组类型

    元组类型使用逗号隔开并使用括号括起来的0个或多个类型组成的列表。

    你可以使用元组类型作为一个函数的返回类型,这样就可以使函数返回多个值。你也可以命名元组类型中的元素,然后用这些名字来引用每个元素的值。元素的名字由一个标识符和:组成。“函数和多返回值”章节里有一个展示上述特性的例子。

    void是空元组类型()的别名。如果括号内只有一个元素,那么该类型就是括号内元素的类型。比如,(Int)的类型是Int而不是(Int)。所以,只有当元组类型包含两个元素以上时才可以标记元组元素。

    -

    元组类型语法: -tuple → (tuple-type-body[opt]) -tuple-type-bodytuple-type-element-list ...[opt] -tuple-type-element-listtuple-type-element | tuple-type-element, tuple-type-element-list -tuple-type-elementattributes[opt] inout [opt] type | inout [opt] element-name type-annotation -element-nameidentifier

    +

    元组类型语法
    元组类型( 元组类型主体 可选 )
    元组类型主体元组类型的元素列表 ... 可选
    元组类型的元素列表元组类型的元素 | 元组类型的元素 , 元组类型的元素列表
    元组类型的元素特性(Attributes)列表 可选 inout 可选 类型 | inout 可选 元素名 类型注解
    元素名标识符

    +

    函数类型

    函数类型表示一个函数、方法或闭包的类型,它由一个参数类型和返回值类型组成,中间用箭头->隔开:

      @@ -658,78 +664,78 @@ func someFunction(a: Int){ /* ... */ }

    由于 参数类型返回值类型 可以是元组类型,所以函数类型可以让函数与方法支持多参数与多返回值。

    你可以对函数类型应用带有参数类型()并返回表达式类型的auto_closure属性(见类型属性章节)。一个自动闭包函数捕获特定表达式上的隐式闭包而非表达式本身。下面的例子使用auto_closure属性来定义一个很简单的assert函数:

    -
    func simpleAssert(condition: @auto_closure () -> Bool, message: String){
    -    if !condition(){
    +
    func simpleAssert(condition: @auto_closure () -> Bool, message: String){
    +    if !condition(){
             println(message)
         }
     }
    -let testNumber = 5
    -simpleAssert(testNumber % 2 == 0, "testNumber isn't an even number.")
    -// prints "testNumber isn't an even number."
    +let testNumber = 5
    +simpleAssert(testNumber % 2 == 0, "testNumber isn't an even number.")
    +// prints "testNumber isn't an even number."
     

    函数类型可以拥有一个可变长参数作为参数类型中的最后一个参数。从语法角度上讲,可变长参数由一个基础类型名字和...组成,如Int...。可变长参数被认为是一个包含了基础类型元素的数组。即Int...就是Int[]。关于使用可变长参数的例子,见章节“可变长参数”。

    为了指定一个in-out参数,可以在参数类型前加inout前缀。但是你不可以对可变长参数或返回值类型使用inout。关于In-Out参数的讨论见章节In-Out参数部分。

    柯里化函数(curried function)的类型相当于一个嵌套函数类型。例如,下面的柯里化函数addTwoNumber()()的类型是Int -> Int -> Int

    -
    func addTwoNumbers(a: Int)(b: Int) -> Int{
    -    return a + b
    +
    func addTwoNumbers(a: Int)(b: Int) -> Int{
    +    return a + b
     }
    -addTwoNumbers(4)(5)      // returns 9
    +addTwoNumbers(4)(5)      // returns 9
     

    柯里化函数的函数类型从右向左组成一组。例如,函数类型Int -> Int -> Int可以被理解为Int -> (Int -> Int)——也就是说,一个函数传入一个Int然后输出作为另一个函数的输入,然后又返回一个Int。例如,你可以使用如下嵌套函数来重写柯里化函数addTwoNumbers()()

    -
    func addTwoNumbers(a: Int) -> (Int -> Int){
    +
    func addTwoNumbers(a: Int) -> (Int -> Int){
         func addTheSecondNumber(b: Int) -> Int{
    -        return a + b
    +        return a + b
         }
    -    return addTheSecondNumber
    +    return addTheSecondNumber
     }
    -addTwoNumbers(4)(5)     // Returns 9
    +addTwoNumbers(4)(5)     // Returns 9
     
    -

    函数类型的语法: -function-typetype -> type

    +

    函数类型语法
    函数类型类型 -> 类型

    +

    数组类型

    Swift语言使用类型名紧接中括号[]来简化标准库中定义的命名型类型Array<T>。换句话说,下面两个声明是等价的:

    -
    let someArray: String[] = ["Alex", "Brian", "Dave"]
    -let someArray: Array<String> = ["Alex", "Brian", "Dave"]
    +
    let someArray: String[] = ["Alex", "Brian", "Dave"]
    +let someArray: Array<String> = ["Alex", "Brian", "Dave"]
     

    上面两种情况下,常量someArray都被声明为字符串数组。数组的元素也可以通过[]获取访问:someArray[0]是指第0个元素“Alex”

    上面的例子同时显示,你可以使用[]作为初始值构造数组,空的[]则用来来构造指定类型的空数组。

    -
    var emptyArray: Double[] = []
    +
    var emptyArray: Double[] = []
     

    你也可以使用链接起来的多个[]集合来构造多维数组。例如,下例使用三个[]集合来构造三维整型数组:

    -
    var array3D: Int[][][] = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
    +
    var array3D: Int[][][] = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
     

    访问一个多维数组的元素时,最左边的下标指向最外层数组的相应位置元素。接下来往右的下标指向第一层嵌入的相应位置元素,依次类推。这就意味着,在上面的例子中,array3D[0]是指[[1, 2], [3, 4]]array3D[0][1]是指[3, 4]array3D[0][1][1]则是指值4

    关于Swift标准库中Array类型的细节讨论,见章节Arrays。

    -

    数组类型的语法: -array-typetype[ ] | array-type[ ]

    +

    数组类型语法
    数组类型类型 [ ] | 数组类型 [ ]

    +

    可选类型

    Swift定义后缀?来作为标准库中的定义的命名型类型Optional<T>的简写。换句话说,下面两个声明是等价的:

    -
    var optionalInteger: Int?
    -var optionalInteger: Optional<Int>
    +
    var optionalInteger: Int?
    +var optionalInteger: Optional<Int>
     

    在上述两种情况下,变量optionalInteger都被声明为可选整型类型。注意在类型和?之间没有空格。

    类型Optional<T>是一个枚举,有两种形式,NoneSome(T),又来代表可能出现或可能不出现的值。任意类型都可以被显式的声明(或隐式的转换)为可选类型。当声明一个可选类型时,确保使用括号给?提供合适的作用范围。比如说,声明一个整型的可选数组,应写作(Int[])?,写成Int[]?的话则会出错。

    如果你在声明或定义可选变量或特性的时候没有提供初始值,它的值则会自动赋成缺省值nil

    可选符合LogicValue协议,因此可以出现在布尔值环境下。此时,如果一个可选类型T?实例包含有类型为T的值(也就是说值为Optional.Some(T)),那么此可选类型就为true,否则为false

    如果一个可选类型的实例包含一个值,那么你就可以使用后缀操作符!来获取该值,正如下面描述的:

    -
    optionalInteger = 42
    -optionalInteger!      // 42
    +
    optionalInteger = 42
    +optionalInteger!      // 42
     

    使用!操作符获取值为nil的可选项会导致运行错误(runtime error)。

    你也可以使用可选链和可选绑定来选择性的执行可选表达式上的操作。如果值为nil,不会执行任何操作因此也就没有运行错误产生。

    更多细节以及更多如何使用可选类型的例子,见章节“可选”。

    -

    可选类型语法: -optional-typetype?

    +

    可选类型语法
    可选类型类型 ?

    +

    隐式解析可选类型

    Swift语言定义后缀!作为标准库中命名类型ImplicitlyUnwrappedOptional<T>的简写。换句话说,下面两个声明等价:

    -
    var implicitlyUnwrappedString: String!
    -var implicitlyUnwrappedString: ImplicitlyUnwrappedOptional<String>
    +
    var implicitlyUnwrappedString: String!
    +var implicitlyUnwrappedString: ImplicitlyUnwrappedOptional<String>
     

    上述两种情况下,变量implicitlyUnwrappedString被声明为一个隐式解析可选类型的字符串。注意类型与!之间没有空格。

    你可以在使用可选的地方同样使用隐式解析可选。比如,你可以将隐式解析可选的值赋给变量、常量和可选特性,反之亦然。

    @@ -738,62 +744,59 @@ optionalInteger! // 42

    使用可选链会选择性的执行隐式解析可选表达式上的某一个操作。如果值为nil,就不会执行任何操作,因此也不会产生运行错误。

    关于隐式解析可选的更多细节,见章节“隐式解析可选”。

    -

    隐式解析可选的语法: -implicitly-unwrapped-optional-type → type!

    +

    隐式解析可选类型(Implicitly Unwrapped Optional Type)语法
    隐式解析可选类型类型 !

    +

    协议合成类型

    -

    协议合成类型是一种符合每个协议的指定协议列表类型。协议合成类型可能会用在类型标注和泛型参数中。

    +

    协议合成类型是一种符合每个协议的指定协议列表类型。协议合成类型可能会用在类型注解和泛型参数中。

    协议合成类型的形式如下:

    -
    protocol<Protocol 1, Procotol 2>
    +
    protocol<Protocol 1, Procotol 2>
     

    协议合成类型允许你指定一个值,其类型可以适配多个协议的条件,而且不需要定义一个新的命名型协议来继承其它想要适配的各个协议。比如,协议合成类型protocol<Protocol A, Protocol B, Protocol C>等效于一个从Protocol AProtocol BProtocol C继承而来的新协议Protocol D,很显然这样做有效率的多,甚至不需引入一个新名字。

    协议合成列表中的每项必须是协议名或协议合成类型的类型别名。如果列表为空,它就会指定一个空协议合成列表,这样每个类型都能适配。

    -

    协议合成类型的语法: -protocol-composition-typeprotocol <protocol-identifier-list[opt]> -protocol-identifier-listprotocol-identifier | protocol-identifier, protocol-identifier-list -protocol-identifiertype-identifier

    +

    协议合成类型语法
    协议合成类型protocol < 协议标识符列表 可选 >
    协议标识符列表协议标识符 | 协议标识符 , 协议标识符列表
    协议标识符类型标识

    +

    元类型

    元类型是指所有类型的类型,包括类、结构体、枚举和协议。

    类、结构体或枚举类型的元类型是相应的类型名紧跟.Type。协议类型的元类型——并不是运行时适配该协议的具体类型——是该协议名字紧跟.Protocol。比如,类SomeClass的元类型就是SomeClass.Type,协议SomeProtocol的元类型就是SomeProtocal.Protocol

    你可以使用后缀self表达式来获取类型。比如,SomeClass.self返回SomeClass本身,而不是SomeClass的一个实例。同样,SomeProtocol.self返回SomeProtocol本身,而不是运行时适配SomeProtocol的某个类型的实例。还可以对类型的实例使用dynamicType表达式来获取该实例在运行阶段的类型,如下所示:

    -
    class SomeBaseClass {
    -    class func printClassName() {
    -        println("SomeBaseClass")
    +
    class SomeBaseClass {
    +    class func printClassName() {
    +        println("SomeBaseClass")
         }
     }
    -class SomeSubClass: SomeBaseClass {
    -    override class func printClassName() {
    -        println("SomeSubClass")
    +class SomeSubClass: SomeBaseClass {
    +    override class func printClassName() {
    +        println("SomeSubClass")
         }
     }
    -let someInstance: SomeBaseClass = SomeSubClass()
    -// someInstance is of type SomeBaseClass at compile time, but
    -// someInstance is of type SomeSubClass at runtime
    +let someInstance: SomeBaseClass = SomeSubClass()
    +// someInstance is of type SomeBaseClass at compile time, but
    +// someInstance is of type SomeSubClass at runtime
     someInstance.dynamicType.printClassName()
    -// prints "SomeSubClass
    +// prints "SomeSubClass
     
    -

    元类型的语法: -metatype-typetype.Type | type.Protocol

    +

    元(Metatype)类型语法
    元类型类型 . Type | 类型 . Protocol x

    +

    类型继承子句

    类型继承子句被用来指定一个命名型类型继承哪个类且适配哪些协议。类型继承子句开始于冒号:,紧跟由,隔开的类型标识符列表。

    类可以继承单个超类,适配任意数量的协议。当定义一个类时,超类的名字必须出现在类型标识符列表首位,然后跟上该类需要适配的任意数量的协议。如果一个类不是从其它类继承而来,那么列表可以以协议开头。关于类继承更多的讨论和例子,见章节“继承”。

    其它命名型类型可能只继承或适配一个协议列表。协议类型可能继承于其它任意数量的协议。当一个协议类型继承于其它协议时,其它协议的条件集合会被集成在一起,然后其它从当前协议继承的任意类型必须适配所有这些条件。

    枚举定义中的类型继承子句可以是一个协议列表,或是指定原始值的枚举,一个单独的指定原始值类型的命名型类型。使用类型继承子句来指定原始值类型的枚举定义的例子,见章节“原始值”。

    -

    类型继承子句的语法: -type-inheritance-clause → :type-inheritance-list -type-inheritance-listtype-identifier | type-identifier, type-inheritance-list

    +

    类型继承子句语法
    类型继承子句: 类型继承列表
    类型继承列表类型标识 | 类型标识 , 类型继承列表

    +

    类型推断

    Swift广泛的使用类型推断,从而允许你可以忽略很多变量和表达式的类型或部分类型。比如,对于var x: Int = 0,你可以完全忽略类型而简写成var x = 0——编译器会正确的推断出x的类型Int。类似的,当完整的类型可以从上下文推断出来时,你也可以忽略类型的一部分。比如,如果你写了let dict: Dictionary = ["A": 1],编译提也能推断出dict的类型是Dictionary<String, Int>

    在上面的两个例子中,类型信息从表达式树(expression tree)的叶子节点传向根节点。也就是说,var x: Int = 0x的类型首先根据0的类型进行推断,然后将该类型信息传递到根节点(变量x)。

    -

    在Swift中,类型信息也可以反方向流动——从根节点传向叶子节点。在下面的例子中,常量eFloat上的显式类型标注(:Float)导致数字字面量2.71828的类型是Float而非Double

    -
    let e = 2.71828 // The type of e is inferred to be Double.
    -let eFloat: Float = 2.71828 // The type of eFloat is Float.
    +

    在Swift中,类型信息也可以反方向流动——从根节点传向叶子节点。在下面的例子中,常量eFloat上的显式类型注解(:Float)导致数字字面量2.71828的类型是Float而非Double

    +
    let e = 2.71828 // The type of e is inferred to be Double.
    +let eFloat: Float = 2.71828 // The type of eFloat is Float.
     

    Swift中的类型推断在单独的表达式或语句水平上进行。这意味着所有用于推断类型的信息必须可以从表达式或其某个子表达式的类型检查中获取。

    @@ -814,16 +817,8 @@ someInstance.dynamicType.printClassName()
    - - - - - - - - - - + + @@ -841,6 +836,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/04_Expressions.html b/chapter3/04_Expressions.html index 031948d4..ed2b27d6 100644 --- a/chapter3/04_Expressions.html +++ b/chapter3/04_Expressions.html @@ -1,57 +1,45 @@ - - + - 表达式 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,6 +595,532 @@
    +
    + +
    +

    翻译:sg552
    校对:numbbbbb, stanzhai

    +
    +

    表达式(Expressions)

    +
    +

    本页包含内容:

    + +

    Swift 中存在四种表达式: 前缀(prefix)表达式,二元(binary)表达式,主要(primary)表达式和后缀(postfix)表达式。表达式可以返回一个值,以及运行某些逻辑(causes a side effect)。

    +

    前缀表达式和二元表达式就是对某些表达式使用各种运算符(operators)。 主要表达式是最短小的表达式,它提供了获取(变量的)值的一种途径。 后缀表达式则允许你建立复杂的表达式,例如配合函数调用和成员访问。 每种表达式都在下面有详细论述~

    +
    +

    表达式语法
    表达式前置表达式 二元表达式列表 可选
    表达式列表表达式 | 表达式 , 表达式列表

    +
    +

    +

    前缀表达式(Prefix Expressions)

    +

    前缀表达式由 前缀符号和表达式组成。(这个前缀符号只能接收一个参数)

    +

    Swift 标准库支持如下的前缀操作符:

    +
      +
    • ++ 自增1 (increment)
    • +
    • -- 自减1 (decrement)
    • +
    • ! 逻辑否 (Logical NOT )
    • +
    • ~ 按位否 (Bitwise NOT )
    • +
    • + 加(Unary plus)
    • +
    • - 减(Unary minus)
    • +
    +

    对于这些操作符的使用,请参见: Basic Operators and Advanced Operators

    +

    作为对上面标准库运算符的补充,你也可以对 某个函数的参数使用 '&'运算符。 更多信息,请参见: "In-Out parameters".

    +
    +

    前置表达式语法
    前置表达式前置运算符 可选 后置表达式
    前置表达式写入写出(in-out)表达式
    写入写出(in-out)表达式& 标识符

    +
    +

    +

    二元表达式(Binary Expressions)

    +

    二元表达式由 "左边参数" + "二元运算符" + "右边参数" 组成, 它有如下的形式:

    +
    +

    left-hand argument operator right-hand argument

    +
    +

    Swift 标准库提供了如下的二元运算符:

    +
      +
    • 求幂相关(无结合,优先级160)
        +
      • << 按位左移(Bitwise left shift)
      • +
      • +
        +

        按位右移(Bitwise right shift)

        +
        +
        +
      • +
      +
    • +
    • 乘除法相关(左结合,优先级150)
        +
      • * 乘
      • +
      • / 除
      • +
      • % 求余
      • +
      • &* 乘法,忽略溢出( Multiply, ignoring overflow)
      • +
      • &/ 除法,忽略溢出(Divide, ignoring overflow)
      • +
      • &% 求余, 忽略溢出( Remainder, ignoring overflow)
      • +
      • & 位与( Bitwise AND)
      • +
      +
    • +
    • 加减法相关(左结合, 优先级140)
        +
      • + 加
      • +
      • - 减
      • +
      • &+ Add with overflow
      • +
      • &- Subtract with overflow
      • +
      • | 按位或(Bitwise OR )
      • +
      • ^ 按位异或(Bitwise XOR)
      • +
      +
    • +
    • Range (无结合,优先级 135)
        +
      • .. 半闭值域 Half-closed range
      • +
      • ... 全闭值域 Closed range
      • +
      +
    • +
    • 类型转换 (无结合,优先级 132)
        +
      • is 类型检查( type check)
      • +
      • as 类型转换( type cast)
      • +
      +
    • +
    • Comparative (无结合,优先级 130)
        +
      • < 小于
      • +
      • <= 小于等于
      • +
      • +

        大于

        +
        +
      • +
      • +

        = 大于等于

        +
        +
      • +
      • == 等于
      • +
      • != 不等
      • +
      • === 恒等于
      • +
      • !== 不恒等
      • +
      • ~= 模式匹配( Pattern match)
      • +
      +
    • +
    • 合取( Conjunctive) (左结合,优先级 120)
        +
      • && 逻辑与(Logical AND)
      • +
      +
    • +
    • 析取(Disjunctive) (左结合,优先级 110)
        +
      • || 逻辑或( Logical OR)
      • +
      +
    • +
    • 三元条件(Ternary Conditional )(右结合,优先级 100)
        +
      • ?: 三元条件 Ternary conditional
      • +
      +
    • +
    • 赋值 (Assignment) (右结合, 优先级 90)
        +
      • = 赋值(Assign)
      • +
      • *= Multiply and assign
      • +
      • /= Divide and assign
      • +
      • %= Remainder and assign
      • +
      • += Add and assign
      • +
      • -= Subtract and assign
      • +
      • <<= Left bit shift and assign
      • +
      • +
        +

        = Right bit shift and assign

        +
        +
        +
      • +
      • &= Bitwise AND and assign
      • +
      • ^= Bitwise XOR and assign
      • +
      • |= Bitwise OR and assign
      • +
      • &&= Logical AND and assign
      • +
      • ||= Logical OR and assign
      • +
      +
    • +
    +

    关于这些运算符(operators)的更多信息,请参见:Basic Operators and Advanced Operators.

    +
    +

    注意
    在解析时, 一个二元表达式表示为一个一级数组(a flat list), 这个数组(List)根据运算符的先后顺序,被转换成了一个tree. 例如: 2 + 3 5 首先被认为是: 2, + , 3, , 5. 随后它被转换成 tree (2 + (3 * 5))

    +
    +

    + +
    +

    二元表达式语法
    二元表达式二元运算符 前置表达式
    二元表达式赋值运算符 前置表达式
    二元表达式条件运算符 前置表达式
    二元表达式类型转换运算符
    二元表达式列表二元表达式 二元表达式列表 可选

    +
    +

    +

    赋值表达式(Assignment Operator)

    +

    The assigment operator sets a new value for a given expression. It has the following form: +赋值表达式会对某个给定的表达式赋值。 它有如下的形式;

    +
    +

    expression = value

    +
    +

    就是把右边的 value 赋值给左边的 expression. 如果左边的expression 需要接收多个参数(是一个tuple ),那么右边必须也是一个具有同样数量参数的tuple. (允许嵌套的tuple)

    +
    (a, _, (b, c)) = ("test", 9.45, (12, 3))
    +// a is "test", b is 12, c is 3, and 9.45 is ignored
    +
    +

    赋值运算符不返回任何值。

    +
    +

    赋值运算符语法
    赋值运算符=

    +
    +

    +

    三元条件运算符(Ternary Conditional Operator)

    +

    三元条件运算符 是根据条件来获取值。 形式如下:

    +
    +

    condition ? expression used if true : expression used if false

    +
    +

    如果 condition 是true, 那么返回 第一个表达式的值(此时不会调用第二个表达式), 否则返回第二个表达式的值(此时不会调用第一个表达式)。

    +

    想看三元条件运算符的例子,请参见: Ternary Conditional Operator.

    +
    +

    三元条件运算符语法
    三元条件运算符? 表达式 :

    +
    +

    +

    类型转换运算符(Type-Casting Operators)

    +

    有两种类型转换操作符: as 和 is. 它们有如下的形式:

    +
    +

    expression as type
    expression as? type
    expression is type

    +
    +

    as 运算符会把目标表达式转换成指定的类型(specified type),过程如下:

    +
      +
    • 如果类型转换成功, 那么目标表达式就会返回指定类型的实例(instance). 例如:把子类(subclass)变成父类(superclass)时.
    • +
    • 如果转换失败,则会抛出编译错误( compile-time error)。
    • +
    • 如果上述两个情况都不是(也就是说,编译器在编译时期无法确定转换能否成功,) 那么目标表达式就会变成指定的类型的optional. (is an optional of the specified type ) 然后在运行时,如果转换成功, 目标表达式就会作为 optional的一部分来返回, 否则,目标表达式返回nil. 对应的例子是: 把一个 superclass 转换成一个 subclass.
    • +
    +
    class SomeSuperType {}
    +class SomeType: SomeSuperType {}
    +class SomeChildType: SomeType {}
    +let s = SomeType()
    +
    +let x = s as SomeSuperType  // known to succeed; type is SomeSuperType
    +let y = s as Int            // known to fail; compile-time error
    +let z = s as SomeChildType  // might fail at runtime; type is SomeChildType?
    +
    +

    使用'as'做类型转换跟正常的类型声明,对于编译器来说是一样的。例如:

    +
    let y1 = x as SomeType  // Type information from 'as'
    +let y2: SomeType = x    // Type information from an annotation
    +
    +

    'is' 运算符在“运行时(runtime)”会做检查。 成功会返回true, 否则 false

    +

    The check must not be known to be true or false at compile time. The following are invalid: +上述检查在“编译时(compile time)”不能使用。 例如下面的使用是错误的:

    +
    "hello" is String
    +"hello" is Int
    +
    +

    关于类型转换的更多内容和例子,请参见: Type Casting.

    +
    +

    类型转换运算符(type-casting-operator)语法
    类型转换运算符is 类型 | as ? 可选 类型

    +
    +

    +

    主表达式(Primary Expressions)

    +

    主表达式是最基本的表达式。 它们可以跟 前缀表达式,二元表达式,后缀表达式以及其他主要表达式组合使用。

    +
    +

    主表达式语法
    主表达式标识符 泛型参数子句 可选
    主表达式字面量表达式
    主表达式self表达式
    主表达式超类表达式
    主表达式闭包表达式
    主表达式圆括号表达式
    主表达式隐式成员表达式
    主表达式通配符表达式

    +
    +

    字符型表达式(Literal Expression)

    +

    由这些内容组成:普通的字符(string, number) , 一个字符的字典或者数组,或者下面列表中的特殊字符。

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    字符(Literal)类型(Type)值(Value)
    _FILE_String所在的文件名
    _LINE_Int所在的行数
    _COLUMN_Int所在的列数
    _FUNCTION_String所在的function 的名字
    +

    在某个函数(function)中,__FUNCTION__ 会返回当前函数的名字。 在某个方法(method)中,它会返回当前方法的名字。 在某个property 的getter/setter中会返回这个属性的名字。 在init/subscript中 只有的特殊成员(member)中会返回这个keyword的名字,在某个文件的顶端(the top level of a file),它返回的是当前module的名字。

    +

    一个array literal,是一个有序的值的集合。 它的形式是:

    +
    +

    [value 1, value 2, ...]

    +
    +

    数组中的最后一个表达式可以紧跟一个逗号(','). []表示空数组 。 array literal的type是 T[], 这个T就是数组中元素的type. 如果该数组中有多种type, T则是跟这些type的公共supertype最接近的type.(closest common supertype)

    +

    一个dictionary literal 是一个包含无序的键值对(key-value pairs)的集合,它的形式是:

    +
    +

    [key 1: value 1, key 2: value 2, ...]

    +
    +

    dictionary 的最后一个表达式可以是一个逗号(','). [:] 表示一个空的dictionary. 它的type是 Dictionary (这里KeyType表示 key的type, ValueType表示 value的type) 如果这个dictionary 中包含多种 types, 那么KeyType, Value 则对应着它们的公共supertype最接近的type( closest common supertype).

    +
    +

    字面量表达式语法
    字面量表达式字面量
    字面量表达式数组字面量 | 字典字面量
    字面量表达式__FILE__ | __LINE__ | __COLUMN__ | __FUNCTION__
    数组字面量[ 数组字面量项列表 可选 ]
    数组字面量项列表数组字面量项 , 可选 | 数组字面量项 , 数组字面量项列表
    数组字面量项表达式
    字典字面量[ 字典字面量项列表 ] | [ : ]
    字典字面量项列表字典字面量项 , 可选 | 字典字面量项 , 字典字面量项列表
    字典字面量项表达式 : 表达式

    +
    +

    self表达式(Self Expression)

    +

    self表达式是对 当前type 或者当前instance的引用。它的形式如下:

    +
    +

    self
    self.member name
    self[subscript index]
    self(initializer arguments
    self.init(initializer arguments

    +
    +

    如果在 initializer, subscript, instance method中,self等同于当前type的instance. 在一个静态方法(static method), 类方法(class method)中, self等同于当前的type.

    +

    当访问 member(成员变量时), self 用来区分重名变量(例如函数的参数). 例如, +(下面的 self.greeting 指的是 var greeting: String, 而不是 init(greeting: String) )

    +
    class SomeClass {
    +    var greeting: String
    +    init(greeting: String) {
    +        self.greeting = greeting
    +    }
    +}
    +
    +

    在mutating 方法中, 你可以使用self 对 该instance进行赋值。

    +
    struct Point {
    +    var x = 0.0, y = 0.0
    +    mutating func moveByX(deltaX: Double, y deltaY: Double) {
    +        self = Point(x: x + deltaX, y: y + deltaY)
    +    }
    +}
    +
    +
    +

    Self 表达式语法
    self表达式self
    self表达式self . 标识符
    self表达式self [ 表达式 ]
    self表达式self . init

    +
    +

    超类表达式(Superclass Expression)

    +

    超类表达式可以使我们在某个class中访问它的超类. 它有如下形式:

    +
    +

    super.member name
    super[subscript index]
    super.init(initializer arguments

    +
    +

    形式1 用来访问超类的某个成员(member). 形式2 用来访问该超类的 subscript 实现。 形式3 用来访问该超类的 initializer.

    +

    子类(subclass)可以通过超类(superclass)表达式在它们的 member, subscripting 和 initializers 中来利用它们超类中的某些实现(既有的方法或者逻辑)。

    +
    +

    超类(superclass)表达式语法
    超类表达式超类方法表达式 | 超类下标表达式 | 超类构造器表达式
    超类方法表达式super . 标识符
    超类下标表达式super [ 表达式 ]
    超类构造器表达式super . init

    +
    +

    闭包表达式(Closure Expression)

    +

    闭包(closure) 表达式可以建立一个闭包(在其他语言中也叫 lambda, 或者 匿名函数(anonymous function)). 跟函数(function)的声明一样, 闭包(closure)包含了可执行的代码(跟方法主体(statement)类似) 以及接收(capture)的参数。 它的形式如下:

    +
    { (parameters) -> return type in
    +    statements
    +}
    +
    +

    闭包的参数声明形式跟方法中的声明一样, 请参见:Function Declaration.

    +

    闭包还有几种特殊的形式, 让使用更加简洁:

    +
      +
    • 闭包可以省略 它的参数的type 和返回值的type. 如果省略了参数和参数类型,就也要省略 'in'关键字。 如果被省略的type 无法被编译器获知(inferred) ,那么就会抛出编译错误。
    • +
    • 闭包可以省略参数,转而在方法体(statement)中使用 $0, $1, $2 来引用出现的第一个,第二个,第三个参数。
    • +
    • 如果闭包中只包含了一个表达式,那么该表达式就会自动成为该闭包的返回值。 在执行 'type inference '时,该表达式也会返回。
    • +
    +

    下面几个 闭包表达式是 等价的:

    +
    myFunction {
    +    (x: Int, y: Int) -> Int in
    +    return x + y
    +}
    +
    +myFunction {
    +    (x, y) in
    +    return x + y
    +}
    +
    +myFunction { return $0 + $1 }
    +
    +myFunction { $0 + $1 }
    +
    +

    关于 向闭包中传递参数的内容,参见: Function Call Expression.

    +

    闭包表达式可以通过一个参数列表(capture list) 来显式指定它需要的参数。 参数列表 由中括号 [] 括起来,里面的参数由逗号','分隔。一旦使用了参数列表,就必须使用'in'关键字(在任何情况下都得这样做,包括忽略参数的名字,type, 返回值时等等)。

    +

    在闭包的参数列表( capture list)中, 参数可以声明为 'weak' 或者 'unowned' .

    +
    myFunction { print(self.title) }                    // strong capture
    +myFunction { [weak self] in print(self!.title) }    // weak capture
    +myFunction { [unowned self] in print(self.title) }  // unowned capture
    +
    +

    在参数列表中,也可以使用任意表达式来赋值. 该表达式会在 闭包被执行时赋值,然后按照不同的力度来获取(这句话请慎重理解)。(captured with the specified strength. ) 例如:

    +
    // Weak capture of "self.parent" as "parent"
    +myFunction { [weak parent = self.parent] in print(parent!.title) }
    +
    +

    关于闭包表达式的更多信息和例子,请参见: Closure Expressions.

    +
    +

    闭包表达式语法
    闭包表达式{ 闭包签名(Signational) 可选 多条语句(Statements) }
    闭包签名(Signational)参数子句 函数结果 可选 in
    闭包签名(Signational)标识符列表 函数结果 可选 in
    闭包签名(Signational)捕获(Capature)列表 参数子句 函数结果 可选 in
    闭包签名(Signational)捕获(Capature)列表 标识符列表 函数结果 可选 in
    闭包签名(Signational)捕获(Capature)列表 in
    捕获(Capature)列表[ 捕获(Capature)说明符 表达式 ]
    捕获(Capature)说明符weak | unowned | unowned(safe) | unowned(unsafe)

    +
    +

    隐式成员表达式(Implicit Member Expression)

    +

    在可以判断出类型(type)的上下文(context)中,隐式成员表达式是访问某个type的member( 例如 class method, enumeration case) 的简洁方法。 它的形式是:

    +
    +

    .member name

    +
    +

    例子:

    +
    var x = MyEnumeration.SomeValue
    +x = .AnotherValue
    +
    +
    +

    隐式成员表达式语法
    隐式成员表达式. 标识符

    +
    +

    圆括号表达式(Parenthesized Expression)

    +

    圆括号表达式由多个子表达式和逗号','组成。 每个子表达式前面可以有 identifier x: 这样的可选前缀。形式如下:

    +
    +

    identifier 1: expression 1, identifier 2: expression 2, ...

    +
    +

    圆括号表达式用来建立tuples , 然后把它做为参数传递给 function. 如果某个圆括号表达式中只有一个 子表达式,那么它的type就是 子表达式的type。例如: (1)的 type是Int, 而不是(Int)

    +
    +

    圆括号表达式(Parenthesized Expression)语法
    圆括号表达式( 表达式元素列表 可选 )
    表达式元素列表表达式元素 | 表达式元素 , 表达式元素列表
    表达式元素表达式 | 标识符 : 表达式

    +
    +

    通配符表达式(Wildcard Expression)

    +

    通配符表达式用来忽略传递进来的某个参数。例如:下面的代码中,10被传递给x, 20被忽略(译注:好奇葩的语法。。。)

    +
    (x, _) = (10, 20)
    +// x is 10, 20 is ignored
    +
    +
    +

    通配符表达式语法
    通配符表达式_

    +
    +

    +

    后缀表达式(Postfix Expressions)

    +

    后缀表达式就是在某个表达式的后面加上 操作符。 严格的讲,每个主要表达式(primary expression)都是一个后缀表达式

    +

    Swift 标准库提供了下列后缀表达式:

    +
      +
    • ++ Increment
    • +
    • -- Decrement
    • +
    +

    对于这些操作符的使用,请参见: Basic Operators and Advanced Operators

    +
    +

    后置表达式语法
    后置表达式主表达式
    后置表达式后置表达式 后置运算符
    后置表达式函数调用表达式
    后置表达式构造器表达式
    后置表达式显示成员表达式
    后置表达式后置self表达式
    后置表达式动态类型表达式
    后置表达式下标表达式
    后置表达式强制取值(Forced Value)表达式
    后置表达式可选链(Optional Chaining)表达式

    +
    +

    函数调用表达式(Function Call Expression)

    +

    函数调用表达式由函数名和参数列表组成。它的形式如下:

    +
    +

    function nameargument value 1, argument value 2

    +
    +

    The function name can be any expression whose value is of a function type. +(不用翻译了, 太罗嗦)

    +

    如果该function 的声明中指定了参数的名字,那么在调用的时候也必须得写出来. 例如:

    +
    +

    function nameargument name 1: argument value 1, argument name 2: argument value 2

    +
    +

    可以在 函数调用表达式的尾部(最后一个参数之后)加上 一个闭包(closure) , 该闭包会被目标函数理解并执行。它具有如下两种写法:

    +
    // someFunction takes an integer and a closure as its arguments
    +someFunction(x, {$0 == 13})
    +someFunction(x) {$0 == 13}
    +
    +

    如果闭包是该函数的唯一参数,那么圆括号可以省略。

    +
    // someFunction takes a closure as its only argument
    +myData.someMethod() {$0 == 13}
    +myData.someMethod {$0 == 13}
    +
    +
    +

    函数调用表达式语法
    函数调用表达式后置表达式 圆括号表达式
    函数调用表达式后置表达式 圆括号表达式 可选 后置闭包(Trailing Closure)
    后置闭包(Trailing Closure)闭包表达式

    +
    +

    初始化函数表达式(Initializer Expression)

    +

    Initializer表达式用来给某个Type初始化。 它的形式如下:

    +
    +

    expression.init(initializer arguments

    +
    +

    (Initializer表达式用来给某个Type初始化。) 跟函数(function)不同, initializer 不能返回值。

    +
    var x = SomeClass.someClassFunction // ok
    +var y = SomeClass.init              // error
    +
    +

    可以通过 initializer 表达式来委托调用(delegate to )到superclass的initializers.

    +
    class SomeSubClass: SomeSuperClass {
    +    init() {
    +        // subclass initialization goes here
    +        super.init()
    +    }
    +}
    +
    +
    +

    构造器表达式语法
    构造器表达式后置表达式 . init

    +
    +

    显式成员表达式(Explicit Member Expression)

    +

    显示成员表达式允许我们访问type, tuple, module的成员变量。它的形式如下:

    +
    +

    expression.member name

    +
    +

    该member 就是某个type在声明时候所定义(declaration or extension) 的变量, 例如:

    +
    class SomeClass {
    +    var someProperty = 42
    +}
    +let c = SomeClass()
    +let y = c.someProperty  // Member access
    +
    +

    对于tuple, 要根据它们出现的顺序(0, 1, 2...)来使用:

    +
    var t = (10, 20, 30)
    +t.0 = t.1
    +// Now t is (20, 20, 30)
    +
    +

    The members of a module access the top-level declarations of that module. +(不确定:对于某个module的member的调用,只能调用在top-level声明中的member.)

    +
    +

    显式成员表达式语法
    显示成员表达式后置表达式 . 十进制数字
    显示成员表达式后置表达式 . 标识符 泛型参数子句 可选

    +
    +

    后缀self表达式(Postfix Self Expression)

    +

    后缀表达式由 某个表达式 + '.self' 组成. 形式如下:

    +
    +

    expression.self
    type.self

    +
    +

    形式1 表示会返回 expression 的值。例如: x.self 返回 x

    +

    形式2:返回对应的type。我们可以用它来动态的获取某个instance的type。

    +
    +

    后置Self 表达式语法
    后置self表达式后置表达式 . self

    +
    +

    dynamic表达式(Dynamic Type Expression)

    +

    (因为dynamicType是一个独有的方法,所以这里保留了英文单词,未作翻译, --- 类似与self expression)

    +

    dynamicType 表达式由 某个表达式 + '.dynamicType' 组成。

    +
    +

    expression.dynamicType

    +
    +

    上面的形式中, expression 不能是某type的名字(当然了,如果我都知道它的名字了还需要动态来获取它吗)。动态类型表达式会返回"运行时"某个instance的type, 具体请看下面的列子:

    +
    class SomeBaseClass {
    +    class func printClassName() {
    +        println("SomeBaseClass")
    +    }
    +}
    +class SomeSubClass: SomeBaseClass {
    +    override class func printClassName() {
    +        println("SomeSubClass")
    +    }
    +}
    +let someInstance: SomeBaseClass = SomeSubClass()
    +
    +// someInstance is of type SomeBaseClass at compile time, but
    +// someInstance is of type SomeSubClass at runtime
    +someInstance.dynamicType.printClassName()
    +// prints "SomeSubClass"
    +
    +
    +

    动态类型表达式语法
    动态类型表达式后置表达式 . dynamicType

    +
    +

    下标脚本表达式(Subscript Expression)

    +

    下标脚本表达式提供了通过下标脚本访问getter/setter 的方法。它的形式是:

    +
    +

    expression[index expressions]

    +
    +

    可以通过下标脚本表达式通过getter获取某个值,或者通过setter赋予某个值.

    +

    关于subscript的声明,请参见: Protocol Subscript Declaration.

    +
    +

    附属脚本表达式语法
    附属脚本表达式后置表达式 [ 表达式列表 ]

    +
    +

    强制取值表达式(Forced-Value Expression)

    +

    强制取值表达式用来获取某个目标表达式的值(该目标表达式的值必须不是nil )。它的形式如下:

    +
    +

    expression!

    +
    +

    如果该表达式的值不是nil, 则返回对应的值。 否则,抛出运行时错误(runtime error)。

    +
    +

    强制取值(Forced Value)语法
    强制取值(Forced Value)表达式后置表达式 !

    +
    +

    可选链表达式(Optional-Chaining Expression)

    +

    可选链表达式由目标表达式 + '?' 组成,形式如下:

    +
    +

    expression?

    +
    +

    后缀'?' 返回目标表达式的值,把它做为可选的参数传递给后续的表达式

    +

    如果某个后缀表达式包含了可选链表达式,那么它的执行过程就比较特殊: 首先先判断该可选链表达式的值,如果是 nil, 整个后缀表达式都返回 nil, 如果该可选链的值不是nil, 则正常返回该后缀表达式的值(依次执行它的各个子表达式)。在这两种情况下,该后缀表达式仍然是一个optional type(In either case, the value of the postfix expression is still of an optional type)

    +

    如果某个"后缀表达式"的"子表达式"中包含了"可选链表达式",那么只有最外层的表达式返回的才是一个optional type. 例如,在下面的例子中, 如果c 不是nil, 那么 c?.property.performAction() 这句代码在执行时,就会先获得c 的property方法,然后调用 performAction()方法。 然后对于 "c?.property.performAction()" 这个整体,它的返回值是一个optional type.

    +
    var c: SomeClass?
    +var result: Bool? = c?.property.performAction()
    +
    +

    如果不使用可选链表达式,那么 上面例子的代码跟下面例子等价:

    +
    if let unwrappedC = c {
    +    result = unwrappedC.property.performAction()
    +}
    +
    +
    +

    可选链表达式语法
    可选链表达式后置表达式 ?

    +
    + + +
    +
    @@ -601,16 +1135,8 @@
    - - - - - - - - - - + + @@ -628,6 +1154,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/05_Declarations.html b/chapter3/05_Declarations.html index 8eea5aa5..db33869d 100644 --- a/chapter3/05_Declarations.html +++ b/chapter3/05_Declarations.html @@ -1,57 +1,45 @@ - - + - 声明 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,6 +595,536 @@
    +
    + +
    +

    翻译:marsprince
    校对:numbbbbb, stanzhai

    +
    +

    声明

    +
    +

    本页包含内容:

    + +

    一条声明可以在你的程序里引入新的名字和构造。举例来说,你可以使用声明来引入函数和方法,变量和常量,或者来定义 +新的命名好的枚举,结构,类和协议类型。你也可以使用一条声明来延长一个已经存在的命名好的类型的行为。或者在你的 +程序里引入在其他地方声明的符号。

    +

    在swift中,大多数声明在某种意义上讲也是执行或同事声明它们的初始化定义。这意味着,因为协议和它们的成员不匹配, +大多数协议成员需要单独的声明。为了方便起见,也因为这些区别在swift里不是很重要,声明语句同时包含了声明和定义。

    +
    +

    声明语法
    声明导入声明
    声明常量声明
    声明变量声明
    声明类型别名声明
    声明函数声明
    声明枚举声明
    声明结构体声明
    声明类声明
    声明协议声明
    声明构造器声明
    声明析构器声明
    声明扩展声明
    声明附属脚本声明
    声明运算符声明
    声明(Declarations)列表声明 声明(Declarations)列表 可选
    声明描述符(Specifiers)列表声明描述符(Specifier) 声明描述符(Specifiers)列表 可选
    声明描述符(Specifier)class | mutating | nonmutating | override | static | unowned | unowned(safe) | unowned(unsafe) | weak

    +
    +

    +

    模块范围

    +

    模块范围定义了对模块中其他源文件可见的代码。(注:待改进)在swift的源文件中,最高级别的代码由零个或多个语句, +声明和表达组成。变量,常量和其他的声明语句在一个源文件的最顶级被声明,使得它们对同一模块中的每个源文件都是可见的。

    +
    +

    顶级(Top Level) 声明语法
    顶级声明多条语句(Statements) 可选

    +
    +

    +

    代码块

    +

    代码块用来将一些声明和控制结构的语句组织在一起。它有如下的形式:

    +
    +

    {
    statements
    }

    +
    +

    代码块中的语句包括声明,表达式和各种其他类型的语句,它们按照在源码中的出现顺序被依次执行。

    +
    +

    代码块语法
    代码块{ 多条语句(Statements) 可选 }

    +
    +

    +

    引入声明

    +

    引入声明使你可以使用在其他文件中声明的内容。引入语句的基本形式是引入整个代码模块;它由import关键字开始,后面 +紧跟一个模块名:

    +
    +

    import module

    +
    +

    你可以提供更多的细节来限制引入的符号,如声明一个特殊的子模块或者在一个模块或子模块中做特殊的声明。(待改进) +当你使用了这些细节后,在当前的程序汇总只有引入的符号是可用的(并不是声明的整个模块)。

    +
    +

    import import kind module.symbol name
    import module.submodule

    +
    +

    + +
    +

    导入(Import)声明语法
    导入声明特性(Attributes)列表 可选 import 导入类型 可选 导入路径
    导入类型typealias | struct | class | enum | protocol | var | func
    导入路径导入路径标识符 | 导入路径标识符 . 导入路径
    导入路径标识符标识符 | 运算符

    +
    +

    +

    常量声明

    +

    常量声明可以在你的程序里命名一个常量。常量以关键词let来声明,遵循如下的格式:

    +
    +

    let constant name: type = expression

    +
    +

    当常量的值被给定后,常量就将常量名称和表达式初始值不变的结合在了一起,而且不能更改。 +这意味着如果常量以类的形式被初始化,类本身的内容是可以改变的,但是常量和类之间的结合关系是不能改变的。 +当一个常量被声明为全局变量,它必须被给定一个初始值。当一个常量在类或者结构体中被声明时,它被认为是一个常量 +属性。常量并不是可计算的属性,因此不包含getters和setters。(译者注:getters和setters不知道怎么翻译,待改进)

    +

    如果常量名是一个元祖形式,元祖中的每一项初始化表达式中都要有对应的值

    +
    let (firstNumber, secondNumber) = (10, 42)
    +
    +

    在上例中,firstNumber是一个值为10的常量,secnodeName是一个值为42的常量。所有常量都可以独立的使用:

    +
    println("The first number is \(firstNumber).")
    +// prints "The first number is 10."
    +println("The second number is \(secondNumber).")
    +// prints "The second number is 42."
    +
    +

    类型注释(:type)在常量声明中是一个可选项,它可以用来描述在类型推断(type inference)中找到的类型。

    +

    声明一个静态常量要使用关键字static。静态属性在类型属性(type propetries)中有介绍。

    +

    如果还想获得更多关于常量的信息或者想在使用中获得帮助,请查看常量和变量(constants and variables), +存储属性(stored properties)等节。

    +
    +

    常数声明语法
    常量声明特性(Attributes)列表 可选 声明描述符(Specifiers)列表 可选 let 模式构造器列表
    模式构造器列表模式构造器 | 模式构造器 , 模式构造器列表
    模式构造器模式 构造器 可选
    构造器= 表达式

    +
    +

    +

    变量声明

    +

    变量声明可以在你的程序里声明一个变量,它以关键字var来声明。根据声明变量类型和值的不同,如存储和计算 +变量和属性,存储变量和属性监视,和静态变量属性,有着不同的声明形式。(待改进) +所使用的声明形式取决于变量所声明的范围和你打算声明的变量类型。

    +
    +

    注意:
    你也可以在协议声明的上下文声明属性,详情参见类型属性声明。

    +
    +

    存储型变量和存储型属性

    +

    下面的形式声明了一个存储型变量或存储型变量属性

    +
    +

    var variable name: type = expression

    +
    +

    你可以在全局,函数内,或者在类和结构体的声明(context)中使用这种形式来声明一个变量。当变量以这种形式 +在全局或者一个函数内被声明时,它代表一个存储型变量。当它在类或者结构体中被声明时,它代表一个存储型变量属性。

    +

    构造器表达式可以被

    +

    和常量声明相比,如果变量名是一个元祖类型,元祖的每一项的名字都要和初始化表达式一致。

    +

    正如名字一样,存储型变量的值或存储型变量属性存储在内存中。

    +

    计算型变量和计算型属性

    +

    如下形式声明一个一个存储型变量或存储型属性:

    +
    +

    var variable name: type {
    get {
    statements
    }
    set(setter name) {
    statements
    }
    }

    +
    +

    你可以在全局,函数体内或者类,结构体,枚举,扩展声明的上下文中使用这种形式的声明。 +当变量以这种形式在全局或者一个函数内被声明时,它代表一个计算型变量。当它在类,结构体,枚举,扩展声明的上下文 +中中被声明时,它代表一个计算型变量属性。

    +

    getter用来读取变量值,setter用来写入变量值。setter子句是可选择的,只有getter是必需的,你可以将这些语句 +都省略,只是简单的直接返回请求值,正如在只读计算属性(read-only computed properites)中描述的那样。 +但是如果你提供了一个setter语句,你也必需提供一个getter语句。

    +

    setter的名字和圆括号内的语句是可选的。如果你写了一个setter名,它就会作为setter的参数被使用。如果你不写setter名, +setter的初始名为newValue,正如在seter声明速记(shorthand setter declaration)中提到的那样。

    +

    不像存储型变量和存储型属性那样,计算型属性和计算型变量的值不存储在内存中。

    +

    获得更多信息,查看更多关于计算型属性的例子,请查看计算型属性(computed properties)一节。

    +

    存储型变量监视器和属性监视器

    +

    你可以用willset和didset监视器来声明一个存储型变量或属性。一个包含监视器的存储型变量或属性按如下的形式声明:

    +
    +

    var variable name: type = expression {
    willSet(setter name) {
    statements
    }
    didSet(setter name) {
    statements
    }
    }

    +
    +

    你可以在全局,函数体内或者类,结构体,枚举,扩展声明的上下文中使用这种形式的声明。 +当变量以这种形式在全局或者一个函数内被声明时,监视器代表一个存储型变量监视器; +当它在类,结构体,枚举,扩展声明的上下文中被声明时,监视器代表属性监视器。

    +

    你可以为适合的监视器添加任何存储型属性。你也可以通过重写子类属性的方式为适合的监视器添加任何继承的属性 +(无论是存储型还是计算型的),参见重写属性监视器(overriding properyt observers)。

    +

    初始化表达式在类或者结构体的声明中是可选的,但是在其他地方是必需的。无论在什么地方声明, +所有包含监视器的变量声明都必须有类型注释(type annotation)。

    +

    当变量或属性的值被改变时,willset和didset监视器提供了一个监视方法(适当的回应)。 +监视器不会在变量或属性第一次初始化时不会被运行,它们只有在值被外部初始化语句改变时才会被运行。

    +

    willset监视器只有在变量或属性值被改变之前运行。新的值作为一个常量经过过willset监视器,因此不可以在 +willset语句中改变它。didset监视器在变量或属性值被改变后立即运行。和willset监视器相反,为了以防止你仍然 +需要获得旧的数据,旧变量值或者属性会经过didset监视器。这意味着,如果你在变量或属性自身的didiset监视器语句 +中设置了一个值,你设置的新值会取代刚刚在willset监视器中经过的那个值。

    +

    在willset和didset语句中,setter名和圆括号的语句是可选的。如果你写了一个setter名,它就会作为willset和didset的参数被使用。如果你不写setter名, +willset监视器初始名为newvalue,didset监视器初始名为oldvalue。

    +

    当你提供一个willset语句时,didset语句是可选的。同样的,在你提供了一个didset语句时,willset语句是可选的。

    +

    获得更多信息,查看如何使用属性监视器的例子,请查看属性监视器(prpperty observers)一节。

    +

    类和静态变量属性

    +

    class关键字用来声明类的计算型属性。static关键字用来声明类的静态变量属性。类和静态变量在类型属性(type properties)中有详细讨论。

    +
    +

    变量声明语法
    变量声明变量声明头(Head) 模式构造器列表
    变量声明变量声明头(Head) 变量名 类型注解 代码块
    变量声明变量声明头(Head) 变量名 类型注解 getter-setter块
    变量声明变量声明头(Head) 变量名 类型注解 getter-setter关键字(Keyword)块
    变量声明变量声明头(Head) 变量名 类型注解 构造器 可选 willSet-didSet代码块
    变量声明头(Head)特性(Attributes)列表 可选 声明描述符(Specifiers)列表 可选 var
    变量名称标识符
    getter-setter块{ getter子句 setter子句 可选 }
    getter-setter块{ setter子句 getter子句 }
    getter子句特性(Attributes)列表 可选 get 代码块
    setter子句特性(Attributes)列表 可选 set setter名称 可选 代码块
    setter名称( 标识符 )
    getter-setter关键字(Keyword)块{ getter关键字(Keyword)子句 setter关键字(Keyword)子句 可选 }
    getter-setter关键字(Keyword)块{ setter关键字(Keyword)子句 getter关键字(Keyword)子句 }
    getter关键字(Keyword)子句特性(Attributes)列表 可选 get
    setter关键字(Keyword)子句特性(Attributes)列表 可选 set
    willSet-didSet代码块{ willSet子句 didSet子句 可选 }
    willSet-didSet代码块{ didSet子句 willSet子句 }
    willSet子句特性(Attributes)列表 可选 willSet setter名称 可选 代码块
    didSet子句特性(Attributes)列表 可选 didSet setter名称 可选 代码块

    +
    +

    +

    类型的别名声明

    +

    类型别名的声明可以在你的程序里为一个已存在的类型声明一个别名。类型的别名声明以关键字typealias开始,遵循如下的 +形式:

    +
    +

    typealias name = existing type

    +
    +

    当一个类型被别名被声明后,你可以在你程序的任何地方使用别名来代替已存在的类型。已存在的类型可以是已经被命名的 +类型或者是混合类型。类型的别名不产生新的类型,它只是简单的和已存在的类型做名称替换。

    +

    查看更多Protocol Associated Type Declaration.

    +
    +

    类型别名声明语法
    类型别名声明类型别名头(Head) 类型别名赋值
    类型别名头(Head)typealias 类型别名名称
    类型别名名称标识符
    类型别名赋值= 类型

    +
    +

    +

    函数声明

    +

    你可以使用函数声明在你的程序里引入新的函数。函数可以在类的上下文,结构体,枚举,或者作为方法的协议中被声明。 +函数声明使用关键字func,遵循如下的形式:

    +
    +

    func function name(parameters) -> return type {
    statements
    }

    +
    +

    如果函数不返回任何值,返回类型可以被忽略,如下所示:

    +
    +

    func function name(parameters) {
    statements
    }

    +
    +

    每个参数的类型都要标明,它们不能被推断出来。初始时函数的参数是常值。在这些参数前面添加var使它们成为变量, +作用域内任何对变量的改变只在函数体内有效,或者用inout使的这些改变可以在调用域内生效。 +更多关于in-out参数的讨论,参见in-out参数(in-out parameters)

    +

    函数可以使用元组类型作为返回值来返回多个变量。

    +

    函数定义可以出现在另一个函数声明内。这种函数被称作nested函数。更多关于nested函数的讨论,参见nestde functions。

    +

    参数名

    +

    函数的参数是一个以逗号分隔的列表 。函数调用是的变量顺序必须和函数声明时的参数顺序一致。 +最简单的参数列表有着如下的形式:

    +
    +

    parameter name: parameter type

    +
    +

    对于函数参数来讲,参数名在函数体内被使用,而不是在函数调用时使用。对于方法参数,参数名在函数体内被使用, +同时也在方法被调用时作为标签被使用。该方法的第一个参数名仅仅在函数体内被使用,就像函数的参数一样,举例来讲:

    +
    func f(x: Int, y: String) -> String {
    +    return y + String(x)
    +}
    +f(7, "hello")  // x and y have no name
    +
    +
    class C {
    +    func f(x: Int, y: String) -> String {
    +       return y + String(x)
    +    }
    +}
    +let c = C()
    +c.f(7, y: "hello")  // x没有名称,y有名称
    +
    +

    你可以按如下的形式,重写参数名被使用的过程:

    +
    +

    external parameter name local parameter name: parameter type
    #parameter name: parameter type
    _ local parameter name: parameter type

    +
    +

    在本地参数前命名的第二名称(second name)使得参数有一个扩展名。且不同于本地的参数名。 +扩展参数名在函数被调用时必须被使用。对应的参数在方法或函数被调用时必须有扩展名 。

    +

    在参数名前所写的哈希符号(#)代表着这个参数名可以同时作为外部或本体参数名来使用。等同于书写两次本地参数名。 +在函数或方法调用时,与其对应的语句必须包含这个名字。

    +

    本地参数名前的强调字符(_)使参数在函数被调用时没有名称。在函数或方法调用时,与其对应的语句必须没有名字。

    +

    特殊类型的参数

    +

    参数可以被忽略,值可以是变化的,并且提供一个初始值,这种方法有着如下的形式:

    +
    +

    _ : <#parameter type#.
    parameter name: parameter type...
    parameter name: parameter type = default argument value

    +
    +

    以强调符(_)命名的参数明确的在函数体内不能被访问。

    +

    一个以基础类型名的参数,如果紧跟着三个点(...),被理解为是可变参数。一个函数至多可以拥有一个可变参数, +且必须是最后一个参数。可变参数被作为该基本类型名的数组来看待。举例来讲,可变参数int...被看做是int[]。 +查看可变参数的使用例子,详见可变参数(variadic parameters)一节。

    +

    在参数的类型后面有一个以等号(=)连接的表达式,这样的参数被看做有着给定表达式的初试值。如果参数在函数 +调用时被省略了,就会使用初始值。如果参数没有胜率,那么它在函数调用是必须有自己的名字.举例来讲, +f()和f(x:7)都是只有一个变量x的函数的有效调用,但是f(7)是非法的,因为它提供了一个值而不是名称。

    +

    特殊方法

    +

    以self修饰的枚举或结构体方法必须以mutating关键字作为函数声明头。

    +

    子类重写的方法必须以override关键字作为函数声明头。不用override关键字重写的方法,使用了override关键字 +却并没有重写父类方法都会报错。

    +

    和类型相关而不是和类型实例相关的方法必须在static声明的结构以或枚举内,亦或是以class关键字定义的类内。

    +

    柯里化函数和方法

    +

    柯里化函数或方法有着如下的形式:

    +
    +

    func function name(parameters)(parameters) -> return type {
    statements
    }

    +
    +

    以这种形式定义的函数的返回值是另一个函数。举例来说,下面的两个声明时等价的:

    +
    func addTwoNumbers(a: Int)(b: Int) -> Int {
    +    return a + b
    +}
    +func addTwoNumbers(a: Int) -> (Int -> Int) {
    +    func addTheSecondNumber(b: Int) -> Int {
    +        return a + b
    +    }
    +    return addTheSecondNumber
    +}
    +
    +
    addTwoNumbers(4)(5) // Returns 9
    +
    +

    多级柯里化应用如下

    +
    +

    函数声明语法
    函数声明函数头 函数名 泛型参数子句 可选 函数签名(Signature) 函数体
    函数头特性(Attributes)列表 可选 声明描述符(Specifiers)列表 可选 func
    函数名标识符 | 运算符
    函数签名(Signature)parameter-clauses 函数结果 可选
    函数结果-> 特性(Attributes)列表 可选 类型
    函数体代码块
    parameter-clauses参数子句 parameter-clauses 可选
    参数子句( ) | ( 参数列表 ... 可选 )
    参数列表参数 | 参数 , 参数列表
    参数inout 可选 let 可选 # 可选 参数名 本地参数名 可选 类型注解 默认参数子句 可选
    参数inout 可选 var # 可选 参数名 本地参数名 可选 类型注解 默认参数子句 可选
    参数特性(Attributes)列表 可选 类型
    参数名标识符 | _
    本地参数名标识符 | _
    默认参数子句= 表达式

    +
    +

    +

    枚举声明

    +

    在你的程序里使用枚举声明来引入一个枚举类型。

    +

    枚举声明有两种基本的形式,使用关键字enum来声明。枚举声明体使用从零开始的变量——叫做枚举事件,和任意数量的 +声明,包括计算型属性,实例方法,静态方法,构造器,类型别名,甚至其他枚举,结构体,和类。枚举声明不能 +包含析构器或者协议声明。

    +

    不像类或者结构体。枚举类型并不提供隐式的初始构造器,所有构造器必须显式的声明。构造器可以委托枚举中的其他 +构造器,但是构造过程仅当构造器将一个枚举时间完成后才全部完成。

    +

    和结构体类似但是和类不同,枚举是值类型:枚举实例在赋予变量或常量时,或者被函数调用时被复制。 +更多关于值类型的信息,参见结构体和枚举都是值类型(Structures and Enumerations Are Value Types)一节。

    +

    你可以扩展枚举类型,正如在扩展名声明(Extension Declaration)中讨论的一样。

    +

    任意事件类型的枚举

    +

    如下的形式声明了一个包含任意类型枚举时间的枚举变量

    +
    +

    enum enumeration name {
    case enumeration case 1
    case enumeration case 2(associated value types)
    }

    +
    +

    这种形式的枚举声明在其他语言中有时被叫做可识别联合(discrinminated)。

    +

    这种形式中,每一个事件块由关键字case开始,后面紧接着一个或多个以逗号分隔的枚举事件。每一个事件名必须是 +独一无二的。每一个事件也可以指定它所存储的指定类型的值,这些类型在关联值类型的元祖里被指定,立即书写在事件 +名后。获得更多关于关联值类型的信息和例子,请查看关联值(associated values)一节。

    +

    使用原始事件值的枚举

    +

    以下的形式声明了一个包含相同基础类型的枚举事件的枚举:

    +
    +

    enum enumeration name: raw value type {
    case enumeration case 1 = raw value 1
    case enumeration case 2 = raw value 2
    }

    +
    +

    在这种形式中,每一个事件块由case关键字开始,后面紧接着一个或多个以逗号分隔的枚举事件。和第一种形式的枚举 +事件不同,这种形式的枚举事件包含一个同类型的基础值,叫做原始值(raw value)。这些值的类型在原始值类型(raw value type) +中被指定,必须是字面上的整数,浮点数,字符或者字符串。

    +

    每一个事件必须有唯一的名字,必须有一个唯一的初始值。如果初始值类型被指定为int,则不必为事件显式的指定值, +它们会隐式的被标为值0,1,2等。每一个没有被赋值的Int类型时间会隐式的赋予一个初始值,它们是自动递增的。

    +
    num ExampleEnum: Int {
    +    case A, B, C = 5, D
    +}
    +
    +

    在上面的例子中,ExampleEnum.A的值是0,ExampleEnum.B的值是。因为ExampleEnum.C的值被显式的设定为5,因此 +ExampleEnum.D的值会自动增长为6.

    +

    枚举事件的初始值可以调用方法roRaw获得,如ExampleEnum.B.toRaw()。你也可以通过调用fromRaw方法来使用初始值找到 +其对应的事件,并返回一个可选的事件。查看更多信息和获取初始值类型事件的信息,参阅初始值(raw values)。

    +

    获得枚举事件

    +

    使用点(.)来引用枚举类型的事件,如 EnumerationType.EnumerationCase。当枚举类型可以上下文推断出时,你可以 +省略它(.仍然需要),参照枚举语法(Enumeration Syntax)和显式成员表达(Implicit Member Expression).

    +

    使用switch语句来检验枚举事件的值,正如使用switch语句匹配枚举值(Matching Enumeration Values with a Switch Statement)一节描述的那样。

    +

    枚举类型是模式匹配(pattern-matched)的,和其相反的是switch语句case块中枚举事件匹配,在枚举事件类型(Enumeration Case Pattern)中有描述。

    +
    +

    枚举声明语法
    枚举声明特性(Attributes)列表 可选 联合式枚举 | 特性(Attributes)列表 可选 原始值式枚举
    联合式枚举枚举名 泛型参数子句 可选 { union-style-enum-members 可选 }
    union-style-enum-membersunion-style-enum-member union-style-enum-members 可选
    union-style-enum-member声明 | 联合式(Union Style)的枚举case子句
    联合式(Union Style)的枚举case子句特性(Attributes)列表 可选 case 联合式(Union Style)的枚举case列表
    联合式(Union Style)的枚举case列表联合式(Union Style)的case | 联合式(Union Style)的case , 联合式(Union Style)的枚举case列表
    联合式(Union Style)的case枚举的case名 元组类型 可选
    枚举名标识符
    枚举的case名标识符
    原始值式枚举枚举名 泛型参数子句 可选 : 类型标识 { 原始值式枚举成员列表 可选 }
    原始值式枚举成员列表原始值式枚举成员 原始值式枚举成员列表 可选
    原始值式枚举成员声明 | 原始值式枚举case子句
    原始值式枚举case子句特性(Attributes)列表 可选 case 原始值式枚举case列表
    原始值式枚举case列表原始值式枚举case | 原始值式枚举case , 原始值式枚举case列表
    原始值式枚举case枚举的case名 原始值赋值 可选
    原始值赋值= 字面量

    +
    +

    +

    结构体声明

    +

    使用结构体声明可以在你的程序里引入一个结构体类型。结构体声明使用struct关键字,遵循如下的形式:

    +
    +

    struct structure name: adopted protocols {
    declarations
    }

    +
    +

    结构体内包含零或多个声明。这些声明可以包括存储型和计算型属性,静态属性,实例方法,静态方法,构造器, +类型别名,甚至其他结构体,类,和枚举声明。结构体声明不能包含析构器或者协议声明。详细讨论和包含多种结构体 +声明的实例,参见类和结构体一节。

    +

    结构体可以包含任意数量的协议,但是不能继承自类,枚举或者其他结构体。

    +

    有三种方法可以创建一个声明过的结构体实例:

    +

    -调用结构体内声明的构造器,参照构造器(initializers)一节。

    +

    —如果没有声明构造器,调用结构体的逐个构造器,详情参见Memberwise Initializers for Structure Types.

    +

    —如果没有声明析构器,结构体的所有属性都有初始值,调用结构体的默认构造器,详情参见默认构造器(Default Initializers).

    +

    结构体的构造过程参见初始化(initiaization)一节。

    +

    结构体实例属性可以用点(.)来获得,详情参见获得属性(Accessing Properties)一节。

    +

    结构体是值类型;结构体的实例在被赋予变量或常量,被函数调用时被复制。获得关于值类型更多信息,参见 +结构体和枚举都是值类型(Structures and Enumerations Are Value Types)一节。

    +

    你可以使用扩展声明来扩展结构体类型的行为,参见扩展声明(Extension Declaration).

    +
    +

    结构体声明语法
    结构体声明特性(Attributes)列表 可选 struct 结构体名称 泛型参数子句 可选 类型继承子句 可选 结构体主体
    结构体名称标识符
    结构体主体{ 声明(Declarations)列表 可选 }

    +
    +

    +

    类声明

    +

    你可以在你的程序中使用类声明来引入一个类。类声明使用关键字class,遵循如下的形式:

    +
    +

    class class name: superclass, adopted protocols {
    declarations
    }

    +
    +

    一个类内包含零或多个声明。这些声明可以包括存储型和计算型属性,实例方法,类方法,构造器,单独的析构器方法, +类型别名,甚至其他结构体,类,和枚举声明。类声明不能包含协议声明。详细讨论和包含多种类声明的实例,参见类和 +结构体一节。

    +

    一个类只能继承一个父类,超类,但是可以包含任意数量的协议。这些超类第一次在type-inheritance-clause出现,遵循任意协议。

    +

    正如在初始化声明(Initializer Declaration)谈及的那样,类可以有指定和方便的构造器。当你声明任一中构造器时, +你可以使用requierd变量来标记构造器,要求任意子类来重写它。指定类的构造器必须初始化类所有的已声明的属性, +它必须在子类构造器调用前被执行。

    +

    类可以重写属性,方法和它的超类的构造器。重写的方法和属性必须以override标注。

    +

    虽然超类的属性和方法声明可以被当前类继承,但是超类声明的指定构造器却不能。这意味着,如果当前类重写了超类 +的所有指定构造器,它就继承了超类的方便构造器。Swift的类并不是继承自一个全局基础类。

    +

    有两种方法来创建已声明的类的实例:

    +
      +
    • 调用类的一个构造器,参见构造器(initializers)。
    • +
    • 如果没有声明构造器,而且类的所有属性都被赋予了初始值,调用类的默认构造器,参见默认构造器(default initializers).
    • +
    +

    类实例属性可以用点(.)来获得,详情参见获得属性(Accessing Properties)一节。

    +

    类是引用类型;当被赋予常量或变量,函数调用时,类的实例是被引用,而不是复制。获得更多关于引用类型的信息, +结构体和枚举都是值类型(Structures and Enumerations Are Value Types)一节。

    +

    你可以使用扩展声明来扩展类的行为,参见扩展声明(Extension Declaration).

    +
    +

    类声明语法
    类声明特性(Attributes)列表 可选 class 类名 泛型参数子句 可选 类型继承子句 可选 类主体
    类名标识符
    类主体{ 声明(Declarations)列表 可选 }

    +
    +

    +

    协议声明(translated by 小一)

    +

    一个协议声明为你的程序引入一个命名了的协议类型。协议声明使用 protocol 关键词来进行声明并有下面这样的形式:

    +
    +

    protocol protocol name: inherited protocols {
    protocol member declarations
    }

    +
    +

    协议的主体包含零或多个协议成员声明,这些成员描述了任何采用该协议必须满足的一致性要求。特别的,一个协议可以声明必须实现某些属性、方法、初始化程序及下标脚本的一致性类型。协议也可以声明专用种类的类型别名,叫做关联类型,它可以指定协议的不同声明之间的关系。协议成员声明会在下面的详情里进行讨论。

    +

    协议类型可以从很多其它协议那继承。当一个协议类型从其它协议那继承的时候,来自其它协议的所有要求就集合了,而且从当前协议继承的任何类型必须符合所有的这些要求。对于如何使用协议继承的例子,查看协议继承

    +
    +

    注意:
    你也可以使用协议合成类型集合多个协议的一致性要求,详情参见协议合成类型协议合成

    +
    +

    你可以通过采用在类型的扩展声明中的协议来为之前声明的类型添加协议一致性。在扩展中你必须实现所有采用协议的要求。如果该类型已经实现了所有的要求,你可以让这个扩展声明的主题留空。

    +

    默认地,符合某一个协议的类型必须实现所有声明在协议中的属性、方法和下标脚本。也就是说,你可以用optional属性标注这些协议成员声明以指定它们的一致性类型实现是可选的。optional属性仅仅可以用于使用objc属性标记过的协议。这样的结果就是仅仅类类型可以采用并符合包含可选成员要求的协议。更多关于如何使用optional属性的信息及如何访问可选协议成员的指导——比如当你不能肯定是否一致性的类型实现了它们——参见可选协议要求

    +

    为了限制协议的采用仅仅针对类类型,需要使用class_protocol属性标记整个协议声明。任意继承自标记有class_protocol属性协议的协议都可以智能地仅能被类类型采用。

    +
    +

    注意:
    如果协议已经用object属性标记了,class_protocol属性就隐性地应用于该协议;没有必要再明确地使用class_protocol属性来标记该协议了。

    +
    +

    协议是命名的类型,因此它们可以以另一个命名类型出现在你代码的所有地方,就像协议类型里讨论的那样。然而你不能构造一个协议的实例,因为协议实际上不提供它们指定的要求的实现。

    +

    你可以使用协议来声明一个类的代理的方法或者应该实现的结构,就像委托(代理)模式描述的那样。

    +
    +

    协议(Protocol)声明语法
    协议声明特性(Attributes)列表 可选 protocol 协议名 类型继承子句 可选 协议主体
    协议名标识符
    协议主体{ 协议成员声明(Declarations)列表 可选 }
    协议成员声明协议属性声明
    协议成员声明协议方法声明
    协议成员声明协议构造器声明
    协议成员声明协议附属脚本声明
    协议成员声明协议关联类型声明
    协议成员声明(Declarations)列表协议成员声明 协议成员声明(Declarations)列表 可选

    +
    +

    +

    协议属性声明

    +

    协议声明了一致性类型必须在协议声明的主体里通过引入一个协议属性声明来实现一个属性。协议属性声明有一种特殊的类型声明形式:

    +
    +

    var property name: type { get set }

    +
    +

    同其它协议成员声明一样,这些属性声明仅仅针对符合该协议的类型声明了gettersetter要求。结果就是你不需要在协议里它被声明的地方实现gettersetter

    +

    gettersetter要求可以通过一致性类型以各种方式满足。如果属性声明包含getset关键词,一致性类型就可以用可读写(实现了gettersetter)的存储型变量属性或计算型属性,但是属性不能以常量属性或只读计算型属性实现。如果属性声明仅仅包含get关键词的话,它可以作为任意类型的属性被实现。比如说实现了协议的属性要求的一致性类型,参见属性要求

    +

    更多参见变量声明

    +
    +

    协议属性声明语法
    协议属性声明变量声明头(Head) 变量名 类型注解 getter-setter关键字(Keyword)块

    +
    +

    协议方法声明

    +

    协议声明了一致性类型必须在协议声明的主体里通过引入一个协议方法声明来实现一个方法. +协议方法声明和函数方法声明有着相同的形式,包含如下两条规则:它们不包括函数体,你不能在类的声明内为它们的 +参数提供初始值.举例来说,符合的类型执行协议必需的方法。参见必需方法一节。

    +

    使用关键字class可以在协议声明中声明一个类或必需的静态方法。执行这些方法的类也用关键字class声明。 +相反的,执行这些方法的结构体必须以关键字static声明。如果你想使用扩展方法,在扩展类时使用class关键字, +在扩展结构体时使用static关键字。

    +

    更多请参阅函数声明。

    +
    +

    协议方法声明语法
    协议方法声明函数头 函数名 泛型参数子句 可选 函数签名(Signature)

    +
    +

    协议构造器声明

    +

    协议声明了一致性类型必须在协议声明的主体里通过引入一个协议构造器声明来实现一个构造器。协议构造器声明 +除了不包含构造器体外,和构造器声明有着相同的形式,

    +

    更多请参阅构造器声明。

    +
    +

    协议构造器声明语法
    协议构造器声明构造器头(Head) 泛型参数子句 可选 参数子句

    +
    +

    协议下标脚本声明

    +

    协议声明了一致性类型必须在协议声明的主体里通过引入一个协议下标脚本声明来实现一个下标脚本。协议属性声明 +对下标脚本声明有一个特殊的形式:

    +
    +

    subscript (parameters) -> return type { get set }

    +
    +

    下标脚本声明只为和协议一致的类型声明了必需的最小数量的的getter和setter。如果下标脚本申明包含get和set关键字, +一致的类型也必须有一个getter和setter语句。如果下标脚本声明值包含get关键字,一致的类型必须至少包含一个 +getter语句,可以选择是否包含setter语句。

    +

    更多参阅下标脚本声明。

    +
    +

    协议附属脚本声明语法
    协议附属脚本声明附属脚本头(Head) 附属脚本结果(Result) getter-setter关键字(Keyword)块

    +
    +

    协议相关类型声明

    +

    协议声明相关类型使用关键字typealias。相关类型为作为协议声明的一部分的类型提供了一个别名。相关类型和参数 +语句中的类型参数很相似,但是它们在声明的协议中包含self关键字。在这些语句中,self指代和协议一致的可能的类型。 +获得更多信息和例子,查看相关类型或类型别名声明。

    +
    +

    协议关联类型声明语法
    协议关联类型声明类型别名头(Head) 类型继承子句 可选 类型别名赋值 可选

    +
    +

    +

    构造器声明

    +

    构造器声明会为程序内的类,结构体或枚举引入构造器。构造器使用关键字Init来声明,遵循两条基本形式。

    +

    结构体,枚举,类可以有任意数量的构造器,但是类的构造器的规则和行为是不一样的。不像结构体和枚举那样,类 +有两种结构体,designed initializers 和convenience initializers,参见构造器一节。

    +

    如下的形式声明了结构体,枚举和类的指定构造器:

    +
    +

    init(parameters) {
    statements
    }

    +
    +

    类的指定构造器将类的所有属性直接初始化。如果类有超类,它不能调用该类的其他构造器,它只能调用超类的一个 +指定构造器。如果该类从它的超类处继承了任何属性,这些属性在当前类内被赋值或修饰时,必须带哦用一个超类的 +指定构造器。

    +

    指定构造器可以在类声明的上下文中声明,因此它不能用扩展声明的方法加入一个类中。

    +

    结构体和枚举的构造器可以带哦用其他的已声明的构造器,来委托其中一个火全部进行初始化过程。

    +

    以关键字convenience来声明一个类的便利构造器:

    +
    +

    convenience init(parameters) {
    statements
    }

    +
    +

    便利构造器可以将初始化过程委托给另一个便利构造器或类的一个指定构造器。这意味着,类的初始化过程必须 +以一个将所有类属性完全初始化的指定构造器的调用作为结束。便利构造器不能调用超类的构造器。

    +

    你可以使用requierd关键字,将便利构造器和指定构造器标记为每个子类的构造器都必须拥有的。因为指定构造器 +不被子类继承,它们必须被立即执行。当子类直接执行所有超类的指定构造器(或使用便利构造器重写指定构造器)时, +必需的便利构造器可以被隐式的执行,亦可以被继承。不像方法,下标脚本那样,你不需要为这些重写的构造器标注 +overrride关键字。

    +

    查看更多关于不同声明方法的构造器的例子,参阅构造过程一节。

    +
    +

    构造器声明语法
    构造器声明构造器头(Head) 泛型参数子句 可选 参数子句 构造器主体
    构造器头(Head)特性(Attributes)列表 可选 convenience 可选 init
    构造器主体代码块

    +
    +

    +

    析构声明

    +

    析构声明为类声明了一个析构器。析构器没有参数,遵循如下的格式:

    +
    +

    deinit {
    statements
    }

    +
    +

    当类没有任何语句时将要被释放时,析构器会自动的被调用。析构器在类的声明体内只能被声明一次——但是不能在 +类的扩展声明内,每个类最多只能有一个。

    +

    子类继承了它的超类的析构器,在子类将要被释放时隐式的调用。子类在所有析构器被执行完毕前不会被释放。

    +

    析构器不会被直接调用。

    +

    查看例子和如何在类的声明中使用析构器,参见析构过程一节。

    +
    +

    析构器声明语法
    析构器声明特性(Attributes)列表 可选 deinit 代码块

    +
    +

    +

    扩展声明

    +

    扩展声明用于扩展一个现存的类,结构体,枚举的行为。扩展声明以关键字extension开始,遵循如下的规则:

    +
    +

    extension type: adopted protocols {
    declarations
    }

    +
    +

    一个扩展声明体包括零个或多个声明。这些声明可以包括计算型属性,计算型静态属性,实例方法,静态和类方法,构造器, +下标脚本声明,甚至其他结构体,类,和枚举声明。扩展声明不能包含析构器,协议声明,存储型属性,属性监测器或其他 +的扩展属性。详细讨论和查看包含多种扩展声明的实例,参见扩展一节。

    +

    扩展声明可以向现存的类,结构体,枚举内添加一致的协议。扩展声明不能向一个类中添加继承的类,因此 +type-inheritance-clause是一个只包含协议列表的扩展声明。

    +

    属性,方法,现存类型的构造器不能被它们类型的扩展所重写。

    +

    扩展声明可以包含构造器声明,这意味着,如果你扩展的类型在其他模块中定义,构造器声明必须委托另一个在 +那个模块里声明的构造器来恰当的初始化。

    +
    +

    扩展(Extension)声明语法
    扩展声明extension 类型标识 类型继承子句 可选 extension-body
    extension-body{ 声明(Declarations)列表 可选 }

    +
    +

    +

    下标脚本声明(translated by 林)

    +

    附属脚本用于向特定类型添加附属脚本支持,通常为访问集合,列表和序列的元素时提供语法便利。附属脚本声明使用关键字subscript,声明形式如下:

    +
    +

    subscript (parameter) -> (return type){
    get{
    statements
    }
    set(setter name){
    statements
    }
    }

    +
    +

    附属脚本声明只能在类,结构体,枚举,扩展和协议声明的上下文进行声明。

    +

    变量(parameters)指定一个或多个用于在相关类型的下标脚本中访问元素的索引(例如,表达式object[i]中的i)。尽管用于元素访问的索引可以是任意类型的,但是每个变量必须包含一个用于指定每种索引类型的类型标注。返回类型(return type)指定被访问的元素的类型。

    +

    和计算性属性一样,下标脚本声明支持对访问元素的读写操作。getter用于读取值,setter用于写入值。setter子句是可选的,当仅需要一个getter子句时,可以将二者都忽略且直接返回请求的值即可。也就是说,如果使用了setter子句,就必须使用getter子句。

    +

    setter的名字和封闭的括号是可选的。如果使用了setter名称,它会被当做传给setter的变量的名称。如果不使用setter名称,那么传给setter的变量的名称默认是value。setter名称的类型必须与返回类型(return type)的类型相同。

    +

    可以在下标脚本声明的类型中,可以重载下标脚本,只要变量(parameters)返回类型(return type)与先前的不同即可。此时,必须使用override关键字声明那个被覆盖的下标脚本。(注:好乱啊!到底是重载还是覆盖?!)

    +

    同样可以在协议声明的上下文中声明下标脚本,Protocol Subscript Declaration中有所描述。

    +

    更多关于下标脚本和下标脚本声明的例子,请参考Subscripts

    +
    +

    附属脚本声明语法
    附属脚本声明附属脚本头(Head) 附属脚本结果(Result) 代码块
    附属脚本声明附属脚本头(Head) 附属脚本结果(Result) getter-setter块
    附属脚本声明附属脚本头(Head) 附属脚本结果(Result) getter-setter关键字(Keyword)块
    附属脚本头(Head)特性(Attributes)列表 可选 subscript 参数子句
    附属脚本结果(Result)-> 特性(Attributes)列表 可选 类型

    +
    +

    +

    运算符声明(translated by 林)

    +

    运算符声明会向程序中引入中缀、前缀或后缀运算符,它使用上下文关键字operator声明。 +可以声明三种不同的缀性:中缀、前缀和后缀。操作符的缀性描述了操作符与它的操作数的相对位置。 +运算符声明有三种基本形式,每种缀性各一种。运算符的缀性通过在operator和运算符之间添加上下文关键字infixprefixpostfix来指定。每种形式中,运算符的名字只能包含Operators中定义的运算符字符。

    +

    下面的这种形式声明了一个新的中缀运算符:

    +
    +

    operator infix operator name{
    previewprecedence precedence level
    associativity associativity
    }

    +
    +

    中缀运算符是二元运算符,它可以被置于两个操作数之间,比如表达式1 + 2 中的加法运算符(+)。

    +

    中缀运算符可以可选地指定优先级,结合性,或两者同时指定。

    +

    运算符的优先级可以指定在没有括号包围的情况下,运算符与它的操作数如何紧密绑定的。可以使用上下文关键字precedence优先级(precedence level)一起来指定一个运算符的优先级。优先级可以是0到255之间的任何一个数字(十进制整数);与十进制整数字面量不同的是,它不可以包含任何下划线字符。尽管优先级是一个特定的数字,但它仅用作与另一个运算符比较(大小)。也就是说,一个操作数可以同时被两个运算符使用时,例如2 + 3 * 5,优先级更高的运算符将优先与操作数绑定。

    +

    运算符的结合性可以指定在没有括号包围的情况下,优先级相同的运算符以何种顺序被分组的。可以使用上下文关键字associativity结合性(associativity)一起来指定一个运算符的结合性,其中结合性可以说是上下文关键字leftrightnone中的任何一个。左结合运算符以从左到右的形式分组。例如,减法运算符(-)具有左结合性,因此4 - 5 - 6被以(4 - 5) - 6的形式分组,其结果为-7。 +右结合运算符以从右到左的形式分组,对于设置为none的非结合运算符,它们不以任何形式分组。具有相同优先级的非结合运算符,不可以互相邻接。例如,表达式1 < 2 < 3非法的。

    +

    声明时不指定任何优先级或结合性的中缀运算符,它们的优先级会被初始化为100,结合性被初始化为none

    +

    下面的这种形式声明了一个新的前缀运算符:

    +
    +

    operator prefix operator name{}

    +
    +

    紧跟在操作数前边的前缀运算符(prefix operator)是一元运算符,例如表达式++i中的前缀递增运算符(++)。

    +

    前缀运算符的声明中不指定优先级。前缀运算符是非结合的。

    +

    下面的这种形式声明了一个新的后缀运算符:

    +
    +

    operator postfix operator name{}

    +
    +

    紧跟在操作数后边的后缀运算符(postfix operator)是一元运算符,例如表达式i++中的前缀递增运算符(++)。

    +

    和前缀运算符一样,后缀运算符的声明中不指定优先级。后缀运算符是非结合的。

    +

    声明了一个新的运算符以后,需要声明一个跟这个运算符同名的函数来实现这个运算符。如何实现一个新的运算符,请参考Custom Operators

    +
    +

    运算符声明语法
    运算符声明前置运算符声明 | 后置运算符声明 | 中置运算符声明
    前置运算符声明运算符 prefix 运算符 { }
    后置运算符声明运算符 postfix 运算符 { }
    中置运算符声明运算符 infix 运算符 { 中置运算符属性 可选 }
    中置运算符属性优先级子句 可选 结和性子句 可选
    优先级子句precedence 优先级水平
    优先级水平 → 数值 0 到 255
    结和性子句associativity 结和性
    结和性left | right | none

    +
    + + +
    +
    @@ -601,16 +1139,8 @@
    - - - - - - - - - - + + @@ -628,6 +1158,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/06_Attributes.html b/chapter3/06_Attributes.html index 42dce0ac..70529fb6 100644 --- a/chapter3/06_Attributes.html +++ b/chapter3/06_Attributes.html @@ -1,57 +1,45 @@ - - + - 特性 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,14 +595,25 @@
    -
    +
    -

    特性

    +
    +

    翻译:Hawstein
    校对:numbbbbb, stanzhai

    +
    +

    特性

    +
    +

    本页内容包括:

    +

    特性提供了关于声明和类型的更多信息。在Swift中有两类特性,用于修饰声明的以及用于修饰类型的。例如,required特性,当应用于一个类的指定或便利初始化器声明时,表明它的每个子类都必须实现那个初始化器。再比如noreturn特性,当应用于函数或方法类型时,表明该函数或方法不会返回到它的调用者。

    通过以下方式指定一个特性:符号@后面跟特性名,如果包含参数,则把参数带上:

    -
    @attribute name
    -@attribute name(attribute arguments)
    -

    有些声明特性通过接收参数来指定特性的更多信息以及它是如何修饰一个特定的声明的。这些特性的参数写在小括号内,它们的格式由它们所属的特性来定义。

    +
    +

    @attribute name
    @attribute name(attribute arguments)

    +
    +

    有些声明特性通过接收参数来指定特性的更多信息以及它是如何修饰一个特定的声明的。这些特性的参数写在小括号内,它们的格式由它们所属的特性来定义。

    +

    声明特性

    声明特性只能应用于声明。然而,你也可以将noreturn特性应用于函数或方法类型。

    assignment

    @@ -620,7 +639,7 @@

    该特性用于修饰任意可以在Objective-C中表示的声明,比如,非嵌套类,协议,类和协议中的属性和方法(包含getter和setter),初始化器,析构器,以下下标。objc特性告诉编译器该声明可以在Objective-C代码中使用。

    如果你将objc特性应用于一个类或协议,它也会隐式地应用于那个类或协议的成员。对于标记了objc特性的类,编译器会隐式地为它的子类添加objc特性。标记了objc特性的协议不能继承自没有标记objc的协议。

    objc特性有一个可选的参数,由标记符组成。当你想把objc所修饰的实体以一个不同的名字暴露给Objective-C,你就可以使用这个特性参数。你可以使用这个参数来命名类,协议,方法,getters,setters,以及初始化器。下面的例子把ExampleClassenabled属性的getter暴露给Objective-C,名字是isEnabled,而不是它原来的属性名。

    -
    @objc
    +
    @objc
     class ExampleClass {
         var enabled: Bool {
         @objc(isEnabled) get {
    @@ -628,7 +647,8 @@ class ExampleClass {
         }
         }
     }
    -

    optional

    +
    +

    optional

    用该特性修饰协议的属性,方法或下标成员,表示实现这些成员并不需要一致性类型(conforming type)。

    你只能用optional特性修饰那些标记了objc特性的协议。因此,只有类类型可以adopt和comform to那些包含可选成员需求的协议。更多关于如何使用optional特性以及如何访问可选协议成员的指导,例如,当你不确定一个conforming类型是否实现了它们,请见:可选协议需求

    required

    @@ -637,6 +657,7 @@ class ExampleClass {

    Interface Builder使用的声明特性

    Interface Builder特性是Interface Builder用来与Xcode同步的声明特性。Swift提供了以下的Interface Builder特性:IBActionIBDesignableIBInspectable,以及IBOutlet。这些特性与Objective-C中对应的特性在概念上是相同的。

    IBOutletIBInspectable用于修饰一个类的属性声明;IBAction特性用于修饰一个类的方法声明;IBDesignable用于修饰类的声明。

    +

    类型特性

    类型特性只能用于修饰类型。然而,你也可以用noreturn特性去修饰函数或方法声明。

    auto_closure

    @@ -644,17 +665,7 @@ class ExampleClass {

    noreturn

    该特性用于修饰函数或方法的类型,表明该函数或方法不会返回到它的调用者中去。你也可以用它标记函数或方法的声明,表示函数或方法的相应类型,T,是@noreturn T

    -

    特性的语法 -attribute -> @ attribute-name attribute-argument-clauseopt -attribute-name -> identifier -attribute-argument-clause -> ( balanced-tokensopt ) -attributes -> attribute attributesopt -balanced-tokens -> balanced-token balanced-tokensopt -balanced-token -> ( balanced-tokensopt ) -balanced-token -> [ balanced-tokensopt ] -balanced-token -> { balanced-tokensopt } -balanced-token -> 任意标识符,关键字,字面量,或运算符 -balanced-token -> 任意标点符号,除了(, ), [, ], {, 或 }

    +

    特性语法
    特性@ 特性名 特性参数子句 可选
    特性名标识符
    特性参数子句( 平衡令牌列表 可选 )
    特性(Attributes)列表特色 特性(Attributes)列表 可选
    平衡令牌列表平衡令牌 平衡令牌列表 可选
    平衡令牌( 平衡令牌列表 可选 )
    平衡令牌[ 平衡令牌列表 可选 ]
    平衡令牌{ 平衡令牌列表 可选 }
    平衡令牌任意标识符, 关键字, 字面量或运算符
    平衡令牌任意标点除了(, ), [, ], {, 或 }

    @@ -674,16 +685,8 @@ balanced-token -> 任意标点符号,除了(, ), [, ], {, 或 }

    - - - - - - - - - - + + @@ -701,6 +704,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/07_Patterns.html b/chapter3/07_Patterns.html index 044b3389..1868ea9e 100644 --- a/chapter3/07_Patterns.html +++ b/chapter3/07_Patterns.html @@ -1,57 +1,45 @@ - - + - 模式 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,6 +595,140 @@
    +
    + +
    +

    翻译:honghaoz
    校对:numbbbbb, stanzhai

    +
    +

    模式(Patterns)

    +
    +

    本页内容包括:

    + +

    模式(pattern)代表了单个值或者复合值的结构。例如,元组(1, 2)的结构是逗号分隔的,包含两个元素的列表。因为模式代表一种值的结构,而不是特定的某个值,你可以把模式和各种同类型的值匹配起来。比如,(x, y)可以匹配元组(1, 2),以及任何含两个元素的元组。除了将模式与一个值匹配外,你可以从合成值中提取出部分或全部,然后分别把各个部分和一个常量或变量绑定起来。

    +

    在Swift中,模式出现在变量和常量的声明(在它们的左侧),for-in语句和switch语句(在它们的case标签)中。尽管任何模式都可以出现在switch语句的case标签中,但在其他情况下,只有通配符模式(wildcard pattern),标识符模式(identifier pattern)和包含这两种模式的模式才能出现。

    +

    你可以为通配符模式(wildcard pattern),标识符模式(identifier pattern)和元组模式(tuple pattern)指定类型注释,用来限制这种模式只匹配某种类型的值。

    +
    +

    模式(Patterns) 语法
    模式通配符模式 类型注解 可选
    模式标识符模式 类型注解on) 可选
    模式值绑定模式
    模式元组模式 类型注解 可选
    模式enum-case-pattern
    模式type-casting-pattern
    模式表达式模式

    +
    +

    +

    通配符模式(Wildcard Pattern)

    +

    通配符模式匹配并忽略任何值,包含一个下划线(_)。当你不关心被匹配的值时,可以使用此模式。例如,下面这段代码进行了1...3的循环,并忽略了每次循环的值:

    +
    for _ in 1...3 {
    +    // Do something three times.
    +}
    +
    +
    +

    通配符模式语法
    通配符模式_

    +
    +

    +

    标识符模式(Identifier Pattern)

    +

    标识符模式匹配任何值,并将匹配的值和一个变量或常量绑定起来。例如,在下面的常量申明中,someValue是一个标识符模式,匹配了类型是Int42

    +
    let someValue = 42
    +
    +

    当匹配成功时,42被绑定(赋值)给常量someValue

    +

    当一个变量或常量申明的左边是标识符模式时,此时,标识符模式是隐式的值绑定模式(value-binding pattern)。

    +
    +

    标识符模式语法
    标识符模式标识符

    +
    +

    +

    值绑定模式(Value-Binding Pattern)

    +

    值绑定模式绑定匹配的值到一个变量或常量。当绑定匹配值给常量时,用关键字let,绑定给变量时,用关键之var

    +

    标识符模式包含在值绑定模式中,绑定新的变量或常量到匹配的值。例如,你可以分解一个元组的元素,并把每个元素绑定到相应的标识符模式中。

    +
    let point = (3, 2)
    +switch point {
    +    // Bind x and y to the elements of point.
    +case let (x, y):
    +    println("The point is at (\(x), \(y)).")
    +}
    +// prints "The point is at (3, 2).”
    +
    +

    在上面这个例子中,let将元组模式(x, y)分配到各个标识符模式。因为这种行为,switch语句中case let (x, y):case (let x, let y):匹配的值是一样的。

    +
    +

    值绑定(Value Binding)模式语法
    值绑定模式var 模式 | let 模式

    +
    +

    +

    元组模式(Tuple Pattern)

    +

    元组模式是逗号分隔的列表,包含一个或多个模式,并包含在一对圆括号中。元组模式匹配相应元组类型的值。

    +

    你可以使用类型注释来限制一个元组模式来匹配某种元组类型。例如,在常量申明let (x, y): (Int, Int) = (1, 2)中的元组模式(x, y): (Int, Int),只匹配两个元素都是Int这种类型的元组。如果仅需要限制一个元组模式中的某几个元素,只需要直接对这几个元素提供类型注释即可。例如,在let (x: String, y)中的元组模式,只要某个元组类型是包含两个元素,且第一个元素类型是String,则被匹配。

    +

    当元组模式被用在for-in语句或者变量或常量申明时,它可以包含通配符模式,标识符模式或者其他包含这两种模式的模式。例如,下面这段代码是不正确的,因为(x, 0)中的元素0是一个表达式模式:

    +
    let points = [(0, 0), (1, 0), (1, 1), (2, 0), (2, 1)]
    +// This code isn't valid.
    +for (x, 0) in points {
    +    /* ... */
    +}
    +
    +

    对于只包含一个元素的元组,括号是不起作用的。模式匹配那个单个元素的类型。例如,下面是等效的:

    +
    let a = 2        // a: Int = 2
    +let (a) = 2      // a: Int = 2
    +let (a): Int = 2 // a: Int = 2
    +
    +
    +

    元组模式语法
    元组模式( 元组模式元素列表 可选 )
    元组模式元素列表元组模式元素 | 元组模式元素 , 元组模式元素列表
    元组模式元素模式

    +
    +

    +

    枚举用例模式(Enumeration Case Pattern)

    +

    枚举用例模式匹配现有的枚举类型的某种用例。枚举用例模式仅在switch语句中的case标签中出现。

    +

    如果你准备匹配的枚举用例有任何关联的值,则相应的枚举用例模式必须指定一个包含每个关联值元素的元组模式。关于使用switch语句来匹配包含关联值枚举用例的例子,请参阅Associated Values.

    +
    +

    枚举用例模式语法
    enum-case-pattern类型标识 可选 . 枚举的case名 元组模式 可选

    +
    +

    +

    类型转换模式(Type-Casting Patterns)

    +

    有两种类型转换模式,is模式和as模式。这两种模式均只出现在switch语句中的case标签中。is模式和as模式有以下形式:

    +
    +

    is type
    pattern as type

    +
    +

    is模式匹配一个值,如果这个值的类型在运行时(runtime)和is模式右边的指定类型(或者那个类型的子类)是一致的。is模式和is操作符一样,它们都进行类型转换,但是抛弃了返回的类型。

    +

    as模式匹配一个值,如果这个值的类型在运行时(runtime)和as模式右边的指定类型(或者那个类型的子类)是一致的。一旦匹配成功,匹配的值的类型被转换成as模式左边指定的模式。

    +

    关于使用switch语句来匹配is模式和as模式值的例子,请参阅Type Casting for Any and AnyObject

    +
    +

    类型转换模式语法
    type-casting-patternis模式 | as模式
    is模式is 类型
    as模式模式 as 类型

    +
    +

    +

    表达式模式(Expression Pattern)

    +

    表达式模式代表了一个表达式的值。这个模式只出现在switch语句中的case标签中。

    +

    由表达式模式所代表的表达式用Swift标准库中的~=操作符与输入表达式的值进行比较。如果~=操作符返回true,则匹配成功。默认情况下,~=操作符使用==操作符来比较两个相同类型的值。它也可以匹配一个整数值与一个Range对象中的整数范围,正如下面这个例子所示:

    +
    let point = (1, 2)
    +switch point {
    +case (0, 0):
    +    println("(0, 0) is at the origin.")
    +case (-2...2, -2...2):
    +    println("(\(point.0), \(point.1)) is near the origin.")
    +default:
    +    println("The point is at (\(point.0), \(point.1)).")
    +}
    +// prints "(1, 2) is near the origin.”
    +
    +

    你可以重载~=操作符来提供自定义的表达式行为。例如,你可以重写上面的例子,以实现用字符串表达的点来比较point表达式。

    +
    // Overload the ~= operator to match a string with an integer
    +func ~=(pattern: String, value: Int) -> Bool {
    +    return pattern == "\(value)"
    +}
    +switch point {
    +case ("0", "0"):
    +    println("(0, 0) is at the origin.")
    +case ("-2...2", "-2...2"):
    +    println("(\(point.0), \(point.1)) is near the origin.")
    +default:
    +    println("The point is at (\(point.0), \(point.1)).")
    +}
    +// prints "(1, 2) is near the origin.”
    +
    +
    +

    表达式模式语法
    表达式模式表达式

    +
    + + +
    +
    @@ -601,16 +743,8 @@
    - - - - - - - - - - + + @@ -628,6 +762,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/08_Generic_Parameters_and_Arguments.html b/chapter3/08_Generic_Parameters_and_Arguments.html index 412eb256..a14017b8 100644 --- a/chapter3/08_Generic_Parameters_and_Arguments.html +++ b/chapter3/08_Generic_Parameters_and_Arguments.html @@ -1,57 +1,45 @@ - - + - 泛型参数 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,73 +595,72 @@
    -
    +
    -

    泛型参数

    +
    +

    翻译:fd5788
    校对:yankuangshi, stanzhai

    +
    +

    泛型参数


    本页包含内容:

    本节涉及泛型类型、泛型函数以及泛型构造器的参数,包括形参和实参。声明泛型类型、函数或构造器时,须指定相应的类型参数。类型参数相当于一个占位符,当实例化泛型类型、调用泛型函数或泛型构造器时,就用具体的类型实参替代之。

    关于 Swift 语言的泛型概述,见泛型(第二部分第22章)。

    -

    泛型实参语句

    -

    泛型形参语句指定泛型类型或函数的类型形参,以及这些参数的关联约束和要求。泛型形参语句用尖括号(<>)包住,并且有以下两种声明形式:

    -
    <generic parameter list>
    -<generic parameter list where requirements >
    -

    泛型形参列表中泛型形参用逗号分开,每一个采用以下形式:

    -
    type parameter : constrain
    -

    泛型形参由两部分组成:类型形参及其后的可选约束。类型形参只是占位符类型(如T,U,V,KeyType,ValueType等)的名字而已。你可以在泛型类型、函数的其余部分或者构造器声明,以及函数或构造器的签名中使用它。

    +

    +

    泛型形参子句

    +

    泛型形参子句指定泛型类型或函数的类型形参,以及这些参数的关联约束和要求。泛型形参子句用尖括号(<>)包住,并且有以下两种形式:

    +
    +

    <generic parameter list>
    <generic parameter list where requirements>

    +
    +

    泛型形参列表中泛型形参用逗号分开,每一个采用以下形式:

    +
    +

    type parameter : constrain

    +
    +

    泛型形参由两部分组成:类型形参及其后的可选约束。类型形参只是占位符类型(如T,U,V,KeyType,ValueType等)的名字而已。你可以在泛型类型、函数的其余部分或者构造器声明,以及函数或构造器的签名中使用它。

    约束用于指明该类型形参继承自某个类或者遵守某个协议或协议的一部分。例如,在下面的泛型中,泛型形参T: Comparable表示任何用于替代类型形参T的类型实参必须满足Comparable协议。

    -
    func simpleMin<T: COmparable>(x: T, y: T) -> T {
    +
    func simpleMin<T: COmparable>(x: T, y: T) -> T {
         if x < y {
             return y
         }
         return x
     }
    -

    如,IntDouble均满足Comparable协议,该函数接受任何一种类型。与泛型类型相反,调用泛型函数或构造器时不需要指定泛型实参语句。类型实参由传递给函数或构造器的实参推断而出。

    -
    simpleMin(17, 42) // T is inferred to be Int
    +
    +

    如,IntDouble均满足Comparable协议,该函数接受任何一种类型。与泛型类型相反,调用泛型函数或构造器时不需要指定泛型实参子句。类型实参由传递给函数或构造器的实参推断而出。

    +
    simpleMin(17, 42) // T is inferred to be Int
     simpleMin(3.14159, 2.71828) // T is inferred to be Double
    -

    Where语句

    -

    要想对类型形参及其关联类型指定额外要求,可以在泛型形参列表之后添加where语句。where语句由关键字where及其后的用逗号分割的多个要求组成。

    -

    where语句中的要求用于指明该类型形参继承自某个类或遵守某个协议或协议的一部分。尽管where语句有助于表达类型形参上的简单约束(如T: Comparable等同于T where T: Comparable,等等),但是依然可以用来对类型形参及其关联约束提供更复杂的约束。如,<T where T: C, T: P>表示泛型类型T继承自类C且遵守协议P

    +
    +

    Where 子句

    +

    要想对类型形参及其关联类型指定额外要求,可以在泛型形参列表之后添加where子句。where子句由关键字where及其后的用逗号分割的多个要求组成。

    +

    where子句中的要求用于指明该类型形参继承自某个类或遵守某个协议或协议的一部分。尽管where子句有助于表达类型形参上的简单约束(如T: Comparable等同于T where T: Comparable,等等),但是依然可以用来对类型形参及其关联约束提供更复杂的约束。如,<T where T: C, T: P>表示泛型类型T继承自类C且遵守协议P

    如上所述,可以强制约束类型形参的关联类型遵守某个协议。<T: Generator where T.Element: Equatable>表示T遵守Generator协议,而且T的关联类型T.Element遵守Eauatable协议(T有关联类型是因为Generator声明了Element,而T遵守Generator协议)。

    也可以用操作符==来指定两个类型等效的要求。例如,有这样一个约束:TU遵守Generator协议,同时要求它们的关联类型等同,可以这样来表达:<T: Generator, U: Generator where T.Element == U.Element>

    当然,替代类型形参的类型实参必须满足所有类型形参所要求的约束和要求。

    -

    泛型函数或构造器可以重载,但在泛型形参语句中的类型形参必须有不同的约束或要求,抑或二者皆不同。当调用重载的泛型函数或构造器时,编译器会用这些约束来决定调用哪个重载函数或构造器。

    +

    泛型函数或构造器可以重载,但在泛型形参子句中的类型形参必须有不同的约束或要求,抑或二者皆不同。当调用重载的泛型函数或构造器时,编译器会用这些约束来决定调用哪个重载函数或构造器。

    泛型类可以生成一个子类,但是这个子类也必须是泛型类。

    -

    Grammar of a generic parameter clause

    -

    parameter-clause → <­generic-parameter-list­requirement-clause >

    -

    ­generic-parameter-list → generic-parameter­ generic-parameter­,­generic-parameter-list ­

    -

    generic-parameter → type-name­

    -

    generic-parameter → type-name­:­type-identifier­

    -

    generic-parameter → type-name­:­protocol-composition-type­

    -

    requirement-clause → where­requirement-list­

    -

    requirement-list → requirement­ requirement­,­requirement-list­

    -

    requirement → conformance-requirement­ same-type-requirement­

    -

    conformance-requirement → type-identifier­:­type-identifier­

    -

    conformance-requirement → type-identifier­:­protocol-composition-type­

    -

    same-type-requirement → type-identifier­==­type-identifier

    +

    泛型形参子句语法
    泛型参数子句< 泛型参数列表 约束子句 可选 >
    泛型参数列表泛形参数 | 泛形参数 , 泛型参数列表
    泛形参数类型名称
    泛形参数类型名称 : 类型标识
    泛形参数类型名称 : 协议合成类型
    约束子句where 约束列表
    约束列表约束 | 约束 , 约束列表
    约束一致性约束 | 同类型约束
    一致性约束类型标识 : 类型标识
    一致性约束类型标识 : 协议合成类型
    同类型约束类型标识 == 类型标识

    -

    泛型实参语句

    -

    泛型实参语句指定泛型类型的类型实参。泛型实参语句用尖括号(<>)包住,并且按如下形式声明:

    -
    < generic argument list >
    -

    泛型实参列表中类型实参有逗号分开。类型实参是实际具体类型的名字,用来替代泛型类型的泛型形参语句中的相应的类型形参。从而得到泛型类型的一个特化版本。如,Swift标准库的泛型字典类型定义如下:

    -
      struct Dictionary<KeyTypel: Hashable, ValueType>: Collection,
    -DictionaryLiteralConvertible {
    +

    +

    泛型实参子句

    +

    泛型实参子句指定泛型类型的类型实参。泛型实参子句用尖括号(<>)包住,形式如下:

    +
    +

    <generic argument list>

    +
    +

    泛型实参列表中类型实参有逗号分开。类型实参是实际具体类型的名字,用来替代泛型类型的泛型形参子句中的相应的类型形参。从而得到泛型类型的一个特化版本。如,Swift标准库的泛型字典类型定义如下:

    +
    struct Dictionary<KeyTypel: Hashable, ValueType>: Collection, DictionaryLiteralConvertible {
         /* .. */
     }
    -

    泛型Dictionary类型的特化版本,Dictionary<String, Int>就是用具体的StringInt类型替代泛型类型KeyType: HashableValueType产生的。每一个类型实参必须满足它所替代的泛型形参的所有约束,包括任何where语句所指定的额外的要求。上面的例子中,类型形参KeyType要求满足Hashable协议,因此String也必须满足Hashable协议。

    +
    +

    泛型Dictionary类型的特化版本,Dictionary<String, Int>就是用具体的StringInt类型替代泛型类型KeyType: HashableValueType产生的。每一个类型实参必须满足它所替代的泛型形参的所有约束,包括任何where子句所指定的额外的要求。上面的例子中,类型形参KeyType要求满足Hashable协议,因此String也必须满足Hashable协议。

    可以用本身就是泛型类型的特化版本的类型实参替代类型形参(假设已满足合适的约束和要求)。例如,为了生成一个元素类型是整型数组的数组,可以用数组的特化版本Array<Int>替代泛型类型Array<T>的类型形参T来实现。

    -
    let arrayOfArrays: Array<Array<Int>> = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
    -

    泛型形参语句一样,不能用泛型实参语句来指定泛型函数或构造器的类型实参。

    +
    let arrayOfArrays: Array<Array<Int>> = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
    +
    +

    泛型形参子句所述,不能用泛型实参子句来指定泛型函数或构造器的类型实参。

    -

    Grammar of a generic argument clause

    -

    generic-argument-clause → <­generic-argument-list­>­

    -

    generic-argument-list → generic-argument­ generic-argument­,­generic-argument-list­

    -

    generic-argument → type

    +

    泛型实参子句语法
    (泛型参数子句Generic Argument Clause)< 泛型参数列表 >
    泛型参数列表泛型参数 | 泛型参数 , 泛型参数列表
    泛型参数类型

    @@ -673,16 +680,8 @@ DictionaryLiteralConvertible {
    - - - - - - - - - - + + @@ -700,6 +699,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/09_Summary_of_the_Grammar.html b/chapter3/09_Summary_of_the_Grammar.html index 11dc97fc..108e932a 100644 --- a/chapter3/09_Summary_of_the_Grammar.html +++ b/chapter3/09_Summary_of_the_Grammar.html @@ -1,55 +1,43 @@ - - + - 语法总结 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + - - - + -
    +
    @@ -109,15 +100,32 @@
    @@ -518,7 +526,7 @@ - + @@ -585,6 +593,468 @@
    +
    + +
    +

    翻译:stanzhai
    校对:xielingwang

    +
    +

    语法总结

    +
    +

    本页包含内容:

    + +

    +

    语句

    +
    +

    语句语法
    语句表达式 ; 可选
    语句声明 ; 可选
    语句循环语句 ; 可选
    语句分支语句 ; 可选
    语句标记语句(Labeled Statement)
    语句控制转移语句 ; 可选
    多条语句(Statements)语句 多条语句(Statements) 可选

    +
    + + +
    +

    循环语句语法
    循环语句for语句
    循环语句for-in语句
    循环语句while语句
    循环语句do-while语句

    +
    + + +
    +

    For 循环语法
    for语句for for初始条件 可选 ; 表达式 可选 ; 表达式 可选 代码块
    for语句for ( for初始条件 可选 ; 表达式 可选 ; 表达式 可选 ) 代码块
    for初始条件变量声明 | 表达式列表

    +
    + + +
    +

    For-In 循环语法
    for-in语句for 模式 in 表达式 代码块

    +
    + + +
    +

    While 循环语法
    while语句while while条件 代码块
    while条件表达式 | 声明

    +
    + + +
    +

    Do-While 循环语法
    do-while语句do 代码块 while while条件

    +
    + + +
    +

    分支语句语法
    分支语句if语句
    分支语句switch语句

    +
    + + +
    +

    If语句语法
    if语句if if条件 代码块 else子句(Clause) 可选
    if条件表达式 | 声明
    else子句(Clause)else 代码块 | else if语句

    +
    + + +
    +

    Switch语句语法
    switch语句switch 表达式 { SwitchCase列表 可选 }
    SwitchCase列表SwitchCase SwitchCase列表 可选
    SwitchCasecase标签 多条语句(Statements) | default标签 多条语句(Statements)
    SwitchCasecase标签 ; | default标签 ;
    case标签case case项列表 :
    case项列表模式 guard-clause 可选 | 模式 guard-clause 可选 , case项列表
    default标签default :
    guard-clausewhere guard-expression
    guard-expression表达式

    +
    + + +
    +

    标记语句语法
    标记语句(Labeled Statement)语句标签 循环语句 | 语句标签 switch语句
    语句标签标签名称 :
    标签名称标识符

    +
    + + +
    +

    控制传递语句(Control Transfer Statement) 语法
    控制传递语句break语句
    控制传递语句continue语句
    控制传递语句fallthrough语句
    控制传递语句return语句

    +
    + + +
    +

    Break 语句语法
    break语句break 标签名称 可选

    +
    + + +
    +

    Continue 语句语法
    continue语句continue 标签名称 可选

    +
    + + +
    +

    Fallthrough 语句语法
    fallthrough语句fallthrough

    +
    + + +
    +

    Return 语句语法
    return语句return 表达式 可选

    +
    +

    +

    泛型参数

    +
    +

    泛型形参子句(Generic Parameter Clause) 语法
    泛型参数子句< 泛型参数列表 约束子句 可选 >
    泛型参数列表泛形参数 | 泛形参数 , 泛型参数列表
    泛形参数类型名称
    泛形参数类型名称 : 类型标识
    泛形参数类型名称 : 协议合成类型
    约束子句where 约束列表
    约束列表约束 | 约束 , 约束列表
    约束一致性约束 | 同类型约束
    一致性约束类型标识 : 类型标识
    一致性约束类型标识 : 协议合成类型
    同类型约束类型标识 == 类型标识

    +
    + + +
    +

    泛型实参子句语法
    (泛型参数子句Generic Argument Clause)< 泛型参数列表 >
    泛型参数列表泛型参数 | 泛型参数 , 泛型参数列表
    泛型参数类型

    +
    +

    +

    声明 (Declarations)

    +
    +

    声明语法
    声明导入声明
    声明常量声明
    声明变量声明
    声明类型别名声明
    声明函数声明
    声明枚举声明
    声明结构体声明
    声明类声明
    声明协议声明
    声明构造器声明
    声明析构器声明
    声明扩展声明
    声明下标脚本声明
    声明运算符声明
    声明(Declarations)列表声明 声明(Declarations)列表 可选
    声明描述符(Specifiers)列表声明描述符(Specifier) 声明描述符(Specifiers)列表 可选
    声明描述符(Specifier)class | mutating | nonmutating | override | static | unowned | unowned(safe) | unowned(unsafe) | weak

    +
    + + +
    +

    顶级(Top Level) 声明语法
    顶级声明多条语句(Statements) 可选

    +
    + + +
    +

    代码块语法
    代码块{ 多条语句(Statements) 可选 }

    +
    + + +
    +

    导入(Import)声明语法
    导入声明特性(Attributes)列表 可选 import 导入类型 可选 导入路径
    导入类型typealias | struct | class | enum | protocol | var | func
    导入路径导入路径标识符 | 导入路径标识符 . 导入路径
    导入路径标识符标识符 | 运算符

    +
    + + +
    +

    常数声明语法
    常量声明特性(Attributes)列表 可选 声明描述符(Specifiers)列表 可选 let 模式构造器列表
    模式构造器列表模式构造器 | 模式构造器 , 模式构造器列表
    模式构造器模式 构造器 可选
    构造器= 表达式

    +
    + + +
    +

    变量声明语法
    变量声明变量声明头(Head) 模式构造器列表
    变量声明变量声明头(Head) 变量名 类型注解 代码块
    变量声明变量声明头(Head) 变量名 类型注解 getter-setter块
    变量声明变量声明头(Head) 变量名 类型注解 getter-setter关键字(Keyword)块
    变量声明变量声明头(Head) 变量名 类型注解 构造器 可选 willSet-didSet代码块
    变量声明头(Head)特性(Attributes)列表 可选 声明描述符(Specifiers)列表 可选 var
    变量名称标识符
    getter-setter块{ getter子句 setter子句 可选 }
    getter-setter块{ setter子句 getter子句 }
    getter子句特性(Attributes)列表 可选 get 代码块
    setter子句特性(Attributes)列表 可选 set setter名称 可选 代码块
    setter名称( 标识符 )
    getter-setter关键字(Keyword)块{ getter关键字(Keyword)子句 setter关键字(Keyword)子句 可选 }
    getter-setter关键字(Keyword)块{ setter关键字(Keyword)子句 getter关键字(Keyword)子句 }
    getter关键字(Keyword)子句特性(Attributes)列表 可选 get
    setter关键字(Keyword)子句特性(Attributes)列表 可选 set
    willSet-didSet代码块{ willSet子句 didSet子句 可选 }
    willSet-didSet代码块{ didSet子句 willSet子句 }
    willSet子句特性(Attributes)列表 可选 willSet setter名称 可选 代码块
    didSet子句特性(Attributes)列表 可选 didSet setter名称 可选 代码块

    +
    + + +
    +

    类型别名声明语法
    类型别名声明类型别名头(Head) 类型别名赋值
    类型别名头(Head)typealias 类型别名名称
    类型别名名称标识符
    类型别名赋值= 类型

    +
    + + +
    +

    函数声明语法
    函数声明函数头 函数名 泛型参数子句 可选 函数签名(Signature) 函数体
    函数头特性(Attributes)列表 可选 声明描述符(Specifiers)列表 可选 func
    函数名标识符 | 运算符
    函数签名(Signature)parameter-clauses 函数结果 可选
    函数结果-> 特性(Attributes)列表 可选 类型
    函数体代码块
    parameter-clauses参数子句 parameter-clauses 可选
    参数子句( ) | ( 参数列表 ... 可选 )
    参数列表参数 | 参数 , 参数列表
    参数inout 可选 let 可选 # 可选 参数名 本地参数名 可选 类型注解 默认参数子句 可选
    参数inout 可选 var # 可选 参数名 本地参数名 可选 类型注解 默认参数子句 可选
    参数特性(Attributes)列表 可选 类型
    参数名标识符 | _
    本地参数名标识符 | _
    默认参数子句= 表达式

    +
    + + +
    +

    枚举声明语法
    枚举声明特性(Attributes)列表 可选 联合式枚举 | 特性(Attributes)列表 可选 原始值式枚举
    联合式枚举枚举名 泛型参数子句 可选 { union-style-enum-members 可选 }
    union-style-enum-membersunion-style-enum-member union-style-enum-members 可选
    union-style-enum-member声明 | 联合式(Union Style)的枚举case子句
    联合式(Union Style)的枚举case子句特性(Attributes)列表 可选 case 联合式(Union Style)的枚举case列表
    联合式(Union Style)的枚举case列表联合式(Union Style)的case | 联合式(Union Style)的case , 联合式(Union Style)的枚举case列表
    联合式(Union Style)的case枚举的case名 元组类型 可选
    枚举名标识符
    枚举的case名标识符
    原始值式枚举枚举名 泛型参数子句 可选 : 类型标识 { 原始值式枚举成员列表 可选 }
    原始值式枚举成员列表原始值式枚举成员 原始值式枚举成员列表 可选
    原始值式枚举成员声明 | 原始值式枚举case子句
    原始值式枚举case子句特性(Attributes)列表 可选 case 原始值式枚举case列表
    原始值式枚举case列表原始值式枚举case | 原始值式枚举case , 原始值式枚举case列表
    原始值式枚举case枚举的case名 原始值赋值 可选
    原始值赋值= 字面量

    +
    + + +
    +

    结构体声明语法
    结构体声明特性(Attributes)列表 可选 struct 结构体名称 泛型参数子句 可选 类型继承子句 可选 结构体主体
    结构体名称标识符
    结构体主体{ 声明(Declarations)列表 可选 }

    +
    + + +
    +

    类声明语法
    类声明特性(Attributes)列表 可选 class 类名 泛型参数子句 可选 类型继承子句 可选 类主体
    类名标识符
    类主体{ 声明(Declarations)列表 可选 }

    +
    + + +
    +

    协议(Protocol)声明语法
    协议声明特性(Attributes)列表 可选 protocol 协议名 类型继承子句 可选 协议主体
    协议名标识符
    协议主体{ 协议成员声明(Declarations)列表 可选 }
    协议成员声明协议属性声明
    协议成员声明协议方法声明
    协议成员声明协议构造器声明
    协议成员声明协议下标脚本声明
    协议成员声明协议关联类型声明
    协议成员声明(Declarations)列表协议成员声明 协议成员声明(Declarations)列表 可选

    +
    + + +
    +

    协议属性声明语法
    协议属性声明变量声明头(Head) 变量名 类型注解 getter-setter关键字(Keyword)块

    +
    + + +
    +

    协议方法声明语法
    协议方法声明函数头 函数名 泛型参数子句 可选 函数签名(Signature)

    +
    + + +
    +

    协议构造器声明语法
    协议构造器声明构造器头(Head) 泛型参数子句 可选 参数子句

    +
    + + +
    +

    协议下标脚本声明语法
    协议下标脚本声明下标脚本头(Head) 下标脚本结果(Result) getter-setter关键字(Keyword)块

    +
    + + +
    +

    协议关联类型声明语法
    协议关联类型声明类型别名头(Head) 类型继承子句 可选 类型别名赋值 可选

    +
    + + +
    +

    构造器声明语法
    构造器声明构造器头(Head) 泛型参数子句 可选 参数子句 构造器主体
    构造器头(Head)特性(Attributes)列表 可选 convenience 可选 init
    构造器主体代码块

    +
    + + +
    +

    析构器声明语法
    析构器声明特性(Attributes)列表 可选 deinit 代码块

    +
    + + +
    +

    扩展(Extension)声明语法
    扩展声明extension 类型标识 类型继承子句 可选 extension-body
    extension-body{ 声明(Declarations)列表 可选 }

    +
    + + +
    +

    下标脚本声明语法
    下标脚本声明下标脚本头(Head) 下标脚本结果(Result) 代码块
    下标脚本声明下标脚本头(Head) 下标脚本结果(Result) getter-setter块
    下标脚本声明下标脚本头(Head) 下标脚本结果(Result) getter-setter关键字(Keyword)块
    下标脚本头(Head)特性(Attributes)列表 可选 subscript 参数子句
    下标脚本结果(Result)-> 特性(Attributes)列表 可选 类型

    +
    + + +
    +

    运算符声明语法
    运算符声明前置运算符声明 | 后置运算符声明 | 中置运算符声明
    前置运算符声明运算符 prefix 运算符 { }
    后置运算符声明运算符 postfix 运算符 { }
    中置运算符声明运算符 infix 运算符 { 中置运算符属性 可选 }
    中置运算符属性优先级子句 可选 结和性子句 可选
    优先级子句precedence 优先级水平
    优先级水平 → 数值 0 到 255
    结和性子句associativity 结和性
    结和性left | right | none

    +
    +

    +

    模式

    +
    +

    模式(Patterns) 语法
    模式通配符模式 类型注解 可选
    模式标识符模式 类型注解on) 可选
    模式值绑定模式
    模式元组模式 类型注解 可选
    模式enum-case-pattern
    模式type-casting-pattern
    模式表达式模式

    +
    + + +
    +

    通配符模式语法
    通配符模式_

    +
    + + +
    +

    标识符模式语法
    标识符模式标识符

    +
    + + +
    +

    值绑定(Value Binding)模式语法
    值绑定模式var 模式 | let 模式

    +
    + + +
    +

    元组模式语法
    元组模式( 元组模式元素列表 可选 )
    元组模式元素列表元组模式元素 | 元组模式元素 , 元组模式元素列表
    元组模式元素模式

    +
    + + +
    +

    枚举用例模式语法
    enum-case-pattern类型标识 可选 . 枚举的case名 元组模式 可选

    +
    + + +
    +

    类型转换模式语法
    type-casting-patternis模式 | as模式
    is模式is 类型
    as模式模式 as 类型

    +
    + + +
    +

    表达式模式语法
    表达式模式表达式

    +
    +

    +

    特性

    +
    +

    特性语法
    特色@ 特性名 特性参数子句 可选
    特性名标识符
    特性参数子句( 平衡令牌列表 可选 )
    特性(Attributes)列表特色 特性(Attributes)列表 可选
    平衡令牌列表平衡令牌 平衡令牌列表 可选
    平衡令牌( 平衡令牌列表 可选 )
    平衡令牌[ 平衡令牌列表 可选 ]
    平衡令牌{ 平衡令牌列表 可选 }
    平衡令牌任意标识符, 关键字, 字面量或运算符
    平衡令牌任意标点除了(, ), [, ], {, 或 }

    +
    +

    +

    表达式

    +
    +

    表达式语法
    表达式前置表达式 二元表达式列表 可选
    表达式列表表达式 | 表达式 , 表达式列表

    +
    + + +
    +

    前置表达式语法
    前置表达式前置运算符 可选 后置表达式
    前置表达式写入写出(in-out)表达式
    写入写出(in-out)表达式& 标识符

    +
    + + +
    +

    二元表达式语法
    二元表达式二元运算符 前置表达式
    二元表达式赋值运算符 前置表达式
    二元表达式条件运算符 前置表达式
    二元表达式类型转换运算符
    二元表达式列表二元表达式 二元表达式列表 可选

    +
    + + +
    +

    赋值运算符语法
    赋值运算符=

    +
    + + +
    +

    三元条件运算符语法
    三元条件运算符? 表达式 :

    +
    + + +
    +

    类型转换运算符语法
    类型转换运算符is 类型 | as ? 可选 类型

    +
    + + +
    +

    主表达式语法
    主表达式标识符 泛型参数子句 可选
    主表达式字面量表达式
    主表达式self表达式
    主表达式超类表达式
    主表达式闭包表达式
    主表达式圆括号表达式
    主表达式隐式成员表达式
    主表达式通配符表达式

    +
    + + +
    +

    字面量表达式语法
    字面量表达式字面量
    字面量表达式数组字面量 | 字典字面量
    字面量表达式__FILE__ | __LINE__ | __COLUMN__ | __FUNCTION__
    数组字面量[ 数组字面量项列表 可选 ]
    数组字面量项列表数组字面量项 , 可选 | 数组字面量项 , 数组字面量项列表
    数组字面量项表达式
    字典字面量[ 字典字面量项列表 ] | [ : ]
    字典字面量项列表字典字面量项 , 可选 | 字典字面量项 , 字典字面量项列表
    字典字面量项表达式 : 表达式

    +
    + + +
    +

    Self 表达式语法
    self表达式self
    self表达式self . 标识符
    self表达式self [ 表达式 ]
    self表达式self . init

    +
    + + +
    +

    超类表达式语法
    超类表达式超类方法表达式 | 超类下标表达式 | 超类构造器表达式
    超类方法表达式super . 标识符
    超类下标表达式super [ 表达式 ]
    超类构造器表达式super . init

    +
    + + +
    +

    闭包表达式语法
    闭包表达式{ 闭包签名(Signational) 可选 多条语句(Statements) }
    闭包签名(Signational)参数子句 函数结果 可选 in
    闭包签名(Signational)标识符列表 函数结果 可选 in
    闭包签名(Signational)捕获(Capature)列表 参数子句 函数结果 可选 in
    闭包签名(Signational)捕获(Capature)列表 标识符列表 函数结果 可选 in
    闭包签名(Signational)捕获(Capature)列表 in
    捕获(Capature)列表[ 捕获(Capature)说明符 表达式 ]
    捕获(Capature)说明符weak | unowned | unowned(safe) | unowned(unsafe)

    +
    + + +
    +

    隐式成员表达式语法
    隐式成员表达式. 标识符

    +
    + + +
    +

    圆括号表达式(Parenthesized Expression)语法
    圆括号表达式( 表达式元素列表 可选 )
    表达式元素列表表达式元素 | 表达式元素 , 表达式元素列表
    表达式元素表达式 | 标识符 : 表达式

    +
    + + +
    +

    通配符表达式语法
    通配符表达式_

    +
    + + +
    +

    后置表达式语法
    后置表达式主表达式
    后置表达式后置表达式 后置运算符
    后置表达式函数调用表达式
    后置表达式构造器表达式
    后置表达式显示成员表达式
    后置表达式后置self表达式
    后置表达式动态类型表达式
    后置表达式下标表达式
    后置表达式强制取值(Forced Value)表达式
    后置表达式可选链(Optional Chaining)表达式

    +
    + + +
    +

    函数调用表达式语法
    函数调用表达式后置表达式 圆括号表达式
    函数调用表达式后置表达式 圆括号表达式 可选 后置闭包(Trailing Closure)
    后置闭包(Trailing Closure)闭包表达式

    +
    + + +
    +

    构造器表达式语法
    构造器表达式后置表达式 . init

    +
    + + +
    +

    显式成员表达式语法
    显示成员表达式后置表达式 . 十进制数字
    显示成员表达式后置表达式 . 标识符 泛型参数子句 可选

    +
    + + +
    +

    后置Self 表达式语法
    后置self表达式后置表达式 . self

    +
    + + +
    +

    动态类型表达式语法
    动态类型表达式后置表达式 . dynamicType

    +
    + + +
    +

    附属脚本表达式语法
    附属脚本表达式后置表达式 [ 表达式列表 ]

    +
    + + +
    +

    强制取值(Forced Value)语法
    强制取值(Forced Value)表达式后置表达式 !

    +
    + + +
    +

    可选链表达式语法
    可选链表达式后置表达式 ?

    +
    +

    +

    词法结构

    +
    +

    标识符语法
    标识符标识符头(Head) 标识符字符列表 可选
    标识符` 标识符头(Head) 标识符字符列表 可选 `
    标识符隐式参数名
    标识符列表标识符 | 标识符 , 标识符列表
    标识符头(Head) → Upper- or lowercase letter A through Z
    标识符头(Head) → U+00A8, U+00AA, U+00AD, U+00AF, U+00B2–U+00B5, or U+00B7–U+00BA
    标识符头(Head) → U+00BC–U+00BE, U+00C0–U+00D6, U+00D8–U+00F6, or U+00F8–U+00FF
    标识符头(Head) → U+0100–U+02FF, U+0370–U+167F, U+1681–U+180D, or U+180F–U+1DBF
    标识符头(Head) → U+1E00–U+1FFF
    标识符头(Head) → U+200B–U+200D, U+202A–U+202E, U+203F–U+2040, U+2054, or U+2060–U+206F
    标识符头(Head) → U+2070–U+20CF, U+2100–U+218F, U+2460–U+24FF, or U+2776–U+2793
    标识符头(Head) → U+2C00–U+2DFF or U+2E80–U+2FFF
    标识符头(Head) → U+3004–U+3007, U+3021–U+302F, U+3031–U+303F, or U+3040–U+D7FF
    标识符头(Head) → U+F900–U+FD3D, U+FD40–U+FDCF, U+FDF0–U+FE1F, or U+FE30–U+FE44
    标识符头(Head) → U+FE47–U+FFFD
    标识符头(Head) → U+10000–U+1FFFD, U+20000–U+2FFFD, U+30000–U+3FFFD, or U+40000–U+4FFFD
    标识符头(Head) → U+50000–U+5FFFD, U+60000–U+6FFFD, U+70000–U+7FFFD, or U+80000–U+8FFFD
    标识符头(Head) → U+90000–U+9FFFD, U+A0000–U+AFFFD, U+B0000–U+BFFFD, or U+C0000–U+CFFFD
    标识符头(Head) → U+D0000–U+DFFFD or U+E0000–U+EFFFD
    标识符字符 → 数值 0 到 9
    标识符字符 → U+0300–U+036F, U+1DC0–U+1DFF, U+20D0–U+20FF, or U+FE20–U+FE2F
    标识符字符标识符头(Head)
    标识符字符列表标识符字符 标识符字符列表 可选
    隐式参数名$ 十进制数字列表

    +
    + + +
    +

    字面量语法
    字面量整型字面量 | 浮点数字面量 | 字符串字面量

    +
    + + +
    +

    整型字面量语法
    整型字面量二进制字面量
    整型字面量八进制字面量
    整型字面量十进制字面量
    整型字面量十六进制字面量
    二进制字面量0b 二进制数字 二进制字面量字符列表 可选
    二进制数字 → 数值 0 到 1
    二进制字面量字符二进制数字 | _
    二进制字面量字符列表二进制字面量字符 二进制字面量字符列表 可选
    八进制字面量0o 八进字数字 八进制字符列表 可选
    八进字数字 → 数值 0 到 7
    八进制字符八进字数字 | _
    八进制字符列表八进制字符 八进制字符列表 可选
    十进制字面量十进制数字 十进制字符列表 可选
    十进制数字 → 数值 0 到 9
    十进制数字列表十进制数字 十进制数字列表 可选
    十进制字符十进制数字 | _
    十进制字符列表十进制字符 十进制字符列表 可选
    十六进制字面量0x 十六进制数字 十六进制字面量字符列表 可选
    十六进制数字 → 数值 0 到 9, a through f, or A through F
    十六进制字符十六进制数字 | _
    十六进制字面量字符列表十六进制字符 十六进制字面量字符列表 可选

    +
    + + +
    +

    浮点型字面量语法
    浮点数字面量十进制字面量 十进制分数 可选 十进制指数 可选
    浮点数字面量十六进制字面量 十六进制分数 可选 十六进制指数
    十进制分数. 十进制字面量
    十进制指数浮点数e 正负号 可选 十进制字面量
    十六进制分数. 十六进制字面量 可选
    十六进制指数浮点数p 正负号 可选 十六进制字面量
    浮点数ee | E
    浮点数pp | P
    正负号+ | -

    +
    + + +
    +

    字符型字面量语法
    字符串字面量" 引用文本 "
    引用文本引用文本条目 引用文本 可选
    引用文本条目转义字符
    引用文本条目( 表达式 )
    引用文本条目 → 除了"­, \­, U+000A, or U+000D的所有Unicode的字符
    转义字符\0 | \ | \t | \n | \r | \" | \'
    转义字符\x 十六进制数字 十六进制数字
    转义字符\u 十六进制数字 十六进制数字 十六进制数字 十六进制数字
    转义字符\U 十六进制数字 十六进制数字 十六进制数字 十六进制数字 十六进制数字 十六进制数字 十六进制数字 十六进制数字

    +
    + + +
    +

    运算符语法语法
    运算符运算符字符 运算符 可选
    运算符字符/ | = | - | + | ! | * | % | < | > | & | | | ^ | ~ | .
    二元运算符运算符
    前置运算符运算符
    后置运算符运算符

    +
    +

    +

    类型

    +
    +

    类型语法
    类型数组类型 | 函数类型 | 类型标识 | 元组类型 | 可选类型 | 隐式解析可选类型 | 协议合成类型 | 元型类型

    +
    + + +
    +

    类型注解语法
    类型注解: 特性(Attributes)列表 可选 类型

    +
    + + +
    +

    类型标识语法
    类型标识类型名称 泛型参数子句 可选 | 类型名称 泛型参数子句 可选 . 类型标识
    类名标识符

    +
    + + +
    +

    元组类型语法
    元组类型( 元组类型主体 可选 )
    元组类型主体元组类型的元素列表 ... 可选
    元组类型的元素列表元组类型的元素 | 元组类型的元素 , 元组类型的元素列表
    元组类型的元素特性(Attributes)列表 可选 inout 可选 类型 | inout 可选 元素名 类型注解
    元素名标识符

    +
    + + +
    +

    函数类型语法
    函数类型类型 -> 类型

    +
    + + +
    +

    数组类型语法
    数组类型类型 [ ] | 数组类型 [ ]

    +
    + + +
    +

    可选类型语法
    可选类型类型 ?

    +
    + + +
    +

    隐式解析可选类型(Implicitly Unwrapped Optional Type)语法
    隐式解析可选类型类型 !

    +
    + + +
    +

    协议合成类型语法
    协议合成类型protocol < 协议标识符列表 可选 >
    协议标识符列表协议标识符 | 协议标识符 , 协议标识符列表
    协议标识符类型标识

    +
    + + +
    +

    元(Metatype)类型语法
    元类型类型 . Type | 类型 . Protocol

    +
    + + +
    +

    类型继承子句语法
    类型继承子句: 类型继承列表
    类型继承列表类型标识 | 类型标识 , 类型继承列表

    +
    + + +
    +
    @@ -597,16 +1067,8 @@
    - - - - - - - - - - + + @@ -624,6 +1086,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/10_Statements.html b/chapter3/10_Statements.html index c71d4cfd..88c9fa67 100644 --- a/chapter3/10_Statements.html +++ b/chapter3/10_Statements.html @@ -1,57 +1,45 @@ - - + - 语句 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -587,257 +595,204 @@
    -
    +
    -

    语句

    +
    +

    翻译:coverxit
    校对:numbbbbb, coverxit, stanzhai

    +
    +

    语句

    +
    +

    本页包含内容:

    +

    在 Swift 中,有两种类型的语句:简单语句和控制流语句。简单语句是最常见的,用于构造表达式和声明。控制流语句则用于控制程序执行的流程,Swift 中有三种类型的控制流语句:循环语句、分支语句和控制传递语句。

    循环语句用于重复执行代码块;分支语句用于执行满足特定条件的代码块;控制传递语句则用于修改代码的执行顺序。在稍后的叙述中,将会详细地介绍每一种类型的控制流语句。

    -

    是否将分号(;)添加到语句的结尾处是可选的。但若要在同一行内写多条独立语句,请务必使用分号。

    +

    是否将分号(;)添加到语句的结尾处是可选的。但若要在同一行内写多条独立语句,请务必使用分号。

    -

    GRAMMAR OF A STATEMENT

    -

    statementexpression; opt

    -

    statementdeclaration; opt

    -

    statementloop-statement; opt

    -

    statementbranch-statement; opt

    -

    statementlabeled-statement

    -

    statementcontrol-transfer-statement; opt

    -

    statementstatment statements; opt

    +

    语句语法
    语句表达式 ; 可选
    语句声明 ; 可选
    语句循环语句 ; 可选
    语句分支语句 ; 可选
    语句标记语句(Labeled Statement)
    语句控制转移语句 ; 可选
    多条语句(Statements)语句 多条语句(Statements) 可选

    +

    循环语句

    取决于特定的循环条件,循环语句允许重复执行代码块。Swift 提供四种类型的循环语句:for语句、for-in语句、while语句和do-while语句。

    -

    通过break语句和continue语句可以改变循环语句的控制流。有关这两条语句,请参考Break 语句待添加链接Continue 语句待添加链接

    +

    通过break语句和continue语句可以改变循环语句的控制流。有关这两条语句,详情参见 Break 语句Continue 语句

    -

    GRAMMAR OF A LOOP STATEMENT

    -

    loop-statementfor-statement

    -

    loop-statementfor-in-statement

    -

    loop-statementwhile-statement

    -

    loop-statementdo-while-statement

    +

    循环语句语法
    循环语句for语句
    循环语句for-in语句
    循环语句while语句
    循环语句do-while语句

    For 语句

    for语句允许在重复执行代码块的同时,递增一个计数器。

    for语句的形式如下:

    -
    for `initialzation`; `condition`; `increment` {
    -    `statements`
    -}
    -
    -

    initialzationconditionincrement之间的分号,以及包围循环体statements的大括号都是不可省略的。

    +
    +

    for initialzation; condition; increment {
    statements
    }

    +
    +

    initialzationconditionincrement 之间的分号,以及包围循环体 statements 的大括号都是不可省略的。

    for语句的执行流程如下:

      -
    1. initialzation只会被执行一次,通常用于声明和初始化在接下来的循环中需要使用的变量。

      -
    2. -
    3. 计算condition表达式: - 如果为真(true),statements将会被执行,然后转到第3步。如果为假(false),statementsincrement都不会被执行,for至此执行完毕。

      -
    4. -
    5. 计算increment表达式,然后转到第2步。

      -
    6. +
    7. initialzation 只会被执行一次,通常用于声明和初始化在接下来的循环中需要使用的变量。
    8. +
    9. 计算 condition 表达式: + 如果为truestatements 将会被执行,然后转到第3步。如果为falsestatementsincrement 都不会被执行,for至此执行完毕。
    10. +
    11. 计算 increment 表达式,然后转到第2步。
    -

    定义在initialzation中的变量仅在for语句的作用域以内有效。condition表达式的值的类型必须符合LogicValue协议。

    +

    定义在 initialzation 中的变量仅在for语句的作用域以内有效。condition 表达式的值的类型必须遵循LogicValue协议。

    -

    GRAMMAR OF A FOR STATEMENT

    -

    for-statementfor for-init opt ; expression opt ; expression opt code-block

    -

    for-statementfor ( for-init opt ; expression opt ; expression opt ) code-block

    -

    for-statementvariable-declaration | expression-list

    +

    For 循环语法
    for语句for for初始条件 可选 ; 表达式 可选 ; 表达式 可选 代码块
    for语句for ( for初始条件 可选 ; 表达式 可选 ; 表达式 可选 ) 代码块
    for初始条件变量声明 | 表达式列表

    For-In 语句

    -

    for-in语句允许在重复执行代码块的同时,迭代集合(或符合Sequence协议的任意类型)中的每一项。

    +

    for-in语句允许在重复执行代码块的同时,迭代集合(或遵循Sequence协议的任意类型)中的每一项。

    for-in语句的形式如下:

    -
    for `item` in `collection` {
    -    `statements`
    -}
    -
    -

    for-in语句在循环开始前会调用collection表达式的generate方法来获取一个生成器类型(这是一个符合Generator协议的类型)的值。接下来循环开始,调用collection表达式的next方法。如果其返回值不是None,它将会被赋给item,然后执行statements,执行完毕后回到循环开始处;否则,将不会赋值给item也不会执行statementsfor-in至此执行完毕。

    -

    GRAMMAR OF A FOR-IN STATEMENT

    -

    for-in-statementfor pattern in expression code-block

    +

    for item in collection {
    statements
    }

    +
    +

    for-in语句在循环开始前会调用 collection 表达式的generate方法来获取一个生成器类型(这是一个遵循Generator协议的类型)的值。接下来循环开始,调用 collection 表达式的next方法。如果其返回值不是None,它将会被赋给 item,然后执行 statements,执行完毕后回到循环开始处;否则,将不会赋值给 item 也不会执行 statementsfor-in至此执行完毕。

    +
    +

    For-In 循环语法
    for-in语句for 模式 in 表达式 代码块

    While 语句

    while语句允许重复执行代码块。

    while语句的形式如下:

    -
    while `condition` {
    -    `statements`
    -}
    -
    +
    +

    while condition {
    statements
    }

    +

    while语句的执行流程如下:

      -
    1. 计算condition表达式: - 如果为真(true),转到第2步。如果为假(false),while至此执行完毕。

      -
    2. -
    3. 执行statements,然后转到第1步。

      -
    4. +
    5. 计算 condition 表达式: + 如果为真true,转到第2步。如果为falsewhile至此执行完毕。
    6. +
    7. 执行 statements ,然后转到第1步。
    -

    由于condition的值在statements执行前就已计算出,因此while语句中的statements可能会被执行若干次,也可能不会被执行。

    -

    condition表达式的值的类型必须符合LogicValue协议。同时,condition表达式也可以使用可选绑定,请参考可选绑定待添加链接

    +

    由于 condition 的值在 statements 执行前就已计算出,因此while语句中的 statements 可能会被执行若干次,也可能不会被执行。

    +

    condition 表达式的值的类型必须遵循LogicValue协议。同时,condition 表达式也可以使用可选绑定,详情参见可选绑定

    -

    GRAMMAR OF A WHILE STATEMENT

    -

    while-statementwhile while-condition code-block

    -

    while-conditionexpression | declaration

    +

    While 循环语法
    while语句while while条件 代码块
    while条件表达式 | 声明

    Do-While 语句

    do-while语句允许代码块被执行一次或多次。

    do-while语句的形式如下:

    -
    do {
    -    `statements`
    -} while `condition`
    -
    +
    +

    do {
    statements
    } while condition

    +

    do-while语句的执行流程如下:

      -
    1. 执行statements,然后转到第2步。

      -
    2. -
    3. 计算condition表达式: - 如果为真(true),转到第1步。如果为假(false),do-while至此执行完毕。

      -
    4. +
    5. 执行 statements,然后转到第2步。
    6. +
    7. 计算 condition 表达式: + 如果为true,转到第1步。如果为falsedo-while至此执行完毕。
    -

    由于condition表达式的值是在statements表达式执行后才计算出,因此do-while语句中的statements至少会被执行一次。

    -

    condition表达式的值的类型必须符合LogicValue协议。同时,condition表达式也可以使用可选绑定,请参考可选绑定待添加链接

    +

    由于 condition 表达式的值是在 statements 执行后才计算出,因此do-while语句中的 statements 至少会被执行一次。

    +

    condition 表达式的值的类型必须遵循LogicValue协议。同时,condition 表达式也可以使用可选绑定,详情参见可选绑定

    -

    GRAMMAR OF A DO-WHILE STATEMENT

    -

    do-while-statementdo code-block while while-condition

    +

    Do-While 循环语法
    do-while语句do 代码块 while while条件

    +

    分支语句

    取决于一个或者多个条件的值,分支语句允许程序执行指定部分的代码。显然,分支语句中条件的值将会决定如何分支以及执行哪一块代码。Swift 提供两种类型的分支语句:if语句和switch语句。

    -

    switch语句中的控制流可以用break语句修改,请参考Break 语句待添加链接

    +

    switch语句中的控制流可以用break语句修改,详情请见Break 语句

    -

    GRAMMAR OF A BRANCH STATEMENT

    -

    branch-statementif-statement

    -

    branch-statementswitch-statement

    +

    分支语句语法
    分支语句if语句
    分支语句switch语句

    If 语句

    取决于一个或多个条件的值,if语句将决定执行哪一块代码。

    if语句有两种标准形式,在这两种形式里都必须有大括号。

    第一种形式是当且仅当条件为真时执行代码,像下面这样:

    -
    if `condition` {
    -    `statements`
    -}
    -
    -

    第二种形式是在第一种形式的基础上添加else语句,当只有一个else语句时,像下面这样:

    -
    if `condition` {
    -    `statements to execute if condition is true`
    -} else {
    -    `statements to execute if condition is false`
    -}
    -
    -

    同时,else语句也可包含if语句,从而形成一条链来测试更多的条件,像下面这样:

    -
    if `condition 1` {
    -    `statements to execute if condition 1 is true`
    -} else if `condition 2` {
    -    `statements to execute if condition 2 is true`
    -}
    -else {
    -    `statements to execute if both conditions are false`
    -}
    -
    -

    if语句中条件的值的类型必须符合LogicValue协议。同时,条件也可以使用可选绑定,请参考可选绑定待添加链接

    -

    GRAMMAR OF AN IF STATEMENT

    -

    if-statementif if-condition code-block else-clause opt

    -

    if-conditionexpression | declaration

    -

    else-clauseelse code-block | else if-statement opt

    +

    if condition {
    statements
    }

    +
    +

    第二种形式是在第一种形式的基础上添加 else 语句,当只有一个 else 语句时,像下面这样:

    +
    +

    if condition { + statements to execute if condition is true +} else { + statements to execute if condition is false +}

    +
    +

    同时,else 语句也可包含if语句,从而形成一条链来测试更多的条件,像下面这样:

    +
    +

    if condition 1 {
    statements to execute if condition 1 is true
    } else if condition 2 {
    statements to execute if condition 2 is true
    }
    else {
    statements to execute if both conditions are false
    }

    +
    +

    if语句中条件的值的类型必须遵循LogicValue协议。同时,条件也可以使用可选绑定,详情参见可选绑定

    +
    +

    If语句语法
    if语句if if条件 代码块 else子句(Clause) 可选
    if条件表达式 | 声明
    else子句(Clause)else 代码块 | else if语句

    Switch 语句

    -

    取决于switch语句的控制表达式(control expression),switch语句将决定执行哪一块代码。

    +

    取决于switch语句的控制表达式(control expression)switch语句将决定执行哪一块代码。

    switch语句的形式如下:

    -
    switch `control expression` {
    -    case `pattern 1`:
    -        `statements`
    -    case `pattern 2` where `condition`:
    -        `statements`
    -    case `pattern 3` where `condition`,
    -    `pattern 4` where `condition`:
    -        `statements`
    -    default:
    -        `statements`
    -}
    -
    -

    switch语句的控制表达式(control expression)会首先被计算,然后与每一个case的模式(pattern)进行匹配。如果匹配成功,程序将会执行对应的case块里的statements。另外,每一个case块都不能为空,也就是说在每一个case块中至少有一条语句。如果你不想在匹配到的case块中执行代码,只需在块里写一条break语句即可。

    -

    可以用作控制表达式的值是十分灵活的,除了标量类型(scalar types,如IntCharacter)外,你可以使用任何类型的值,包括浮点数、字符串、元组、自定义类的实例和可选(optional)类型,甚至是枚举类型中的成员值和指定的范围(range)等。关于在switch语句中使用这些类型,请参考控制流待添加链接一章的Switch待添加链接

    -

    你可以在模式后面添加一个起保护作用的表达式(guard expression)。起保护作用的表达式是这样构成的:关键字where后面跟着一个作为额外测试条件的表达式。因此,当且仅当控制表达式匹配一个case的某个模式且起保护作用的表达式为真时,对应case块中的statements才会被执行。在下面的例子中,控制表达式只会匹配含两个相等元素的元组,如(1, 1)

    -
    case let (x, y) where x == y:
    -}
    -
    -

    正如上面这个例子,也可以在模式中使用let(或var)语句来绑定常量(或变量)。这些常量(或变量)可以在其对应的起保护作用的表达式和其对应的case块里的代码中引用。但是,如果case中有多个模式匹配控制表达式,那么这些模式都不能绑定常量(或变量)。

    -

    switch语句也可以包含默认(default)块,只有其它case块都无法匹配控制表达式时,默认块中的代码才会被执行。一个switch语句只能有一个默认块,而且必须在switch语句的最后面。

    -

    尽管模式匹配操作实际的执行顺序,特别是模式的计算顺序是不可知的,但是 Swift 规定switch语句中的模式匹配的顺序和书写源代码的顺序保持一致。因此,当多个模式含有相同的值且能够匹配控制表达式时,程序只会执行源代码中第一个匹配的case块中的代码。

    -

    Switch 语句必须是完备的

    -

    在 Swift 中,switch语句中控制表达式的每一个可能的值都必须至少有一个case块与之对应。在某些情况下(例如,表达式的类型是Int),你可以使用默认块满足该要求。

    -

    不存在隐式的贯穿(fall through)

    -

    当匹配的case块中的代码执行完毕后,程序会终止switch语句,而不会继续执行下一个case块。这就意味着,如果你想执行下一个case块,需要显式地在你需要的case块里使用fallthrough语句。关于fallthrough语句的更多信息,请参考Fallthrough 语句待添加链接

    -

    GRAMMAR OF A SWITCH STATEMENT

    -

    switch-statementswitch expression { switch-cases opt }

    -

    switch-casesswitch-case switch-cases opt

    -

    switch-casecase-label statement | default-label statements

    -

    switch-casecase-label ; | default-label ;

    -

    case-labelcase case-item-list :

    -

    case-item-listpattern guard-clause opt | pattern guard-clause opt, case-item-list

    -

    default-labeldefault :

    -

    guard-clausewhere guard-expression

    -

    guard-expressionexpression

    +

    switch control expression {
    case pattern 1:
    statements
    case pattern 2 where condition:
    statements
    case pattern 3 where condition,
    pattern 4 where condition:
    statements
    default:
    statements
    }

    -

    带标签的语句

    -

    你可以在循环语句或switch语句前面加上标签,它由标签名和紧随其后的冒号(:)组成。在breakcontinue后面跟上标签名可以显式地在循环语句或switch语句中更改控制流,把控制权传递给指定标签标记的语句。关于这两条语句用法,请参考Break 语句待添加链接Continue 语句待添加链接

    -

    标签的作用域是该标签所标记的语句之后的所有语句。你可以不使用带标签的语句,但只要使用它,标签名就必唯一。

    -

    关于使用带标签的语句的例子,请参考控制流待添加链接一章的带标签的语句待添加链接

    +

    switch语句的控制表达式(control expression)会首先被计算,然后与每一个 case 的模式(pattern)进行匹配。如果匹配成功,程序将会执行对应的 case 分支里的 statements。另外,每一个 case 分支都不能为空,也就是说在每一个 case 分支中至少有一条语句。如果你不想在匹配到的 case 分支中执行代码,只需在该分支里写一条break语句即可。

    +

    可以用作控制表达式的值是十分灵活的,除了标量类型(scalar types,如IntCharacter)外,你可以使用任何类型的值,包括浮点数、字符串、元组、自定义类的实例和可选(optional)类型,甚至是枚举类型中的成员值和指定的范围(range)等。关于在switch语句中使用这些类型,详情参见控制流一章的 Switch

    +

    你可以在模式后面添加一个起保护作用的表达式(guard expression)。起保护作用的表达式是这样构成的:关键字where后面跟着一个作为额外测试条件的表达式。因此,当且仅当控制表达式匹配一个case的某个模式且起保护作用的表达式为真时,对应 case 分支中的 statements 才会被执行。在下面的例子中,控制表达式只会匹配含两个相等元素的元组,如(1, 1)

    +
    case let (x, y) where x == y:
    +
    +

    正如上面这个例子,也可以在模式中使用let(或var)语句来绑定常量(或变量)。这些常量(或变量)可以在其对应的起保护作用的表达式和其对应的case块里的代码中引用。但是,如果 case 中有多个模式匹配控制表达式,那么这些模式都不能绑定常量(或变量)。

    +

    switch语句也可以包含默认(default)分支,只有其它 case 分支都无法匹配控制表达式时,默认分支中的代码才会被执行。一个switch语句只能有一个默认分支,而且必须在switch语句的最后面。

    +

    尽管模式匹配操作实际的执行顺序,特别是模式的计算顺序是不可知的,但是 Swift 规定switch语句中的模式匹配的顺序和书写源代码的顺序保持一致。因此,当多个模式含有相同的值且能够匹配控制表达式时,程序只会执行源代码中第一个匹配的 case 分支中的代码。

    +

    Switch 语句必须是完备的

    +

    在 Swift 中,switch语句中控制表达式的每一个可能的值都必须至少有一个 case 分支与之对应。在某些情况下(例如,表达式的类型是Int),你可以使用默认块满足该要求。

    +

    不存在隐式的贯穿(fall through)

    +

    当匹配的 case 分支中的代码执行完毕后,程序会终止switch语句,而不会继续执行下一个 case 分支。这就意味着,如果你想执行下一个 case 分支,需要显式地在你需要的 case 分支里使用fallthrough语句。关于fallthrough语句的更多信息,详情参见 Fallthrough 语句

    -

    GRAMMAR OF A LABELED STATEMENT

    -

    labeled-statementstatement-label loop-statement | statement-label switch-statement

    -

    statement-labellabel-name :

    -

    label-nameidentifier

    +

    Switch语句语法
    switch语句switch 表达式 { SwitchCase列表 可选 }
    SwitchCase列表SwitchCase SwitchCase列表 可选
    SwitchCasecase标签 多条语句(Statements) | default标签 多条语句(Statements)
    SwitchCasecase标签 ; | default标签 ;
    case标签case case项列表 :
    case项列表模式 guard-clause 可选 | 模式 guard-clause 可选 , case项列表
    default标签default :
    guard-clausewhere guard-expression
    guard-expression表达式

    +
    +

    + 带标签的语句

    +

    你可以在循环语句或switch语句前面加上标签,它由标签名和紧随其后的冒号(:)组成。在breakcontinue后面跟上标签名可以显式地在循环语句或switch语句中更改控制流,把控制权传递给指定标签标记的语句。关于这两条语句用法,详情参见 Break 语句Continue 语句

    +

    标签的作用域是该标签所标记的语句之后的所有语句。你可以不使用带标签的语句,但只要使用它,标签名就必唯一。

    +

    关于使用带标签的语句的例子,详情参见控制流一章的带标签的语句

    +
    +

    标记语句语法
    标记语句(Labeled Statement)语句标签 循环语句 | 语句标签 switch语句
    语句标签标签名称 :
    标签名称标识符

    控制传递语句

    通过无条件地把控制权从一片代码传递到另一片代码,控制传递语句能够改变代码执行的顺序。Swift 提供四种类型的控制传递语句:break语句、continue语句、fallthrough语句和return语句。

    -

    GRAMMAR OF A CONTROL TRANSER STATEMENT

    -

    control-transfer-statementbreak-statement

    -

    control-transfer-statementcontinue-statement

    -

    control-transfer-statementfallthrough-statement

    -

    control-transfer-statementreturn-statement

    +

    控制传递语句(Control Transfer Statement) 语法
    控制传递语句break语句
    控制传递语句continue语句
    控制传递语句fallthrough语句
    控制传递语句return语句

    +

    Break 语句

    -

    break语句用于终止循环或switch语句的执行。使用break语句时,可以只写break这个关键词,也可以在break后面跟上标签名(label name),像下面这样:

    -
    break
    -break `label name`
    -
    +

    break语句用于终止循环或switch语句的执行。使用break语句时,可以只写break这个关键词,也可以在break后面跟上标签名(label name),像下面这样:

    +
    +

    break
    break label name

    +

    break语句后面带标签名时,可用于终止由这个标签标记的循环或switch语句的执行。

    而当只写break时,则会终止switch语句或上下文中包含break语句的最内层循环的执行。

    在这两种情况下,控制权都会被传递给循环或switch语句外面的第一行语句。

    -

    关于使用break语句的例子,请参考控制流待添加链接一章的Break待添加链接带标签的语句待添加链接

    +

    关于使用break语句的例子,详情参见控制流一章的 Break带标签的语句

    -

    GRAMMAR OF A BREAK STATEMENT

    -

    break-statementbreak label-name opt

    +

    Break 语句语法
    break语句break 标签名称 可选

    +

    Continue 语句

    -

    continue语句用于终止循环中当前迭代的执行,但不会终止该循环的执行。使用continue语句时,可以只写continue这个关键词,也可以在continue后面跟上标签名(label name),像下面这样:

    -
    continue
    -continue `label name`
    -
    +

    continue语句用于终止循环中当前迭代的执行,但不会终止该循环的执行。使用continue语句时,可以只写continue这个关键词,也可以在continue后面跟上标签名(label name),像下面这样:

    +
    +

    continue
    continue label name

    +

    continue语句后面带标签名时,可用于终止由这个标签标记的循环中当前迭代的执行。

    而当只写break时,可用于终止上下文中包含continue语句的最内层循环中当前迭代的执行。

    在这两种情况下,控制权都会被传递给循环外面的第一行语句。

    -

    for语句中,continue语句执行后,increment表达式还是会被计算,这是因为每次循环体执行完毕后increment表达式都会被计算。

    -

    关于使用continue语句的例子,请参考控制流待添加链接一章的Continue待添加链接带标签的语句待添加链接

    +

    for语句中,continue语句执行后,increment 表达式还是会被计算,这是因为每次循环体执行完毕后 increment 表达式都会被计算。

    +

    关于使用continue语句的例子,详情参见控制流一章的 Continue带标签的语句

    -

    GRAMMAR OF A CONTINUE STATEMENT

    -

    continue-statementcontinue label-name opt

    +

    Continue 语句语法
    continue语句continue 标签名称 可选

    +

    Fallthrough 语句

    -

    fallthrough语句用于在switch语句中传递控制权。fallthrough语句会把控制权从switch语句中的一个case传递给下一个case。这种传递是无条件的,即使下一个case的值与switch语句的控制表达式的值不匹配。

    -

    fallthrough语句可出现在switch语句中的任意case里,但不能出现在最后一个'case'块。同时,fallthrough语句也不能把控制权传递给使用了可选绑定的case块。

    -

    关于在switch语句中使用fallthrough语句的例子,请参考控制流待添加链接一章的控制传递语句待添加链接

    +

    fallthrough语句用于在switch语句中传递控制权。fallthrough语句会把控制权从switch语句中的一个 case 传递给下一个 case 。这种传递是无条件的,即使下一个 case 的模式与switch语句的控制表达式的值不匹配。

    +

    fallthrough语句可出现在switch语句中的任意 case 里,但不能出现在最后一个 case 分支中。同时,fallthrough语句也不能把控制权传递给使用了可选绑定的 case 分支。

    +

    关于在switch语句中使用fallthrough语句的例子,详情参见控制流一章的控制传递语句

    -

    GRAMMAR OF A FALLTRHOUGH STATEMENT

    -

    continue-statementfallthrough

    +

    Fallthrough 语句语法
    fallthrough语句fallthrough

    Return 语句

    return语句用于在函数或方法的实现中将控制权传递给调用者,接着程序将会从调用者的位置继续向下执行。

    使用return语句时,可以只写return这个关键词,也可以在return后面跟上表达式,像下面这样:

    -
    return
    -return `表达式`
    -
    +
    +

    return
    return expression

    +

    return语句后面带表达式时,表达式的值将会返回给调用者。如果表达式值的类型与调用者期望的类型不匹配,Swift 则会在返回表达式的值之前将表达式值的类型转换为调用者期望的类型。

    而当只写return时,仅仅是将控制权从该函数或方法传递给调用者,而不返回一个值。(这就是说,该函数或方法的返回类型为Void()

    -

    GRAMMAR OF A RETURN STATEMENT

    -

    return-statementreturn expression opt

    +

    Return 语句语法
    return语句return 表达式 可选

    @@ -857,16 +812,8 @@ return `表达式`
    - - - - - - - - - - + + @@ -884,6 +831,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/chapter3/chapter3.html b/chapter3/chapter3.html index 98c54610..b22f1e87 100644 --- a/chapter3/chapter3.html +++ b/chapter3/chapter3.html @@ -1,57 +1,45 @@ - - + - 语言参考 | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + - - - + -
    +
    @@ -111,15 +102,32 @@
    @@ -520,7 +528,7 @@ - + @@ -601,16 +609,8 @@
    - - - - - - - - - - + + @@ -628,6 +628,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/contributing.md b/contributing.md new file mode 100644 index 00000000..6edaf3ae --- /dev/null +++ b/contributing.md @@ -0,0 +1,18 @@ +# 贡献参考流程 + +有些朋友可能不太清楚如何帮忙翻译,我这里写一个简单的流程,大家可以参考一下: + +1. 首先fork我的项目 +2. 把fork过去的项目也就是你的项目clone到你的本地 +3. 在命令行运行 `git branch develop` 来创建一个新分支 +4. 运行 `git checkout develop` 来切换到新分支 +5. 运行 `git remote add upstream https://github.com/numbbbbb/the-swift-programming-language-in-chinese.git` 把我的库添加为远端库 +6. 运行 `git remote update`更新 +7. 运行 `git fetch upstream gh-pages` 拉取我的库的更新到本地 +8. 运行 `git rebase upstream/gh-pages` 将我的更新合并到你的分支 + +这是一个初始化流程,只需要做一遍就行,之后请一直在develop分支进行修改。 + +如果修改过程中我的库有了更新,请重复6、7、8步。 + +修改之后,首先push到你的库,然后登录GitHub,在你的库的首页可以看到一个 `pull request` 按钮,点击它,填写一些说明信息,然后提交即可。 \ No newline at end of file diff --git a/cover.jpg b/cover.jpg new file mode 100644 index 00000000..ea7077ad Binary files /dev/null and b/cover.jpg differ diff --git a/cover_small.jpg b/cover_small.jpg new file mode 100644 index 00000000..d3aa2e69 Binary files /dev/null and b/cover_small.jpg differ diff --git a/gitbook/app.js b/gitbook/app.js index 1ff719d4..a213e8fb 100644 --- a/gitbook/app.js +++ b/gitbook/app.js @@ -1 +1 @@ -var requirejs,require,define;(function(global){function isFunction(e){return ostring.call(e)==="[object Function]"}function isArray(e){return ostring.call(e)==="[object Array]"}function each(e,t){if(e){var n;for(n=0;n-1;n-=1)if(e[n]&&t(e[n],n,e))break}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){if(n||!hasProp(e,i))r&&typeof t=="object"&&t&&!isArray(t)&&!isFunction(t)&&!(t instanceof RegExp)?(e[i]||(e[i]={}),mixin(e[i],t,n,r)):e[i]=t}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function m(e){var t,n,r=e.length;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}}function g(e,t,n){var r,i,s,u,a,f,l,c,h,p,d,v=t&&t.split("/"),g=v,y=o.map,b=y&&y["*"];e&&e.charAt(0)==="."&&(t?(g=v.slice(0,v.length-1),e=e.split("/"),l=e.length-1,o.nodeIdCompat&&jsSuffixRegExp.test(e[l])&&(e[l]=e[l].replace(jsSuffixRegExp,"")),e=g.concat(e),m(e),e=e.join("/")):e.indexOf("./")===0&&(e=e.substring(2)));if(n&&y&&(v||b)){s=e.split("/");e:for(u=s.length;u>0;u-=1){f=s.slice(0,u).join("/");if(v)for(a=v.length;a>0;a-=1){i=getOwn(y,v.slice(0,a).join("/"));if(i){i=getOwn(i,f);if(i){c=i,h=u;break e}}}!p&&b&&getOwn(b,f)&&(p=getOwn(b,f),d=u)}!c&&p&&(c=p,h=d),c&&(s.splice(0,h,c),e=s.join("/"))}return r=getOwn(o.pkgs,e),r?r:e}function y(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===r.contextName)return t.parentNode.removeChild(t),!0})}function b(e){var t=getOwn(o.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),r.require.undef(e),r.require([e]),!0}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e,t,n,i){var s,o,u,a,f=null,l=t?t.name:null,h=e,p=!0,m="";return e||(p=!1,e="_@r"+(d+=1)),a=w(e),f=a[0],e=a[1],f&&(f=g(f,l,i),o=getOwn(c,f)),e&&(f?o&&o.normalize?m=o.normalize(e,function(e){return g(e,l,i)}):m=g(e,l,i):(m=g(e,l,i),a=w(m),f=a[0],m=a[1],n=!0,s=r.nameToUrl(m))),u=f&&!o&&!n?"_unnormalized"+(v+=1):"",{prefix:f,name:m,parentMap:t,unnormalized:!!u,url:s,originalName:h,isDefine:p,id:(f?f+"!"+m:m)+u}}function S(e){var t=e.id,n=getOwn(u,t);return n||(n=u[t]=new r.Module(e)),n}function x(e,t,n){var r=e.id,i=getOwn(u,r);hasProp(c,r)&&(!i||i.defineEmitComplete)?t==="defined"&&n(c[r]):(i=S(e),i.error&&t==="error"?n(i.error):i.on(t,n))}function T(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=getOwn(u,t);n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function N(){globalDefQueue.length&&(apsp.apply(l,[l.length,0].concat(globalDefQueue)),globalDefQueue=[])}function C(e){delete u[e],delete a[e]}function k(e,t,n){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,i){var s=r.id,o=getOwn(u,s);o&&!e.depMatched[i]&&!n[s]&&(getOwn(t,s)?(e.defineDep(i,c[s]),e.check()):k(o,t,n))}),n[r]=!0)}function L(){var e,n,i=o.waitSeconds*1e3,u=i&&r.startTime+i<(new Date).getTime(),f=[],l=[],c=!1,h=!0;if(t)return;t=!0,eachProp(a,function(e){var t=e.map,r=t.id;if(!e.enabled)return;t.isDefine||l.push(e);if(!e.error)if(!e.inited&&u)b(r)?(n=!0,c=!0):(f.push(r),y(r));else if(!e.inited&&e.fetched&&t.isDefine){c=!0;if(!t.prefix)return h=!1}});if(u&&f.length)return e=makeError("timeout","Load timeout for modules: "+f,null,f),e.contextName=r.contextName,T(e);h&&each(l,function(e){k(e,{},{})}),(!u||n)&&c&&(isBrowser||isWebWorker)&&!s&&(s=setTimeout(function(){s=0,L()},50)),t=!1}function A(e){hasProp(c,e[0])||S(E(e[0],null,!0)).init(e[1],e[2])}function O(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function M(e){var t=e.currentTarget||e.srcElement;return O(t,r.onScriptLoad,"load","onreadystatechange"),O(t,r.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function _(){var e;N();while(l.length){e=l.shift();if(e[0]===null)return T(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));A(e)}}var t,n,r,i,s,o={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},u={},a={},f={},l=[],c={},h={},p={},d=1,v=1;return i={require:function(e){return e.require?e.require:e.require=r.makeRequire(e.map)},exports:function(e){e.usingExports=!0;if(e.map.isDefine)return e.exports?c[e.map.id]=e.exports:e.exports=c[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(o.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},n=function(e){this.events=getOwn(f,e.id)||{},this.map=e,this.shim=getOwn(o.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},n.prototype={init:function(e,t,n,r){r=r||{};if(this.inited)return;this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check()},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(this.fetched)return;this.fetched=!0,r.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();r.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))},load:function(){var e=this.map.url;h[e]||(h[e]=!0,r.load(this.map.id,e))},check:function(){if(!this.enabled||this.enabling)return;var e,t,n=this.map.id,i=this.depExports,s=this.exports,o=this.factory;if(!this.inited)this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{s=r.execCb(n,o,i,s)}catch(u){e=u}else s=r.execCb(n,o,i,s);this.map.isDefine&&s===undefined&&(t=this.module,t?s=t.exports:this.usingExports&&(s=this.exports));if(e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",T(this.error=e)}else s=o;this.exports=s,this.map.isDefine&&!this.ignore&&(c[n]=s,req.onResourceLoad&&req.onResourceLoad(r,this.map,this.depMaps)),C(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}},callPlugin:function(){var e=this.map,t=e.id,n=E(e.prefix);this.depMaps.push(n),x(n,"defined",bind(this,function(n){var i,s,a,f=getOwn(p,this.map.id),l=this.map.name,c=this.map.parentMap?this.map.parentMap.name:null,h=r.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){n.normalize&&(l=n.normalize(l,function(e){return g(e,c,!0)})||""),s=E(e.prefix+"!"+l,this.map.parentMap),x(s,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),a=getOwn(u,s.id),a&&(this.depMaps.push(s),this.events.error&&a.on("error",bind(this,function(e){this.emit("error",e)})),a.enable());return}if(f){this.map.url=r.nameToUrl(f),this.load();return}i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(u,function(e){e.map.id.indexOf(t+"_unnormalized")===0&&C(e.map.id)}),T(e)}),i.fromText=bind(this,function(n,s){var u=e.name,a=E(u),f=useInteractive;s&&(n=s),f&&(useInteractive=!1),S(a),hasProp(o.config,t)&&(o.config[u]=o.config[t]);try{req.exec(n)}catch(l){return T(makeError("fromtexteval","fromText eval for "+t+" failed: "+l,l,[t]))}f&&(useInteractive=!0),this.depMaps.push(a),r.completeLoad(u),h([u],i)}),n.load(e.name,h,i,o)})),r.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){a[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,s,o;if(typeof e=="string"){e=E(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,o=getOwn(i,e.id);if(o){this.depExports[t]=o(this);return}this.depCount+=1,x(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&x(e,"error",bind(this,this.errback))}n=e.id,s=u[n],!hasProp(i,n)&&s&&!s.enabled&&r.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(u,e.id);t&&!t.enabled&&r.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),e==="error"&&delete this.events[e]}},r={config:o,contextName:e,registry:u,defined:c,urlFetched:h,defQueue:l,Module:n,makeModuleMap:E,nextTick:req.nextTick,onError:T,configure:function(e){e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/");var t=o.shim,n={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){n[t]?(o[t]||(o[t]={}),mixin(o[t],e,!0,!0)):o[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(p[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,n){isArray(e)&&(e={deps:e}),(e.exports||e.init)&&!e.exportsFn&&(e.exportsFn=r.makeShimExports(e)),t[n]=e}),o.shim=t),e.packages&&each(e.packages,function(e){var t,n;e=typeof e=="string"?{name:e}:e,n=e.name,t=e.location,t&&(o.paths[n]=e.location),o.pkgs[n]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(u,function(e,t){!e.inited&&!e.map.unnormalized&&(e.map=E(t))}),(e.deps||e.callback)&&r.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,n){function s(o,a,f){var l,h,p;return n.enableBuildCallback&&a&&isFunction(a)&&(a.__requireJsBuild=!0),typeof o=="string"?isFunction(a)?T(makeError("requireargs","Invalid require call"),f):t&&hasProp(i,o)?i[o](u[t.id]):req.get?req.get(r,o,t,s):(h=E(o,t,!1,!0),l=h.id,hasProp(c,l)?c[l]:T(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(_(),r.nextTick(function(){_(),p=S(E(null,t)),p.skipMap=n.skipMap,p.init(o,a,f,{enabled:!0}),L()}),s)}return n=n||{},mixin(s,{isBrowser:isBrowser,toUrl:function(e){var n,i=e.lastIndexOf("."),s=e.split("/")[0],o=s==="."||s==="..";return i!==-1&&(!o||i>1)&&(n=e.substring(i,e.length),e=e.substring(0,i)),r.nameToUrl(g(e,t&&t.id,!0),n,!0)},defined:function(e){return hasProp(c,E(e,t,!1,!0).id)},specified:function(e){return e=E(e,t,!1,!0).id,hasProp(c,e)||hasProp(u,e)}}),t||(s.undef=function(e){N();var n=E(e,t,!0),r=getOwn(u,e);y(e),delete c[e],delete h[n.url],delete f[e],eachReverse(l,function(t,n){t[0]===e&&l.splice(n,1)}),r&&(r.events.defined&&(f[e]=r.events),C(e))}),s},enable:function(e){var t=getOwn(u,e.id);t&&S(e).enable()},completeLoad:function(e){var t,n,r,i=getOwn(o.shim,e)||{},s=i.exports;N();while(l.length){n=l.shift();if(n[0]===null){n[0]=e;if(t)break;t=!0}else n[0]===e&&(t=!0);A(n)}r=getOwn(u,e);if(!t&&!hasProp(c,e)&&r&&!r.inited){if(o.enforceDefine&&(!s||!getGlobal(s))){if(b(e))return;return T(makeError("nodefine","No define call for "+e,null,[e]))}A([e,i.deps||[],i.exportsFn])}L()},nameToUrl:function(e,t,n){var i,s,u,a,f,l,c,h=getOwn(o.pkgs,e);h&&(e=h),c=getOwn(p,e);if(c)return r.nameToUrl(c,t,n);if(req.jsExtRegExp.test(e))f=e+(t||"");else{i=o.paths,s=e.split("/");for(u=s.length;u>0;u-=1){a=s.slice(0,u).join("/"),l=getOwn(i,a);if(l){isArray(l)&&(l=l[0]),s.splice(0,u,l);break}}f=s.join("/"),f+=t||(/^data\:|\?/.test(f)||n?"":".js"),f=(f.charAt(0)==="/"||f.match(/^[\w\+\.\-]+:/)?"":o.baseUrl)+f}return o.urlArgs?f+((f.indexOf("?")===-1?"?":"&")+o.urlArgs):f},load:function(e,t){req.load(r,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if(e.type==="load"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=M(e);r.completeLoad(t.id)}},onScriptError:function(e){var t=M(e);if(!b(t.id))return T(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}},r.require=r.makeRequire(),r}function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState==="interactive"?interactiveScript:(eachReverse(scripts(),function(e){if(e.readyState==="interactive")return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.11",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=typeof window!="undefined"&&typeof navigator!="undefined"&&!!window.document,isWebWorker=!isBrowser&&typeof importScripts!="undefined",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera!="undefined"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(typeof define!="undefined")return;if(typeof requirejs!="undefined"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=undefined}typeof require!="undefined"&&!isFunction(require)&&(cfg=require,require=undefined),req=requirejs=function(e,t,n,r){var i,s,o=defContextName;return!isArray(e)&&typeof e!="string"&&(s=e,isArray(t)?(e=t,t=n,n=r):e=[]),s&&s.context&&(o=s.context),i=getOwn(contexts,o),i||(i=contexts[o]=req.s.newContext(o)),s&&i.configure(s),i.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick=typeof setTimeout!="undefined"?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,n){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,n){var r=e&&e.config||{},i;if(isBrowser)return i=req.createNode(r,t,n),i.setAttribute("data-requirecontext",e.contextName),i.setAttribute("data-requiremodule",t),i.attachEvent&&!(i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0)&&!isOpera?(useInteractive=!0,i.attachEvent("onreadystatechange",e.onScriptLoad)):(i.addEventListener("load",e.onScriptLoad,!1),i.addEventListener("error",e.onScriptError,!1)),i.src=n,currentlyAddingScript=i,baseElement?head.insertBefore(i,baseElement):head.appendChild(i),currentlyAddingScript=null,i;if(isWebWorker)try{importScripts(n),e.completeLoad(t)}catch(s){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+n,s,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){head||(head=e.parentNode),dataMain=e.getAttribute("data-main");if(dataMain)return mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,n){var r,i;typeof e!="string"&&(n=t,t=e,e=null),isArray(t)||(n=t,t=null),!t&&isFunction(n)&&(t=[],n.length&&(n.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(n.length===1?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),(i?i.defQueue:globalDefQueue).push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this),define("requireLib",function(){}),function(e,t){typeof module=="object"&&typeof module.exports=="object"?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}(typeof window!="undefined"?window:this,function(window,noGlobal){function isArraylike(e){var t=e.length,n=jQuery.type(e);return n==="function"||jQuery.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||t===0||typeof t=="number"&&t>0&&t-1 in e}function winnow(e,t,n){if(jQuery.isFunction(t))return jQuery.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return jQuery.grep(e,function(e){return e===t!==n});if(typeof t=="string"){if(risSimple.test(t))return jQuery.filter(t,e,n);t=jQuery.filter(t,e)}return jQuery.grep(e,function(e){return indexOf.call(t,e)>=0!==n})}function sibling(e,t){while((e=e[t])&&e.nodeType!==1);return e}function createOptions(e){var t=optionsCache[e]={};return jQuery.each(e.match(rnotwhite)||[],function(e,n){t[n]=!0}),t}function completed(){document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1),jQuery.ready()}function Data(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=jQuery.expando+Math.random()}function dataAttr(e,t,n){var r;if(n===undefined&&e.nodeType===1){r="data-"+t.replace(rmultiDash,"-$1").toLowerCase(),n=e.getAttribute(r);if(typeof n=="string"){try{n=n==="true"?!0:n==="false"?!1:n==="null"?null:+n+""===n?+n:rbrace.test(n)?jQuery.parseJSON(n):n}catch(i){}data_user.set(e,t,n)}else n=undefined}return n}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(e){}}function manipulationTarget(e,t){return jQuery.nodeName(e,"table")&&jQuery.nodeName(t.nodeType!==11?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function disableScript(e){return e.type=(e.getAttribute("type")!==null)+"/"+e.type,e}function restoreScript(e){var t=rscriptTypeMasked.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function setGlobalEval(e,t){var n=0,r=e.length;for(;n")).appendTo(t.documentElement),t=iframe[0].contentDocument,t.write(),t.close(),n=actualDisplay(e,t),iframe.detach();elemdisplay[e]=n}return n}function curCSS(e,t,n){var r,i,s,o,u=e.style;return n=n||getStyles(e),n&&(o=n.getPropertyValue(t)||n[t]),n&&(o===""&&!jQuery.contains(e.ownerDocument,e)&&(o=jQuery.style(e,t)),rnumnonpx.test(o)&&rmargin.test(t)&&(r=u.width,i=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=o,o=n.width,u.width=r,u.minWidth=i,u.maxWidth=s)),o!==undefined?o+"":o}function addGetHookIf(e,t){return{get:function(){if(e()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}function vendorPropName(e,t){if(t in e)return t;var n=t[0].toUpperCase()+t.slice(1),r=t,i=cssPrefixes.length;while(i--){t=cssPrefixes[i]+n;if(t in e)return t}return r}function setPositiveNumber(e,t,n){var r=rnumsplit.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function augmentWidthOrHeight(e,t,n,r,i){var s=n===(r?"border":"content")?4:t==="width"?1:0,o=0;for(;s<4;s+=2)n==="margin"&&(o+=jQuery.css(e,n+cssExpand[s],!0,i)),r?(n==="content"&&(o-=jQuery.css(e,"padding"+cssExpand[s],!0,i)),n!=="margin"&&(o-=jQuery.css(e,"border"+cssExpand[s]+"Width",!0,i))):(o+=jQuery.css(e,"padding"+cssExpand[s],!0,i),n!=="padding"&&(o+=jQuery.css(e,"border"+cssExpand[s]+"Width",!0,i)));return o}function getWidthOrHeight(e,t,n){var r=!0,i=t==="width"?e.offsetWidth:e.offsetHeight,s=getStyles(e),o=jQuery.css(e,"boxSizing",!1,s)==="border-box";if(i<=0||i==null){i=curCSS(e,t,s);if(i<0||i==null)i=e.style[t];if(rnumnonpx.test(i))return i;r=o&&(support.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+augmentWidthOrHeight(e,t,n||(o?"border":"content"),r,s)+"px"}function showHide(e,t){var n,r,i,s=[],o=0,u=e.length;for(;o=0&&n=0},isPlainObject:function(e){return jQuery.type(e)!=="object"||e.nodeType||jQuery.isWindow(e)?!1:e.constructor&&!hasOwn.call(e.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return e==null?e+"":typeof e=="object"||typeof e=="function"?class2type[toString.call(e)]||"object":typeof e},globalEval:function(code){var script,indirect=eval;code=jQuery.trim(code),code&&(code.indexOf("use strict")===1?(script=document.createElement("script"),script.text=code,document.head.appendChild(script).parentNode.removeChild(script)):indirect(code))},camelCase:function(e){return e.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=isArraylike(e);if(n)if(o)for(;ir.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function ut(e){return e[w]=!0,e}function at(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ft(e,t){var n=e.split("|"),i=e.length;while(i--)r.attrHandle[n[i]]=t}function lt(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function pt(e){return ut(function(t){return t=+t,ut(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function dt(e){return e&&typeof e.getElementsByTagName!==L&&e}function vt(){}function mt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function bt(e,t,n){var r=0,i=t.length;for(;r-1&&(s[f]=!(o[f]=c))}}else g=wt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):P.apply(o,g)})}function St(e){var t,n,i,s=e.length,o=r.relative[e[0].type],u=o||r.relative[" "],a=o?1:0,l=gt(function(e){return e===t},u,!0),c=gt(function(e){return B.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a1&&yt(h),a>1&&mt(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(z,"$1"),n,a0,i=e.length>0,s=function(s,o,u,a,l){var c,h,d,v=0,m="0",g=s&&[],y=[],b=f,w=s||i&&r.find.TAG("*",l),E=S+=b==null?1:Math.random()||.1,x=w.length;l&&(f=o!==p&&o);for(;m!==x&&(c=w[m])!=null;m++){if(i&&c){h=0;while(d=e[h++])if(d(c,o,u)){a.push(c);break}l&&(S=E)}n&&((c=!d&&c)&&v--,s&&g.push(c))}v+=m;if(n&&m!==v){h=0;while(d=t[h++])d(g,y,o,u);if(s){if(v>0)while(m--)!g[m]&&!y[m]&&(y[m]=_.call(a));y=wt(y)}P.apply(a,y),l&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(a)}return l&&(S=E,f=b),g};return n?ut(s):s}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w="sizzle"+ -(new Date),E=e.document,S=0,x=0,T=ot(),N=ot(),C=ot(),k=function(e,t){return e===t&&(c=!0),0},L=typeof undefined,A=1<<31,O={}.hasOwnProperty,M=[],_=M.pop,D=M.push,P=M.push,H=M.slice,B=M.indexOf||function(e){var t=0,n=this.length;for(;t+~]|"+F+")"+F+"*"),V=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),$=new RegExp(U),J=new RegExp("^"+q+"$"),K={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I.replace("w","w*")+")"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+U),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/[+~]/,tt=/'|\\/g,nt=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)};try{P.apply(M=H.call(E.childNodes),E.childNodes),M[E.childNodes.length].nodeType}catch(it){P={apply:M.length?function(e,t){D.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}n=st.support={},s=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},h=st.setDocument=function(e){var t,i=e?e.ownerDocument||e:E,o=i.defaultView;if(i===p||i.nodeType!==9||!i.documentElement)return p;p=i,d=i.documentElement,v=!s(i),o&&o!==o.top&&(o.addEventListener?o.addEventListener("unload",function(){h()},!1):o.attachEvent&&o.attachEvent("onunload",function(){h()})),n.attributes=at(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=at(function(e){return e.appendChild(i.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Y.test(i.getElementsByClassName)&&at(function(e){return e.innerHTML="
    ",e.firstChild.className="i",e.getElementsByClassName("i").length===2}),n.getById=at(function(e){return d.appendChild(e).id=w,!i.getElementsByName||!i.getElementsByName(w).length}),n.getById?(r.find.ID=function(e,t){if(typeof t.getElementById!==L&&v){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!==L&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==L)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==L&&v)return t.getElementsByClassName(e)},g=[],m=[];if(n.qsa=Y.test(i.querySelectorAll))at(function(e){e.innerHTML="",e.querySelectorAll("[msallowclip^='']").length&&m.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+F+"*(?:value|"+j+")"),e.querySelectorAll(":checked").length||m.push(":checked")}),at(function(e){var t=i.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+F+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")});return(n.matchesSelector=Y.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&at(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",U)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=Y.test(d.compareDocumentPosition),b=t||Y.test(d.contains)?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return c=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,r&1||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===i||e.ownerDocument===E&&b(E,e)?-1:t===i||t.ownerDocument===E&&b(E,t)?1:l?B.call(l,e)-B.call(l,t):0:r&4?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,r=0,s=e.parentNode,o=t.parentNode,u=[e],a=[t];if(!s||!o)return e===i?-1:t===i?1:s?-1:o?1:l?B.call(l,e)-B.call(l,t):0;if(s===o)return lt(e,t);n=e;while(n=n.parentNode)u.unshift(n);n=t;while(n=n.parentNode)a.unshift(n);while(u[r]===a[r])r++;return r?lt(u[r],a[r]):u[r]===E?-1:a[r]===E?1:0},i},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){(e.ownerDocument||e)!==p&&h(e),t=t.replace(V,"='$1']");if(n.matchesSelector&&v&&(!g||!g.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&e.document.nodeType!==11)return r}catch(i){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},st.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=r.attrHandle[t.toLowerCase()],s=i&&O.call(r.attrHandle,t.toLowerCase())?i(e,t,!v):undefined;return s!==undefined?s:n.attributes||!v?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},st.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,r=[],i=0,s=0;c=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(k);if(c){while(t=e[s++])t===e[s]&&(i=r.push(s));while(i--)e.splice(r[i],1)}return l=null,e},i=st.getText=function(e){var t,n="",r=0,s=e.nodeType;if(!s)while(t=e[r++])n+=i(t);else if(s===1||s===9||s===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(s===3||s===4)return e.nodeValue;return n},r=st.selectors={cacheLength:50,createPseudo:ut,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(nt,rt),e[3]=(e[3]||e[4]||e[5]||"").replace(nt,rt),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&$.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return e==="*"?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&T(e,function(e){return t.test(typeof e.className=="string"&&e.className||typeof e.getAttribute!==L&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[w]||(m[w]={}),f=l[e]||[],p=f[0]===S&&f[1],h=f[0]===S&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[S,p,h];break}}else if(y&&(f=(t[w]||(t[w]={}))[e])&&f[0]===S)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[w]||(c[w]={}))[e]=[S,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ut(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=B.call(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:ut(function(e){var t=[],n=[],r=u(e.replace(z,"$1"));return r[w]?ut(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:ut(function(e){return function(t){return st(e,t).length>0}}),contains:ut(function(e){return function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:ut(function(e){return J.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()==="text")},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[n<0?n+t:n]}),even:pt(function(e,t){var n=0;for(;n=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=n<0?n+t:n;for(;++r2&&(l=f[0]).type==="ID"&&n.getById&&t.nodeType===9&&v&&r.relative[f[1].type]){t=(r.find.ID(l.matches[0].replace(nt,rt),t)||[])[0];if(!t)return i;p&&(t=t.parentNode),e=e.slice(f.shift().value.length)}a=K.needsContext.test(e)?0:f.length;while(a--){l=f[a];if(r.relative[c=l.type])break;if(h=r.find[c])if(s=h(l.matches[0].replace(nt,rt),et.test(f[0].type)&&dt(t.parentNode)||t)){f.splice(a,1),e=s.length&&mt(f);if(!e)return P.apply(i,s),i;break}}}return(p||u(e,d))(s,t,!v,i,et.test(e)&&dt(t.parentNode)||t),i},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!c,h(),n.sortDetached=at(function(e){return e.compareDocumentPosition(p.createElement("div"))&1}),at(function(e){return e.innerHTML="",e.firstChild.getAttribute("href")==="#"})||ft("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}),(!n.attributes||!at(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),e.firstChild.getAttribute("value")===""}))&&ft("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input")return e.defaultValue}),at(function(e){return e.getAttribute("disabled")==null})||ft(j,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),st}(window);jQuery.find=Sizzle,jQuery.expr=Sizzle.selectors,jQuery.expr[":"]=jQuery.expr.pseudos,jQuery.unique=Sizzle.uniqueSort,jQuery.text=Sizzle.getText,jQuery.isXMLDoc=Sizzle.isXML,jQuery.contains=Sizzle.contains;var rneedsContext=jQuery.expr.match.needsContext,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,risSimple=/^.[^:#\[\.,]*$/;jQuery.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),t.length===1&&r.nodeType===1?jQuery.find.matchesSelector(r,e)?[r]:[]:jQuery.find.matches(e,jQuery.grep(t,function(e){return e.nodeType===1}))},jQuery.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if(typeof e!="string")return this.pushStack(jQuery(e).filter(function(){for(t=0;t1?jQuery.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(winnow(this,e||[],!1))},not:function(e){return this.pushStack(winnow(this,e||[],!0))},is:function(e){return!!winnow(this,typeof e=="string"&&rneedsContext.test(e)?jQuery(e):e||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,init=jQuery.fn.init=function(e,t){var n,r;if(!e)return this;if(typeof e=="string"){e[0]==="<"&&e[e.length-1]===">"&&e.length>=3?n=[null,e,null]:n=rquickExpr.exec(e);if(n&&(n[1]||!t)){if(n[1]){t=t instanceof jQuery?t[0]:t,jQuery.merge(this,jQuery.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:document,!0));if(rsingleTag.test(n[1])&&jQuery.isPlainObject(t))for(n in t)jQuery.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return r=document.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=document,this.selector=e,this}return!t||t.jquery?(t||rootjQuery).find(e):this.constructor(t).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):jQuery.isFunction(e)?typeof rootjQuery.ready!="undefined"?rootjQuery.ready(e):e(jQuery):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),jQuery.makeArray(e,this))};init.prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};jQuery.extend({dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&e.nodeType!==9)if(e.nodeType===1){if(i&&jQuery(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}}),jQuery.fn.extend({has:function(e){var t=jQuery(e,this),n=t.length;return this.filter(function(){var e=0;for(;e-1:n.nodeType===1&&jQuery.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?jQuery.unique(s):s)},index:function(e){return e?typeof e=="string"?indexOf.call(jQuery(e),this[0]):indexOf.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),jQuery(e,t))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),jQuery.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return jQuery.dir(e,"parentNode")},parentsUntil:function(e,t,n){return jQuery.dir(e,"parentNode",n)},next:function(e){return sibling(e,"nextSibling")},prev:function(e){return sibling(e,"previousSibling")},nextAll:function(e){return jQuery.dir(e,"nextSibling")},prevAll:function(e){return jQuery.dir(e,"previousSibling")},nextUntil:function(e,t,n){return jQuery.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return jQuery.dir(e,"previousSibling",n)},siblings:function(e){return jQuery.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return jQuery.sibling(e.firstChild)},contents:function(e){return e.contentDocument||jQuery.merge([],e.childNodes)}},function(e,t){jQuery.fn[e]=function(n,r){var i=jQuery.map(this,t,n);return e.slice(-5)!=="Until"&&(r=n),r&&typeof r=="string"&&(i=jQuery.filter(r,i)),this.length>1&&(guaranteedUnique[e]||jQuery.unique(i),rparentsprev.test(e)&&i.reverse()),this.pushStack(i)}});var rnotwhite=/\S+/g,optionsCache={};jQuery.Callbacks=function(e){e=typeof e=="string"?optionsCache[e]||createOptions(e):jQuery.extend({},e);var t,n,r,i,s,o,u=[],a=!e.once&&[],f=function(c){t=e.memory&&c,n=!0,o=i||0,i=0,s=u.length,r=!0;for(;u&&o-1)u.splice(n,1),r&&(n<=s&&s--,n<=o&&o--)}),this},has:function(e){return e?jQuery.inArray(e,u)>-1:!!u&&!!u.length},empty:function(){return u=[],s=0,this},disable:function(){return u=a=t=undefined,this},disabled:function(){return!u},lock:function(){return a=undefined,t||l.disable(),this},locked:function(){return!a},fireWith:function(e,t){return u&&(!n||a)&&(t=t||[],t=[e,t.slice?t.slice():t],r?a.push(t):f(t)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!n}};return l},jQuery.extend({Deferred:function(e){var t=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return jQuery.Deferred(function(n){jQuery.each(t,function(t,s){var o=jQuery.isFunction(e[t])&&e[t];i[s[1]](function(){var e=o&&o.apply(this,arguments);e&&jQuery.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s[0]+"With"](this===r?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?jQuery.extend(e,r):r}},i={};return r.pipe=r.then,jQuery.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=slice.call(arguments),r=n.length,i=r!==1||e&&jQuery.isFunction(e.promise)?r:0,s=i===1?e:jQuery.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?slice.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t0)return;readyList.resolveWith(document,[jQuery]),jQuery.fn.triggerHandler&&(jQuery(document).triggerHandler("ready"),jQuery(document).off("ready"))}}),jQuery.ready.promise=function(e){return readyList||(readyList=jQuery.Deferred(),document.readyState==="complete"?setTimeout(jQuery.ready):(document.addEventListener("DOMContentLoaded",completed,!1),window.addEventListener("load",completed,!1))),readyList.promise(e)},jQuery.ready.promise();var access=jQuery.access=function(e,t,n,r,i,s,o){var u=0,a=e.length,f=n==null;if(jQuery.type(n)==="object"){i=!0;for(u in n)jQuery.access(e,t,u,n[u],!0,s,o)}else if(r!==undefined){i=!0,jQuery.isFunction(r)||(o=!0),f&&(o?(t.call(e,r),t=null):(f=t,t=function(e,t,n){return f.call(jQuery(e),n)}));if(t)for(;u1,null,!0)},removeData:function(e){return this.each(function(){data_user.remove(this,e)})}}),jQuery.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=data_priv.get(e,t),n&&(!r||jQuery.isArray(n)?r=data_priv.access(e,t,jQuery.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=jQuery.queue(e,t),r=n.length,i=n.shift(),s=jQuery._queueHooks(e,t),o=function(){jQuery.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return data_priv.get(e,n)||data_priv.access(e,n,{empty:jQuery.Callbacks("once memory").add(function(){data_priv.remove(e,[t+"queue",n])})})}}),jQuery.fn.extend({queue:function(e,t){var n=2;return typeof e!="string"&&(t=e,e="fx",n--),arguments.lengthx",support.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue})();var strundefined=typeof undefined;support.focusinBubbles="onfocusin"in window;var rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;jQuery.event={global:{},add:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=data_priv.get(e);if(!m)return;n.handler&&(s=n,n=s.handler,i=s.selector),n.guid||(n.guid=jQuery.guid++),(a=m.events)||(a=m.events={}),(o=m.handle)||(o=m.handle=function(t){return typeof jQuery!==strundefined&&jQuery.event.triggered!==t.type?jQuery.event.dispatch.apply(e,arguments):undefined}),t=(t||"").match(rnotwhite)||[""],f=t.length;while(f--){u=rtypenamespace.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p)continue;c=jQuery.event.special[p]||{},p=(i?c.delegateType:c.bindType)||p,c=jQuery.event.special[p]||{},l=jQuery.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&jQuery.expr.match.needsContext.test(i),namespace:d.join(".")},s),(h=a[p])||(h=a[p]=[],h.delegateCount=0,(!c.setup||c.setup.call(e,r,d,o)===!1)&&e.addEventListener&&e.addEventListener(p,o,!1)),c.add&&(c.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,l):h.push(l),jQuery.event.global[p]=!0}},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=data_priv.hasData(e)&&data_priv.get(e);if(!m||!(a=m.events))return;t=(t||"").match(rnotwhite)||[""],f=t.length;while(f--){u=rtypenamespace.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in a)jQuery.event.remove(e,p+t[f],n,r,!0);continue}c=jQuery.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=a[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;while(s--)l=h[s],(i||v===l.origType)&&(!n||n.guid===l.guid)&&(!u||u.test(l.namespace))&&(!r||r===l.selector||r==="**"&&l.selector)&&(h.splice(s,1),l.selector&&h.delegateCount--,c.remove&&c.remove.call(e,l));o&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&jQuery.removeEvent(e,p,m.handle),delete a[p])}jQuery.isEmptyObject(a)&&(delete m.handle,data_priv.remove(e,"events"))},trigger:function(e,t,n,r){var i,s,o,u,a,f,l,c=[n||document],h=hasOwn.call(e,"type")?e.type:e,p=hasOwn.call(e,"namespace")?e.namespace.split("."):[];s=o=n=n||document;if(n.nodeType===3||n.nodeType===8)return;if(rfocusMorph.test(h+jQuery.event.triggered))return;h.indexOf(".")>=0&&(p=h.split("."),h=p.shift(),p.sort()),a=h.indexOf(":")<0&&"on"+h,e=e[jQuery.expando]?e:new jQuery.Event(h,typeof e=="object"&&e),e.isTrigger=r?2:3,e.namespace=p.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=undefined,e.target||(e.target=n),t=t==null?[e]:jQuery.makeArray(t,[e]),l=jQuery.event.special[h]||{};if(!r&&l.trigger&&l.trigger.apply(n,t)===!1)return;if(!r&&!l.noBubble&&!jQuery.isWindow(n)){u=l.delegateType||h,rfocusMorph.test(u+h)||(s=s.parentNode);for(;s;s=s.parentNode)c.push(s),o=s;o===(n.ownerDocument||document)&&c.push(o.defaultView||o.parentWindow||window)}i=0;while((s=c[i++])&&!e.isPropagationStopped())e.type=i>1?u:l.bindType||h,f=(data_priv.get(s,"events")||{})[e.type]&&data_priv.get(s,"handle"),f&&f.apply(s,t),f=a&&s[a],f&&f.apply&&jQuery.acceptData(s)&&(e.result=f.apply(s,t),e.result===!1&&e.preventDefault());return e.type=h,!r&&!e.isDefaultPrevented()&&(!l._default||l._default.apply(c.pop(),t)===!1)&&jQuery.acceptData(n)&&a&&jQuery.isFunction(n[h])&&!jQuery.isWindow(n)&&(o=n[a],o&&(n[a]=null),jQuery.event.triggered=h,n[h](),jQuery.event.triggered=undefined,o&&(n[a]=o)),e.result},dispatch:function(e){e=jQuery.event.fix(e);var t,n,r,i,s,o=[],u=slice.call(arguments),a=(data_priv.get(this,"events")||{})[e.type]||[],f=jQuery.event.special[e.type]||{};u[0]=e,e.delegateTarget=this;if(f.preDispatch&&f.preDispatch.call(this,e)===!1)return;o=jQuery.event.handlers.call(this,e,a),t=0;while((i=o[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((s=i.handlers[n++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(s.namespace))e.handleObj=s,e.data=s.data,r=((jQuery.event.special[s.origType]||{}).handle||s.handler).apply(i.elem,u),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return f.postDispatch&&f.postDispatch.call(this,e),e.result},handlers:function(e,t){var n,r,i,s,o=[],u=t.delegateCount,a=e.target;if(u&&a.nodeType&&(!e.button||e.type!=="click"))for(;a!==this;a=a.parentNode||this)if(a.disabled!==!0||e.type!=="click"){r=[];for(n=0;n=0:jQuery.find(i,this,null,[a]).length),r[i]&&r.push(s);r.length&&o.push({elem:a,handlers:r})}return u]*)\/>/gi,rtagName=/<([\w:]+)/,rhtml=/<|&#?\w+;/,rnoInnerhtml=/<(?:script|style|link)/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptType=/^$|\/(?:java|ecma)script/i,rscriptTypeMasked=/^true\/(.*)/,rcleanScript=/^\s*\s*$/g,wrapMap={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td,jQuery.extend({clone:function(e,t,n){var r,i,s,o,u=e.cloneNode(!0),a=jQuery.contains(e.ownerDocument,e);if(!support.noCloneChecked&&(e.nodeType===1||e.nodeType===11)&&!jQuery.isXMLDoc(e)){o=getAll(u),s=getAll(e);for(r=0,i=s.length;r0&&setGlobalEval(o,!a&&getAll(e,"script")),u},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l=t.createDocumentFragment(),c=[],h=0,p=e.length;for(;h")+u[2],f=u[0];while(f--)s=s.lastChild;jQuery.merge(c,s.childNodes),s=l.firstChild,s.textContent=""}}l.textContent="",h=0;while(i=c[h++]){if(r&&jQuery.inArray(i,r)!==-1)continue;a=jQuery.contains(i.ownerDocument,i),s=getAll(l.appendChild(i),"script"),a&&setGlobalEval(s);if(n){f=0;while(i=s[f++])rscriptType.test(i.type||"")&&n.push(i)}}return l},cleanData:function(e){var t,n,r,i,s=jQuery.event.special,o=0;for(;(n=e[o])!==undefined;o++){if(jQuery.acceptData(n)){i=n[data_priv.expando];if(i&&(t=data_priv.cache[i])){if(t.events)for(r in t.events)s[r]?jQuery.event.remove(n,r):jQuery.removeEvent(n,r,t.handle);data_priv.cache[i]&&delete data_priv.cache[i]}}delete data_user.cache[n[data_user.expando]]}}}),jQuery.fn.extend({text:function(e){return access(this,function(e){return e===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9)this.textContent=e})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=manipulationTarget(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=manipulationTarget(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?jQuery.filter(e,this):this,i=0;for(;(n=r[i])!=null;i++)!t&&n.nodeType===1&&jQuery.cleanData(getAll(n)),n.parentNode&&(t&&jQuery.contains(n.ownerDocument,n)&&setGlobalEval(getAll(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++)e.nodeType===1&&(jQuery.cleanData(getAll(e,!1)),e.textContent="");return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return jQuery.clone(this,e,t)})},html:function(e){return access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&t.nodeType===1)return t.innerHTML;if(typeof e=="string"&&!rnoInnerhtml.test(e)&&!wrapMap[(rtagName.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(rxhtmlTag,"<$1>");try{for(;n1&&typeof h=="string"&&!support.checkClone&&rchecked.test(h))return this.each(function(n){var r=l.eq(n);p&&(e[0]=h.call(this,n,r.html())),r.domManip(e,t)});if(f){n=jQuery.buildFragment(e,this[0].ownerDocument,!1,this),r=n.firstChild,n.childNodes.length===1&&(n=r);if(r){i=jQuery.map(getAll(n,"script"),disableScript),s=i.length;for(;a1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(e){return typeof e=="boolean"?e?this.show():this.hide():this.each(function(){isHidden(this)?jQuery(this).show():jQuery(this).hide()})}}),jQuery.Tween=Tween,Tween.prototype={constructor:Tween,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(jQuery.cssNumber[n]?"":"px")},cur:function(){var e=Tween.propHooks[this.prop];return e&&e.get?e.get(this):Tween.propHooks._default.get(this)},run:function(e){var t,n=Tween.propHooks[this.prop];return this.options.duration?this.pos=t=jQuery.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=jQuery.css(e.elem,e.prop,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){jQuery.fx.step[e.prop]?jQuery.fx.step[e.prop](e):e.elem.style&&(e.elem.style[jQuery.cssProps[e.prop]]!=null||jQuery.cssHooks[e.prop])?jQuery.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},jQuery.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=rfxnum.exec(t),s=i&&i[3]||(jQuery.cssNumber[e]?"":"px"),o=(jQuery.cssNumber[e]||s!=="px"&&+r)&&rfxnum.exec(jQuery.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3],i=i||[],o=+r||1;do u=u||".5",o/=u,jQuery.style(n.elem,e,o+s);while(u!==(u=n.cur()/r)&&u!==1&&--a)}return i&&(o=n.start=+o||+r||0,n.unit=s,n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]),n}]};jQuery.Animation=jQuery.extend(Animation,{tweener:function(e,t){jQuery.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r1)},removeAttr:function(e){return this.each(function(){jQuery.removeAttr(this,e)})}}),jQuery.extend({attr:function(e,t,n){var r,i,s=e.nodeType;if(!e||s===3||s===8||s===2)return;if(typeof e.getAttribute===strundefined)return jQuery.prop(e,t,n);if(s!==1||!jQuery.isXMLDoc(e))t=t.toLowerCase(),r=jQuery.attrHooks[t]||(jQuery.expr.match.bool.test(t)?boolHook:nodeHook);if(n===undefined)return r&&"get"in r&&(i=r.get(e,t))!==null?i:(i=jQuery.find.attr(e,t),i==null?undefined:i);if(n!==null)return r&&"set"in r&&(i=r.set(e,n,t))!==undefined?i:(e.setAttribute(t,n+""),n);jQuery.removeAttr(e,t)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(rnotwhite);if(s&&e.nodeType===1)while(n=s[i++])r=jQuery.propFix[n]||n,jQuery.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!support.radioValue&&t==="radio"&&jQuery.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),boolHook={set:function(e,t,n){return t===!1?jQuery.removeAttr(e,n):e.setAttribute(n,n),n}},jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(e,t){var n=attrHandle[t]||jQuery.find.attr;attrHandle[t]=function(e,t,r){var i,s;return r||(s=attrHandle[t],attrHandle[t]=i,i=n(e,t,r)!=null?t.toLowerCase():null,attrHandle[t]=s),i}});var rfocusable=/^(?:input|select|textarea|button)$/i;jQuery.fn.extend({prop:function(e,t){return access(this,jQuery.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[jQuery.propFix[e]||e]})}}),jQuery.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,s,o=e.nodeType;if(!e||o===3||o===8||o===2)return;return s=o!==1||!jQuery.isXMLDoc(e),s&&(t=jQuery.propFix[t]||t,i=jQuery.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&(r=i.get(e,t))!==null?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||rfocusable.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),support.optSelected||(jQuery.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this});var rclass=/[\t\r\n\f]/g;jQuery.fn.extend({addClass:function(e){var t,n,r,i,s,o,u=typeof e=="string"&&e,a=0,f=this.length;if(jQuery.isFunction(e))return this.each(function(t){jQuery(this).addClass(e.call(this,t,this.className))});if(u){t=(e||"").match(rnotwhite)||[];for(;a=0)r=r.replace(" "+i+" "," ");o=e?jQuery.trim(r):"",n.className!==o&&(n.className=o)}}}return this},toggleClass:function(e,t){var n=typeof e;return typeof t=="boolean"&&n==="string"?t?this.addClass(e):this.removeClass(e):jQuery.isFunction(e)?this.each(function(n){jQuery(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var t,r=0,i=jQuery(this),s=e.match(rnotwhite)||[];while(t=s[r++])i.hasClass(t)?i.removeClass(t):i.addClass(t)}else if(n===strundefined||n==="boolean")this.className&&data_priv.set(this,"__className__",this.className),this.className=this.className||e===!1?"":data_priv.get(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1}});var rreturn=/\r/g;jQuery.fn.extend({val:function(e){var t,n,r,i=this[0];if(!arguments.length){if(i)return t=jQuery.valHooks[i.type]||jQuery.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,typeof n=="string"?n.replace(rreturn,""):n==null?"":n);return}return r=jQuery.isFunction(e),this.each(function(n){var i;if(this.nodeType!==1)return;r?i=e.call(this,n,jQuery(this).val()):i=e,i==null?i="":typeof i=="number"?i+="":jQuery.isArray(i)&&(i=jQuery.map(i,function(e){return e==null?"":e+""})),t=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!t||!("set"in t)||t.set(this,i,"value")===undefined)this.value=i})}}),jQuery.extend({valHooks:{option:{get:function(e){var t=jQuery.find.attr(e,"value");return t!=null?t:jQuery.trim(jQuery.text(e))}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0)n=!0}return n||(e.selectedIndex=-1),s}}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(e,t){if(jQuery.isArray(t))return e.checked=jQuery.inArray(jQuery(e).val(),t)>=0}},support.checkOn||(jQuery.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})}),jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){jQuery.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),jQuery.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var nonce=jQuery.now(),rquery=/\?/;jQuery.parseJSON=function(e){return JSON.parse(e+"")},jQuery.parseXML=function(e){var t,n;if(!e||typeof e!="string")return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&jQuery.error("Invalid XML: "+e),t};var ajaxLocParts,ajaxLocation,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href}catch(e){ajaxLocation=document.createElement("a"),ajaxLocation.href="",ajaxLocation=ajaxLocation.href}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[],jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ajaxExtend(ajaxExtend(e,jQuery.ajaxSettings),t):ajaxExtend(jQuery.ajaxSettings,e)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(e,t){function S(e,t,s,u){var f,m,g,b,E,S=t;if(y===2)return;y=2,o&&clearTimeout(o),n=undefined,i=u||"",w.readyState=e>0?4:0,f=e>=200&&e<300||e===304,s&&(b=ajaxHandleResponses(l,w,s)),b=ajaxConvert(l,b,w,f);if(f)l.ifModified&&(E=w.getResponseHeader("Last-Modified"),E&&(jQuery.lastModified[r]=E),E=w.getResponseHeader("etag"),E&&(jQuery.etag[r]=E)),e===204||l.type==="HEAD"?S="nocontent":e===304?S="notmodified":(S=b.state,m=b.data,g=b.error,f=!g);else{g=S;if(e||!S)S="error",e<0&&(e=0)}w.status=e,w.statusText=(t||S)+"",f?p.resolveWith(c,[m,S,w]):p.rejectWith(c,[w,S,g]),w.statusCode(v),v=undefined,a&&h.trigger(f?"ajaxSuccess":"ajaxError",[w,l,f?m:g]),d.fireWith(c,[w,S]),a&&(h.trigger("ajaxComplete",[w,l]),--jQuery.active||jQuery.event.trigger("ajaxStop"))}typeof e=="object"&&(t=e,e=undefined),t=t||{};var n,r,i,s,o,u,a,f,l=jQuery.ajaxSetup({},t),c=l.context||l,h=l.context&&(c.nodeType||c.jquery)?jQuery(c):jQuery.event,p=jQuery.Deferred(),d=jQuery.Callbacks("once memory"),v=l.statusCode||{},m={},g={},y=0,b="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(y===2){if(!s){s={};while(t=rheaders.exec(i))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return y===2?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return y||(e=g[n]=g[n]||e,m[e]=t),this},overrideMimeType:function(e){return y||(l.mimeType=e),this},statusCode:function(e){var t;if(e)if(y<2)for(t in e)v[t]=[v[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),S(0,t),this}};p.promise(w).complete=d.add,w.success=w.done,w.error=w.fail,l.url=((e||l.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//"),l.type=t.method||t.type||l.method||l.type,l.dataTypes=jQuery.trim(l.dataType||"*").toLowerCase().match(rnotwhite)||[""],l.crossDomain==null&&(u=rurl.exec(l.url.toLowerCase()),l.crossDomain=!(!u||u[1]===ajaxLocParts[1]&&u[2]===ajaxLocParts[2]&&(u[3]||(u[1]==="http:"?"80":"443"))===(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?"80":"443")))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=jQuery.param(l.data,l.traditional)),inspectPrefiltersOrTransports(prefilters,l,t,w);if(y===2)return w;a=l.global,a&&jQuery.active++===0&&jQuery.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!rnoContent.test(l.type),r=l.url,l.hasContent||(l.data&&(r=l.url+=(rquery.test(r)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=rts.test(r)?r.replace(rts,"$1_="+nonce++):r+(rquery.test(r)?"&":"?")+"_="+nonce++)),l.ifModified&&(jQuery.lastModified[r]&&w.setRequestHeader("If-Modified-Since",jQuery.lastModified[r]),jQuery.etag[r]&&w.setRequestHeader("If-None-Match",jQuery.etag[r])),(l.data&&l.hasContent&&l.contentType!==!1||t.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):l.accepts["*"]);for(f in l.headers)w.setRequestHeader(f,l.headers[f]);if(!l.beforeSend||l.beforeSend.call(c,w,l)!==!1&&y!==2){b="abort";for(f in{success:1,error:1,complete:1})w[f](l[f]);n=inspectPrefiltersOrTransports(transports,l,t,w);if(!n)S(-1,"No Transport");else{w.readyState=1,a&&h.trigger("ajaxSend",[w,l]),l.async&&l.timeout>0&&(o=setTimeout(function(){w.abort("timeout")},l.timeout));try{y=1,n.send(m,S)}catch(E){if(!(y<2))throw E;S(-1,E)}}return w}return w.abort()},getJSON:function(e,t,n){return jQuery.get(e,t,n,"json")},getScript:function(e,t){return jQuery.get(e,undefined,t,"script")}}),jQuery.each(["get","post"],function(e,t){jQuery[t]=function(e,n,r,i){return jQuery.isFunction(n)&&(i=i||r,r=n,n=undefined),jQuery.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){jQuery.fn[t]=function(e){return this.on(t,e)}}),jQuery._evalUrl=function(e){return jQuery.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},jQuery.fn.extend({wrapAll:function(e){var t;return jQuery.isFunction(e)?this.each(function(t){jQuery(this).wrapAll(e.call(this,t))}):(this[0]&&(t=jQuery(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return jQuery.isFunction(e)?this.each(function(t){jQuery(this).wrapInner(e.call(this,t))}):this.each(function(){var t=jQuery(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=jQuery.isFunction(e);return this.each(function(n){jQuery(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){jQuery.nodeName(this,"body")||jQuery(this).replaceWith(this.childNodes)}).end()}}),jQuery.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},jQuery.expr.filters.visible=function(e){return!jQuery.expr.filters.hidden(e)};var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.param=function(e,t){var n,r=[],i=function(e,t){t=jQuery.isFunction(t)?t():t==null?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};t===undefined&&(t=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional);if(jQuery.isArray(e)||e.jquery&&!jQuery.isPlainObject(e))jQuery.each(e,function(){i(this.name,this.value)});else for(n in e)buildParams(n,e[n],t,i);return r.join("&").replace(r20,"+")},jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=jQuery.prop(this,"elements");return e?jQuery.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(e)&&(this.checked||!rcheckableType.test(e))}).map(function(e,t){var n=jQuery(this).val();return n==null?null:jQuery.isArray(n)?jQuery.map(n,function(e){return{name:t.name,value:e.replace(rCRLF,"\r\n")}}):{name:t.name,value:n.replace(rCRLF,"\r\n")}}).get()}}),jQuery.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var xhrId=0,xhrCallbacks={},xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();window.ActiveXObject&&jQuery(window).on("unload",function(){for(var e in xhrCallbacks)xhrCallbacks[e]()}),support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,support.ajax=xhrSupported=!!xhrSupported,jQuery.ajaxTransport(function(e){var t;if(support.cors||xhrSupported&&!e.crossDomain)return{send:function(n,r){var i,s=e.xhr(),o=++xhrId;s.open(e.type,e.url,e.async,e.username,e.password);if(e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),!e.crossDomain&&!n["X-Requested-With"]&&(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete xhrCallbacks[o],t=s.onload=s.onerror=null,e==="abort"?s.abort():e==="error"?r(s.status,s.statusText):r(xhrSuccessStatus[s.status]||s.status,s.statusText,typeof s.responseText=="string"?{text:s.responseText}:undefined,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=xhrCallbacks[o]=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(u){if(t)throw u}},abort:function(){t&&t()}}}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return jQuery.globalEval(e),e}}}),jQuery.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),jQuery.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=jQuery("TYPE html> - jsREPL Sandbox + 《The Swift Programming Language》中文版 - + +序yle="margin-left:15%;">
  • 翻译无任何商业目的,仅供内部学习交流使用!

  • TYPE html> + + + 《The Swift Programming Language》中文版 + + + + diff --git a/gitbook/print.css b/gitbook/print.css index 562c0c25..ec902887 100755 --- a/gitbook/print.css +++ b/gitbook/print.css @@ -1 +1 @@ -article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:1.428571429;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}button,input,select[multiple],textarea{background-image:none}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:18px;margin-bottom:18px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}p{margin:0 0 9px}.lead{margin-bottom:18px;font-size:14.95px;font-weight:200;line-height:1.4}@media(min-width:768px){.lead{font-size:19.5px}}small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#428bca}.text-warning{color:#c09853}.text-danger{color:#b94a48}.text-success{color:#468847}.text-info{color:#3a87ad}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;line-height:1.1}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{margin-top:18px;margin-bottom:9px}h4,h5,h6{margin-top:9px;margin-bottom:9px}h1,.h1{font-size:33px}h2,.h2{font-size:27px}h3,.h3{font-size:23px}h4,.h4{font-size:17px}h5,.h5{font-size:13px}h6,.h6{font-size:12px}h1 small,.h1 small{font-size:23px}h2 small,.h2 small{font-size:17px}h3 small,.h3 small,h4 small,.h4 small{font-size:13px}.page-header{padding-bottom:8px;margin:36px 0 18px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:9px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-bottom:18px}dt,dd{line-height:1.428571429}dt{font-weight:bold}dd{margin-left:0}@media(min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table}.dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:9px 18px;margin:0 0 18px;border-left:5px solid #eee}blockquote p{font-size:16.25px;font-weight:300;line-height:1.25}blockquote p:last-child{margin-bottom:0}blockquote small{display:block;line-height:1.428571429;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:18px;font-style:normal;line-height:1.428571429}code,pre{font-family:Monaco,Menlo,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:4px}pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12px;line-height:1.428571429;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre.prettyprint{margin-bottom:18px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.container:before,.container:after{content:" ";display:table}.container:after{clear:both}.container:before,.container:after{content:" ";display:table}.container:after{clear:both}.row{margin-left:-15px;margin-right:-15px}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11{float:left}.col-xs-1{width:8.333333333333332%}.col-xs-2{width:16.666666666666664%}.col-xs-3{width:25%}.col-xs-4{width:33.33333333333333%}.col-xs-5{width:41.66666666666667%}.col-xs-6{width:50%}.col-xs-7{width:58.333333333333336%}.col-xs-8{width:66.66666666666666%}.col-xs-9{width:75%}.col-xs-10{width:83.33333333333334%}.col-xs-11{width:91.66666666666666%}.col-xs-12{width:100%}@media(min-width:768px){.container{max-width:750px}.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11{float:left}.col-sm-1{width:8.333333333333332%}.col-sm-2{width:16.666666666666664%}.col-sm-3{width:25%}.col-sm-4{width:33.33333333333333%}.col-sm-5{width:41.66666666666667%}.col-sm-6{width:50%}.col-sm-7{width:58.333333333333336%}.col-sm-8{width:66.66666666666666%}.col-sm-9{width:75%}.col-sm-10{width:83.33333333333334%}.col-sm-11{width:91.66666666666666%}.col-sm-12{width:100%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-11{left:91.66666666666666%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-11{margin-left:91.66666666666666%}}@media(min-width:992px){.container{max-width:970px}.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11{float:left}.col-md-1{width:8.333333333333332%}.col-md-2{width:16.666666666666664%}.col-md-3{width:25%}.col-md-4{width:33.33333333333333%}.col-md-5{width:41.66666666666667%}.col-md-6{width:50%}.col-md-7{width:58.333333333333336%}.col-md-8{width:66.66666666666666%}.col-md-9{width:75%}.col-md-10{width:83.33333333333334%}.col-md-11{width:91.66666666666666%}.col-md-12{width:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.333333333333332%}.col-md-push-2{left:16.666666666666664%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333333333333%}.col-md-push-5{left:41.66666666666667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.333333333333336%}.col-md-push-8{left:66.66666666666666%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333333333334%}.col-md-push-11{left:91.66666666666666%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-11{right:91.66666666666666%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-11{margin-left:91.66666666666666%}}@media(min-width:1200px){.container{max-width:1170px}.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11{float:left}.col-lg-1{width:8.333333333333332%}.col-lg-2{width:16.666666666666664%}.col-lg-3{width:25%}.col-lg-4{width:33.33333333333333%}.col-lg-5{width:41.66666666666667%}.col-lg-6{width:50%}.col-lg-7{width:58.333333333333336%}.col-lg-8{width:66.66666666666666%}.col-lg-9{width:75%}.col-lg-10{width:83.33333333333334%}.col-lg-11{width:91.66666666666666%}.col-lg-12{width:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-11{left:91.66666666666666%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-11{margin-left:91.66666666666666%}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:18px}.table thead>tr>th,.table tbody>tr>th,.table tfoot>tr>th,.table thead>tr>td,.table tbody>tr>td,.table tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.table thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table caption+thead tr:first-child th,.table colgroup+thead tr:first-child th,.table thead:first-child tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed thead>tr>th,.table-condensed tbody>tr>th,.table-condensed tfoot>tr>th,.table-condensed thead>tr>td,.table-condensed tbody>tr>td,.table-condensed tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8;border-color:#d6e9c6}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td{background-color:#d0e9c6;border-color:#c9e2b3}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede;border-color:#eed3d7}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td{background-color:#ebcccc;border-color:#e6c1c7}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3;border-color:#fbeed5}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td{background-color:#faf2cc;border-color:#f8e5be}@media(max-width:768px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0;background-color:#fff}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>thead>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>thead>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:18px;font-size:19.5px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}select[multiple],select[size]{height:auto}select optgroup{font-size:inherit;font-style:inherit;font-family:inherit}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{height:auto}.form-control:-moz-placeholder{color:#999}.form-control::-moz-placeholder{color:#999}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control{display:block;width:100%;height:32px;padding:6px 12px;font-size:13px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6)}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}textarea.form-control{height:auto}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:18px;margin-top:10px;margin-bottom:10px;padding-left:20px;vertical-align:middle}.radio label,.checkbox label{display:inline;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm{height:auto}.input-lg{height:44px;padding:10px 16px;font-size:17px;line-height:1.33;border-radius:6px}select.input-lg{height:44px;line-height:44px}textarea.input-lg{height:auto}.has-warning .help-block,.has-warning .control-label{color:#c09853}.has-warning .form-control{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.has-warning .input-group-addon{color:#c09853;border-color:#c09853;background-color:#fcf8e3}.has-error .help-block,.has-error .control-label{color:#b94a48}.has-error .form-control{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.has-error .input-group-addon{color:#b94a48;border-color:#b94a48;background-color:#f2dede}.has-success .help-block,.has-success .control-label{color:#468847}.has-success .form-control{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.has-success .input-group-addon{color:#468847;border-color:#468847;background-color:#dff0d8}.form-control-static{margin-bottom:0;padding-top:7px}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media(min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table}.form-horizontal .form-group:after{clear:both}@media(min-width:768px){.form-horizontal .control-label{text-align:right}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:13px;font-weight:normal;line-height:1.428571429;text-align:center;vertical-align:middle;cursor:pointer;border:1px solid transparent;border-radius:4px;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-link{color:#428bca;font-weight:normal;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg{padding:10px 16px;font-size:17px;line-height:1.33;border-radius:6px}.btn-sm,.btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs{padding:1px 5px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-print:before{content:"\e045"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-briefcase:before{content:"\1f4bc"}.glyphicon-calendar:before{content:"\1f4c5"}.glyphicon-pushpin:before{content:"\1f4cc"}.glyphicon-paperclip:before{content:"\1f4ce"}.glyphicon-camera:before{content:"\1f4f7"}.glyphicon-lock:before{content:"\1f512"}.glyphicon-bell:before{content:"\1f514"}.glyphicon-bookmark:before{content:"\1f516"}.glyphicon-fire:before{content:"\1f525"}.glyphicon-wrench:before{content:"\1f527"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;border-bottom:0 dotted;content:""}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:13px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:8px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.428571429;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#fff;background-color:#428bca}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0 dotted;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media(min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-default .caret{border-top-color:#333}.btn-primary .caret,.btn-success .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret{border-top-color:#fff}.dropup .btn-default .caret{border-bottom-color:#333}.dropup .btn-primary .caret,.dropup .btn-success .caret,.dropup .btn-warning .caret,.dropup .btn-danger .caret,.dropup .btn-info .caret{border-bottom-color:#fff}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar:before,.btn-toolbar:after{content:" ";display:table}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{content:" ";display:table}.btn-toolbar:after{clear:both}.btn-toolbar .btn-group{float:left}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-group+.btn-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group-xs>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px;padding:1px 5px}.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-lg>.btn{padding:10px 16px;font-size:17px;line-height:1.33;border-radius:6px}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{content:" ";display:table}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{content:" ";display:table}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:4px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child>.btn:last-child,.btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified .btn{float:none;display:table-cell;width:1%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group.col{float:none;padding-left:0;padding-right:0}.input-group .form-control{width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:44px;padding:10px 16px;font-size:17px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:44px;line-height:44px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:13px;font-weight:normal;line-height:1;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:17px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-4px}.input-group-btn>.btn:hover,.input-group-btn>.btn:active{z-index:2}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav:before,.nav:after{content:" ";display:table}.nav:after{clear:both}.nav:before,.nav:after{content:" ";display:table}.nav:after{clear:both}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:8px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center}@media(min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}}.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;margin-right:0}.nav-tabs.nav-justified>.active>a{border-bottom-color:#fff}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:5px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center}@media(min-width:768px){.nav-justified>li{display:table-cell;width:1%}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;margin-right:0}.nav-tabs-justified>.active>a{border-bottom-color:#fff}.tabbable:before,.tabbable:after{content:" ";display:table}.tabbable:after{clear:both}.tabbable:before,.tabbable:after{content:" ";display:table}.tabbable:after{clear:both}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.nav .caret{border-top-color:#428bca;border-bottom-color:#428bca}.nav a:hover .caret{border-top-color:#2a6496;border-bottom-color:#2a6496}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;z-index:1000;min-height:50px;margin-bottom:18px;border:1px solid transparent}.navbar:before,.navbar:after{content:" ";display:table}.navbar:after{clear:both}.navbar:before,.navbar:after{content:" ";display:table}.navbar:after{clear:both}@media(min-width:768px){.navbar{border-radius:4px}}.navbar-header:before,.navbar-header:after{content:" ";display:table}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{content:" ";display:table}.navbar-header:after{clear:both}@media(min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media(min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-collapse .navbar-nav.navbar-left:first-child{margin-left:-15px}.navbar-collapse .navbar-nav.navbar-right:last-child{margin-right:-15px}.navbar-collapse .navbar-text:last-child{margin-right:0}}.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media(min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{border-width:0 0 1px}@media(min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;border-width:0 0 1px}@media(min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{z-index:1030;top:0}.navbar-fixed-bottom{bottom:0;margin-bottom:0}.navbar-brand{float:left;padding:16px 15px;font-size:17px;line-height:18px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media(min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;border:1px solid transparent;border-radius:4px}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media(min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:8px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:18px}@media(max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:18px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media(min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:16px;padding-bottom:16px}}@media(min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:9px;margin-bottom:9px}@media(min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media(max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media(min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{left:auto;right:0}.navbar-btn{margin-top:9px;margin-bottom:9px}.navbar-text{float:left;margin-top:16px;margin-bottom:16px}@media(min-width:768px){.navbar-text{margin-left:15px;margin-right:15px}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#ccc}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e6e6e6}.navbar-default .navbar-nav>.dropdown>a:hover .caret,.navbar-default .navbar-nav>.dropdown>a:focus .caret{border-top-color:#333;border-bottom-color:#333}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}.navbar-default .navbar-nav>.open>a .caret,.navbar-default .navbar-nav>.open>a:hover .caret,.navbar-default .navbar-nav>.open>a:focus .caret{border-top-color:#555;border-bottom-color:#555}.navbar-default .navbar-nav>.dropdown>a .caret{border-top-color:#777;border-bottom-color:#777}@media(max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}.navbar-inverse .navbar-nav>.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-nav>.dropdown>a .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .navbar-nav>.open>a .caret,.navbar-inverse .navbar-nav>.open>a:hover .caret,.navbar-inverse .navbar-nav>.open>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}@media(max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:18px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:18px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#eee}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca;cursor:default}.pagination>.disabled>span,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:17px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:18px 0;list-style:none;text-align:center}.pager:before,.pager:after{content:" ";display:table}.pager:after{clear:both}.pager:before,.pager:after{content:" ";display:table}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#fff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999;border-radius:10px}.badge:empty{display:none}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.btn .badge{position:relative;top:-1px}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;font-size:19.5px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eee}.jumbotron h1{line-height:1;color:inherit}.jumbotron p{line-height:1.4}.container .jumbotron{border-radius:6px}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1{font-size:58.5px}}.thumbnail{padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto;display:block}.thumbnail>img{display:block;max-width:100%;height:auto}a.thumbnail:hover,a.thumbnail:focus{border-color:#428bca}.thumbnail>img{margin-left:auto;margin-right:auto}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:18px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#356635}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#2d6987}.alert-warning{background-color:#fcf8e3;border-color:#fbeed5;color:#c09853}.alert-warning hr{border-top-color:#f8e5be}.alert-warning .alert-link{color:#a47e3c}.alert-danger{background-color:#f2dede;border-color:#eed3d7;color:#b94a48}.alert-danger hr{border-top-color:#e6c1c7}.alert-danger .alert-link{color:#953b39}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:18px;margin-bottom:18px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:18px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-body:before,.panel-body:after{content:" ";display:table}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{content:" ";display:table}.panel-body:after{clear:both}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0}.panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.list-group .list-group-item:last-child{border-bottom:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table{margin-bottom:0}.panel>.panel-body+.table{border-top:1px solid #ddd}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-title{margin-top:0;margin-bottom:0;font-size:15px}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-group .panel{margin-bottom:0;border-radius:4px;overflow:hidden}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-warning{border-color:#fbeed5}.panel-warning>.panel-heading{color:#c09853;background-color:#fcf8e3;border-color:#fbeed5}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#fbeed5}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#fbeed5}.panel-danger{border-color:#eed3d7}.panel-danger>.panel-heading{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#eed3d7}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#eed3d7}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:19.5px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}body.modal-open,.modal-open .navbar-fixed-top,.modal-open .navbar-fixed-bottom{margin-right:15px}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{margin-left:auto;margin-right:auto;width:auto;padding:10px;z-index:1050}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.428571429px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.428571429}.modal-body{position:relative;padding:20px}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:before,.modal-footer:after{content:" ";display:table}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{content:" ";display:table}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.modal-dialog{left:50%;right:auto;width:600px;padding-top:30px;padding-bottom:30px}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}}.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;right:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:13px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top .arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.popover.right .arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom .arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom .arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.popover.left .arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-control.left{background-image:-webkit-gradient(linear,0% top,100% top,from(rgba(0,0,0,0.5)),to(rgba(0,0,0,0.0001)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.5) 0),color-stop(rgba(0,0,0,0.0001) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',endColorstr='#00000000',GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-gradient(linear,0% top,100% top,from(rgba(0,0,0,0.0001)),to(rgba(0,0,0,0.5)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.0001) 0),color-stop(rgba(0,0,0,0.5) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#80000000',GradientType=1)}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;left:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.affix{position:fixed}@-ms-viewport{width:device-width}@media screen and (max-width:400px){@-ms-viewport{width:320px}}.hidden{display:none!important;visibility:hidden!important}.visible-xs{display:none!important}tr.visible-xs{display:none!important}th.visible-xs,td.visible-xs{display:none!important}@media(max-width:767px){.visible-xs{display:block!important}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block!important}tr.visible-xs.visible-sm{display:table-row!important}th.visible-xs.visible-sm,td.visible-xs.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block!important}tr.visible-xs.visible-md{display:table-row!important}th.visible-xs.visible-md,td.visible-xs.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-xs.visible-lg{display:block!important}tr.visible-xs.visible-lg{display:table-row!important}th.visible-xs.visible-lg,td.visible-xs.visible-lg{display:table-cell!important}}.visible-sm{display:none!important}tr.visible-sm{display:none!important}th.visible-sm,td.visible-sm{display:none!important}@media(max-width:767px){.visible-sm.visible-xs{display:block!important}tr.visible-sm.visible-xs{display:table-row!important}th.visible-sm.visible-xs,td.visible-sm.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-sm{display:block!important}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block!important}tr.visible-sm.visible-md{display:table-row!important}th.visible-sm.visible-md,td.visible-sm.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-sm.visible-lg{display:block!important}tr.visible-sm.visible-lg{display:table-row!important}th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell!important}}.visible-md{display:none!important}tr.visible-md{display:none!important}th.visible-md,td.visible-md{display:none!important}@media(max-width:767px){.visible-md.visible-xs{display:block!important}tr.visible-md.visible-xs{display:table-row!important}th.visible-md.visible-xs,td.visible-md.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block!important}tr.visible-md.visible-sm{display:table-row!important}th.visible-md.visible-sm,td.visible-md.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-md{display:block!important}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-md.visible-lg{display:block!important}tr.visible-md.visible-lg{display:table-row!important}th.visible-md.visible-lg,td.visible-md.visible-lg{display:table-cell!important}}.visible-lg{display:none!important}tr.visible-lg{display:none!important}th.visible-lg,td.visible-lg{display:none!important}@media(max-width:767px){.visible-lg.visible-xs{display:block!important}tr.visible-lg.visible-xs{display:table-row!important}th.visible-lg.visible-xs,td.visible-lg.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block!important}tr.visible-lg.visible-sm{display:table-row!important}th.visible-lg.visible-sm,td.visible-lg.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block!important}tr.visible-lg.visible-md{display:table-row!important}th.visible-lg.visible-md,td.visible-lg.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-lg{display:block!important}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}.hidden-xs{display:block!important}tr.hidden-xs{display:table-row!important}th.hidden-xs,td.hidden-xs{display:table-cell!important}@media(max-width:767px){.hidden-xs{display:none!important}tr.hidden-xs{display:none!important}th.hidden-xs,td.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm{display:none!important}tr.hidden-xs.hidden-sm{display:none!important}th.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md{display:none!important}tr.hidden-xs.hidden-md{display:none!important}th.hidden-xs.hidden-md,td.hidden-xs.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-xs.hidden-lg{display:none!important}tr.hidden-xs.hidden-lg{display:none!important}th.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg{display:none!important}}.hidden-sm{display:block!important}tr.hidden-sm{display:table-row!important}th.hidden-sm,td.hidden-sm{display:table-cell!important}@media(max-width:767px){.hidden-sm.hidden-xs{display:none!important}tr.hidden-sm.hidden-xs{display:none!important}th.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}tr.hidden-sm{display:none!important}th.hidden-sm,td.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md{display:none!important}tr.hidden-sm.hidden-md{display:none!important}th.hidden-sm.hidden-md,td.hidden-sm.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-sm.hidden-lg{display:none!important}tr.hidden-sm.hidden-lg{display:none!important}th.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg{display:none!important}}.hidden-md{display:block!important}tr.hidden-md{display:table-row!important}th.hidden-md,td.hidden-md{display:table-cell!important}@media(max-width:767px){.hidden-md.hidden-xs{display:none!important}tr.hidden-md.hidden-xs{display:none!important}th.hidden-md.hidden-xs,td.hidden-md.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-md.hidden-sm{display:none!important}tr.hidden-md.hidden-sm{display:none!important}th.hidden-md.hidden-sm,td.hidden-md.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}tr.hidden-md{display:none!important}th.hidden-md,td.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-md.hidden-lg{display:none!important}tr.hidden-md.hidden-lg{display:none!important}th.hidden-md.hidden-lg,td.hidden-md.hidden-lg{display:none!important}}.hidden-lg{display:block!important}tr.hidden-lg{display:table-row!important}th.hidden-lg,td.hidden-lg{display:table-cell!important}@media(max-width:767px){.hidden-lg.hidden-xs{display:none!important}tr.hidden-lg.hidden-xs{display:none!important}th.hidden-lg.hidden-xs,td.hidden-lg.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-lg.hidden-sm{display:none!important}tr.hidden-lg.hidden-sm{display:none!important}th.hidden-lg.hidden-sm,td.hidden-lg.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-lg.hidden-md{display:none!important}tr.hidden-lg.hidden-md{display:none!important}th.hidden-lg.hidden-md,td.hidden-lg.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-lg{display:none!important}tr.hidden-lg{display:none!important}th.hidden-lg,td.hidden-lg{display:none!important}}.visible-print{display:none!important}tr.visible-print{display:none!important}th.visible-print,td.visible-print{display:none!important}@media print{.visible-print{display:block!important}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}.hidden-print{display:none!important}tr.hidden-print{display:none!important}th.hidden-print,td.hidden-print{display:none!important}}.link-inherit{color:inherit}.link-inherit:hover,.link-inherit:focus{color:inherit}.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}.book-chapter{display:none}article{page-break-after:always}h1{font-size:27px}h2{font-size:22px}h3{font-size:17px}h4{font-size:13px}h5{font-size:12px}h6{font-size:9px}pre,blockquote{border:1px solid #999;page-break-inside:avoid}img{max-width:100%!important;page-break-inside:avoid}.exercise{margin:1cm 0;padding:.4cm;page-break-inside:avoid;border:3px solid #ddd}.exercise .exercise-header{margin-bottom:.4cm;padding-bottom:.2cm;border-bottom:1px solid #ddd} \ No newline at end of file +.link-inherit{color:inherit}.link-inherit:hover,.link-inherit:focus{color:inherit}.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}.book-chapter{display:none}article{page-break-after:always}pre,blockquote{border:1px solid #999;page-break-inside:avoid;background:#f1f1f1;padding:8px}img{max-width:100%!important;page-break-inside:avoid;margin:0 auto}.exercise,.quiz{margin:1cm 0;padding:.4cm;page-break-inside:avoid;border:3px solid #ddd}.exercise .exercise-header,.quiz .exercise-header{margin-bottom:.4cm;padding-bottom:.2cm;border-bottom:1px solid #ddd}.exercise .question,.quiz .question{margin-top:.4cm} \ No newline at end of file diff --git a/gitbook/style.css b/gitbook/style.css index d2a74234..9593fb16 100755 --- a/gitbook/style.css +++ b/gitbook/style.css @@ -1 +1 @@ -article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:Merriweather,"EB Garamond",Georgia,serif;font-size:14px;line-height:1.428571429;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}button,input,select[multiple],textarea{background-image:none}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:3px}.img-thumbnail{padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:1px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16.099999999999998px;font-weight:200;line-height:1.4}@media(min-width:768px){.lead{font-size:21px}}small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#428bca}.text-warning{color:#c09853}.text-danger{color:#b94a48}.text-success{color:#468847}.text-info{color:#3a87ad}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:Merriweather,"EB Garamond",Georgia,serif;font-weight:500;line-height:1.1}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{margin-top:20px;margin-bottom:10px}h4,h5,h6{margin-top:10px;margin-bottom:10px}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}h1 small,.h1 small{font-size:24px}h2 small,.h2 small{font-size:18px}h3 small,.h3 small,h4 small,.h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-bottom:20px}dt,dd{line-height:1.428571429}dt{font-weight:bold}dd{margin-left:0}@media(min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table}.dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{font-size:17.5px;font-weight:300;line-height:1.25}blockquote p:last-child{margin-bottom:0}blockquote small{display:block;line-height:1.428571429;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:1.428571429}code,pre{font-family:Monaco,Menlo,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:1px}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:1px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.container:before,.container:after{content:" ";display:table}.container:after{clear:both}.container:before,.container:after{content:" ";display:table}.container:after{clear:both}.row{margin-left:-15px;margin-right:-15px}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11{float:left}.col-xs-1{width:8.333333333333332%}.col-xs-2{width:16.666666666666664%}.col-xs-3{width:25%}.col-xs-4{width:33.33333333333333%}.col-xs-5{width:41.66666666666667%}.col-xs-6{width:50%}.col-xs-7{width:58.333333333333336%}.col-xs-8{width:66.66666666666666%}.col-xs-9{width:75%}.col-xs-10{width:83.33333333333334%}.col-xs-11{width:91.66666666666666%}.col-xs-12{width:100%}@media(min-width:768px){.container{max-width:750px}.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11{float:left}.col-sm-1{width:8.333333333333332%}.col-sm-2{width:16.666666666666664%}.col-sm-3{width:25%}.col-sm-4{width:33.33333333333333%}.col-sm-5{width:41.66666666666667%}.col-sm-6{width:50%}.col-sm-7{width:58.333333333333336%}.col-sm-8{width:66.66666666666666%}.col-sm-9{width:75%}.col-sm-10{width:83.33333333333334%}.col-sm-11{width:91.66666666666666%}.col-sm-12{width:100%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-11{left:91.66666666666666%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-11{margin-left:91.66666666666666%}}@media(min-width:992px){.container{max-width:970px}.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11{float:left}.col-md-1{width:8.333333333333332%}.col-md-2{width:16.666666666666664%}.col-md-3{width:25%}.col-md-4{width:33.33333333333333%}.col-md-5{width:41.66666666666667%}.col-md-6{width:50%}.col-md-7{width:58.333333333333336%}.col-md-8{width:66.66666666666666%}.col-md-9{width:75%}.col-md-10{width:83.33333333333334%}.col-md-11{width:91.66666666666666%}.col-md-12{width:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.333333333333332%}.col-md-push-2{left:16.666666666666664%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333333333333%}.col-md-push-5{left:41.66666666666667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.333333333333336%}.col-md-push-8{left:66.66666666666666%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333333333334%}.col-md-push-11{left:91.66666666666666%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-11{right:91.66666666666666%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-11{margin-left:91.66666666666666%}}@media(min-width:1200px){.container{max-width:1170px}.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11{float:left}.col-lg-1{width:8.333333333333332%}.col-lg-2{width:16.666666666666664%}.col-lg-3{width:25%}.col-lg-4{width:33.33333333333333%}.col-lg-5{width:41.66666666666667%}.col-lg-6{width:50%}.col-lg-7{width:58.333333333333336%}.col-lg-8{width:66.66666666666666%}.col-lg-9{width:75%}.col-lg-10{width:83.33333333333334%}.col-lg-11{width:91.66666666666666%}.col-lg-12{width:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-11{left:91.66666666666666%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-11{margin-left:91.66666666666666%}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table thead>tr>th,.table tbody>tr>th,.table tfoot>tr>th,.table thead>tr>td,.table tbody>tr>td,.table tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.table thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table caption+thead tr:first-child th,.table colgroup+thead tr:first-child th,.table thead:first-child tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed thead>tr>th,.table-condensed tbody>tr>th,.table-condensed tfoot>tr>th,.table-condensed thead>tr>td,.table-condensed tbody>tr>td,.table-condensed tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8;border-color:#d6e9c6}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td{background-color:#d0e9c6;border-color:#c9e2b3}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede;border-color:#eed3d7}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td{background-color:#ebcccc;border-color:#e6c1c7}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3;border-color:#fbeed5}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td{background-color:#faf2cc;border-color:#f8e5be}@media(max-width:768px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0;background-color:#fff}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>thead>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>thead>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}select[multiple],select[size]{height:auto}select optgroup{font-size:inherit;font-style:inherit;font-family:inherit}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{height:auto}.form-control:-moz-placeholder{color:#999}.form-control::-moz-placeholder{color:#999}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;border:1px solid #ccc;border-radius:1px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6)}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}textarea.form-control{height:auto}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;margin-top:10px;margin-bottom:10px;padding-left:20px;vertical-align:middle}.radio label,.checkbox label{display:inline;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px}select.input-sm{height:30px;line-height:30px}textarea.input-sm{height:auto}.input-lg{height:45px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:3px}select.input-lg{height:45px;line-height:45px}textarea.input-lg{height:auto}.has-warning .help-block,.has-warning .control-label{color:#c09853}.has-warning .form-control{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.has-warning .input-group-addon{color:#c09853;border-color:#c09853;background-color:#fcf8e3}.has-error .help-block,.has-error .control-label{color:#b94a48}.has-error .form-control{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.has-error .input-group-addon{color:#b94a48;border-color:#b94a48;background-color:#f2dede}.has-success .help-block,.has-success .control-label{color:#468847}.has-success .form-control{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.has-success .input-group-addon{color:#468847;border-color:#468847;background-color:#dff0d8}.form-control-static{margin-bottom:0;padding-top:7px}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media(min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table}.form-horizontal .form-group:after{clear:both}@media(min-width:768px){.form-horizontal .control-label{text-align:right}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.428571429;text-align:center;vertical-align:middle;cursor:pointer;border:1px solid transparent;border-radius:1px;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-link{color:#428bca;font-weight:normal;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:3px}.btn-sm,.btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px}.btn-xs{padding:1px 5px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-print:before{content:"\e045"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-briefcase:before{content:"\1f4bc"}.glyphicon-calendar:before{content:"\1f4c5"}.glyphicon-pushpin:before{content:"\1f4cc"}.glyphicon-paperclip:before{content:"\1f4ce"}.glyphicon-camera:before{content:"\1f4f7"}.glyphicon-lock:before{content:"\1f512"}.glyphicon-bell:before{content:"\1f514"}.glyphicon-bookmark:before{content:"\1f516"}.glyphicon-fire:before{content:"\1f525"}.glyphicon-wrench:before{content:"\1f527"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;border-bottom:0 dotted;content:""}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:1px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.428571429;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#fff;background-color:#428bca}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0 dotted;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media(min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-default .caret{border-top-color:#333}.btn-primary .caret,.btn-success .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret{border-top-color:#fff}.dropup .btn-default .caret{border-bottom-color:#333}.dropup .btn-primary .caret,.dropup .btn-success .caret,.dropup .btn-warning .caret,.dropup .btn-danger .caret,.dropup .btn-info .caret{border-bottom-color:#fff}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar:before,.btn-toolbar:after{content:" ";display:table}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{content:" ";display:table}.btn-toolbar:after{clear:both}.btn-toolbar .btn-group{float:left}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-group+.btn-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group-xs>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px;padding:1px 5px}.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px}.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:3px}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{content:" ";display:table}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{content:" ";display:table}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:1px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child>.btn:last-child,.btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified .btn{float:none;display:table-cell;width:1%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group.col{float:none;padding-left:0;padding-right:0}.input-group .form-control{width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:45px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:3px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:45px;line-height:45px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:1px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:1px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:3px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-4px}.input-group-btn>.btn:hover,.input-group-btn>.btn:active{z-index:2}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav:before,.nav:after{content:" ";display:table}.nav:after{clear:both}.nav:before,.nav:after{content:" ";display:table}.nav:after{clear:both}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:1px 1px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center}@media(min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}}.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;margin-right:0}.nav-tabs.nav-justified>.active>a{border-bottom-color:#fff}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:5px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center}@media(min-width:768px){.nav-justified>li{display:table-cell;width:1%}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;margin-right:0}.nav-tabs-justified>.active>a{border-bottom-color:#fff}.tabbable:before,.tabbable:after{content:" ";display:table}.tabbable:after{clear:both}.tabbable:before,.tabbable:after{content:" ";display:table}.tabbable:after{clear:both}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.nav .caret{border-top-color:#428bca;border-bottom-color:#428bca}.nav a:hover .caret{border-top-color:#2a6496;border-bottom-color:#2a6496}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;z-index:1000;min-height:50px;margin-bottom:20px;border:1px solid transparent}.navbar:before,.navbar:after{content:" ";display:table}.navbar:after{clear:both}.navbar:before,.navbar:after{content:" ";display:table}.navbar:after{clear:both}@media(min-width:768px){.navbar{border-radius:0}}.navbar-header:before,.navbar-header:after{content:" ";display:table}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{content:" ";display:table}.navbar-header:after{clear:both}@media(min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media(min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-collapse .navbar-nav.navbar-left:first-child{margin-left:-15px}.navbar-collapse .navbar-nav.navbar-right:last-child{margin-right:-15px}.navbar-collapse .navbar-text:last-child{margin-right:0}}.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media(min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{border-width:0 0 1px}@media(min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;border-width:0 0 1px}@media(min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{z-index:1030;top:0}.navbar-fixed-bottom{bottom:0;margin-bottom:0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media(min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;border:1px solid transparent;border-radius:1px}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media(min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media(max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media(min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}@media(min-width:768px){.navbar-left{float:left!important;float:left}.navbar-right{float:right!important;float:right}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8px;margin-bottom:8px}@media(min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media(max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media(min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{left:auto;right:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-text{float:left;margin-top:15px;margin-bottom:15px}@media(min-width:768px){.navbar-text{margin-left:15px;margin-right:15px}}.navbar-default{background-color:#f8f8f8;border-color:#d5d5d5}.navbar-default .navbar-brand{color:#333}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#333;background-color:transparent}.navbar-default .navbar-text{color:#333}.navbar-default .navbar-nav>li>a{color:#333}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#ccc}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e6e6e6}.navbar-default .navbar-nav>.dropdown>a:hover .caret,.navbar-default .navbar-nav>.dropdown>a:focus .caret{border-top-color:#333;border-bottom-color:#333}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}.navbar-default .navbar-nav>.open>a .caret,.navbar-default .navbar-nav>.open>a:hover .caret,.navbar-default .navbar-nav>.open>a:focus .caret{border-top-color:#555;border-bottom-color:#555}.navbar-default .navbar-nav>.dropdown>a .caret{border-top-color:#333;border-bottom-color:#333}@media(max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#333}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#333}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}.navbar-inverse .navbar-nav>.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-nav>.dropdown>a .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .navbar-nav>.open>a .caret,.navbar-inverse .navbar-nav>.open>a:hover .caret,.navbar-inverse .navbar-nav>.open>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}@media(max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:1px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:1px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:1px;border-top-left-radius:1px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:1px;border-top-right-radius:1px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#eee}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca;cursor:default}.pagination>.disabled>span,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:1px;border-top-left-radius:1px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:1px;border-top-right-radius:1px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager:before,.pager:after{content:" ";display:table}.pager:after{clear:both}.pager:before,.pager:after{content:" ";display:table}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#fff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999;border-radius:10px}.badge:empty{display:none}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.btn .badge{position:relative;top:-1px}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;font-size:21px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eee}.jumbotron h1{line-height:1;color:inherit}.jumbotron p{line-height:1.4}.container .jumbotron{border-radius:3px}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1{font-size:63px}}.thumbnail{padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:1px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto;display:block}.thumbnail>img{display:block;max-width:100%;height:auto}a.thumbnail:hover,a.thumbnail:focus{border-color:#428bca}.thumbnail>img{margin-left:auto;margin-right:auto}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:1px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#356635}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#2d6987}.alert-warning{background-color:#fcf8e3;border-color:#fbeed5;color:#c09853}.alert-warning hr{border-top-color:#f8e5be}.alert-warning .alert-link{color:#a47e3c}.alert-danger{background-color:#f2dede;border-color:#eed3d7;color:#b94a48}.alert-danger hr{border-top-color:#e6c1c7}.alert-danger .alert-link{color:#953b39}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:1px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:1px;border-top-left-radius:1px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:1px;border-bottom-left-radius:1px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:1px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-body:before,.panel-body:after{content:" ";display:table}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{content:" ";display:table}.panel-body:after{clear:both}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0}.panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.list-group .list-group-item:last-child{border-bottom:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table{margin-bottom:0}.panel>.panel-body+.table{border-top:1px solid #ddd}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:0;border-top-left-radius:0}.panel-title{margin-top:0;margin-bottom:0;font-size:16px}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:0;border-bottom-left-radius:0}.panel-group .panel{margin-bottom:0;border-radius:1px;overflow:hidden}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-warning{border-color:#fbeed5}.panel-warning>.panel-heading{color:#c09853;background-color:#fcf8e3;border-color:#fbeed5}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#fbeed5}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#fbeed5}.panel-danger{border-color:#eed3d7}.panel-danger>.panel-heading{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#eed3d7}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#eed3d7}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:1px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:3px}.well-sm{padding:9px;border-radius:1px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}body.modal-open,.modal-open .navbar-fixed-top,.modal-open .navbar-fixed-bottom{margin-right:15px}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{margin-left:auto;margin-right:auto;width:auto;padding:10px;z-index:1050}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:3px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.428571429px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.428571429}.modal-body{position:relative;padding:20px}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:before,.modal-footer:after{content:" ";display:table}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{content:" ";display:table}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.modal-dialog{left:50%;right:auto;width:600px;padding-top:30px;padding-bottom:30px}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}}.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:1px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;right:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:3px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top .arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.popover.right .arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom .arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom .arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.popover.left .arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-control.left{background-image:-webkit-gradient(linear,0% top,100% top,from(rgba(0,0,0,0.5)),to(rgba(0,0,0,0.0001)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.5) 0),color-stop(rgba(0,0,0,0.0001) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',endColorstr='#00000000',GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-gradient(linear,0% top,100% top,from(rgba(0,0,0,0.0001)),to(rgba(0,0,0,0.5)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.0001) 0),color-stop(rgba(0,0,0,0.5) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#80000000',GradientType=1)}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;left:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.affix{position:fixed}@-ms-viewport{width:device-width}@media screen and (max-width:400px){@-ms-viewport{width:320px}}.hidden{display:none!important;visibility:hidden!important}.visible-xs{display:none!important}tr.visible-xs{display:none!important}th.visible-xs,td.visible-xs{display:none!important}@media(max-width:767px){.visible-xs{display:block!important}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block!important}tr.visible-xs.visible-sm{display:table-row!important}th.visible-xs.visible-sm,td.visible-xs.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block!important}tr.visible-xs.visible-md{display:table-row!important}th.visible-xs.visible-md,td.visible-xs.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-xs.visible-lg{display:block!important}tr.visible-xs.visible-lg{display:table-row!important}th.visible-xs.visible-lg,td.visible-xs.visible-lg{display:table-cell!important}}.visible-sm{display:none!important}tr.visible-sm{display:none!important}th.visible-sm,td.visible-sm{display:none!important}@media(max-width:767px){.visible-sm.visible-xs{display:block!important}tr.visible-sm.visible-xs{display:table-row!important}th.visible-sm.visible-xs,td.visible-sm.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-sm{display:block!important}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block!important}tr.visible-sm.visible-md{display:table-row!important}th.visible-sm.visible-md,td.visible-sm.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-sm.visible-lg{display:block!important}tr.visible-sm.visible-lg{display:table-row!important}th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell!important}}.visible-md{display:none!important}tr.visible-md{display:none!important}th.visible-md,td.visible-md{display:none!important}@media(max-width:767px){.visible-md.visible-xs{display:block!important}tr.visible-md.visible-xs{display:table-row!important}th.visible-md.visible-xs,td.visible-md.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block!important}tr.visible-md.visible-sm{display:table-row!important}th.visible-md.visible-sm,td.visible-md.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-md{display:block!important}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-md.visible-lg{display:block!important}tr.visible-md.visible-lg{display:table-row!important}th.visible-md.visible-lg,td.visible-md.visible-lg{display:table-cell!important}}.visible-lg{display:none!important}tr.visible-lg{display:none!important}th.visible-lg,td.visible-lg{display:none!important}@media(max-width:767px){.visible-lg.visible-xs{display:block!important}tr.visible-lg.visible-xs{display:table-row!important}th.visible-lg.visible-xs,td.visible-lg.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block!important}tr.visible-lg.visible-sm{display:table-row!important}th.visible-lg.visible-sm,td.visible-lg.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block!important}tr.visible-lg.visible-md{display:table-row!important}th.visible-lg.visible-md,td.visible-lg.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-lg{display:block!important}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}.hidden-xs{display:block!important}tr.hidden-xs{display:table-row!important}th.hidden-xs,td.hidden-xs{display:table-cell!important}@media(max-width:767px){.hidden-xs{display:none!important}tr.hidden-xs{display:none!important}th.hidden-xs,td.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm{display:none!important}tr.hidden-xs.hidden-sm{display:none!important}th.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md{display:none!important}tr.hidden-xs.hidden-md{display:none!important}th.hidden-xs.hidden-md,td.hidden-xs.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-xs.hidden-lg{display:none!important}tr.hidden-xs.hidden-lg{display:none!important}th.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg{display:none!important}}.hidden-sm{display:block!important}tr.hidden-sm{display:table-row!important}th.hidden-sm,td.hidden-sm{display:table-cell!important}@media(max-width:767px){.hidden-sm.hidden-xs{display:none!important}tr.hidden-sm.hidden-xs{display:none!important}th.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}tr.hidden-sm{display:none!important}th.hidden-sm,td.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md{display:none!important}tr.hidden-sm.hidden-md{display:none!important}th.hidden-sm.hidden-md,td.hidden-sm.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-sm.hidden-lg{display:none!important}tr.hidden-sm.hidden-lg{display:none!important}th.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg{display:none!important}}.hidden-md{display:block!important}tr.hidden-md{display:table-row!important}th.hidden-md,td.hidden-md{display:table-cell!important}@media(max-width:767px){.hidden-md.hidden-xs{display:none!important}tr.hidden-md.hidden-xs{display:none!important}th.hidden-md.hidden-xs,td.hidden-md.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-md.hidden-sm{display:none!important}tr.hidden-md.hidden-sm{display:none!important}th.hidden-md.hidden-sm,td.hidden-md.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}tr.hidden-md{display:none!important}th.hidden-md,td.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-md.hidden-lg{display:none!important}tr.hidden-md.hidden-lg{display:none!important}th.hidden-md.hidden-lg,td.hidden-md.hidden-lg{display:none!important}}.hidden-lg{display:block!important}tr.hidden-lg{display:table-row!important}th.hidden-lg,td.hidden-lg{display:table-cell!important}@media(max-width:767px){.hidden-lg.hidden-xs{display:none!important}tr.hidden-lg.hidden-xs{display:none!important}th.hidden-lg.hidden-xs,td.hidden-lg.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-lg.hidden-sm{display:none!important}tr.hidden-lg.hidden-sm{display:none!important}th.hidden-lg.hidden-sm,td.hidden-lg.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-lg.hidden-md{display:none!important}tr.hidden-lg.hidden-md{display:none!important}th.hidden-lg.hidden-md,td.hidden-lg.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-lg{display:none!important}tr.hidden-lg{display:none!important}th.hidden-lg,td.hidden-lg{display:none!important}}.visible-print{display:none!important}tr.visible-print{display:none!important}th.visible-print,td.visible-print{display:none!important}@media print{.visible-print{display:block!important}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}.hidden-print{display:none!important}tr.hidden-print{display:none!important}th.hidden-print,td.hidden-print{display:none!important}}@font-face{font-family:'FontAwesome';src:url('.//fonts/fontawesome/fontawesome-webfont.eot');src:url('.//fonts/fontawesome/fontawesome-webfont.eot') format('embedded-opentype'),url('.//fonts/fontawesome/fontawesome-webfont.woff') format('woff'),url('.//fonts/fontawesome/fontawesome-webfont.ttf') format('truetype'),url('.//fonts/fontawesome/fontawesome-webfont.svg') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857142858em;text-align:center}.fa-ul{padding-left:0;margin-left:2.142857142857143em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;top:.14285714285714285em;text-align:center}.fa-li.fa-lg{left:-1.8571428571428572em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-move:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-resize-full:before{content:"\f065"}.fa-resize-small:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-resize-vertical:before{content:"\f07d"}.fa-resize-horizontal:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-fullscreen:before{content:"\f0b2"}.fa-group:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-asc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-desc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building:before{content:"\f0f7"}.fa-hospital:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-expand-o:before{content:"\f116"}.fa-collapse-o:before{content:"\f117"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-reply-all:before{content:"\f122"}.fa-mail-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-o:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-horizontal:before{content:"\f141"}.fa-ellipsis-vertical:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.link-inherit{color:inherit}.link-inherit:hover,.link-inherit:focus{color:inherit}@font-face{font-family:'EB Garamond';font-style:normal;font-weight:400;src:local('EB Garamond 12 Regular'),url('.//fonts/ebgaramond/400.woff') format('woff')}@font-face{font-family:'EB Garamond';font-style:italic;font-weight:400i;src:local('EB Garamond 12 Italic'),url('.//fonts/ebgaramond/400i.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:normal;font-weight:250;src:local('Merriweather Light'),url('.//fonts/merriweather/250.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:italic;font-weight:250i;src:local('Merriweather Light Italic'),url('.//fonts/merriweather/250i.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:normal;font-weight:400;src:local('Merriweather'),url('.//fonts/merriweather/400.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:italic;font-weight:400i;src:local('Merriweather Italic'),url('.//fonts/merriweather/400i.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:normal;font-weight:600;src:local(''),url('.//fonts/merriweather/600.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:normal;font-weight:700;src:local('Merriweather Bold'),url('.//fonts/merriweather/700.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:italic;font-weight:700i;src:local('Merriweather Bold Italic'),url('.//fonts/merriweather/700i.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:normal;font-weight:900;src:local('Merriweather Heavy'),url('.//fonts/merriweather/900.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:italic;font-weight:900i;src:local('Merriweather Heavy Italic'),url('.//fonts/merriweather/900i.woff') format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:400;src:local('Anonymous Pro'),url('.//fonts/anonymouspro/400.woff') format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:400i;src:local('Anonymous Pro Italic'),url('.//fonts/anonymouspro/400i.woff') format('woff')}@font-face{font-family:'Anonymous Pro';font-style:normal;font-weight:700;src:local('Anonymous Pro Bold'),url('.//fonts/anonymouspro/700.woff') format('woff')}@font-face{font-family:'Anonymous Pro';font-style:italic;font-weight:700i;src:local('Anonymous Pro Bold Italic'),url('.//fonts/anonymouspro/700i.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),url('.//fonts/opensans/300.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300i;src:local('Open Sans Light Italic'),url('.//fonts/opensans/300i.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans Regular'),url('.//fonts/opensans/400.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400i;src:local('Open Sans Italic'),url('.//fonts/opensans/400i.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),url('.//fonts/opensans/600.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600i;src:local('Open Sans Semibold Italic'),url('.//fonts/opensans/600i.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:700;src:local('Open Sans Bold'),url('.//fonts/opensans/700.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:italic;font-weight:700i;src:local('Open Sans Bold Italic'),url('.//fonts/opensans/700i.woff') format('woff')}.book-langs-index{width:100%;height:100%;padding:40px 0;margin:0;overflow:auto}@media(max-width:600px){.book-langs-index{padding:0}}.book-langs-index .inner{max-width:600px;width:100%;margin:0 auto;padding:30px;background:#fff;border-radius:3px}.book-langs-index .inner h3{margin:0}.book-langs-index .inner .languages{list-style:none;padding:20px 30px;margin-top:20px;border-top:1px solid #eee}.book-langs-index .inner .languages:before,.book-langs-index .inner .languages:after{content:" ";display:table}.book-langs-index .inner .languages:after{clear:both}.book-langs-index .inner .languages:before,.book-langs-index .inner .languages:after{content:" ";display:table}.book-langs-index .inner .languages:after{clear:both}.book-langs-index .inner .languages li{width:50%;float:left;padding:10px 5px;font-size:16px}@media(max-width:600px){.book-langs-index .inner .languages li{width:100%;max-width:100%}}.book .book-header{font-family:"Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif;position:absolute;overflow:visible;top:0;right:0;left:0;height:50px;z-index:2;font-size:.85em;color:#7e888b;background:#fff;box-shadow:0 1px 2px rgba(199,206,209,0.6)}.book .book-header .btn{display:block;height:50px;padding:0 15px;border-bottom:0;color:#7e888b;text-transform:uppercase;line-height:50px;-webkit-box-shadow:none!important;box-shadow:none!important;position:relative}.book .book-header .btn:hover{position:relative;text-decoration:none;color:#151515;background:#f0f2f4}.book .book-header h1{margin:0;font-size:20px;text-align:center;line-height:50px;padding-left:200px;padding-right:200px;-webkit-transition:margin-left .5s ease;transition:margin-left .5s ease}.book .book-header h1 a,.book .book-header h1 a:hover{color:inherit;text-decoration:none}@media(max-width:800px){.book .book-header h1{display:none}}.book .book-header h1 i{display:none}.book.is-loading .book-header h1 i{display:inline-block}.book.is-loading .book-header h1 a{display:none}.book.with-summary .book-header h1{margin-left:250px}.book.without-animation .book-header h1{-webkit-transition:none!important;transition:none!important}.book.color-theme-1 .book-header{color:#afa790;background:#ece3c4}.book.color-theme-1 .book-header .btn{color:#afa790}.book.color-theme-1 .book-header .btn:hover{color:#73553c;background:#e2dabe}.book.color-theme-2 .book-header{color:#7e888b;background:#1d1f21}.book.color-theme-2 .book-header .btn{color:#7e888b}.book.color-theme-2 .book-header .btn:hover{color:#c9c9c9;background:#0b0d0e}.book .book-summary{font-family:"Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif;position:absolute;top:50px;left:-250px;bottom:0;z-index:1;width:250px;color:#c4cdd4;background:#f0f2f4;box-shadow:inset -1px 0 5px rgba(0,0,0,0.1);-webkit-transition:all .5s ease;transition:all .5s ease}.book .book-summary .book-search{padding:6px;background:transparent;position:absolute;top:-50px;left:0;right:0;-webkit-transition:top .5s ease;transition:top .5s ease}.book .book-summary .book-search input,.book .book-summary .book-search input:focus{width:100%;border:1px solid #c4cdd4;-webkit-box-shadow:none;box-shadow:none}.book .book-summary ul.summary{position:absolute;top:0;left:0;right:0;bottom:0;overflow-y:auto;list-style:none;margin:0;padding:0;-webkit-transition:top .5s ease;transition:top .5s ease}.book .book-summary ul.summary li{list-style:none}.book .book-summary ul.summary li.divider{height:1px;margin:7px 0;overflow:hidden;background:#d3d9de;box-shadow:0 1px rgba(255,255,255,0.7)}.book .book-summary ul.summary li i.fa-check{display:none;position:absolute;right:9px;top:16px;font-size:9px;color:#3c3}.book .book-summary ul.summary li.done>a{color:#364149;font-weight:normal}.book .book-summary ul.summary li.done>a i{display:inline}.book .book-summary ul.summary li a,.book .book-summary ul.summary li span{display:block;padding:10px 15px;border-bottom:0;color:#6c8193;background:transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative}.book .book-summary ul.summary li span{cursor:not-allowed;opacity:.3;filter:alpha(opacity=30)}.book .book-summary ul.summary li.active>a,.book .book-summary ul.summary li a:hover{color:#008cff;background:transparent;text-decoration:none}.book .book-summary ul.summary li ul{padding-left:20px}@media(max-width:600px){.book .book-summary{width:100%;bottom:0;left:-100%}}.book.with-summary .book-summary{left:0}.book.without-animation .book-summary{-webkit-transition:none!important;transition:none!important}.book.with-search .book-summary .book-search{top:0}.book.with-search .book-summary ul.summary{top:50px}.book.color-theme-1 .book-summary{color:#afa790;background:#f3eacb}.book.color-theme-1 .book-summary .book-search{background:transparent}.book.color-theme-1 .book-summary .book-search input,.book.color-theme-1 .book-summary .book-search input:focus{border:1px solid #d6cfba}.book.color-theme-1 .book-summary ul.summary li.divider{background:#d3d9de;box-shadow:none}.book.color-theme-1 .book-summary ul.summary li i.fa-check{color:#3c3}.book.color-theme-1 .book-summary ul.summary li.done>a{color:#364149}.book.color-theme-1 .book-summary ul.summary li a,.book.color-theme-1 .book-summary ul.summary li span{color:#877f6a;background:transparent}.book.color-theme-1 .book-summary ul.summary li.active>a,.book.color-theme-1 .book-summary ul.summary li a:hover{color:#704214;background:transparent}.book.color-theme-2 .book-summary{color:#c4cdd4;background:#111}.book.color-theme-2 .book-summary .book-search{background:transparent}.book.color-theme-2 .book-summary .book-search input,.book.color-theme-2 .book-summary .book-search input:focus{border:1px solid #c4cdd4}.book.color-theme-2 .book-summary ul.summary li.divider{background:#1d1f21;box-shadow:none}.book.color-theme-2 .book-summary ul.summary li i.fa-check{color:#3c3}.book.color-theme-2 .book-summary ul.summary li.done>a{color:#364149}.book.color-theme-2 .book-summary ul.summary li a,.book.color-theme-2 .book-summary ul.summary li span{color:#6c8193;background:transparent}.book.color-theme-2 .book-summary ul.summary li.active>a,.book.color-theme-2 .book-summary ul.summary li a:hover{color:#008cff;background:transparent}.book-header #font-settings-wrapper{position:relative}.book-header #font-settings-wrapper .dropdown-menu{background-color:#fff;border-color:#d3d9de;padding:0}.book-header #font-settings-wrapper .dropdown-menu .dropdown-caret{position:absolute;top:14px;left:-8px;width:10px;height:18px;float:left;overflow:hidden}.book-header #font-settings-wrapper .dropdown-menu .dropdown-caret .caret-outer{position:absolute;border-bottom:9px solid transparent;border-top:9px solid transparent;border-right:9px solid rgba(0,0,0,0.1);height:auto;left:0;top:0;width:auto;display:inline-block;margin-left:-1px}.book-header #font-settings-wrapper .dropdown-menu .dropdown-caret .caret-inner{position:absolute;display:inline-block;margin-left:-1px;top:0;left:1px;border-bottom:9px solid transparent;border-top:9px solid transparent;border-right:9px solid #fff}.book-header #font-settings-wrapper .dropdown-menu button{border:0;background-color:transparent;color:#7e888b}.book-header #font-settings-wrapper .dropdown-menu button:hover{color:#151515;background-color:#f0f2f4}.book-header #font-settings-wrapper .dropdown-menu #enlarge-font-size{width:50%;font-size:1.4em}.book-header #font-settings-wrapper .dropdown-menu #reduce-font-size{width:50.5%;font-size:1em}.book-header #font-settings-wrapper .dropdown-menu .btn-group-xs .btn{width:33.7%;padding:initial}.book-header #font-settings-wrapper .dropdown-menu .list-group{margin:0}.book-header #font-settings-wrapper .dropdown-menu .list-group .list-group-item{cursor:pointer;background-color:transparent;border-color:#d3d9de;border-width:1px 0!important}.book-header #font-settings-wrapper .dropdown-menu .list-group .list-group-item:hover{color:#151515;background-color:#f0f2f4!important}.book-header #font-settings-wrapper .dropdown-menu .list-group .list-group-item.active{color:#151515;background-color:#f0f2f4!important}.book-header #font-settings-wrapper .dropdown-menu.open{display:block}.color-theme-1 #font-settings-wrapper .dropdown-menu{background-color:#f3eacb;border-color:#d3d9de}.color-theme-1 #font-settings-wrapper .dropdown-menu .dropdown-caret .caret-inner{border-right:9px solid #f3eacb}.color-theme-1 #font-settings-wrapper .dropdown-menu button{color:#afa790}.color-theme-1 #font-settings-wrapper .dropdown-menu button:hover{color:#73553c;background-color:#e2dabe}.color-theme-1 #font-settings-wrapper .dropdown-menu .list-group .list-group-item{border-color:#d3d9de}.color-theme-1 #font-settings-wrapper .dropdown-menu .list-group .list-group-item:hover{color:#73553c;background-color:#e2dabe!important}.color-theme-1 #font-settings-wrapper .dropdown-menu .list-group .list-group-item.active{color:#73553c;background-color:#e2dabe!important}.color-theme-2 #font-settings-wrapper .dropdown-menu{background-color:#111;border-color:#1d1f21}.color-theme-2 #font-settings-wrapper .dropdown-menu .dropdown-caret .caret-inner{border-right:9px solid #111}.color-theme-2 #font-settings-wrapper .dropdown-menu button{color:#7e888b}.color-theme-2 #font-settings-wrapper .dropdown-menu button:hover{color:#c9c9c9;background-color:#0b0d0e}.color-theme-2 #font-settings-wrapper .dropdown-menu .list-group .list-group-item{border-color:#1d1f21}.color-theme-2 #font-settings-wrapper .dropdown-menu .list-group .list-group-item:hover{color:#c9c9c9;background-color:#0b0d0e!important}.color-theme-2 #font-settings-wrapper .dropdown-menu .list-group .list-group-item.active{color:#c9c9c9;background-color:#0b0d0e!important}.book{position:relative;width:100%;height:100%}.book .book-body{position:absolute;top:50px;right:0;left:0;bottom:0;color:#000;background:#fff;-webkit-transition:left .5s ease;transition:left .5s ease}.book .book-body .body-inner{position:absolute;top:0;right:0;left:0;bottom:0;overflow-y:auto}.book .book-body .page-wrapper{position:relative;outline:0}.book .book-body .page-wrapper .page-inner{max-width:800px;margin:0 auto}.book .book-body .page-wrapper .page-inner section{margin:0;padding:5px 15px;background:#fff;border-radius:2px;line-height:1.5em}.book .book-body .page-wrapper .page-inner .btn-group .btn{border-radius:0;background:#eee;border:0}@media(max-width:1240px){.book .book-body{overflow-y:auto}.book .book-body .body-inner{position:static;padding-bottom:20px;min-height:calc(100% - 57px)}}@media(min-width:600px){.book.with-summary .book-body{left:250px}}.book.without-animation .book-body{-webkit-transition:none!important;transition:none!important}.book.color-theme-1 .book-body{color:#704214;background:#f3eacb}.book.color-theme-1 .book-body .page-wrapper .page-inner section{background:#f3eacb}.book.color-theme-2 .book-body{color:#a4b1b1;background:#1d1f21}.book.color-theme-2 .book-body .page-wrapper .page-inner section{background:#1d1f21}.book.font-size-0 .book-body{font-size:1.2rem}.book.font-size-1 .book-body{font-size:1.4rem}.book.font-size-2 .book-body{font-size:1.6rem}.book.font-size-3 .book-body{font-size:2.2rem}.book.font-size-4 .book-body{font-size:4rem}.book.font-family-0{font-family:Merriweather,"EB Garamond",Georgia,serif}.book.font-family-1{font-family:"Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif}.book .book-body .page-wrapper .page-inner section.exercise{padding:0;margin:20px 15px;border:3px solid #2f8cde}.book .book-body .page-wrapper .page-inner section.exercise .header{padding:5px 15px;color:#fff;background:#2f8cde}.book .book-body .page-wrapper .page-inner section.exercise .header h2{margin:0;font-size:20px}.book .book-body .page-wrapper .page-inner section.exercise .message{margin:5px 15px}.book .book-body .page-wrapper .page-inner section.exercise .editor{min-height:50px;font-size:14px;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.book .book-body .page-wrapper .page-inner section.exercise .alert{display:none;margin:0;margin-bottom:10px;padding:8px 15px}.book .book-body .page-wrapper .page-inner section.exercise.return-error .alert-danger{display:block}.book .book-body .page-wrapper .page-inner section.exercise.return-success .alert-success{display:block}.book .book-body .page-wrapper .page-inner section.quiz{padding:0;margin:20px 15px;border:3px solid #2f8cde}.book .book-body .page-wrapper .page-inner section.quiz .header{padding:5px 15px;color:#fff;background:#2f8cde}.book .book-body .page-wrapper .page-inner section.quiz .header h2{margin:0;font-size:20px}.book .book-body .page-wrapper .page-inner section.quiz .message{margin:15px}.book .book-body .page-wrapper .page-inner section.quiz .question .question-header{padding:5px 15px;color:#fff;background:#2f8cde}.book .book-body .page-wrapper .page-inner section.quiz .question .question-inner{padding:15px}.book .book-body .page-wrapper .page-inner section.quiz .question .question-inner .quiz-label{font-weight:normal;cursor:pointer}.book .book-body .page-wrapper .page-inner section.quiz .question table{margin-bottom:10px;width:100%}.book .book-body .page-wrapper .page-inner section.quiz .question th,.book .book-body .page-wrapper .page-inner section.quiz .question td{padding-right:5px}.book .book-body .page-wrapper .page-inner section.quiz .question li{list-style-type:none}.book .book-body .page-wrapper .page-inner section.quiz .question li input{margin-right:10px}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal{color:#704214}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code{background:#fdf6e3;color:#657b83;border-color:#f8df9c}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs{display:block;padding:.5em;background:#fdf6e3;color:#657b83}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-template_comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-template_comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-doctype,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-doctype,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pi,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pi,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-javadoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-javadoc{color:#93a1a1}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-winutils,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-winutils,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .method,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .method,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-addition,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-tag,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-tag,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-request,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-request,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-status,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-status,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .nginx .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .nginx .hljs-title{color:#859900}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-command,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-command,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-tag .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-rules .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-rules .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-phpdoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-phpdoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-hexcolor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-hexcolor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_url,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_url{color:#2aa198}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-localvars,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-localvars,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-chunk,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-chunk,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-decorator,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-decorator,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-identifier,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-identifier,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .vhdl .hljs-literal,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .vhdl .hljs-literal,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-id,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-id,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-function,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-function{color:#268bd2}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-variable,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-body,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-body,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .smalltalk .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .smalltalk .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-constant,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-class .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-class .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-parent,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-parent,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .haskell .hljs-type,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .haskell .hljs-type,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_reference,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_reference{color:#b58900}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-shebang,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-shebang,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-change,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-change,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-special,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-special,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attr_selector,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attr_selector,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-subst,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-subst,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-cdata,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-cdata,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .clojure .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .clojure .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-header{color:#cb4b16}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-deletion,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-important,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-important{color:#dc322f}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_label,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_label{color:#6c71c4}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula{background:#eee8d5}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal{color:#a4b1b1}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code{background:black;color:#eaeaea;border-color:#000}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-title{color:#969896}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-variable,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-tag,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-id,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-class,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo{color:#d54e53}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-number,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-number,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-literal,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-literal,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-params,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-params,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-constant{color:#e78c45}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute{color:#e7c547}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-string,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-string,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-value,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-value,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-header,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-header,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata{color:#b9ca4a}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor{color:#70c0b1}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title{color:#7aa6da}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function{color:#c397d8}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs{display:block;background:black;color:#eaeaea;padding:.5em}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .xml,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .xml,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .vbscript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .css,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .css,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata{opacity:.5}.book .book-body .page-wrapper .page-inner section.normal{padding-bottom:25px;padding-top:15px;color:#000;letter-spacing:.01rem}.book .book-body .page-wrapper .page-inner section.normal>*:first-child{margin-top:0!important}.book .book-body .page-wrapper .page-inner section.normal>*:last-child{margin-bottom:0!important}.book .book-body .page-wrapper .page-inner section.normal a{color:#4183c4}.book .book-body .page-wrapper .page-inner section.normal a.absent{color:#c00}.book .book-body .page-wrapper .page-inner section.normal a.anchor{display:block;padding-left:30px;margin-left:-30px;cursor:pointer;position:absolute;top:0;left:0;bottom:0}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal h6{line-height:1.7;margin:20px 0 10px;padding:0;font-weight:bold;-webkit-font-smoothing:antialiased;cursor:text;position:relative}.book .book-body .page-wrapper .page-inner section.normal h1 tt,.book .book-body .page-wrapper .page-inner section.normal h1 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h2 tt,.book .book-body .page-wrapper .page-inner section.normal h2 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h3 tt,.book .book-body .page-wrapper .page-inner section.normal h3 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h4 tt,.book .book-body .page-wrapper .page-inner section.normal h4 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h5 tt,.book .book-body .page-wrapper .page-inner section.normal h5 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h6 tt,.book .book-body .page-wrapper .page-inner section.normal h6 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h1{font-size:2.5em}.book .book-body .page-wrapper .page-inner section.normal h2{font-size:2em;border-bottom:1px solid #eee}.book .book-body .page-wrapper .page-inner section.normal h3{font-size:1.5em}.book .book-body .page-wrapper .page-inner section.normal h4{font-size:1.2em}.book .book-body .page-wrapper .page-inner section.normal h5{font-size:1em}.book .book-body .page-wrapper .page-inner section.normal h6{font-size:1em}.book .book-body .page-wrapper .page-inner section.normal p,.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal ul,.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal dl,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal pre{margin:15px 0}.book .book-body .page-wrapper .page-inner section.normal body>h2:first-child{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal body>h1:first-child{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal body>h1:first-child+h2{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal body>h3:first-child,.book .book-body .page-wrapper .page-inner section.normal body>h4:first-child,.book .book-body .page-wrapper .page-inner section.normal body>h5:first-child,.book .book-body .page-wrapper .page-inner section.normal body>h6:first-child{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal a:first-child h1,.book .book-body .page-wrapper .page-inner section.normal a:first-child h2,.book .book-body .page-wrapper .page-inner section.normal a:first-child h3,.book .book-body .page-wrapper .page-inner section.normal a:first-child h4,.book .book-body .page-wrapper .page-inner section.normal a:first-child h5,.book .book-body .page-wrapper .page-inner section.normal a:first-child h6{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal h1 p,.book .book-body .page-wrapper .page-inner section.normal h2 p,.book .book-body .page-wrapper .page-inner section.normal h3 p,.book .book-body .page-wrapper .page-inner section.normal h4 p,.book .book-body .page-wrapper .page-inner section.normal h5 p,.book .book-body .page-wrapper .page-inner section.normal h6 p{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal li p.first{display:inline-block}.book .book-body .page-wrapper .page-inner section.normal ul,.book .book-body .page-wrapper .page-inner section.normal ol{padding-left:30px}.book .book-body .page-wrapper .page-inner section.normal ul :first-child,.book .book-body .page-wrapper .page-inner section.normal ol :first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal ul :last-child,.book .book-body .page-wrapper .page-inner section.normal ol :last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal ul p{margin:0}.book .book-body .page-wrapper .page-inner section.normal ul ul{margin:0}.book .book-body .page-wrapper .page-inner section.normal dl{padding:0}.book .book-body .page-wrapper .page-inner section.normal dl dt{font-size:14px;font-weight:bold;font-style:italic;padding:0;margin:15px 0 5px}.book .book-body .page-wrapper .page-inner section.normal dl dt:first-child{padding:0}.book .book-body .page-wrapper .page-inner section.normal dl dt>:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal dl dt>:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal dl dd{margin:0 0 15px;padding:0 15px}.book .book-body .page-wrapper .page-inner section.normal dl dd>:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal dl dd>:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal blockquote{border-left:4px solid #ddd;padding:0 15px;color:#777}.book .book-body .page-wrapper .page-inner section.normal blockquote p{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal blockquote>:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal blockquote>:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal table{width:100%;padding:0}.book .book-body .page-wrapper .page-inner section.normal table tr{border-top:1px solid #ccc;background-color:white;margin:0;padding:0}.book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n){background-color:#f8f8f8}.book .book-body .page-wrapper .page-inner section.normal table tr th{font-weight:bold;border:1px solid #ccc;text-align:left;margin:0;padding:6px 13px}.book .book-body .page-wrapper .page-inner section.normal table tr td{border:1px solid #ccc;text-align:left;margin:0;padding:6px 13px}.book .book-body .page-wrapper .page-inner section.normal table tr th :first-child,.book .book-body .page-wrapper .page-inner section.normal table tr td :first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal table tr th :last-child,.book .book-body .page-wrapper .page-inner section.normal table tr td :last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal img{max-width:100%;display:block;margin:0 auto}.book .book-body .page-wrapper .page-inner section.normal span.frame{display:block;overflow:hidden}.book .book-body .page-wrapper .page-inner section.normal span.frame>span{border:1px solid #ddd;display:block;float:left;overflow:hidden;margin:13px 0 0;padding:7px;width:auto}.book .book-body .page-wrapper .page-inner section.normal span.frame span img{display:block;float:left}.book .book-body .page-wrapper .page-inner section.normal span.frame span span{clear:both;color:#333;display:block;padding:5px 0 0}.book .book-body .page-wrapper .page-inner section.normal span.align-center{display:block;overflow:hidden;clear:both}.book .book-body .page-wrapper .page-inner section.normal span.align-center>span{display:block;overflow:hidden;margin:13px auto 0;text-align:center}.book .book-body .page-wrapper .page-inner section.normal span.align-center span img{margin:0 auto;text-align:center}.book .book-body .page-wrapper .page-inner section.normal span.align-right{display:block;overflow:hidden;clear:both}.book .book-body .page-wrapper .page-inner section.normal span.align-right>span{display:block;overflow:hidden;margin:13px 0 0;text-align:right}.book .book-body .page-wrapper .page-inner section.normal span.align-right span img{margin:0;text-align:right}.book .book-body .page-wrapper .page-inner section.normal span.float-left{display:block;margin-right:13px;overflow:hidden;float:left}.book .book-body .page-wrapper .page-inner section.normal span.float-left span{margin:13px 0 0}.book .book-body .page-wrapper .page-inner section.normal span.float-right{display:block;margin-left:13px;overflow:hidden;float:right}.book .book-body .page-wrapper .page-inner section.normal span.float-right>span{display:block;overflow:hidden;margin:13px auto 0;text-align:right}.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal tt{margin:0 2px;padding:0 5px;white-space:nowrap;border:1px solid #eaeaea;background-color:#f8f8f8;border-radius:3px}.book .book-body .page-wrapper .page-inner section.normal pre code{margin:0;padding:0;white-space:pre;border:0;background:transparent}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-comment,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-title{color:#8e908c}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-variable,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-attribute,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-tag,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-regexp,.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-constant,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-tag .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-pi,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-doctype,.book .book-body .page-wrapper .page-inner section.normal pre code .html .hljs-doctype,.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-id,.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-class,.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-pseudo{color:#c82829}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-number,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-preprocessor,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-pragma,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-built_in,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-literal,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-params,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-constant{color:#f5871f}.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-class .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-rules .hljs-attribute{color:#eab700}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-string,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-value,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-inheritance,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-header,.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-symbol,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-cdata{color:#718c00}.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-hexcolor{color:#3e999f}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-function,.book .book-body .page-wrapper .page-inner section.normal pre code .python .hljs-decorator,.book .book-body .page-wrapper .page-inner section.normal pre code .python .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-function .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-title .hljs-keyword,.book .book-body .page-wrapper .page-inner section.normal pre code .perl .hljs-sub,.book .book-body .page-wrapper .page-inner section.normal pre code .javascript .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .coffeescript .hljs-title{color:#4271ae}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-keyword,.book .book-body .page-wrapper .page-inner section.normal pre code .javascript .hljs-function{color:#8959a8}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.book .book-body .page-wrapper .page-inner section.normal pre code .coffeescript .javascript,.book .book-body .page-wrapper .page-inner section.normal pre code .javascript .xml,.book .book-body .page-wrapper .page-inner section.normal pre code .tex .hljs-formula,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .javascript,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .vbscript,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .css,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-cdata{opacity:.5}.book .book-body .page-wrapper .page-inner section.normal pre{font-size:inherit;line-height:1.5em;overflow:auto;padding:20px;border-radius:3px}.book .book-body .page-wrapper .page-inner section.normal pre code,.book .book-body .page-wrapper .page-inner section.normal pre tt{background-color:transparent;border:0}@-webkit-keyframes animate-loading{from{width:0}}@keyframes animate-loading{from{width:0}}.book .book-body .book-progress{height:0;width:100%;position:relative;background:#fff;margin-bottom:10px}.book .book-body .book-progress .bar{height:2px;position:static;right:0;left:250px;top:50px;background:#fff;border-radius:5px;overflow:hidden}.book .book-body .book-progress .bar .inner{height:100%;width:0;background:#3c3;-webkit-animation:animate-loading 1s;animation:animate-loading 1s}.book .book-body .book-progress .bar .inner .in-inner{height:100%;width:50%}.book .book-body .book-progress .chapters{display:none;position:absolute;right:36px;left:20px;top:7px}.book .book-body .book-progress .chapters .chapter{position:absolute;width:16px;height:16px;border-radius:16px;background:#fff;box-shadow:0 0 1px #bbb}.book .book-body .book-progress .chapters .chapter.done{background:#3c3;box-shadow:none}@media(max-width:800px){.book .book-body .book-progress .chapters .chapter{display:none}.book .book-body .book-progress .chapters .chapter.new-chapter{display:block}}.book.color-theme-1 .book-body .book-progress .bar{background:#f3eacb}.book.color-theme-1 .book-body .book-progress .bar .inner{background:#704214}.book.color-theme-1 .book-body .chapters .chapter{background:#f3eacb}.book.color-theme-1 .book-body .chapters .chapter.done{background:#704214}.book.color-theme-2 .book-body .book-progress .bar{background:#1d1f21}.book.color-theme-2 .book-body .book-progress .bar .inner{background:#3c3}.book.color-theme-2 .book-body .chapters .chapter{background:#1d1f21}.book.color-theme-2 .book-body .chapters .chapter.done{background:#3c3}.book .book-body .navigation{position:absolute;top:0;bottom:0;margin:0;max-width:150px;min-width:90px;display:flex;justify-content:center;align-content:center;flex-direction:column;font-size:40px;color:rgba(0,0,0,0.4);text-align:center;-webkit-transition:all 350ms ease;transition:all 350ms ease}.book .book-body .navigation:hover{text-decoration:none;color:rgba(0,0,0,0.6)}.book .book-body .navigation.navigation-next{right:0}.book .book-body .navigation.navigation-prev{left:0}@media(max-width:1240px){.book .book-body .navigation{position:static;top:auto;max-width:50%;width:50%;display:inline-block;float:left}.book .book-body .navigation.navigation-unique{max-width:100%;width:100%}}*{-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:none;-webkit-touch-callout:none;-webkit-font-smoothing:antialiased}html,body{height:100%}body{text-rendering:optimizeLegibility;font-smoothing:antialiased;font-family:Merriweather,"EB Garamond",Georgia,serif} \ No newline at end of file +article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}button,input,select[multiple],textarea{background-image:none}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:3px}.img-thumbnail{padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:1px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16.099999999999998px;font-weight:200;line-height:1.4}@media(min-width:768px){.lead{font-size:21px}}small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#428bca}.text-warning{color:#c09853}.text-danger{color:#b94a48}.text-success{color:#468847}.text-info{color:#3a87ad}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{margin-top:20px;margin-bottom:10px}h4,h5,h6{margin-top:10px;margin-bottom:10px}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}h1 small,.h1 small{font-size:24px}h2 small,.h2 small{font-size:18px}h3 small,.h3 small,h4 small,.h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-bottom:20px}dt,dd{line-height:1.428571429}dt{font-weight:bold}dd{margin-left:0}@media(min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table}.dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{font-size:17.5px;font-weight:300;line-height:1.25}blockquote p:last-child{margin-bottom:0}blockquote small{display:block;line-height:1.428571429;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:1.428571429}code,pre{font-family:Monaco,Menlo,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:1px}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:1px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.container:before,.container:after{content:" ";display:table}.container:after{clear:both}.container:before,.container:after{content:" ";display:table}.container:after{clear:both}.row{margin-left:-15px;margin-right:-15px}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11{float:left}.col-xs-1{width:8.333333333333332%}.col-xs-2{width:16.666666666666664%}.col-xs-3{width:25%}.col-xs-4{width:33.33333333333333%}.col-xs-5{width:41.66666666666667%}.col-xs-6{width:50%}.col-xs-7{width:58.333333333333336%}.col-xs-8{width:66.66666666666666%}.col-xs-9{width:75%}.col-xs-10{width:83.33333333333334%}.col-xs-11{width:91.66666666666666%}.col-xs-12{width:100%}@media(min-width:768px){.container{max-width:750px}.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11{float:left}.col-sm-1{width:8.333333333333332%}.col-sm-2{width:16.666666666666664%}.col-sm-3{width:25%}.col-sm-4{width:33.33333333333333%}.col-sm-5{width:41.66666666666667%}.col-sm-6{width:50%}.col-sm-7{width:58.333333333333336%}.col-sm-8{width:66.66666666666666%}.col-sm-9{width:75%}.col-sm-10{width:83.33333333333334%}.col-sm-11{width:91.66666666666666%}.col-sm-12{width:100%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-11{left:91.66666666666666%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-11{margin-left:91.66666666666666%}}@media(min-width:992px){.container{max-width:970px}.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11{float:left}.col-md-1{width:8.333333333333332%}.col-md-2{width:16.666666666666664%}.col-md-3{width:25%}.col-md-4{width:33.33333333333333%}.col-md-5{width:41.66666666666667%}.col-md-6{width:50%}.col-md-7{width:58.333333333333336%}.col-md-8{width:66.66666666666666%}.col-md-9{width:75%}.col-md-10{width:83.33333333333334%}.col-md-11{width:91.66666666666666%}.col-md-12{width:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.333333333333332%}.col-md-push-2{left:16.666666666666664%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333333333333%}.col-md-push-5{left:41.66666666666667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.333333333333336%}.col-md-push-8{left:66.66666666666666%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333333333334%}.col-md-push-11{left:91.66666666666666%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-11{right:91.66666666666666%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-11{margin-left:91.66666666666666%}}@media(min-width:1200px){.container{max-width:1170px}.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11{float:left}.col-lg-1{width:8.333333333333332%}.col-lg-2{width:16.666666666666664%}.col-lg-3{width:25%}.col-lg-4{width:33.33333333333333%}.col-lg-5{width:41.66666666666667%}.col-lg-6{width:50%}.col-lg-7{width:58.333333333333336%}.col-lg-8{width:66.66666666666666%}.col-lg-9{width:75%}.col-lg-10{width:83.33333333333334%}.col-lg-11{width:91.66666666666666%}.col-lg-12{width:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-11{left:91.66666666666666%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-11{margin-left:91.66666666666666%}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table thead>tr>th,.table tbody>tr>th,.table tfoot>tr>th,.table thead>tr>td,.table tbody>tr>td,.table tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.table thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table caption+thead tr:first-child th,.table colgroup+thead tr:first-child th,.table thead:first-child tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed thead>tr>th,.table-condensed tbody>tr>th,.table-condensed tfoot>tr>th,.table-condensed thead>tr>td,.table-condensed tbody>tr>td,.table-condensed tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8;border-color:#d6e9c6}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td{background-color:#d0e9c6;border-color:#c9e2b3}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede;border-color:#eed3d7}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td{background-color:#ebcccc;border-color:#e6c1c7}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3;border-color:#fbeed5}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td{background-color:#faf2cc;border-color:#f8e5be}@media(max-width:768px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0;background-color:#fff}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>thead>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>thead>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}select[multiple],select[size]{height:auto}select optgroup{font-size:inherit;font-style:inherit;font-family:inherit}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{height:auto}.form-control:-moz-placeholder{color:#999}.form-control::-moz-placeholder{color:#999}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;border:1px solid #ccc;border-radius:1px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,0.6)}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}textarea.form-control{height:auto}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;margin-top:10px;margin-bottom:10px;padding-left:20px;vertical-align:middle}.radio label,.checkbox label{display:inline;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px}select.input-sm{height:30px;line-height:30px}textarea.input-sm{height:auto}.input-lg{height:45px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:3px}select.input-lg{height:45px;line-height:45px}textarea.input-lg{height:auto}.has-warning .help-block,.has-warning .control-label{color:#c09853}.has-warning .form-control{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.has-warning .input-group-addon{color:#c09853;border-color:#c09853;background-color:#fcf8e3}.has-error .help-block,.has-error .control-label{color:#b94a48}.has-error .form-control{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.has-error .input-group-addon{color:#b94a48;border-color:#b94a48;background-color:#f2dede}.has-success .help-block,.has-success .control-label{color:#468847}.has-success .form-control{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.has-success .input-group-addon{color:#468847;border-color:#468847;background-color:#dff0d8}.form-control-static{margin-bottom:0;padding-top:7px}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media(min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table}.form-horizontal .form-group:after{clear:both}@media(min-width:768px){.form-horizontal .control-label{text-align:right}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.428571429;text-align:center;vertical-align:middle;cursor:pointer;border:1px solid transparent;border-radius:1px;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-link{color:#428bca;font-weight:normal;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:3px}.btn-sm,.btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px}.btn-xs{padding:1px 5px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-print:before{content:"\e045"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-briefcase:before{content:"\1f4bc"}.glyphicon-calendar:before{content:"\1f4c5"}.glyphicon-pushpin:before{content:"\1f4cc"}.glyphicon-paperclip:before{content:"\1f4ce"}.glyphicon-camera:before{content:"\1f4f7"}.glyphicon-lock:before{content:"\1f512"}.glyphicon-bell:before{content:"\1f514"}.glyphicon-bookmark:before{content:"\1f516"}.glyphicon-fire:before{content:"\1f525"}.glyphicon-wrench:before{content:"\1f527"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;border-bottom:0 dotted;content:""}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:1px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.428571429;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#fff;background-color:#428bca}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0 dotted;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media(min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-default .caret{border-top-color:#333}.btn-primary .caret,.btn-success .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret{border-top-color:#fff}.dropup .btn-default .caret{border-bottom-color:#333}.dropup .btn-primary .caret,.dropup .btn-success .caret,.dropup .btn-warning .caret,.dropup .btn-danger .caret,.dropup .btn-info .caret{border-bottom-color:#fff}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar:before,.btn-toolbar:after{content:" ";display:table}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{content:" ";display:table}.btn-toolbar:after{clear:both}.btn-toolbar .btn-group{float:left}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-group+.btn-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group-xs>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px;padding:1px 5px}.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px}.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:3px}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{content:" ";display:table}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{content:" ";display:table}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:1px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child>.btn:last-child,.btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified .btn{float:none;display:table-cell;width:1%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group.col{float:none;padding-left:0;padding-right:0}.input-group .form-control{width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:45px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:3px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:45px;line-height:45px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:1px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:1px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:1px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:3px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-4px}.input-group-btn>.btn:hover,.input-group-btn>.btn:active{z-index:2}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav:before,.nav:after{content:" ";display:table}.nav:after{clear:both}.nav:before,.nav:after{content:" ";display:table}.nav:after{clear:both}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:1px 1px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center}@media(min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}}.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;margin-right:0}.nav-tabs.nav-justified>.active>a{border-bottom-color:#fff}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:5px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center}@media(min-width:768px){.nav-justified>li{display:table-cell;width:1%}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;margin-right:0}.nav-tabs-justified>.active>a{border-bottom-color:#fff}.tabbable:before,.tabbable:after{content:" ";display:table}.tabbable:after{clear:both}.tabbable:before,.tabbable:after{content:" ";display:table}.tabbable:after{clear:both}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.nav .caret{border-top-color:#428bca;border-bottom-color:#428bca}.nav a:hover .caret{border-top-color:#2a6496;border-bottom-color:#2a6496}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;z-index:1000;min-height:50px;margin-bottom:20px;border:1px solid transparent}.navbar:before,.navbar:after{content:" ";display:table}.navbar:after{clear:both}.navbar:before,.navbar:after{content:" ";display:table}.navbar:after{clear:both}@media(min-width:768px){.navbar{border-radius:0}}.navbar-header:before,.navbar-header:after{content:" ";display:table}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{content:" ";display:table}.navbar-header:after{clear:both}@media(min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media(min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-collapse .navbar-nav.navbar-left:first-child{margin-left:-15px}.navbar-collapse .navbar-nav.navbar-right:last-child{margin-right:-15px}.navbar-collapse .navbar-text:last-child{margin-right:0}}.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media(min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{border-width:0 0 1px}@media(min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;border-width:0 0 1px}@media(min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{z-index:1030;top:0}.navbar-fixed-bottom{bottom:0;margin-bottom:0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media(min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;border:1px solid transparent;border-radius:1px}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media(min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media(max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media(min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}@media(min-width:768px){.navbar-left{float:left!important;float:left}.navbar-right{float:right!important;float:right}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8px;margin-bottom:8px}@media(min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media(max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media(min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{left:auto;right:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-text{float:left;margin-top:15px;margin-bottom:15px}@media(min-width:768px){.navbar-text{margin-left:15px;margin-right:15px}}.navbar-default{background-color:#f8f8f8;border-color:#d5d5d5}.navbar-default .navbar-brand{color:#333}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#333;background-color:transparent}.navbar-default .navbar-text{color:#333}.navbar-default .navbar-nav>li>a{color:#333}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#ccc}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e6e6e6}.navbar-default .navbar-nav>.dropdown>a:hover .caret,.navbar-default .navbar-nav>.dropdown>a:focus .caret{border-top-color:#333;border-bottom-color:#333}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}.navbar-default .navbar-nav>.open>a .caret,.navbar-default .navbar-nav>.open>a:hover .caret,.navbar-default .navbar-nav>.open>a:focus .caret{border-top-color:#555;border-bottom-color:#555}.navbar-default .navbar-nav>.dropdown>a .caret{border-top-color:#333;border-bottom-color:#333}@media(max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#333}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#333}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}.navbar-inverse .navbar-nav>.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-nav>.dropdown>a .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .navbar-nav>.open>a .caret,.navbar-inverse .navbar-nav>.open>a:hover .caret,.navbar-inverse .navbar-nav>.open>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}@media(max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:1px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:1px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:1px;border-top-left-radius:1px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:1px;border-top-right-radius:1px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#eee}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca;cursor:default}.pagination>.disabled>span,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:1px;border-top-left-radius:1px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:1px;border-top-right-radius:1px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager:before,.pager:after{content:" ";display:table}.pager:after{clear:both}.pager:before,.pager:after{content:" ";display:table}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#fff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999;border-radius:10px}.badge:empty{display:none}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.btn .badge{position:relative;top:-1px}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;font-size:21px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eee}.jumbotron h1{line-height:1;color:inherit}.jumbotron p{line-height:1.4}.container .jumbotron{border-radius:3px}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1{font-size:63px}}.thumbnail{padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:1px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto;display:block}.thumbnail>img{display:block;max-width:100%;height:auto}a.thumbnail:hover,a.thumbnail:focus{border-color:#428bca}.thumbnail>img{margin-left:auto;margin-right:auto}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:1px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#356635}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#2d6987}.alert-warning{background-color:#fcf8e3;border-color:#fbeed5;color:#c09853}.alert-warning hr{border-top-color:#f8e5be}.alert-warning .alert-link{color:#a47e3c}.alert-danger{background-color:#f2dede;border-color:#eed3d7;color:#b94a48}.alert-danger hr{border-top-color:#e6c1c7}.alert-danger .alert-link{color:#953b39}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:1px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:1px;border-top-left-radius:1px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:1px;border-bottom-left-radius:1px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:1px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-body:before,.panel-body:after{content:" ";display:table}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{content:" ";display:table}.panel-body:after{clear:both}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0}.panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.list-group .list-group-item:last-child{border-bottom:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table{margin-bottom:0}.panel>.panel-body+.table{border-top:1px solid #ddd}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:0;border-top-left-radius:0}.panel-title{margin-top:0;margin-bottom:0;font-size:16px}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:0;border-bottom-left-radius:0}.panel-group .panel{margin-bottom:0;border-radius:1px;overflow:hidden}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-warning{border-color:#fbeed5}.panel-warning>.panel-heading{color:#c09853;background-color:#fcf8e3;border-color:#fbeed5}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#fbeed5}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#fbeed5}.panel-danger{border-color:#eed3d7}.panel-danger>.panel-heading{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#eed3d7}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#eed3d7}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:1px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:3px}.well-sm{padding:9px;border-radius:1px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}body.modal-open,.modal-open .navbar-fixed-top,.modal-open .navbar-fixed-bottom{margin-right:15px}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{margin-left:auto;margin-right:auto;width:auto;padding:10px;z-index:1050}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:3px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.428571429px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.428571429}.modal-body{position:relative;padding:20px}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:before,.modal-footer:after{content:" ";display:table}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{content:" ";display:table}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.modal-dialog{left:50%;right:auto;width:600px;padding-top:30px;padding-bottom:30px}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}}.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:1px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;right:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:3px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top .arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.popover.right .arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom .arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom .arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.popover.left .arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-control.left{background-image:-webkit-gradient(linear,0% top,100% top,from(rgba(0,0,0,0.5)),to(rgba(0,0,0,0.0001)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.5) 0),color-stop(rgba(0,0,0,0.0001) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',endColorstr='#00000000',GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-gradient(linear,0% top,100% top,from(rgba(0,0,0,0.0001)),to(rgba(0,0,0,0.5)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.0001) 0),color-stop(rgba(0,0,0,0.5) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#80000000',GradientType=1)}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;left:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.affix{position:fixed}@-ms-viewport{width:device-width}@media screen and (max-width:400px){@-ms-viewport{width:320px}}.hidden{display:none!important;visibility:hidden!important}.visible-xs{display:none!important}tr.visible-xs{display:none!important}th.visible-xs,td.visible-xs{display:none!important}@media(max-width:767px){.visible-xs{display:block!important}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block!important}tr.visible-xs.visible-sm{display:table-row!important}th.visible-xs.visible-sm,td.visible-xs.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block!important}tr.visible-xs.visible-md{display:table-row!important}th.visible-xs.visible-md,td.visible-xs.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-xs.visible-lg{display:block!important}tr.visible-xs.visible-lg{display:table-row!important}th.visible-xs.visible-lg,td.visible-xs.visible-lg{display:table-cell!important}}.visible-sm{display:none!important}tr.visible-sm{display:none!important}th.visible-sm,td.visible-sm{display:none!important}@media(max-width:767px){.visible-sm.visible-xs{display:block!important}tr.visible-sm.visible-xs{display:table-row!important}th.visible-sm.visible-xs,td.visible-sm.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-sm{display:block!important}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block!important}tr.visible-sm.visible-md{display:table-row!important}th.visible-sm.visible-md,td.visible-sm.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-sm.visible-lg{display:block!important}tr.visible-sm.visible-lg{display:table-row!important}th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell!important}}.visible-md{display:none!important}tr.visible-md{display:none!important}th.visible-md,td.visible-md{display:none!important}@media(max-width:767px){.visible-md.visible-xs{display:block!important}tr.visible-md.visible-xs{display:table-row!important}th.visible-md.visible-xs,td.visible-md.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block!important}tr.visible-md.visible-sm{display:table-row!important}th.visible-md.visible-sm,td.visible-md.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-md{display:block!important}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-md.visible-lg{display:block!important}tr.visible-md.visible-lg{display:table-row!important}th.visible-md.visible-lg,td.visible-md.visible-lg{display:table-cell!important}}.visible-lg{display:none!important}tr.visible-lg{display:none!important}th.visible-lg,td.visible-lg{display:none!important}@media(max-width:767px){.visible-lg.visible-xs{display:block!important}tr.visible-lg.visible-xs{display:table-row!important}th.visible-lg.visible-xs,td.visible-lg.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block!important}tr.visible-lg.visible-sm{display:table-row!important}th.visible-lg.visible-sm,td.visible-lg.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block!important}tr.visible-lg.visible-md{display:table-row!important}th.visible-lg.visible-md,td.visible-lg.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-lg{display:block!important}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}.hidden-xs{display:block!important}tr.hidden-xs{display:table-row!important}th.hidden-xs,td.hidden-xs{display:table-cell!important}@media(max-width:767px){.hidden-xs{display:none!important}tr.hidden-xs{display:none!important}th.hidden-xs,td.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm{display:none!important}tr.hidden-xs.hidden-sm{display:none!important}th.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md{display:none!important}tr.hidden-xs.hidden-md{display:none!important}th.hidden-xs.hidden-md,td.hidden-xs.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-xs.hidden-lg{display:none!important}tr.hidden-xs.hidden-lg{display:none!important}th.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg{display:none!important}}.hidden-sm{display:block!important}tr.hidden-sm{display:table-row!important}th.hidden-sm,td.hidden-sm{display:table-cell!important}@media(max-width:767px){.hidden-sm.hidden-xs{display:none!important}tr.hidden-sm.hidden-xs{display:none!important}th.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}tr.hidden-sm{display:none!important}th.hidden-sm,td.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md{display:none!important}tr.hidden-sm.hidden-md{display:none!important}th.hidden-sm.hidden-md,td.hidden-sm.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-sm.hidden-lg{display:none!important}tr.hidden-sm.hidden-lg{display:none!important}th.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg{display:none!important}}.hidden-md{display:block!important}tr.hidden-md{display:table-row!important}th.hidden-md,td.hidden-md{display:table-cell!important}@media(max-width:767px){.hidden-md.hidden-xs{display:none!important}tr.hidden-md.hidden-xs{display:none!important}th.hidden-md.hidden-xs,td.hidden-md.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-md.hidden-sm{display:none!important}tr.hidden-md.hidden-sm{display:none!important}th.hidden-md.hidden-sm,td.hidden-md.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}tr.hidden-md{display:none!important}th.hidden-md,td.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-md.hidden-lg{display:none!important}tr.hidden-md.hidden-lg{display:none!important}th.hidden-md.hidden-lg,td.hidden-md.hidden-lg{display:none!important}}.hidden-lg{display:block!important}tr.hidden-lg{display:table-row!important}th.hidden-lg,td.hidden-lg{display:table-cell!important}@media(max-width:767px){.hidden-lg.hidden-xs{display:none!important}tr.hidden-lg.hidden-xs{display:none!important}th.hidden-lg.hidden-xs,td.hidden-lg.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-lg.hidden-sm{display:none!important}tr.hidden-lg.hidden-sm{display:none!important}th.hidden-lg.hidden-sm,td.hidden-lg.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-lg.hidden-md{display:none!important}tr.hidden-lg.hidden-md{display:none!important}th.hidden-lg.hidden-md,td.hidden-lg.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-lg{display:none!important}tr.hidden-lg{display:none!important}th.hidden-lg,td.hidden-lg{display:none!important}}.visible-print{display:none!important}tr.visible-print{display:none!important}th.visible-print,td.visible-print{display:none!important}@media print{.visible-print{display:block!important}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}.hidden-print{display:none!important}tr.hidden-print{display:none!important}th.hidden-print,td.hidden-print{display:none!important}}@font-face{font-family:'FontAwesome';src:url('.//fonts/fontawesome/fontawesome-webfont.eot');src:url('.//fonts/fontawesome/fontawesome-webfont.eot') format('embedded-opentype'),url('.//fonts/fontawesome/fontawesome-webfont.woff') format('woff'),url('.//fonts/fontawesome/fontawesome-webfont.ttf') format('truetype'),url('.//fonts/fontawesome/fontawesome-webfont.svg') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857142858em;text-align:center}.fa-ul{padding-left:0;margin-left:2.142857142857143em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;top:.14285714285714285em;text-align:center}.fa-li.fa-lg{left:-1.8571428571428572em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-move:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-resize-full:before{content:"\f065"}.fa-resize-small:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-resize-vertical:before{content:"\f07d"}.fa-resize-horizontal:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-fullscreen:before{content:"\f0b2"}.fa-group:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-asc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-desc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building:before{content:"\f0f7"}.fa-hospital:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-expand-o:before{content:"\f116"}.fa-collapse-o:before{content:"\f117"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-reply-all:before{content:"\f122"}.fa-mail-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-o:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-horizontal:before{content:"\f141"}.fa-ellipsis-vertical:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.link-inherit{color:inherit}.link-inherit:hover,.link-inherit:focus{color:inherit}@font-face{font-family:'Merriweather';font-style:normal;font-weight:250;src:local('Merriweather Light'),url('.//fonts/merriweather/250.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:italic;font-weight:250;src:local('Merriweather Light Italic'),url('.//fonts/merriweather/250i.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:normal;font-weight:400;src:local('Merriweather'),url('.//fonts/merriweather/400.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:italic;font-weight:400;src:local('Merriweather Italic'),url('.//fonts/merriweather/400i.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:normal;font-weight:700;src:local('Merriweather Bold'),url('.//fonts/merriweather/700.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:italic;font-weight:700;src:local('Merriweather Bold Italic'),url('.//fonts/merriweather/700i.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:normal;font-weight:900;src:local('Merriweather Heavy'),url('.//fonts/merriweather/900.woff') format('woff')}@font-face{font-family:'Merriweather';font-style:italic;font-weight:900;src:local('Merriweather Heavy Italic'),url('.//fonts/merriweather/900i.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),url('.//fonts/opensans/300.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local('Open Sans Light Italic'),url('.//fonts/opensans/300i.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans Regular'),url('.//fonts/opensans/400.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local('Open Sans Italic'),url('.//fonts/opensans/400i.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),url('.//fonts/opensans/600.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local('Open Sans Semibold Italic'),url('.//fonts/opensans/600i.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:700;src:local('Open Sans Bold'),url('.//fonts/opensans/700.woff') format('woff')}@font-face{font-family:'Open Sans';font-style:italic;font-weight:700;src:local('Open Sans Bold Italic'),url('.//fonts/opensans/700i.woff') format('woff')}.book-langs-index{width:100%;height:100%;padding:40px 0;margin:0;overflow:auto}@media(max-width:600px){.book-langs-index{padding:0}}.book-langs-index .inner{max-width:600px;width:100%;margin:0 auto;padding:30px;background:#fff;border-radius:3px}.book-langs-index .inner h3{margin:0}.book-langs-index .inner .languages{list-style:none;padding:20px 30px;margin-top:20px;border-top:1px solid #eee}.book-langs-index .inner .languages:before,.book-langs-index .inner .languages:after{content:" ";display:table}.book-langs-index .inner .languages:after{clear:both}.book-langs-index .inner .languages:before,.book-langs-index .inner .languages:after{content:" ";display:table}.book-langs-index .inner .languages:after{clear:both}.book-langs-index .inner .languages li{width:50%;float:left;padding:10px 5px;font-size:16px}@media(max-width:600px){.book-langs-index .inner .languages li{width:100%;max-width:100%}}.book .book-header{font-family:"Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif;position:absolute;overflow:visible;top:0;right:0;left:0;height:50px;z-index:2;font-size:.85em;color:#7e888b;background:#fff;border-bottom:1px solid rgba(0,0,0,0.07)}.book .book-header .btn{display:block;height:50px;padding:0 15px;border-bottom:0;color:#7e888b;text-transform:uppercase;line-height:50px;-webkit-box-shadow:none!important;box-shadow:none!important;position:relative}.book .book-header .btn:hover{position:relative;text-decoration:none;color:#151515;background:#f0f2f4}.book .book-header h1{margin:0;font-size:20px;text-align:center;line-height:50px;padding-left:200px;padding-right:200px;-webkit-transition:margin-left .5s ease;transition:margin-left .5s ease}.book .book-header h1 a,.book .book-header h1 a:hover{color:inherit;text-decoration:none}@media(max-width:800px){.book .book-header h1{display:none}}.book .book-header h1 i{display:none}.book.is-loading .book-header h1 i{display:inline-block}.book.is-loading .book-header h1 a{display:none}.book.with-summary .book-header h1{margin-left:250px}.book.without-animation .book-header h1{-webkit-transition:none!important;transition:none!important}.book.color-theme-1 .book-header{color:#afa790;background:#ece3c4}.book.color-theme-1 .book-header .btn{color:#afa790}.book.color-theme-1 .book-header .btn:hover{color:#73553c;background:#e2dabe}.book.color-theme-2 .book-header{color:#7e888b;background:#1d1f21}.book.color-theme-2 .book-header .btn{color:#7e888b}.book.color-theme-2 .book-header .btn:hover{color:#c9c9c9;background:#0b0d0e}.book .book-summary{font-family:"Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif;position:absolute;top:50px;left:-250px;bottom:0;z-index:1;width:250px;color:#c4cdd4;background:#fff;border-right:1px solid rgba(0,0,0,0.07);-webkit-transition:all .5s ease;transition:all .5s ease}.book .book-summary .book-search{padding:6px;background:transparent;position:absolute;top:-50px;left:0;right:0;-webkit-transition:top .5s ease;transition:top .5s ease}.book .book-summary .book-search input,.book .book-summary .book-search input:focus{width:100%;border:1px solid rgba(0,0,0,0.07);-webkit-box-shadow:none;box-shadow:none}.book .book-summary ul.summary{position:absolute;top:0;left:0;right:0;bottom:0;overflow-y:auto;list-style:none;margin:0;padding:0;-webkit-transition:top .5s ease;transition:top .5s ease}.book .book-summary ul.summary li{list-style:none}.book .book-summary ul.summary li.divider{height:1px;margin:7px 0;overflow:hidden;background:rgba(0,0,0,0.07)}.book .book-summary ul.summary li i.fa-check{display:none;position:absolute;right:9px;top:16px;font-size:9px;color:#3c3}.book .book-summary ul.summary li.done>a{color:#364149;font-weight:normal}.book .book-summary ul.summary li.done>a i{display:inline}.book .book-summary ul.summary li a,.book .book-summary ul.summary li span{display:block;padding:10px 15px;border-bottom:0;color:#364149;background:transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative}.book .book-summary ul.summary li span{cursor:not-allowed;opacity:.3;filter:alpha(opacity=30)}.book .book-summary ul.summary li.active>a,.book .book-summary ul.summary li a:hover{color:#008cff;background:transparent;text-decoration:none}.book .book-summary ul.summary li ul{padding-left:20px}@media(max-width:600px){.book .book-summary{width:100%;bottom:0;left:-100%}}.book.with-summary .book-summary{left:0}.book.without-animation .book-summary{-webkit-transition:none!important;transition:none!important}.book.with-search .book-summary .book-search{top:0}.book.with-search .book-summary ul.summary{top:50px}.book.color-theme-1 .book-summary{color:#afa790;background:#f3eacb}.book.color-theme-1 .book-summary .book-search{background:transparent}.book.color-theme-1 .book-summary .book-search input,.book.color-theme-1 .book-summary .book-search input:focus{border:1px solid #d6cfba}.book.color-theme-1 .book-summary ul.summary li.divider{background:rgba(0,0,0,0.07);box-shadow:none}.book.color-theme-1 .book-summary ul.summary li i.fa-check{color:#3c3}.book.color-theme-1 .book-summary ul.summary li.done>a{color:#877f6a}.book.color-theme-1 .book-summary ul.summary li a,.book.color-theme-1 .book-summary ul.summary li span{color:#877f6a;background:transparent}.book.color-theme-1 .book-summary ul.summary li.active>a,.book.color-theme-1 .book-summary ul.summary li a:hover{color:#704214;background:transparent}.book.color-theme-2 .book-summary{color:#c4cdd4;background:#1d1f21}.book.color-theme-2 .book-summary .book-search{background:transparent}.book.color-theme-2 .book-summary .book-search input,.book.color-theme-2 .book-summary .book-search input:focus{border:1px solid #000}.book.color-theme-2 .book-summary ul.summary li.divider{background:#1d1f21;box-shadow:none}.book.color-theme-2 .book-summary ul.summary li i.fa-check{color:#3c3}.book.color-theme-2 .book-summary ul.summary li.done>a{color:#6c8193}.book.color-theme-2 .book-summary ul.summary li a,.book.color-theme-2 .book-summary ul.summary li span{color:#6c8193;background:transparent}.book.color-theme-2 .book-summary ul.summary li.active>a,.book.color-theme-2 .book-summary ul.summary li a:hover{color:#008cff;background:transparent}.book-header #font-settings-wrapper{position:relative}.book-header #font-settings-wrapper .dropdown-menu{background-color:#fff;border-color:rgba(0,0,0,0.07);padding:0}.book-header #font-settings-wrapper .dropdown-menu .dropdown-caret{position:absolute;top:14px;left:-8px;width:10px;height:18px;float:left;overflow:hidden}.book-header #font-settings-wrapper .dropdown-menu .dropdown-caret .caret-outer{position:absolute;border-bottom:9px solid transparent;border-top:9px solid transparent;border-right:9px solid rgba(0,0,0,0.1);height:auto;left:0;top:0;width:auto;display:inline-block;margin-left:-1px}.book-header #font-settings-wrapper .dropdown-menu .dropdown-caret .caret-inner{position:absolute;display:inline-block;margin-left:-1px;top:0;left:1px;border-bottom:9px solid transparent;border-top:9px solid transparent;border-right:9px solid #fff}.book-header #font-settings-wrapper .dropdown-menu button{border:0;background-color:transparent;color:#7e888b}.book-header #font-settings-wrapper .dropdown-menu button:hover{color:#151515;background-color:#f0f2f4}.book-header #font-settings-wrapper .dropdown-menu #enlarge-font-size{width:50%;font-size:1.4em}.book-header #font-settings-wrapper .dropdown-menu #reduce-font-size{width:50.5%;font-size:1em}.book-header #font-settings-wrapper .dropdown-menu .btn-group-xs .btn{width:33.7%;padding:initial}.book-header #font-settings-wrapper .dropdown-menu .list-group{margin:0}.book-header #font-settings-wrapper .dropdown-menu .list-group .list-group-item{cursor:pointer;background-color:transparent;border-color:rgba(0,0,0,0.07);border-width:1px 0!important}.book-header #font-settings-wrapper .dropdown-menu .list-group .list-group-item:hover{color:#151515;background-color:#f0f2f4!important}.book-header #font-settings-wrapper .dropdown-menu .list-group .list-group-item.active{color:#151515;background-color:#f0f2f4!important}.book-header #font-settings-wrapper .dropdown-menu.open{display:block}.color-theme-1 #font-settings-wrapper .dropdown-menu{background-color:#f3eacb;border-color:rgba(0,0,0,0.07)}.color-theme-1 #font-settings-wrapper .dropdown-menu .dropdown-caret .caret-inner{border-right:9px solid #f3eacb}.color-theme-1 #font-settings-wrapper .dropdown-menu button{color:#afa790}.color-theme-1 #font-settings-wrapper .dropdown-menu button:hover{color:#73553c;background-color:#e2dabe}.color-theme-1 #font-settings-wrapper .dropdown-menu .list-group .list-group-item{border-color:rgba(0,0,0,0.07)}.color-theme-1 #font-settings-wrapper .dropdown-menu .list-group .list-group-item:hover{color:#73553c;background-color:#e2dabe!important}.color-theme-1 #font-settings-wrapper .dropdown-menu .list-group .list-group-item.active{color:#73553c;background-color:#e2dabe!important}.color-theme-2 #font-settings-wrapper .dropdown-menu{background-color:#1d1f21;border-color:#1d1f21}.color-theme-2 #font-settings-wrapper .dropdown-menu .dropdown-caret .caret-inner{border-right:9px solid #1d1f21}.color-theme-2 #font-settings-wrapper .dropdown-menu button{color:#7e888b}.color-theme-2 #font-settings-wrapper .dropdown-menu button:hover{color:#c9c9c9;background-color:#0b0d0e}.color-theme-2 #font-settings-wrapper .dropdown-menu .list-group .list-group-item{border-color:#1d1f21}.color-theme-2 #font-settings-wrapper .dropdown-menu .list-group .list-group-item:hover{color:#c9c9c9;background-color:#0b0d0e!important}.color-theme-2 #font-settings-wrapper .dropdown-menu .list-group .list-group-item.active{color:#c9c9c9;background-color:#0b0d0e!important}.book{position:relative;width:100%;height:100%}.book .book-body{position:absolute;top:50px;right:0;left:0;bottom:0;color:#000;background:#fff;-webkit-transition:left .5s ease;transition:left .5s ease}.book .book-body .body-inner{position:absolute;top:0;right:0;left:0;bottom:0;overflow-y:auto}.book .book-body .page-wrapper{position:relative;outline:0}.book .book-body .page-wrapper .page-inner{max-width:800px;margin:0 auto}.book .book-body .page-wrapper .page-inner section{margin:0;padding:5px 15px;background:#fff;border-radius:2px;line-height:1.6em;font-size:1.6rem}.book .book-body .page-wrapper .page-inner .btn-group .btn{border-radius:0;background:#eee;border:0}@media(max-width:1240px){.book .book-body{overflow-y:auto}.book .book-body .body-inner{position:static;padding-bottom:20px;min-height:calc(100% - 57px)}}@media(min-width:600px){.book.with-summary .book-body{left:250px}}.book.without-animation .book-body{-webkit-transition:none!important;transition:none!important}.book.color-theme-1 .book-body{color:#704214;background:#f3eacb}.book.color-theme-1 .book-body .page-wrapper .page-inner section{background:#f3eacb}.book.color-theme-2 .book-body{color:#a4b1b1;background:#1d1f21}.book.color-theme-2 .book-body .page-wrapper .page-inner section{background:#1d1f21}.book.font-size-0 .book-body{font-size:1.2rem}.book.font-size-1 .book-body{font-size:1.4rem}.book.font-size-2 .book-body{font-size:1.6rem}.book.font-size-3 .book-body{font-size:2.2rem}.book.font-size-4 .book-body{font-size:4rem}.book.font-family-0{font-family:"Merriweather",Georgia,serif}.book.font-family-1{font-family:"Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif}.book .book-body .page-wrapper .page-inner section.exercise{padding:0;margin:20px 15px;border:3px solid #2f8cde}.book .book-body .page-wrapper .page-inner section.exercise .header{padding:5px 15px;color:#fff;background:#2f8cde}.book .book-body .page-wrapper .page-inner section.exercise .header h2{margin:0;font-size:20px}.book .book-body .page-wrapper .page-inner section.exercise .message{margin:5px 15px}.book .book-body .page-wrapper .page-inner section.exercise .editor{min-height:50px;font-size:14px;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.book .book-body .page-wrapper .page-inner section.exercise .alert{display:none;margin:0;margin-bottom:10px;padding:8px 15px}.book .book-body .page-wrapper .page-inner section.exercise.return-error .alert-danger{display:block}.book .book-body .page-wrapper .page-inner section.exercise.return-success .alert-success{display:block}.book .book-body .page-wrapper .page-inner section.quiz{padding:0;margin:20px 15px;border:3px solid #2f8cde}.book .book-body .page-wrapper .page-inner section.quiz .header{padding:5px 15px;color:#fff;background:#2f8cde}.book .book-body .page-wrapper .page-inner section.quiz .header h2{margin:0;font-size:20px}.book .book-body .page-wrapper .page-inner section.quiz .message{margin:15px}.book .book-body .page-wrapper .page-inner section.quiz .question .question-header{padding:5px 15px;color:#fff;background:#2f8cde}.book .book-body .page-wrapper .page-inner section.quiz .question .question-inner{padding:15px}.book .book-body .page-wrapper .page-inner section.quiz .question .question-inner .quiz-label{font-weight:normal;cursor:pointer}.book .book-body .page-wrapper .page-inner section.quiz .question table{margin-bottom:10px;width:100%}.book .book-body .page-wrapper .page-inner section.quiz .question th,.book .book-body .page-wrapper .page-inner section.quiz .question td{padding-right:5px}.book .book-body .page-wrapper .page-inner section.quiz .question li{list-style-type:none}.book .book-body .page-wrapper .page-inner section.quiz .question li input{margin-right:10px}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal{color:#704214}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code{background:#fdf6e3;color:#657b83;border-color:#f8df9c}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs{display:block;padding:.5em;background:#fdf6e3;color:#657b83}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-template_comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-template_comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-doctype,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-doctype,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pi,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pi,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-javadoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-javadoc{color:#93a1a1}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-winutils,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-winutils,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .method,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .method,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-addition,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-tag,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-tag,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-request,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-request,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-status,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-status,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .nginx .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .nginx .hljs-title{color:#859900}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-command,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-command,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-tag .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-rules .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-rules .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-phpdoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-phpdoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-hexcolor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-hexcolor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_url,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_url{color:#2aa198}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-localvars,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-localvars,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-chunk,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-chunk,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-decorator,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-decorator,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-identifier,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-identifier,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .vhdl .hljs-literal,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .vhdl .hljs-literal,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-id,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-id,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-function,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-function{color:#268bd2}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-variable,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-body,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-body,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .smalltalk .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .smalltalk .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-constant,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-class .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-class .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-parent,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-parent,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .haskell .hljs-type,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .haskell .hljs-type,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_reference,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_reference{color:#b58900}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-shebang,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-shebang,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-change,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-change,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-special,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-special,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attr_selector,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attr_selector,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-subst,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-subst,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-cdata,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-cdata,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .clojure .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .clojure .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-header{color:#cb4b16}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-deletion,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-important,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-important{color:#dc322f}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_label,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_label{color:#6c71c4}.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula{background:#eee8d5}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal{color:#a4b1b1}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code{background:black;color:#eaeaea;border-color:#000}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-title{color:#969896}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-variable,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-tag,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-id,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-class,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo{color:#d54e53}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-number,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-number,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-literal,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-literal,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-params,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-params,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-constant{color:#e78c45}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute{color:#e7c547}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-string,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-string,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-value,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-value,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-header,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-header,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata{color:#b9ca4a}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor{color:#70c0b1}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title{color:#7aa6da}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function{color:#c397d8}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs{display:block;background:black;color:#eaeaea;padding:.5em}.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .xml,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .xml,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .vbscript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .css,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .css,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata{opacity:.5}.book .book-body .page-wrapper .page-inner section.normal{padding-bottom:25px;padding-top:15px;color:#000;letter-spacing:.01rem}.book .book-body .page-wrapper .page-inner section.normal>*:first-child{margin-top:0!important}.book .book-body .page-wrapper .page-inner section.normal>*:last-child{margin-bottom:0!important}.book .book-body .page-wrapper .page-inner section.normal a{color:#4183c4}.book .book-body .page-wrapper .page-inner section.normal a.absent{color:#c00}.book .book-body .page-wrapper .page-inner section.normal a.anchor{display:block;padding-left:30px;margin-left:-30px;cursor:pointer;position:absolute;top:0;left:0;bottom:0}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal h6{line-height:1.7;margin:20px 0 10px;padding:0;font-weight:bold;-webkit-font-smoothing:antialiased;cursor:text;position:relative}.book .book-body .page-wrapper .page-inner section.normal h1 tt,.book .book-body .page-wrapper .page-inner section.normal h1 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h2 tt,.book .book-body .page-wrapper .page-inner section.normal h2 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h3 tt,.book .book-body .page-wrapper .page-inner section.normal h3 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h4 tt,.book .book-body .page-wrapper .page-inner section.normal h4 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h5 tt,.book .book-body .page-wrapper .page-inner section.normal h5 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h6 tt,.book .book-body .page-wrapper .page-inner section.normal h6 code{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal h1{font-size:2.5em}.book .book-body .page-wrapper .page-inner section.normal h2{font-size:2em;border-bottom:1px solid #eee}.book .book-body .page-wrapper .page-inner section.normal h3{font-size:1.5em}.book .book-body .page-wrapper .page-inner section.normal h4{font-size:1.2em}.book .book-body .page-wrapper .page-inner section.normal h5{font-size:1em}.book .book-body .page-wrapper .page-inner section.normal h6{font-size:1em}.book .book-body .page-wrapper .page-inner section.normal p,.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal ul,.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal dl,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal pre{margin:15px 0}.book .book-body .page-wrapper .page-inner section.normal body>h2:first-child{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal body>h1:first-child{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal body>h1:first-child+h2{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal body>h3:first-child,.book .book-body .page-wrapper .page-inner section.normal body>h4:first-child,.book .book-body .page-wrapper .page-inner section.normal body>h5:first-child,.book .book-body .page-wrapper .page-inner section.normal body>h6:first-child{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal a:first-child h1,.book .book-body .page-wrapper .page-inner section.normal a:first-child h2,.book .book-body .page-wrapper .page-inner section.normal a:first-child h3,.book .book-body .page-wrapper .page-inner section.normal a:first-child h4,.book .book-body .page-wrapper .page-inner section.normal a:first-child h5,.book .book-body .page-wrapper .page-inner section.normal a:first-child h6{margin-top:0;padding-top:0}.book .book-body .page-wrapper .page-inner section.normal h1 p,.book .book-body .page-wrapper .page-inner section.normal h2 p,.book .book-body .page-wrapper .page-inner section.normal h3 p,.book .book-body .page-wrapper .page-inner section.normal h4 p,.book .book-body .page-wrapper .page-inner section.normal h5 p,.book .book-body .page-wrapper .page-inner section.normal h6 p{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal li p.first{display:inline-block}.book .book-body .page-wrapper .page-inner section.normal ul,.book .book-body .page-wrapper .page-inner section.normal ol{padding-left:30px}.book .book-body .page-wrapper .page-inner section.normal ul :first-child,.book .book-body .page-wrapper .page-inner section.normal ol :first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal ul :last-child,.book .book-body .page-wrapper .page-inner section.normal ol :last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal ul p{margin:0}.book .book-body .page-wrapper .page-inner section.normal ul ul{margin:0}.book .book-body .page-wrapper .page-inner section.normal dl{padding:0}.book .book-body .page-wrapper .page-inner section.normal dl dt{font-size:14px;font-weight:bold;font-style:italic;padding:0;margin:15px 0 5px}.book .book-body .page-wrapper .page-inner section.normal dl dt:first-child{padding:0}.book .book-body .page-wrapper .page-inner section.normal dl dt>:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal dl dt>:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal dl dd{margin:0 0 15px;padding:0 15px}.book .book-body .page-wrapper .page-inner section.normal dl dd>:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal dl dd>:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal blockquote{border-left:4px solid #ddd;padding:0 15px;color:#777}.book .book-body .page-wrapper .page-inner section.normal blockquote p{font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal blockquote>:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal blockquote>:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal table{width:100%;padding:0}.book .book-body .page-wrapper .page-inner section.normal table tr{border-top:1px solid #ccc;background-color:white;margin:0;padding:0}.book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n){background-color:#f8f8f8}.book .book-body .page-wrapper .page-inner section.normal table tr th{font-weight:bold;border:1px solid #ccc;text-align:left;margin:0;padding:6px 13px}.book .book-body .page-wrapper .page-inner section.normal table tr td{border:1px solid #ccc;text-align:left;margin:0;padding:6px 13px}.book .book-body .page-wrapper .page-inner section.normal table tr th :first-child,.book .book-body .page-wrapper .page-inner section.normal table tr td :first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal table tr th :last-child,.book .book-body .page-wrapper .page-inner section.normal table tr td :last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal img{max-width:100%;display:block;margin:0 auto}.book .book-body .page-wrapper .page-inner section.normal span.frame{display:block;overflow:hidden}.book .book-body .page-wrapper .page-inner section.normal span.frame>span{border:1px solid #ddd;display:block;float:left;overflow:hidden;margin:13px 0 0;padding:7px;width:auto}.book .book-body .page-wrapper .page-inner section.normal span.frame span img{display:block;float:left}.book .book-body .page-wrapper .page-inner section.normal span.frame span span{clear:both;color:#333;display:block;padding:5px 0 0}.book .book-body .page-wrapper .page-inner section.normal span.align-center{display:block;overflow:hidden;clear:both}.book .book-body .page-wrapper .page-inner section.normal span.align-center>span{display:block;overflow:hidden;margin:13px auto 0;text-align:center}.book .book-body .page-wrapper .page-inner section.normal span.align-center span img{margin:0 auto;text-align:center}.book .book-body .page-wrapper .page-inner section.normal span.align-right{display:block;overflow:hidden;clear:both}.book .book-body .page-wrapper .page-inner section.normal span.align-right>span{display:block;overflow:hidden;margin:13px 0 0;text-align:right}.book .book-body .page-wrapper .page-inner section.normal span.align-right span img{margin:0;text-align:right}.book .book-body .page-wrapper .page-inner section.normal span.float-left{display:block;margin-right:13px;overflow:hidden;float:left}.book .book-body .page-wrapper .page-inner section.normal span.float-left span{margin:13px 0 0}.book .book-body .page-wrapper .page-inner section.normal span.float-right{display:block;margin-left:13px;overflow:hidden;float:right}.book .book-body .page-wrapper .page-inner section.normal span.float-right>span{display:block;overflow:hidden;margin:13px auto 0;text-align:right}.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal tt{margin:0 2px;padding:0 5px;white-space:nowrap;border:1px solid #eaeaea;background-color:#f8f8f8;border-radius:3px}.book .book-body .page-wrapper .page-inner section.normal pre code{margin:0;padding:0;white-space:pre;border:0;background:transparent}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-comment,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-title{color:#8e908c}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-variable,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-attribute,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-tag,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-regexp,.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-constant,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-tag .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-pi,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-doctype,.book .book-body .page-wrapper .page-inner section.normal pre code .html .hljs-doctype,.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-id,.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-class,.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-pseudo{color:#c82829}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-number,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-preprocessor,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-pragma,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-built_in,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-literal,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-params,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-constant{color:#f5871f}.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-class .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-rules .hljs-attribute{color:#eab700}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-string,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-value,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-inheritance,.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-header,.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-symbol,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-cdata{color:#718c00}.book .book-body .page-wrapper .page-inner section.normal pre code .css .hljs-hexcolor{color:#3e999f}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-function,.book .book-body .page-wrapper .page-inner section.normal pre code .python .hljs-decorator,.book .book-body .page-wrapper .page-inner section.normal pre code .python .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-function .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .ruby .hljs-title .hljs-keyword,.book .book-body .page-wrapper .page-inner section.normal pre code .perl .hljs-sub,.book .book-body .page-wrapper .page-inner section.normal pre code .javascript .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre code .coffeescript .hljs-title{color:#4271ae}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs-keyword,.book .book-body .page-wrapper .page-inner section.normal pre code .javascript .hljs-function{color:#8959a8}.book .book-body .page-wrapper .page-inner section.normal pre code .hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.book .book-body .page-wrapper .page-inner section.normal pre code .coffeescript .javascript,.book .book-body .page-wrapper .page-inner section.normal pre code .javascript .xml,.book .book-body .page-wrapper .page-inner section.normal pre code .tex .hljs-formula,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .javascript,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .vbscript,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .css,.book .book-body .page-wrapper .page-inner section.normal pre code .xml .hljs-cdata{opacity:.5}.book .book-body .page-wrapper .page-inner section.normal pre{font-size:inherit;line-height:1.5em;overflow:auto;padding:20px;border-radius:3px}.book .book-body .page-wrapper .page-inner section.normal pre code,.book .book-body .page-wrapper .page-inner section.normal pre tt{background-color:transparent;border:0}@-webkit-keyframes animate-loading{from{width:0}}@keyframes animate-loading{from{width:0}}.book .book-body .book-progress{height:0;width:100%;position:relative;background:#fff;margin-bottom:10px}.book .book-body .book-progress .bar{height:2px;position:static;right:0;left:250px;top:50px;background:#fff;border-radius:5px;overflow:hidden}.book .book-body .book-progress .bar .inner{height:100%;width:0;background:#3c3;-webkit-animation:animate-loading 1s;animation:animate-loading 1s}.book .book-body .book-progress .bar .inner .in-inner{height:100%;width:50%}.book .book-body .book-progress .chapters{display:none;position:absolute;right:36px;left:20px;top:7px}.book .book-body .book-progress .chapters .chapter{position:absolute;width:16px;height:16px;border-radius:16px;background:#fff;box-shadow:0 0 1px #bbb}.book .book-body .book-progress .chapters .chapter.done{background:#3c3;box-shadow:none}@media(max-width:800px){.book .book-body .book-progress .chapters .chapter{display:none}.book .book-body .book-progress .chapters .chapter.new-chapter{display:block}}.book.color-theme-1 .book-body .book-progress .bar{background:#f3eacb}.book.color-theme-1 .book-body .book-progress .bar .inner{background:#704214}.book.color-theme-1 .book-body .chapters .chapter{background:#f3eacb}.book.color-theme-1 .book-body .chapters .chapter.done{background:#704214}.book.color-theme-2 .book-body .book-progress .bar{background:#1d1f21}.book.color-theme-2 .book-body .book-progress .bar .inner{background:#3c3}.book.color-theme-2 .book-body .chapters .chapter{background:#1d1f21}.book.color-theme-2 .book-body .chapters .chapter.done{background:#3c3}.book .book-body .navigation{position:absolute;top:0;bottom:0;margin:0;max-width:150px;min-width:90px;display:flex;justify-content:center;align-content:center;flex-direction:column;font-size:40px;color:rgba(0,0,0,0.2);text-align:center;-webkit-transition:all 350ms ease;transition:all 350ms ease}.book .book-body .navigation:hover{text-decoration:none;color:rgba(0,0,0,0.6)}.book .book-body .navigation.navigation-next{right:0}.book .book-body .navigation.navigation-prev{left:0}@media(max-width:1240px){.book .book-body .navigation{position:static;top:auto;max-width:50%;width:50%;display:inline-block;float:left}.book .book-body .navigation.navigation-unique{max-width:100%;width:100%}}*{-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:none;-webkit-touch-callout:none;-webkit-font-smoothing:antialiased}html,body{height:100%}body{text-rendering:optimizeLegibility;font-smoothing:antialiased;font-family:"Open Sans","Clear Sans","Helvetica Neue",Helvetica,Arial,sans-serif} \ No newline at end of file diff --git a/googleb0a4f5a22e9cb82f.html b/googleb0a4f5a22e9cb82f.html new file mode 100755 index 00000000..c8049599 --- /dev/null +++ b/googleb0a4f5a22e9cb82f.html @@ -0,0 +1 @@ +google-site-verification: googleb0a4f5a22e9cb82f.html \ No newline at end of file diff --git a/index.html b/index.html index 4e03f3de..fb0f5c59 100644 --- a/index.html +++ b/index.html @@ -1,55 +1,43 @@ - - + - Introduction | Swift 编程语言 - + 《The Swift Programming Language》中文版 - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + - - - + -
    +
    @@ -109,15 +100,32 @@
    @@ -518,7 +526,7 @@ - + @@ -585,14 +593,85 @@
    -
    +
    -

    Swift 编程语言

    -

    Swift 是苹果在 WWDC 2014 上发布的一款全新的编程语言,本书译自苹果官方的 Swift 教程《The Swift Programming Language》。

    -

    翻译正在进行中,翻译完成的部分会实时同步到这里。您可以到项目首页查看当前进度。

    -

    由于是多人协同翻译,可能会有些术语或者句子翻译不太恰当,如果您在阅读过程中发现此类问题,请直接给我们提 issue 或者 pull request。翻译完成后我们会进行认真的校对,给大家提供一本高质量的 Swift 教程。

    -

    如果您愿意加入进来,帮助我们进行翻译和校对,请阅读项目首页中的说明并加入QQ群:364279588,我们期待您的加入,在 Swift 的历史上留下您的足迹!

    -

    最后,非常感谢您的阅读,如果您觉得本文不错的话请分享给其他人,您的支持就是我们最大的动力!

    +
    +

    Swift 兴趣交流群:305014012,307017261(已满) +Swift 开发者社区

    +
    +

    +
    +

    如果你觉得这个项目不错,请点击Star一下,您的支持我们最大的动力。

    +
    +

    The Swift Programming Language 中文版

    +

    这一次,让中国和世界同步

    +

    现在是6月12日凌晨4:38,我用了整整一晚上的时间来进行最后的校对,终于可以在12日拿出一个可以发布的版本。

    +

    9天时间,1317个 Star,310个 Fork,超过30人参与翻译和校对工作,项目最高排名GitHub总榜第4。

    +

    设想过很多遍校对完成时的场景,仰天大笑还是泪流满面?真正到了这一刻才发现,疲倦已经不允许我有任何情绪。

    +

    说实话,刚开始发起项目的时候完全没想到会发展成今天这样,我一度计划自己一个人翻译完整本书。万万没想到,会有这么多的人愿意加入并贡献出自己的力量。

    +

    coverxit发给我最后一份文档的时候说,我要去背单词了,我问他,周末要考六级?他说是的。

    +

    pp-prog告诉我,这几天太累了,校对到一半睡着了,醒来又继续做。2点17分,发给我校对完成的文档。

    +

    lifedim说他平时12点就会睡,1点47分,发给我校对后的文档。

    +

    团队里每个人都有自己的事情,上班、上学、创业,但是我们只用了9天就完成整本书的翻译。我不知道大家付出了多少,牺牲了多少,但是我知道,他们的付出必将被这些文字记录下来,即使再过10年,20年,依然熠熠生辉,永不被人遗忘。

    +

    全体人员名单(排名不分先后):

    +
    @@ -609,16 +688,8 @@
    - - - - - - - - - - + + @@ -636,6 +707,6 @@ require(["gitbook"], function(gitbook) { - + diff --git a/manifest.appcache b/manifest.appcache index a94593fe..2a38d427 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# Revision 1402328527096 +# Revision 1403001528980 CACHE: index.html @@ -11,8 +11,8 @@ chapter2/01_The_Basics.html chapter2/03_Strings_and_Characters.html chapter2/04_Collection_Types.html chapter2/05_Control_Flow.html -chapter2/06_Functions.html chapter2/07_Closures.html +chapter2/06_Functions.html chapter2/08_Enumerations.html chapter2/09_Classes_and_Structures.html chapter2/10_Properties.html @@ -21,33 +21,27 @@ chapter2/12_Subscripts.html chapter2/02_Basic_Operators.html chapter2/14_Initialization.html chapter2/15_Deinitialization.html -chapter2/16_Automatic_Reference_Counting.html chapter2/17_Optional_Chaining.html +chapter2/16_Automatic_Reference_Counting.html chapter2/18_Type_Casting.html chapter2/19_Nested_Types.html chapter2/20_Extensions.html chapter2/21_Protocols.html chapter2/22_Generics.html -chapter2/23_Advanced_Operators.html chapter2/chapter2.html +chapter2/23_Advanced_Operators.html chapter3/06_Attributes.html chapter3/01_About_the_Language_Reference.html chapter3/03_Types.html chapter3/04_Expressions.html -chapter3/05_Declarations.html -chapter3/02_Lexical_Structure.html chapter3/07_Patterns.html +chapter3/02_Lexical_Structure.html +chapter3/05_Declarations.html chapter3/08_Generic_Parameters_and_Arguments.html chapter3/09_Summary_of_the_Grammar.html chapter3/10_Statements.html chapter3/chapter3.html gitbook/app.js -gitbook/fonts/anonymouspro/400.woff -gitbook/fonts/anonymouspro/400i.woff -gitbook/fonts/anonymouspro/700.woff -gitbook/fonts/anonymouspro/700i.woff -gitbook/fonts/ebgaramond/400.woff -gitbook/fonts/ebgaramond/400i.woff gitbook/fonts/fontawesome/FontAwesome.otf gitbook/fonts/fontawesome/fontawesome-webfont.eot gitbook/fonts/fontawesome/fontawesome-webfont.svg @@ -77,7 +71,6 @@ gitbook/jsrepl/sandbox.html gitbook/jsrepl/sandbox.js gitbook/print.css gitbook/style.css -gitbook/plugins/gitbook-plugin-mixpanel/plugin.js gitbook/plugins/gitbook-plugin-mathjax/plugin.js NETWORK: diff --git a/search_index.json b/search_index.json index 848f52f0..1752b6fc 100644 --- a/search_index.json +++ b/search_index.json @@ -1 +1 @@ -{"version":"0.5.2","fields":[{"name":"title","boost":10},{"name":"body","boost":1}],"ref":"url","documentStore":{"store":{"index.html#gitbook_8":["2014","issu","languag","program","pull","qq群:364279588","request","swift","undefinedundefin","wwdc"],"chapter1/01_swift.html#gitbook_9":["arc","automat","c","cocoa","cocoa的基础上构建框架栈并将其标准化。objective-c","count","c的兼容性的限制。swift","foundat","hello","io","objective-c","os","refer","swift","touch","undefinedundefin","world","x"],"chapter1/02_a_swift_tour.html#gitbook_10":["0","0..3","0..time","0.0","1","10","100","103","11","12","13","16","19","2","2.5","20","25","3","3.0","3.1","3.59","3.69","3.79","4","42","43","5","5.2","50","597","69105","7","7.simpledescript","70","70.0","75","8","87","8:09","9","9.9","94","a.adjust","a.simpledescript","ac","ace.toraw","acerawvalu","add","addon","addone(numb","adescript","adjust","amount","anoth","anotherproperti","ant","anycommonel","anycommonelements([1","appl","applese","applesummari","area","b","b.adjust","b.simpledescript","bdescript","blue","bool","bottl","c","captain","card","card(rank","card添加一个方法,创建一副完整的扑克牌并把每张牌的rank和suit","case","catfish","celeri","chees","class","club","condit","condition(item","convertedrank","convertedrank.simpledescript","count","counter","counter.incrementby(2","cucumb","dai","default","deinit","diamond","dictionary(item","result","result(str","result(sunris","return","returnfifteen","rh","rhsitem","sandwich","score","secondforloop","see","self","self.nam","self.sidelength","self被用来区别实例变量。当你创建实例的时候,像传入函数参数一样给类传入构造器的参数。每个属性都需要赋值——无论是通过声明(就像numberofsides)还是通过构造器(就像nam","sequenc","serverrespons","serverresponse.error(\"out","serverresponse.result(\"6:00","serverresponse和switch","set","setter","seven","shape","shape.numberofsid","shape.simpledescript","shapedescript","shape类缺少了一些重要的东西:一个构造函数来初始化类实例。使用init","shoppinglist","shoppinglist[1","side","sidelength","simpl","simpleclass","simpledescript","simplestructur","simplestructure时候mutating关键字用来标记一个会修改结构体的方法。simpleclass","six","size","some(100","some(t","sort([1","soup","spade","spici","squar","square(sidelength","square.sidelength","standard","string","string(self.toraw","string(width","struct","structur","success","suit","suit.heart","suit.simpledescript","suit添加一个color方法,对spades和clubs返回“black”,对hearts和diamonds返回“r","sum","sumof","sumof(42","sumof(numb","sunris","sunset","super.init(nam","swift","switch","switch中匹配到的子句之后,程序会退出switch语句,并不会继续向下运行,所以不需要在每个子句结尾写break","t","t.generatortype.el","tast","tea","teamscor","ten","test","test.area","test.simpledescript","three","threedescript","threeofspad","threeofspades.simpledescript","threeofspadesdescript","time","todai","toraw和fromraw","triagl","triangl","triangle.perimet","triangle.sidelength","triangleandsquar","triangleandsquare(s","triangleandsquare.squar","triangleandsquare.square.sidelength","triangleandsquare.triangle.sidelength","true","tuesdai","tulip","two","type","u","u.generatortype.el","uncom","undefinedundefin","var","veget","vegetablecom","veri","water","watercress","where,只在冒号后面写接口或者类名。<t","width","widthlabel","willset","willset和didset","world","x","x.hassuffix(\"pepp","xcode","y"],"chapter1/chapter1.html#gitbook_11":["swift","undefinedundefin"],"chapter2/13_Inheritance.html#gitbook_12":["0","0.0","0和maxpasseng","1","10.0","2","35.0","4","40.0","5","60.0","automat","automatic.descript","automatic.spe","automaticcar","automaticcar的speed属性,属性的didset观察器就会自动地设置gear属性,为新的速度选择一个合适的挡位。具体来说就是,属性观察器将新的速度值除以10,然后向下取得最接近的整数值,最后加1来得到档位gear的值。例如,速度为10.0时,挡位为1;速度为35.0时,挡位为4","automaticcar,它是car的子类。automaticcar表示自动挡汽车,它可以根据当前的速度自动选择合适的挡位。automaticcar也提供了定制的descript","bicycl","bicycle.descript","bicycle。这个新类是在vehicle类的基础上创建起来。因此你需要将vehicle类放在bicycl","bicycle不仅可以继承vehicle的属性,还可以继承它的方法。如果你创建了一个bicycle类的实例,你就可以调用它继承来的descript","bicycle是vehicle的子类,vehicle是bicycle的超类。新的bicycle类自动获得vehicle类的特性,比如maxpassengers和numberofwheels属性。你可以在子类中定制这些特性,或添加新的特性来更好地描述bicycl","bicycle的一个子类:双人自行车(tandem)。tandem从bicycle继承了两个属性,而这两个属性是bicycle从vehicle继承而来的。tandem并不修改轮子的数量,因为它仍是一辆自行车,有2个轮子。但它需要修改maxpasseng","bicycle类定义了一个初始化器来设置它定制的特性(自行车只有2个轮子)。bicycle的初始化器调用了它父类vehicle的初始化器super.init(),以此确保在bicycle类试图修改那些继承来的属性前,vehicl","bicycle,它继承了vehicl","car","car.descript","car中的description方法并非完全自定义,而是通过super.description使用了超类vehicle中的descript","car声明了一个新的存储型属性speed,它是double类型的,默认值是0.0,表示“时速是0英里”。'car'有自己的初始化器,它将乘客的最大数量设为5,轮子数量设为4","car的新实例,并打印descript","car重写了继承来的description方法,它的声明与vehicle中的description方法一致,声明前面加上了overrid","class","class前添加@final特性(@fin","class)来将整个类标记为fin","definit","descript","didset","doubl","final","final方法,属性或下标,在编译时会报错。在扩展中,你添加到类里的方法,属性或下标也可以在扩展的定义里标记为fin","final来防止它们被重写,只需要在声明关键字前加上@final特性即可。(例如:@fin","func","gear","getters和sett","getter和sett","getter(或sett","goe","here","init","initi","instanc","int","int(spe","limitedcar","limitedcar.descript","limitedcar.spe","maxpasseng","method),实例属性(inst","method),类方法(class","min(newvalu","mph","numberofwheel","objective-c,在swift","observ","observer),这样一来,当属性值改变时,类就会被通知到。可以为任何属性添加属性观察器,无论它原本被定义为存储型属性(stor","overrid","override关键字。这么做,你就表明了你是想提供一个重写版本,而非错误地提供了一个相同的定义。意外的重写行为可能会导致不可预知的错误,任何缺少overrid","override关键字会提醒swift","passeng","perform","println(\"automaticcar","println(\"bicycl","println(\"car","println(\"speedlimitedcar","println(\"tandem","properti","property)还是计算型属性(comput","property),或下标(subscript)提供自己定制的实现(implementation)。我们把这种行为叫重写(overrid","return","set","setter,那么你也一定要提供getter。如果你不想在重写版本中的getter里修改继承来的属性值,你可以直接返回super.someproperty来返回继承来的值。正如下面的speedlimitedcar","someclass","somemethod的重写实现中,可以通过super.somemethod()来调用超类版本的somemethod","someproperty的getter或setter的重写实现中,可以通过super.someproperty来访问超类版本的someproperti","somesuperclass","somevehicl","speed","speedlimitedcar","speedlimitedcar实例的speed属性时,属性setter的实现会去检查新值与限制值40mph的大小,它会将超类的speed设置为newvalue和40.0中较小的那个。这两个值哪个较小由min函数决定,它是swift标准库中的一个全局函数。min","speedlimitedcar实例的speed属性设置为一个大于40mph的数,然后打印description函数的输出,你会发现速度被限制在40mph","speedlimitedcar,它是car的子类。类speedlimitedcar表示安装了限速装置的车,它的最高速度只能达到40mph。你可以通过重写继承来的spe","string","subclass","subclassing(子类化?待定)重写(overriding)访问超类的方法,属性及下标重写方法重写属性重写属性的getters和setters重写属性观察器(properti","subscript","super","super.descript","super.init","super.spe","super[someindex","swift","swift中,类可以调用和访问超类的方法,属性和下标,并且可以重写(override)这些方法,属性和下标来优化或修改它们的行为。swift","tandem","tandem.descript","tandem类也继承了descript","travel","undefinedundefin","up","var","vehicl","vehicle的一个新的子类,叫car,它重写了从vehicle类继承来的'description'","vehicle的基类。这个基类声明了两个对所有车辆都通用的属性(numberofwheels和maxpassengers)。这些属性在description方法中使用,这个方法返回一个str","vehicle类中maxpassengers的默认值对自行车来说已经是正确的,因此在bicycle的初始化器中并没有改变它。而numberofwheels原来的值对自行车来说是不正确的,因此在初始化器中将它更改为2","vehicle类定义了初始化器(initi","vehicle类的初始化器为任意的一辆车设置一些初始化属性值(numberofwheel","wheel","willset或didset实现是不恰当。此外还要注意,你不可以同时提供重写的setter和重写的属性观察器。如果你想观察属性值的变化,并且你已经为那个属性提供了定制的setter,那么你在sett"],"chapter2/01_The_Basics.html#gitbook_13":["0","0.0","0.0125","0.14159","000123.456","0b","0b10001","0o","0o21","0x","0x11","0xc.3p0","0xfp-2","0xfp2","0x)。小数点两边必须有至少一个十进制数字(或者是十六进制的数字)。浮点原始值还有一个可选的指数,在十进制浮点数中通过大写或者小写的e来指定,在十六进制浮点数中通过大写或者小写的p","0为fals","0为true的时候代码运行才会继续,也就是说,当age的值非负的时候。如果age的值是负数,就像代码中那样,ag","1","1.21875e1","1.25","1.25e-2","1.25e2","10","10^-2","10^2","12.1875","123","125.0","15","17","1_000_000","1_000_000.000_000_1","1的比较结果是bool类型,所以第二个例子可以通过类型检查。类似i","200","255","2^-2","2^2","2_000","3","3.14159","3.14159,0.1和-273.15","3.75","32位平台上,int和int32","32位平台上,uint和uint32","3可以直接和原始值0.14159","3没有显式声明类型,而表达式中出现了一个浮点原始值,所以表达式会被推测为doubl","4.75会变成4,-3.9会变成-3","404","42","42和-23","42和3.14159","42并且没有标明类型,swift","60.0","64位平台上,int和int64","64位平台上,uint和uint64","8、16、32和64","8位无符号整数类型是uint8,32位有符号整数类型是int32","_","actualnumb","actualnumber常量可以在if语句的第一个分支中使用。它已经被可选包含的值初始化过,所以不需要再使用!后缀来获取它的值。在这个例子中,actualnumb","ag","anotherpi","array和dictionari","assert(ag","assert函数来写一个断言。给assert函数传入一个结果为true或者false的表达式以及一条信息,当表达式为fals","assumedstr","audiosampl","audiosample.min","audiosample被定义为uint16的一个别名。因为它是别名,audiosample.min实际上是uint16.min,所以会给maxamplitudefound赋一个初值0","binaryinteg","bonjour","bool","bool。布尔值是指逻辑,因为它们只能是真或者假。swift","bool类型的地方使用了非布尔值,swift","c","cannotbeneg","cat","chang","cocoa里的nslog函数一样,println","code","comment","compile-tim","constantnam","convert","convertednumb","current","currentloginattempt","decimaldoubl","decimalinteg","definitestr","descript","dogcow","doubl","double(thre","double或者float","double精确度很高,至少有15位数字,而float最少只有6","double而不是float","double表示64","end","error","eww","exponentdoubl","exp,那这个数相当于基数和10^exp","exp,那这个数相当于基数和2^exp","fals","first","float表示32","found","found"","found")元组把一个int值和一个str","friendlywelcom","friendlywelcome的值从"hello!"改为了"bonjour!"","gt","hello","hexadecimaldoubl","hexadecimalinteg","horribl","http","http200statu","http200status.descript","http200status.statuscod","http404error","http404error.0","http404error.1","if和while语句中来对可选的值进行判断并把值赋给一个常量或者变量。if和whil","if语句来判断一个可选是否包含值。如果可选有值,结果是true;如果没有值,结果是fals","if语句的第一个分支中操作actualnumber的值,你可以改成if","implicitli","int","int(pi","int)或者(str","int8","int8.max","int8类型的常量或者变量可以存储的数字范围是-128~127,uint8类型的常量或者变量能存储的数字范围是0~255","integ","integerpi","interpolation)的方式把常量名或者变量名当做占位符加入到长字符串中,swift会用当前常量或变量的值替换这些占位符。将常量或变量名放入反斜杠符加一对圆括号中"\\()"","intuint浮点数类型安全和类型推测数值类原始值数值类型转换整数转换整数和浮点数转换类型别名布尔值元组可选if","int就够了。这可以提高代码一致性和可复用性。即使是在32位平台上,int可以存储的整数范围也可以达到-2147483648~2147483647","int是整型;double和float是浮点型;bool是布尔型;string是字符串。swift","int类型更大或者更小的数字。swift","io","justoveronemillion","justthestatuscod","languagenam","less","let来声明常量,用var","line","maxamplitudefound","maximumnumberofloginattempt","maximumnumberofloginattempts或者welcomemessage)和一个指定类型的值(比如数字10或者字符串hello","maximumnumberofloginattempts的新常量,并给它一个值10。然后,声明一个名字是currentloginattempt的变量并将它的值初始化为0","maxvalu","meaningoflif","messag","minvalu","min和max","multilin","multipl","nest","nil","nil不是指针——它是一个确定的值,用来表示值缺失。任何类型的可选都可以被设置为nil","nil的话请不要使用隐式解析可选。如果你需要在变量的生命周期中判断是否是nil","nil,nil","nil,但是后面的代码运行需要一个非nil","now","nsnotfound)来暗示值缺失。这种方法假设方法的调用者知道并记得对特殊值进行判断。然而,swift","objc","objective-c","octalinteg","ok","on","onemillion","option","orangesareorang","orangesareorange和turnipsaredelicious的类型会被推测为bool,因为它们的初值是布尔原始值。就像之前提到的int和double一样,如果你创建变量的时候给它们赋值true或者false,那你不需要给常量或者变量标明bool","os","over","paddeddoubl","person'","pi","pointonefouronefivenin","possiblenumb","possiblenumber.toint","possiblenumber.toint返回的可选int包含一个值,创建一个叫做actualnumb","possiblestr","print","println","println(\"\\(possiblenumb","println(\"eww","println(\"mmm","println(\"th","println(\"thi","println(assumedstr","println(cat","println(definitestr","println(friendlywelcom","println(possiblestr","println函数输出传入的str","println是一个用来输出的全局函数,输出的内容会在最后带换行。如果你用xcode,println将会输出内容到“console”面板上。(另一种函数叫print","properti","quot;an","quot;not","refer","second","serverresponsecod","someopt","sometype(ofinitialvalu","start","statement","statu","statuscod","statusmessag","string","string."","string”的意思是“可以存储任意str","string和隐式解析可选str","string类型有一个叫做toint的方法,作用是将一个string值转换成一个int值。然而,并不是所有的字符串都可以转换成一个整数。字符串"123"可以被转换成数字123,但是字符串"hello","string,你绝对不可能不小心传进去一个int","string,名字为welcomemessag","string,类型安全会阻止你不小心传入一个int","subscript","surveyansw","swift","swift可以推断出这个常量或者变量的类型,详情参见类型安全和类型推断(待添加链接)。在上面的例子中,没有给welcomemessag","swift用字符串插值(str","tasti","three","three的值被用来创建一个doubl","toint方法可能会失败,所以它返回一个可选的int,而不是一个int。一个可选的int被写作int?而不是int。问号暗示包含的值是可选,也就是说可能包含int值也可能不包含值。(不能包含其他任何值比如bool值或者string值。只能是int","toint方法来尝试将一个string转换成int","toobig","true","true。从字面意思来说,断言“断言”一个条件是否为真。你可以使用断言来保证在运行其他代码之前,某些重要的条件已经被满足。如果条件判断为true,代码运行会继续进行;如果条件判断为fals","true和fals","tupl","turnip","turnipsaredelici","twothousand","twothousandandon","twothousand类型是uint16,然而常量one类型是uint8。它们不能直接相加,因为它们类型不同。所以要调用uint16(one)来创建一个新的uint16数字并用on","typealia","uint","uint16","uint16(on","uint16有一个构造器,可以接受一个uint8类型的值,所以这个构造器可以用现有的uint8来创建一个新的uint16。注意,你并不能传入任意类型的值,只能传入uint16","uint16,可以进行相加。目标常量twothousandandone的类型被推测为uint16,因为它是两个uint16","uint8","uint8.max","uint8.min","uint,除非你真的需要存储一个和当前平台原生字长相同的无符号整数。除了这种情况,最好使用int,即使你要存储的值已知是非负的。统一使用int","undefinedundefin","unicod","unown","unwrap","valu","var","web","welcomemessag","welcomemessage变量添加了类型标注,表示这个变量可以存储str","world"","written","x","xcode","y","z","zero"],"chapter2/03_Strings_and_Characters.html#gitbook_14":["0","1","10","103","111","128054","128054,是一个十六进制1f436","144","159","16","182","2","2.5","21","240","3","33","39","4","40","5","55357","56374","6","68","7.5","8","act","act1scenecount","anoth","anotheremptystr","api","ascii","blackheart","boolean","c","capulet'","carriag","cell","charact","character1","character2","characterpluscharact","characterplusstr","characters)字符串字面量初始化空字符串字符串可变性字符串是值类型使用字符(characters)计算字符数量连接字符串和字符字符串插值比较字符串字符串相等前缀/后缀相等大写和小写字符串unicodeunicod","cocoa","codeunit","compile-tim","constantstr","countel","countelements(unusualmenageri","d","dog","dogstr","dogstring.unicodescalar","dogstring.utf16","dogstring.utf8","dollarsign","dollarsign、blackheart","double(multipli","dromedari","emptystr","emptystring.isempti","enumer","error","face","face,unicod","for-in","foundat","friar","g","good","great","hall","hasprefix","hasprefix/hassuffix","hello","help","highland","hors","instruct","isempti","koala","lawrence'","length","liter","look","loop","lowercasestr","mansion","messag","morn","multipli","n","nn","nnnn","nnnnnnnn","normal","normal.lowercasestr","normal.uppercasestr","nsmutablestr","nsstring","o","objective-c","orchard","outsid","over","penguin","place","pleas","print","print(\"\\(codeunit","print(\"\\(scalar.valu","print(\"\\n","println","println(\"\\(scalar","println(\"ther","println(\"unusualmenageri","println(charact","public","quot","quot;"","quot;a"),u+1f425","quot;hello","quot;海贼王"","quot;🐥"","quotat","r","represent","romeoandjuliet","room","samequot","scalar","scene","scene.hasprefix(\"act","shouti","snail","somestr","sparklingheart","street","string","string1","string2","stringpluscharact","stringplusstr","structur","swift","t","terminolog","touch","type","u+0024","u+0061","u+1f436","u+1f496","u+2665","u+d83d","u+dc36","u0001f496","u2665","uint16","uint32","uint8","undefinedundefin","unicod","unicodescalar","unicodescalarview","unnnn","unnnnnnnn","unusualmenageri","uppercasestr","us","utf-16","utf-8","utf-8utf-16unicod","utf16","utf16count","utf16view","utf8","utf8view","valu","var","variablestr","verona","welcom","whisper","wiseword","work","world"","x24","xnn","yensign"],"chapter2/04_Collection_Types.html#gitbook_26":["collect","type","types)undefinedundefin"],"chapter2/05_Control_Flow.html#gitbook_27":["swift提供了类似c语言的流程控制结构,包括将任务执行多次的for和while循环,基于特定条件选择执行不同分支的if和switch语句,还有控制流程跳转到其他代码的break和continu","undefinedundefin"],"chapter2/06_Functions.html#gitbook_28":["0","0是真的(true),这将使得choosestepfunction返回stepbackward函数。一个指向返回的函数的引用保存在了movenearertozero","1","1...amounttopad","10","10.0","107","12","13","19","2","3","3.0","4","5","6","8","9","_","aardvark","addtwoint","addtwoints(a","addtwoints和mathfunction有同样的类型,所以这个赋值过程在swift","addtwoints和multiplytwoints。这两个函数都传入两个int","again","alignright(originalstr","alignright(var","alignright函数将参数string定义为变量参数。这意味着str","alignright的函数,用来右对齐输入的字符串到一个长的输出字符串中。左侧空余的地方用指定的填充字符填充。这个例子中,字符串"hello"被转换成了"-----hello"","amounttopad","anna","anotherint","anothermathfunct","arbitrari","argument","arithmet","arithmeticmean(1","arithmeticmean(3","arithmeticmean(numb","b","backward","bodi","bool","brian","c","call","case","charact","charactertofind","choosestepfunct","choosestepfunction(backward","choosestepfunction(currentvalu","choosestepfunction的函数,它的返回类型是(int","compile-tim","conson","constant","contain","containsave","containscharact","containscharacter(#str","containscharacter(str","count","count(\"som","count(str","countelements(str","countelements(stringtoprint","count函数来处理任何一个字符串,返回的值将是一个包含三个int型值的元组(tupl","currentvalu","currentvalue逐渐接近到0是需要向正数走还是向负数走。currentvalue的初始值是3,这意味着currentvalu","d","dave","default","defin","doubl","double(numbers.count","e","enclos","end","equal","error","extern","f","fals","five","func","function","functions)函数参数与返回值(funct","functions)函数的定义与调用(defin","functions),它们定义在全局域中。你也可以把函数定义在别的函数体中,称作嵌套函数(nest","func作为前缀。指定函数返回类型时,用返回箭头->","g","global","goe","goodby","greet","greeting被调用,该函数结束它的执行并返回greet","gt","h","halfopenrangelength(start","hello","hello-world","here","in-out","infer","inout","inout标记。如果你用inout标记一个参数,这个参数不能别var或者let","input","int","int型的变量来调用swaptwoints。需要注意的是,someint和anotherint在传入swaptwoints函数前,都加了&","int的函数。choosestepfunction根据布尔值backwards来返回stepforward函数或stepbackward","int,你可以传入任何这种类型的函数;第二个和第三个参数叫a和b,它们的类型都是int","int,可以读作“这个函数类型,它有两个int型的参数并返回一个int","j","join","join(\"hello","join(s1","join(str","joiner","joiner的值没有被指定,函数会使用默认值("","join函数一样,如果join","join函数中,第一个参数有一个叫string的外部参数名和s1的局部参数名,第二个参数有一个叫tostring的外部参数名和s2的局部参数名,第三个参数有一个叫withjoiner的外部参数名和join","join函数的另一个版本,这个版本中并没有为它的参数提供外部参数名,但是join","join函数,其中join","k","l","liter","local","localparameternam","m","mathfunct","mathfunction(2","mathfunction(a","mathfunction的变量,类型是‘一个有两个int型的参数并返回一个int型的值的函数’,并让这个新变量指向addtwoint","mean","movenearertozero","movenearertozero(currentvalu","movenearertozero指向了正确的函数,它可以被用来数到0","multipl","multiplytwoint","multiplytwoints(a","n","name","names)外部参数名(extern","names)简写外部参数名(shorthand","names)默认参数值(default","nest","now","number","numbers的double...型可变参数,在函数体内可以当做一个叫numbers的doubl","o","originalstr","other","p","pad","paddedstr","paramet","parameternam","parameters)函数类型(funct","parameters)常量参数和变量参数(const","parameters)无参函数(funct","parameters)无返回值函数(funct","parameters)输入输出参数(in-out","personnam","print","printandcount(\"hello","printandcount(stringtoprint","printandcount,输出一个字符串并返回int类型的字符数。第二个函数printwithoutcount","printhelloworld","println(\"\\(currentvalu","println(\"\\(total.vowel","println(\"count","println(\"goodby","println(\"hello","println(\"result","println(\"someint","println(\"zero","println(halfopenrangelength(1","println(sayhello(\"anna","println(sayhello(\"brian","println(sayhelloagain(\"anna","println(sayhelloworld","println(stringtoprint","printmathresult(addtwoint","printmathresult(mathfunct","printmathresult函数的作用就是输出另一个合适类型的数学函数的调用结果。它不关心传入函数是如何实现的,它只关心这个传入的函数类型是正确的。这使得printmathresult可以以一种类型安全(type-saf","printmathresult函数,它有三个参数:第一个参数叫mathfunction,类型是(int","printmathresult被调用时,它被传入addtwoints函数和整数3和5。它用传入3和5调用addtwoints,并输出结果:8","printwithoutcounting(\"hello","printwithoutcounting(stringtoprint","q","quot","quot;greetingforperson",之所以叫这个名字是因为这个函数用一个人的名字当做输入,并返回给这个人的问候语。为了完成这个任务,你定义一个输入参数-一个叫做personname的string值,和一个包含给这个人问候语的str","r","refer","result","return","s","s1","s2","saygoodbye(\"dav","saygoodbye(personnam","saygoodbye函数依然返回了值。没有定义返回类型的函数会返回特殊的值,叫void。它其实是一个空的元组(tupl","sayhello(personnam","sayhelloagain(personnam","sayhelloworld","sayhello。上面的例子展示的是用"anna"和"brian"","sayhello函数时,在圆括号中传给它一个string类型的实参。因为这个函数返回一个string类型的值,sayhello可以被包含在println","sayhello函数的另一个版本,叫wavegoodbye,这个函数直接输出str","sayhello的函数体中,先定义了一个新的名为greeting的string常量,同时赋值了给personname的一个简单问候消息。然后用return关键字把这个问候返回出去。一旦return","shorthand","somefunction(externalparameternam","somefunction(parameternam","someint","someint和anotherint的原始值在swaptwoint","start","stepbackward","stepbackward(input","stepforward","stepforward(input","stepforward和stepbackward。stepforward函数返回一个比输入值大一的值。stepbackward函数返回一个比输入值小一的值。这两个函数的类型都是(int","still","string","string(character).lowercasestr","string的左边,以右对齐到总的字符串中。这个值存在局部常量amounttopad中。这个函数然后将amounttopad多的填充(pad)字符填充到string左边,并返回结果。它使用了str","swaptwoints(&someint","swaptwoints(inout","swaptwoints函数仅仅交换a与b的值。该函数先将a的值存到一个暂时常量temporarya中,然后将b的值赋给a,最后将temporarya幅值给b","swaptwoints函数并没有定义任何返回值,但仍然修改了someint和anotherint","swaptwoints函数,有两个分别叫做a和b","swift","swift统一的函数语法足够灵活,可以用来表示任何函数,包括从最简单的没有参数名字的c风格函数,到复杂的带局部和外部参数名的objective-c","swift自动为join","switch","t","temporarya","three","tostr","tostring:\"world","total","total.conson","true","tupl","type","types)使用函数类型(us","types)函数类型作为参数类型(funct","types)函数类型作为返回类型(funct","types)嵌套函数(nest","u","undefinedundefin","us","v","valu","values)函数参数名(funct","values)可变参数(variad","values)多重输入参数(multipl","values)多重返回值函数(funct","values)默认值参数的外部参数名(extern","value),因为这些量是不能被修改的。当传入的参数作为输入输出参数时,需要在参数前加&","var","variabl","variad","void","void。在swift中,void","vowel","w","withjoin","without","world","x","y","z","zero"],"chapter2/07_Closures.html#gitbook_29":["0","0,$1,$2","0,这时闭包会将字符串输出,而map","1","10","10中,如果number为16,则返回6,58返回8,510返回0","16","16,58,510","16变成了1,58变成了5,510变成了51","2","20","3","30","4","40","5","50","510","58","6","7","8","9","alex","alsoincrementbyten","amount","arrai","b","backward","backwards(s1","barri","block","bool","c","captur","caputur","chri","closur","constant","cycl","daniella","digitnam","digitnames[numb","eight","equal","ewa","five","fiveeight","fiveonezero","force-unwrap","forincr","four","func","function","gt","incrementbyseven","incrementbysevn","incrementbyten","incrementor","inout","int","kei","lambda","makeincrementor","makeincrementor(forincr","map","name","nine","note","number","numbers.map","objective-c","on","onesix","oper","option","output","paramet","quot;a"","quot;alex"","quot;b"","quot;barry"","quot;fiveeight"","quot;fiveonezero"","quot;onesix"","quot;tim"","quot;tom"","quot;大于"","quot;按照字母顺序后出现"","refer","return","returntyp","return参数名称缩写运算符函数trail","revers","runingtot","runningtot","s1","s2","s2),backward","seven","six","somefunctionthattakesaclosur","somefunctionthattakesaclosure(closur","sort","sort(nam","statement","string","strong","swift","three","trail","true","two","type","undefinedundefin","valu","var","variabl","zero"],"chapter2/08_Enumerations.html#gitbook_30":["1","3","8590951226","85909_51226","9","9的行星,通过fromraw返回的可选planet值将是nil","abcdefghijklmnop","alt","ascii","asciicontrolcharact","asciicontrolcharacter的枚举的原始值类型被定义为字符型character,并被设置了一些比较常见的ascii控制字符。字符值的描述请详见字符串和字符str","associ","barcod","barcode.upca(8","barcode.upca和其整数值被新的barcode.qrcode和其字符串值所替代。条形码的常量和变量可以存储一个.upca或者一个.qrcod","barcode的枚举类型,它可以是upca的一个关联值(int,int,int),或者qrcode的一个字符串类型(str","binding),通过原始值9试图访问一个行星。if","blue","carriagereturn","case","charact","check","code","compasspoint","compasspoint.west","control","c和objective-c一样,swift的枚举成员在被创建时不会被赋予一个默认的整数值。在上面的compasspoints例子中,north,south,east和west不是隐式得等于0,1,2和3。相反的,这些不同的枚举成员在compasspoint","c语言,你就会知道,在c语言中枚举指定相关名称为一组整型值。swift中的枚举更加灵活,不必给每一个枚举成员(enumer","default","definit","directiontohead","directiontohead的值。当它等于.north,打印“lot","directiontohead的类型被推断当它被compasspoint的一个可能值初始化。一旦directiontohead被声明为一个compasspoint,你可以使用更短的点(.)语法将其设置为另一个compasspoint","earth","earthsord","east","enum","enumer","equal","flow)中介绍,当考虑一个枚举的成员们时,一个switch语句必须全面。如果忽略了.west这种情况,上面那段代码将无法通过编译,因为它没有考虑到compasspoint","fromraw方法来试图找到具有特定原始值的枚举成员。这个例子通过原始值7识别uranu","goe","harmless","height=\"120","height=\"169","here","human","identifi","img","int","int值都可以找到一个匹配的行星。正因为如此,fromraw方法可以返回一个可选的枚举成员。在上面的例子中,possibleplanet是planet?类型,或“可选的planet","int或string的实际值,它只是定义了,当barcode常量和变量等于barcode.upca或barcode.qrcod","isn't","jupit","linefe","mar","member","mercuri","methods),用于提供和枚举所代表的值相关联的功能。枚举也可以定义构造函数(initializers)来提供一个初始成员值;可以在原始的实现基础上扩展它们的功能;可以遵守协议(protocol","mostli","n","neptun","nepturn","north","north”。当它等于.south,打印“watch","north,south,east和west)是枚举的成员值(或者成员)。cas","numbersystem","option","out","penguin","place","planet","planet.earth","planet.earth.toraw","planet.fromraw(7","planet.fromraw(9)语句获得一个可选planet,如果可选planet可以被获得,把someplanet设置成该可选planet的内容。在这个范例中,无法检索到位置为9的行星,所以els","planet.fromraw(positiontofind","planet.uranu","planet.venus的原始值是2","planet这个枚举的一个细化,利用原始整型值来表示每个planet","posit","positiontofind","possibleplanet","print","println(\"lot","println(\"mostli","println(\"not","println(\"qr","println(\"ther","println(\"upc-a","println(\"watch","println(\"wher","productbarcod","productbarcode的新变量,并且赋给它一个barcode.upca的关联元组值(8","productcod","properties),用于提供关于枚举当前值的附加信息,实例方法(inst","properties),方法(methods),构造过程(initialization),扩展(extensions),和协议(protocol","qr","qrcode(\"abcdefghijklmnop","qrcode(let","qrcode(productcod","qrcode(str","qr码格式的二维码,它可以使用任何iso8859-1字符,并且可以编码一个最多拥有2,953","r","raw","rise","safe","saturn","ski","someeumer","someplanet","south","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/barcode_qr_2x.png","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/barcode_upc_2x.png","sun","swift","swift中其他类型一样,它们的名字(例如compasspoint和planet","swift中,枚举类型是一等(first-class)类型。它们采用了很多传统上只被类(class)所支持的特征,例如计算型属性(comput","swift的枚举存储任何类型的关联值,如果需要的话,每个成员的数据类型可以是各不相同的。枚举的这种特性跟其他语言中的可辨识联合(discrimin","switch","switch语句关联值(associ","switch语句来检查,然而这次关联值可以被提取作为switch语句的一部分。你可以在switch的case分支代码中提取每个关联值作为一个常量(用let前缀)或者作为一个变量(用var","swith","t","tab","toraw","type","undefinedundefin","unions)和变体(vari","unions),或者变体(vari","unions),标签联合(tag","upc-a格式的一维码,它使用数字0到9.每一个条形码都有一个代表“数字系统”的数字,该数字后接10","upc-a码作为三个整型值的元组,和把qr","upca(int","upca(let","upca(numbersystem","uranu","valu","values)原始值(raw","var","var或者let","venu","watch","west","width=\"169","width=\"252"],"chapter2/09_Classes_and_Structures.html#gitbook_31":["collect","undefinedundefin"],"chapter2/10_Properties.html#gitbook_32":["0","0),宽度高度都是10","0.0","1","10","10.0","10,同时maxinputlevelforallchannel","11","11,则会将右声道的currentlevel","15),表示向右上方移动正方形到如图所示橙色正方形的位置。设置属性center的值会调用setter来修改属性origin的x和i","15.0","160","2","2.0","200","3","360","4","4.0","40.0","42","5","5.0","536","6","7","7,类属性maxinputlevelforallchannel","8","896","9","ad","alt=\"comput","alt=\"stat","alternativerect","amount","anoth","assum","audio","audiochannel","audiochannel.maxinputlevelforallchannel","audiochannel.thresholdlevel","audiochannel也定义了一个名为currentlevel","audiochannel来创建表示立体声系统的两个声道leftchannel和rightchannel","c","cap","center","centeri","centerx","center属性之后被设置了一个新的值(15","class","computedtypeproperti","creat","cuboid","cuboid(width","cuboid的结构体,表示三维空间的立方体,包含width、height和depth属性,还有一个名为volume的只读计算属性用来返回立方体的体积,设置volume的值毫无意义,因为无法确定width、height和depth","currentlevel","currentlevel值大于任何之前任意audiochannel实例中的值,属性监视器将新值保存在静态属性maxinputlevelforallchannel","currentlevel包含didset","currentlevel的新值大于允许的阈值thresholdlevel,属性监视器将currentlevel的值限定为阈值thresholdlevel","data","data.txt","dataimport","dataimporter和datamanag","datamanag","datamanager也可以不从文件中导入数据,所以当datamanager的实例被创建时,就没有必要创建一个dataimporter的实例。同时,更有意义的是当用到dataimport","datamanager的一个功能是从文件导入数据,该功能由dataimport","datamanager类包含一个名为data的存储属性,初始值是一个空的字符串(string)数组。虽然没有写出全部代码,datamanag","depth","didset","didset属性监视器将currentlevel","didset监视器会将旧的属性值作为参数传入,可以为该参数命名或者使用默认参数名oldvalu","didset监视器在totalsteps的值改变后被调用,它把新的值和旧的值进行对比,如果总的步数增加了,就输出一个消息表示增加了多少步。didset没有提供自定义名称,所以默认值oldvalu","doubl","enum","error","even","extern","file","filenam","firstvalu","fixedlengthrang","fixedlengthrange(firstvalu","fixedlengthrange的实例包含一个名为firstvalue的变量存储属性和一个名为length的常量存储属性。在上面的例子中,length","fourbyfivebytwo","fourbyfivebytwo.volum","function","getter来获取值,一个可选的sett","getter没有sett","global","height","height=\"357","height=\"387","here","img","import","initi","initialsquarecent","input","instanc","int","integ","lazi","lazy特性(attribute),importer属性只有在第一次被访问的时候才被创建。比如访问它的属性filenam","leftchannel","leftchannel.currentlevel","length","level","manag","manager.data","maximum","maxinputlevelforallchannel","maxinputlevelforallchannels,它用来表示所有audiochannel","more","new","newcenter.i","newcenter.x","newtotalstep","newvalue.i","newvalue.x","non-trivi","now","objective-c","objective-c经验,应该知道有2","oldvalu","origin","origin.i","origin.x","overal","point","point(x","point封装了一个(x","print","println(\"about","println(\"ad","println(\"square.origin","println(\"th","println(audiochannel.maxinputlevelforallchannel","println(leftchannel.currentlevel","println(manager.importer.filenam","println(rightchannel.currentlevel","println(someclass.computedtypeproperti","println(somestructure.storedtypeproperti","properti","properties)存储属性常量和存储属性延迟存储属性存储属性和实例变量计算属性便捷sett","provid","rang","rangeoffouritem","rangeoffouritems.firstvalu","rangeoffouritems声明成了常量(用let关键字),即使firstvalu","rangeofthreeitem","rangeofthreeitems.firstvalu","rect","rect(origin","rect也提供了一个名为center的计算属性。一个矩形的中心点可以从原点和尺寸来算出,所以不需要将它以显式声明的point来保存。rect的计算属性center提供了自定义的getter和sett","report","repres","return","rightchannel","rightchannel.currentlevel","sampl","set","set(newcent","setter","setter没有定义表示新值的参数名,则可以使用默认名称newvalue。下面是使用了便捷setter声明的rect","size","size(width","size.height","size.width","size封装了一个width和height","someclass","someenumer","somestructur","somestructure.storedtypeproperti","squar","square.cent","square.origin","square.origin.i","square.origin.x","square的center属性可以通过点运算符(square.center)来访问,这会调用getter来获取属性的值。跟直接返回已经存在的值不同,getter实际上通过计算然后返回一个新的point实例表示square的中心点。如代码所示,它正确返回了中心点(5","square的rect实例,初始值原点是(0","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/computedproperties_2x.png","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/staticpropertiesvumeter_2x.png","static","static来定义值类型的类属性,关键字class来为类(class","step","stepcount","stepcounter.totalstep","stepcounter类定义了一个int类型的属性totalsteps,它是一个存储属性,包含willset和didset","store","storedtypeproperti","string","struct","swift","swift编程语言中把这些理论统一用属性来实现。swift","take","thought","threshold","thresholdlevel","time","totalstep","totalsteps设置新值的时候,它的willset和didset","undefinedundefin","valu","var","variabl","var关键字定义计算属性,包括只读计算属性,因为他们的值不是固定的。let","var定义),也可以是常量存储属性(用关键字let","volum","vumet","width","width=\"243","width=\"388","willset","willset(newtotalstep","willset和didset","willset和didset的实际例子,其中定义了一个名为stepcount","willset监视器会将新的属性值作为固定参数传入,在willset的实现代码中可以为这个参数指定一个名称,如果不指定则参数仍然可用,这时使用默认名称newvalu","willset监视器将表示新值的参数自定义为newtotalstep","x","y"],"chapter2/11_Methods.html#gitbook_33":["0","0.0","1","1)都被锁定。每次有玩家完成一个等级,这个等级就对这个设备上的所有玩家解锁。leveltrack","1.0","15","2","3","3.0","4.0","5.0","6","_","advancetolevel(level","amount","amount和numberoftimes。默认地,swift只把amount当作一个局部名称,但是把numberoftim","argyrio","behavior","beto","body)中,self指向这个类型本身,而不是类型的某个实例。对于结构体和枚举来说,这意味着你可以用self","bool","case","class","completedlevel(level","constant","count","counter","counter'","counter.incr","counter.incrementby(5","counter.reset","counter的例子(count","counter的替换版本(它定义了一个更复杂的incrementbi","counter这个类还声明了一个可变属性count","currentlevel","currentlevel属性,leveltracker定义了实例方法advancetolevel。这个方法会在更新currentlevel之前检查所请求的新等级是否已经解锁。advancetolevel方法返回布尔值以指示是否确实能够设置currentlevel","deltai","deltax","dot","doubl","enum","enumer","equal","error","explicitli","extern","fals","fixedpoint","fixedpoint.movebyx(2.0","func","func关键字之前加上关键字class;声明结构体和枚举的类型方法,在方法的func关键字之前加上关键字stat","goe","hash","here","high","highest","highestunlockedlevel","implement","increment","incrementbi","incrementby(amount","init(nam","initi","instanc","int","istotherightofx(x","itself);类型方法与类型自身相关联。类型方法与objective-c中的类方法(class","level","levelisunlocked(level","leveltrack","leveltracker.highestunlockedlevel","leveltracker.levelisunlocked(level","leveltracker.unlocklevel(level","leveltracker监测玩家的已解锁的最高等级。这个值被存储在静态属性highestunlockedlevel","leveltracker还定义了两个类型方法与highestunlockedlevel配合工作。第一个类型方法是unlocklevel:一旦新等级被解锁,它会更新highestunlockedlevel的值。第二个类型方法是levelisunlocked:如果某个给定的等级已经被解锁,他返回true。(注意:我们没用使用leveltracker.highestunlockedlevel,这个类型方法还是能够访问静态属性highestunlockedlevel","leveltracker还监测每个玩家的进度。它用实例属性currentlevel","line","local","low","method","method)movebyx,movebyx用来移动一个point。movebyx方法在被调用时修改了这个point,而不是返回一个新的point。方法定义是加上那个了mut","method)类型方法(typ","methods)self属性(th","methods)。在swift中,你可以为所有的类、结构体和枚举定义类型方法:each","methods)修改外部参数名称(modifi","methods)在变异方法中给self赋值(assign","methods)实例方法(inst","methods)方法的局部参数名称和外部参数名称(loc","modifi","movebyx(deltax","movebyx创建了一个新的分支结构(他的x和i","mutat","mutating)这个方法。方法可以从内部变异它的属性;并且它做的任何改变在方法结束时都会回写到原始结构。方法会给它隐含的self","name","next","next方法时,开关在不同的电源状态(off,low,high","now","numberoftim","objective-c的方法时很相似。这个约定还让express","objective-c里面,你只能为objective-c的类定义类型方法(type-level","ovenlight","ovenlight.next","paramet","player","player(nam","player.completedlevel(1","player.tracker.advancetolevel(6","playernam","player类使用leveltrack","player类创建一个新的leveltracker实例来检测这个用户的发展进度。他提供了completedlevel方法:一旦玩家完成某个指定等级就调用它。这个方法为所有玩家解锁下一等级,并且将当前玩家的进度更新为下一等级。(我们忽略了advancetolevel返回的布尔值,因为之前调用leveltracker.unlocklevel","point","point(x","point结构体定义了一个变异方法(mut","print","println(\"highest","println(\"level","println(\"play","println(\"th","println(\"thi","properti","property)在实例方法中修改值类型(modifi","report","reset","reset将计数器重置为0","return","right","scope","self","self.count","self.x","self。不论何时,在一个方法中使用一个已知的属性或者方法名称,如果你没有明确的写self,swift假定你是指当前实例的属性或者方法。这种假定在上面的counter中已经示范了:counter中的三个实例方法中都使用的是count(而不是self.count","self一个全新的实例。上面point","self前缀,swift就认为两次使用的x都指的是名称为x","self属性(th","self消除方法参数x和实例属性x","self赋值(assign","self,它完全等同于这个实力变量本身。你可以在一个实例的实例方法中使用这个隐含的self","someclass","someclass.sometypemethod","somepoint","somepoint.i","somepoint.istotherightofx(1.0","somepoint.movebyx(2.0","somepoint.x","sometypemethod","static","store","string","struct","structur","support","swift","swift中,结构体和枚举能够定义方法;事实上这是swift与c/objective-c的主要区别之一。在objective-c中,类是唯一能定义方法的类型。在swift","swift中定义方法使用了与objective-c","swift中的方法和objective-c中的方法极其相似。像在objective-c中一样,swift中方法的名称通常用一个介词指向方法的第一个参数,比如:with,for,by等等。前面的counter类的例子中incrementby方法就是这样的。介词的使用让方法在被调用时能像一个句子一样被解读。swift","switch","syntax","tracker","tracker.advancetolevel(level","tristateswitch","tristateswitch.low","true","type","undefinedundefin","unlock","unlocklevel(level","valu","var","within","x","y"],"chapter2/12_Subscripts.html#gitbook_34":["0","0.0","1","1.5","2","3","3.2","3的6倍是18","4","6","8","ant","arrai","array(count","assert(indexisvalidforrow(row","b>提示41","td>1*2","td>3","td>4","td>5","td>6","td>7","td>8","td>9","three","tr","true","undefinedundefin","var","welcom","win","world","x","y"],"chapter2/15_Deinitialization.html#gitbook_37":["1","10","100","10000","10_000","11","12","2","2000","2100","3","4","5","6","7","7900","8","9","9900","bank","bank.coinsinbank","bank.receivecoins(coinsinpurs","bank.vendcoins(coin","bank和player。bank结构体管理一个虚拟货币的流通,在这个流通中bank永远不可能拥有超过10,000的硬币。在这个游戏中有且只能有一个bank存在,因此bank","bank根据它的coinsinbank属性来跟踪当前它拥有的硬币数量。银行还提供两个方法—vendcoins和receivecoin","class","coin","coinsinbank","coinsinpurs","deinit","deinit来标示析构函数,类似于初始化函数用init","func","game","init(coin","int","join","left","min(numberofcoinstovend","new","nil","now","numberofcoinstovend","player","player(coin","playeron","playerone!.coinsinpurs","playerone!.wincoins(2_000","playerone是可选的,所以由一个感叹号(!)来修饰,每当其wincoins方法被调用时,coinsinpurs","player实例都由一个指定数目硬币组成的启动额度初始化,这些硬币在bank初始化的过程中得到。如果没有足够的硬币可用,play","player实例随着一个100个硬币(如果有)的请求而被创建。这个player实例存储在一个名为playerone的可选player变量中。这里使用一个可选变量,是因为players可以随时离开游戏。设置为可选使得你可以跟踪当前是否有play","player已经赢得了2,000硬币。player的钱包现在有2,100硬币,bank只剩余7,900","player现在已经离开了游戏。这表明是要将可选的playerone变量设置为nil,意思是"没有player实例"。当这种情况发生的时候,playerone变量对player实例的引用被破坏了。没有其它属性或者变量引用player实例,因此为了清空它占用的内存从而释放它。在这发生前一步,其析构函数被自动调用,其硬币被返回到bank","player类定义了一个wincoins方法,该方法从bank获取一定数量的硬币,并把它们添加到player的钱包。player类还实现了一个析构函数,这个析构函数在player实例释放前一步被调用。这里析构函数只是将player的所有硬币都返回给bank","player类描述了游戏中的一个玩家。每一个player在任何时刻都有一定数量的硬币存储在他们的钱包中。这通过player的coinsinpurs","println(\"a","println(\"playeron","println(\"th","println(\"ther","receivecoins(coin","receivecoins方法只是将bank的硬币存储和接收到的硬币数目相加,再保存回bank","return","static","struct","swift会自动释放不再需要的实例以释放资源。如自动引用计数那一章描述,swift通过自动引用计数(arc","undefinedundefin","var","vendcoins(var","vendcoins方法在bank分发硬币之前检查是否有足够的硬币。如果没有足够多的硬币,bank返回一个比请求时小的数字(如果没有硬币留在bank中就返回0)。vendcoins方法声明numberofcoinstovend为一个变量参数,这样就可以在方法体的内部修改数字,而不需要定义一个新的变量。vendcoin","wincoins(coin","won"],"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":["0","1234567890123456","1234_5678_9012_3456","73","apart","apartment(numb","apartment实例有一个叫number,类型为int的属性,并有一个可选的初始化为nil的tenant属性。ten","apartment实例的强引用来自于变量number73。如果你断开这个强引用,再也没有指向apart","applese","arc","arc为了能帮助你管理内存,需要更多的关于你的代码之间关系的信息。本章描述了这些情况,并且为你示范怎样启用arc","arc会分配一大块内存用来储存实例的信息。内存中会包含实例的类型信息,以及这个实例所有相关属性的值。此外,当实例不再被使用时,arc","arc会在引用的实例被销毁后自动将其赋值为nil","arc会在第三个,也即最后一个强引用被断开的时候,销毁person实例,这也意味着你不再使用这个person","arc会跟踪你所新创建的person实例的引用数量,并且会在person","arc会跟踪和计算每一个实例正在被多少属性,常量和变量所引用。哪怕实例的引用数为一,arc","arc无法在实例被销毁后将无主引用设为nil,因为非可选类型的变量不允许被赋值为nil","arc销毁被引用的实例。这种行为阻止了引用变为循环强引用。声明属性或者变量时,在前面加上weak","ashtml","ashtml声明为lazy属性,因为只有当元素确实需要处理为html输出的字符串时,才需要使用ashtml。也就是说,在默认的闭包中可以使用self,因为只有当初始化完成以及self确实存在后,才能访问lazi","ashtml属性。然而,由于ashtml是闭包而不是实例方法,如果你想改变特定元素的html","ashtml属性持有闭包的强引用。但是,闭包在其闭包体内使用了self(引用了self.name和self.text),因此闭包占有了self,这意味着闭包又反过来持有了htmlelement实例的强引用。这样两个对象就产生了循环强引用。(更多关于闭包占有值的信息,请参考captur","ashtml属性,这个闭包返回一个代表html标签的字符串。如果text值存在,该标签就包含可选值text;如果text不存在,该标签就不包含文本。对于段落元素,根据text是"som","be","bodi","call","canada","canada'","capit","capitalc","capitalcity默认值为nil,一旦country的实例在构造函数中给name属性赋值后,整个初始化过程就完成了。这代表一旦name属性被后,country的构造函数就能引用并传递显式的self。country的构造函数在赋值capitalcity时,就能将self作为参数传递给c","capitalnam","captur","card","citi","city!)的方式,将country的capitalcity属性声明为显示展开的可选类型属性。这表示像其他可选类型一样,capitalcity属性的默认值为nil","city(nam","city的构造函数有一个country实例的参数,并且将实例保存为countri","class","closur","countri","country(nam","country.capitalcity.nam","country和city的实例,而不产生循环强引用,并且capitalc","country和city,每个类将另外一个类的实例保存为属性。在这个模型中,每个国家必须有首都,而每一个城市必须属于一个国家。为了实现这种关系,country类拥有一个capitalcity属性,而city类有一个countri","country的构造函数调用了city的构造函数。然而,只有country的实例完全初始化完后,country的构造函数才能把self传给c","creditcard","creditcard(numb","custom","customer(nam","customer和creditcard","customer和creditcard之间的关系与前面弱引用例子中apartment和person的关系截然不同。在这个数据模型中,一个客户可能有或者没有信用卡,但是一张信用卡总是关联着一个客户。为了表示这种关系,customer类有一个可选类型的card属性,但是creditcard类有一个非可选类型的custom","customer和creditcard的例子展示了一个属性的值允许为nil,而另一个属性的值不允许为nil","customer实例持有对creditcard实例的强引用,而creditcard实例持有对custom","customer实例的强引用,该实例被销毁了。其后,再也没有指向creditcard","customer的无主引用,当你断开john变量持有的强引用时,再也没有指向custom","customer类的实例,用它初始化creditcard实例,并将新创建的creditcard实例赋值为客户的card","deinit","deiniti","goe","gt","gt;"","hello","here","htmlelement","htmlelement(nam","htmlelementdeinitializer中的消息并没有别打印,证明了htmlel","htmlelement例子中,无主引用是正确的解决循环强引用的方法。这样这样编写htmlel","htmlelement实现和之前的实现一致,只是在ashtml闭包中多了一个占有列表。这里,占有列表是[unown","htmlelement类产生了类实例和ashtml","htmlelement类只提供一个构造函数,通过name和text(如果有的话)参数来初始化一个元素。该类也定义了一个析构函数,当htmlel","htmlelement类定义了一个name属性来表示这个元素的名称,例如代表段落的"p",或者代表换行的"br"。htmlelement还定义了一个可选属性text,用来设置和展现html","htmlelement还定义了一个lazy属性ashtml。这个属性引用了一个闭包,将name和text组合成html","index","init(nam","init(numb","initi","int","john","john!.apart","john!.card","john变量被设为nil后customer实例和creditcard","john和number73","john和number73,并分别被设定为下面的apartment和person的实例。这两个变量都被初始化为nil","john和number73在被赋值为nil后,person实例和apart","john和number73赋值为nil","john现在有一个指向person实例的强引用,而变量number73有一个指向apart","john的可选类型customer变量,用来保存某个特定客户的引用。由于是可选类型,所以变量被初始化为nil","lazi","list","name","nil","nil时,将闭包内的占有定义为弱引用。弱引用总是可选类型,并且当引用的实例被销毁后,弱引用的值会自动置为nil","nil时,没有任何一个析构函数被调用。强引用循环阻止了person和apart","nil的实例使用弱引用。相反的,对于初始化赋值后再也不会被赋值为nil","nil的方式断开两个强引用(包括最先的那个强引用),只留下一个强引用,person","non-opt","number","number73","number73!.ten","number值和customer实例传递给creditcard构造函数的方式来创建creditcard实例。这样可以确保当创建creditcard实例时总是有一个custom","ottawa","p","p>hello","paragraph","paragraph变量为nil,打破它持有的htmlelement实例的强引用,htmlel","paragraph变量定义为可选htmlelement,因此我们可以赋值nil","person","person(nam","person?的变量,用来按照代码片段中的顺序,为新的person实例建立多个引用。由于这些变量是被定义为可选类型(person?,而不是person),它们的值会被自动初始化为nil,目前还不会引用到person","person和apart","person和apartment实例并将类实例赋值给john和number73","person和apartment的例子一致,但是有一个重要的区别。这一次,apartment的ten","person和apartment的例子展示了两个属性的值都允许为nil","person实例依然保持对apartment实例的强引用,但是apartment实例只是对person实例的弱引用。这意味着当你断开john变量所保持的强引用时,再也没有指向person","person实例有一个类型为string,名字为name的属性,并有一个可选的初始化为nil的apartment属性。apart","person实例现在有了一个指向apartment实例的强引用,而apartment实例也有了一个指向person实例的强引用。因此,当你断开john和number73变量所持有的强引用时,引用计数并不会降为0,实例也不会被arc","person类开始,并定义了一个叫nam","person类有一个构造函数,此构造函数为实例的name属性赋值并打印出信息,以表明初始化过程生效。person","person类的新实例被赋值给了reference1变量,所以reference1到person类的新实例之间建立了一个强引用。正是因为这个强引用,arc会保证person","person类的构造函数的时候,"john","print","println(\"\\(country.name)'","println(\"\\(nam","println(\"apart","println(\"card","println(paragraph!.ashtml","prints\"hello","quot","refer","reference)和无主引用(unown","reference1","reference2","reference3","return","self","self.capitalc","self.countri","self.custom","self.nam","self.name)>\\(text)check","class类型。它创建了一个可以存储ani","cocoa","code","come","common","compound","confid","conform","conformance(arrai","equatable类型都可以安全的使用在findindex函数中,因为其保证支持等式操作。为了说明这个事实,当你定义一个函数时,你可以写一个equat","equatable,也就意味着“任何t类型都遵循equat","equival","error","exampl","exist","extens","extension][6","extension][7","fals","findindex([\"mik","findindex([3.14159","findindex(arrai","findindex中这个单个类型参数写做:t","findindex函数现在则可以成功的编译过,并且作用于任何遵循equatable的类型,如double或str","findindex,用某个类型t","findstringindex","findstringindex(arrai","findstringindex(str","findstringindex的泛型版本findindex。请注意这个函数仍然返回int","findstringindex的非泛型函数,该函数功能是去查找包含一给定string值的数组。若查找到匹配的字符串,findstringindex函数返回该字符串在数组中的索引值(int),反之则返回nil","first","for-in循环和半闭区间操作(..)来迭代somecontainer中的所有items。对于每个item,函数检查是否somecontainer中的item不等于对应的anothercontainer中的item,如果这两个items不等,则这两个容器不匹配,返回fals","for—that","foundindex","fromthetop","func","function","gener","give","goe","guide,即便你没有实现它。例如:swift的array和dictionary类型都是泛型集。你可以创建一个int数组,也可创建一个string数组,或者甚至于可以是任何其他swift的类型数据数组。同样的,你也可以创建存储任何指定类型的字典(dictionari","hashtabl","hello","here","here’","hierarchi","implement","import","in-out参数交换a和b的值,这两个参数被描述为[in-out类型参数][1","index","indic","inform","inout","inspir","int","intstack","intstack指定了container的实现,适用的itemtype被用作int类型。对于这个contain","intstack类型只能用于int值,不过,其对于定义一个泛型stack","intstack类型实现了container协议的所有三个要求,在intstack","intstack类型的非泛型版本,适用于遵循contain","int索引值下标可以检索到每一个item","int这一行,一切仍旧可以工作,因为它清楚的知道itemtyp","int,将抽象的itemtype类型转换为具体的int","item","items.append(item","items.count","items.removelast","items[i","items。这个需求通过一个类型约束和wher","items的属性,使用空的t","itemtyp","itemtype。th","item是如何存储的或何种类型是允许的。这个协议只指定三个任何遵循contain","item的push方法,该参数必须是t","keytyp","languag","last","left","librari","llama","look","made","malcolm","manag","match","method","model","mutat","name","navig","need","nil","note","now","number","option","origin","out","pair","parakeet","paramet","parameters类型参数命名类型参数泛型类型类型约束类型约束语法类型约束行为关联类型关联类型行为扩展一个存在的类型为一指定关联类型wher","part","placehold","pop","popviewcontrolleranim","pop并移除值"cuatro"","pop方法的返回值,该返回值将是一个t","possibl","print","println(\"al","println(\"not","println(\"someint","println(\"th","protocol","provid","provide(这个协议不会定义itemtype是遵循类型所提供的何种信息的别名)。尽管如此,itemtype别名支持一种方法识别在一个容器里的items类型,以及定义一种使用在append方法和下标中的类型,以便保证任何期望的contain","push","push(item","push)/出栈(pop","pushviewcontroller:anim","remov","report","return","same","see","self.push(item","someclass","somecontain","somecontainer.count","somecontainer[i","somecontainer中item","somecontainer中的item","somecontainer和anothercontainer。somecontainer参数是类型c1,anothercontainer参数是类型c2。c1和c2","somecontainer和anothercontainer包含相同的item","somecontainer是一个c1","somefunction(somet","somestr","someu","stack","stack(栈)。一个栈是一系列值域的集合,和array(数组)相似,但其是一个比swift的array类型更多限制的集合。一个数组可以允许其里面任何位置的插入/删除操作,而栈,只允许,只允许在集合的末端添加新的项(如同push一个新值进栈)。同样的一个栈也只能从末端移除项(如同pop","stack(inout","swaptwovalues例子中,节点类型t是一种类型参数的示例。类型参数指定并命名为一个节点类型,并且紧随在函数名后面,并用一对尖括号括起来(如)。这个尖括号告诉swift那个t是swaptwovalues函数所定义的一个节点类型。因为t是一个节点,swift不会去查找每一个命名为t","temporarya","terrapin","three","tre","true","type","type-saf","typealia","t分别代表tnt和string","t定义了一个名为“某种类型t”的节点提供给后来用。这种将来类型可以在结构体的定义里任何地方表示为“t”。在这种情况下,t","t来表示)来代替实际类型名(如int、string或double)。节点类型名并不是表示t必须是任何类型,但是其规定a和b必须是同一类型的t,而不管t表示任何类型。只有swaptwovalues函数在每次调用时所传入的实际类型决定了t","t被用作append方法的item参数和下标的返回类型。swift因此可以推断出被用作这个特定容器的itemtype的t","t,有一个需要t必须是someclass子类的类型约束;第二个类型参数u,有一个需要u必须遵循someprotocol","u","uinavigationcontrol","undefinedundefin","uno","uppercamelcas","us","valu","valuetofind","valuetofind”。不是所有的swift中的类型都可以用等式符(==)进行比较。例如,如果你创建一个你自己的类或结构体来表示一个复杂的数据模型,那么swift没法猜到对于这个类或结构体而言“等于”的意思。正因如此,这部分代码不能可能保证工作于每个可能的类型t","var","variabl","view","whenev","where语句作为一个类型参数队列的一部分。一个where语句使你能够要求一个关联类型遵循一个特定的协议,以及(或)那个特定的类型参数和关联类型可以是相同的。你可写一个where语句,通过紧随放置wher","where语句的一部分,写在关键字wher","world"],"chapter2/chapter2.html#gitbook_49":["swift","undefinedundefin"],"chapter3/06_Attributes.html#gitbook_50":["adopt","appropri","argument","assign","attribut","attribute-argument-claus","attribute-argument-clauseopt","attribute-nam","attributesopt","auto_closur","balanced-token","balanced-tokensopt","bool","builder","builder特性是interfac","builder特性:ibaction,ibdesignable,ibinspectable,以及iboutlet。这些特性与objective-c","builder用来与xcode同步的声明特性。swift提供了以下的interfac","class","class_protocol","conform","data","enabl","exampleclass","export","final","gt","iboutlet和ibinspectable用于修饰一个类的属性声明;ibaction特性用于修饰一个类的方法声明;ibdesign","identifi","inout。如何使用assign","interfac","lazi","name","name(attribut","noreturn","noreturn特性标记的函数或方法,你可以将它重写(override)为用该特性标记的。相反,对于一个已经用noreturn特性标记的函数或方法,你则不可以将它重写为没使用该特性标记的。相同的规则试用于当你在一个comform","nscopi","nscopying特性的行为与objective-c中的copi","nsmanag","nsmanagedobject子类中的存储型变量属性,表明属性的存储和实现由cor","objc","objc(isen","objc特性修饰一个协议,class_protocol特性就会隐式地应用到该协议,因此无需显式地用class_protocol","objc特性应用于一个类或协议,它也会隐式地应用于那个类或协议的成员。对于标记了objc特性的类,编译器会隐式地为它的子类添加objc特性。标记了objc特性的协议不能继承自没有标记objc","objc特性有一个可选的参数,由标记符组成。当你想把objc所修饰的实体以一个不同的名字暴露给objective-c,你就可以使用这个特性参数。你可以使用这个参数来命名类,协议,方法,getters,setters,以及初始化器。下面的例子把exampleclass中enabled属性的getter暴露给objective-c,名字是isen","objective-c中表示的声明,比如,非嵌套类,协议,类和协议中的属性和方法(包含getter和setter),初始化器,析构器,以下下标。objc特性告诉编译器该声明可以在objective-c","option","optional特性修饰那些标记了objc特性的协议。因此,只有类类型可以adopt和comform","requir","return","setter与属性值的一个副本合成,由copywithzone方法返回,而不是属性本身的值。该属性的类型必需遵循nscopi","swift中有两类特性,用于修饰声明的以及用于修饰类型的。例如,required特性,当应用于一个类的指定或便利初始化器声明时,表明它的每个子类都必须实现那个初始化器。再比如noreturn","t","to那些包含可选成员需求的协议。更多关于如何使用optional特性以及如何访问可选协议成员的指导,例如,当你不确定一个conform","type","t,是@noreturn","undefinedundefin","valu","var"],"chapter3/01_About_the_Language_Reference.html#gitbook_51":["block","getter-claus","getter-sett","getter-setter-block","getter-setter方法​​块可以由一个getter子句后跟一个可选的setter子句构成,用大括号括起来,或者由一个setter子句后跟一个gett","grammar","opt","setter-claus","setter-clause­opt","swift","swift语言相对小点,这是由于在swift代码中几乎无处不在的许多常见的的类型,函数以及运算符都由swift标准库来定义。虽然这些类型,函数和运算符不是swift","undefinedundefin"],"chapter3/03_Types.html#gitbook_52":["0","0——编译器会正确的推断出x的类型int。类似的,当完整的类型可以从上下文推断出来时,你也可以忽略类型的一部分。比如,如果你写了let","0中x的类型首先根据0的类型进行推断,然后将该类型信息传递到根节点(变量x","0,你可以完全忽略类型而简写成var","1","1],编译提也能推断出dict的类型是dictionary<str","2","2.71828","3","3.14159","4","42","4]],array3d[0][1]是指[3","4],array3d[0][1][1]则是指值4","5","6","7","8","9","addthesecondnumb","addthesecondnumber(b","addtwonumbers(4)(5","addtwonumbers(a","alex","annot","arrai","array-typ","array3d","array3d[0]是指[[1","array$0
    $1$2`。例如,class`class`。反引号不属于标识符的一部分,`x`(x","comparable等同于t","comparable表示任何用于替代类型形参t的类型实参必须满足compar","comparable,等等),但是依然可以用来对类型形参及其关联约束提供更复杂的约束。如,<t","conformance-requir","constrain","dictionary泛型形参语句泛型实参语句泛型实参语句泛型实参语句where语句泛型实参语句":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}},"s":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"表":{"docs":{},"示":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},"继":{"docs":{},"承":{"docs":{},"自":{"docs":{},"类":{"docs":{},"c":{"docs":{},"且":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"协":{"docs":{},"议":{"docs":{},"p":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}},"q":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"q":{"docs":{},"群":{"docs":{},":":{"3":{"6":{"4":{"2":{"7":{"9":{"5":{"8":{"8":{"docs":{"index.html#gitbook_8":{"ref":"index.html#gitbook_8","tf":0.06666666666666667}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}},"u":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018}}}},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}}}},"r":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.008928571428571428}},";":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},";":{"docs":{},")":{"docs":{},",":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"f":{"4":{"2":{"5":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"x":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}},"海":{"docs":{},"贼":{"docs":{},"王":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}},"":{"docs":{},"":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"之":{"docs":{},"所":{"docs":{},"以":{"docs":{},"叫":{"docs":{},"这":{"docs":{},"个":{"docs":{},"名":{"docs":{},"字":{"docs":{},"是":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"人":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"当":{"docs":{},"做":{"docs":{},"输":{"docs":{},"入":{"docs":{},",":{"docs":{},"并":{"docs":{},"返":{"docs":{},"回":{"docs":{},"给":{"docs":{},"这":{"docs":{},"个":{"docs":{},"人":{"docs":{},"的":{"docs":{},"问":{"docs":{},"候":{"docs":{},"语":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"完":{"docs":{},"成":{"docs":{},"这":{"docs":{},"个":{"docs":{},"任":{"docs":{},"务":{"docs":{},",":{"docs":{},"你":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"输":{"docs":{},"入":{"docs":{},"参":{"docs":{},"数":{"docs":{},"-":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},",":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"包":{"docs":{},"含":{"docs":{},"给":{"docs":{},"这":{"docs":{},"个":{"docs":{},"人":{"docs":{},"问":{"docs":{},"候":{"docs":{},"语":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}},"o":{"docs":{},"m":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}},"大":{"docs":{},"于":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}},"按":{"docs":{},"照":{"docs":{},"字":{"docs":{},"母":{"docs":{},"顺":{"docs":{},"序":{"docs":{},"后":{"docs":{},"出":{"docs":{},"现":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}}}}}}},"短":{"docs":{},"路":{"docs":{},"计":{"docs":{},"算":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}}}}}}}}}},"、":{"docs":{},"\\":{"docs":{},"­":{"docs":{},"、":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}}},"未":{"docs":{},"转":{"docs":{},"义":{"docs":{},"的":{"docs":{},"反":{"docs":{},"斜":{"docs":{},"线":{"docs":{},"\\":{"docs":{},"、":{"docs":{},"回":{"docs":{},"车":{"docs":{},"符":{"docs":{},"(":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}},"e":{"docs":{},"d":{"docs":{},"-":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.006696428571428571}},"-":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.008928571428571428}}}}}}}}}}}}},")":{"docs":{},"\\":{"docs":{},"&":{"docs":{},"#":{"3":{"9":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}},"docs":{}},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"a":{"docs":{},"b":{"docs":{},"c":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"g":{"docs":{},"h":{"docs":{},"i":{"docs":{},"j":{"docs":{},"k":{"docs":{},"l":{"docs":{},"m":{"docs":{},"n":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}},"码":{"docs":{},"格":{"docs":{},"式":{"docs":{},"的":{"docs":{},"二":{"docs":{},"维":{"docs":{},"码":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"任":{"docs":{},"何":{"docs":{},"i":{"docs":{},"s":{"docs":{},"o":{"8":{"8":{"5":{"9":{"docs":{},"-":{"1":{"docs":{},"字":{"docs":{},"符":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"可":{"docs":{},"以":{"docs":{},"编":{"docs":{},"码":{"docs":{},"一":{"docs":{},"个":{"docs":{},"最":{"docs":{},"多":{"docs":{},"拥":{"docs":{},"有":{"2":{"docs":{},",":{"9":{"5":{"3":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"index.html#gitbook_8":{"ref":"index.html#gitbook_8","tf":0.06666666666666667}}}}},"i":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.022727272727272728}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}},"­":{"docs":{},",":{"docs":{},"­":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.005625879043600563},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"1":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.012121212121212121}}},"2":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.006060606060606061}}},"3":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00808080808080808}}},"docs":{},")":{"docs":{},"和":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},"(":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"t":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}},"导":{"docs":{},"演":{"docs":{},"的":{"docs":{},"电":{"docs":{},"影":{"docs":{},"“":{"docs":{},"g":{"docs":{},"h":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"b":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}},"p":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"k":{"docs":{},"n":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}},"<":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},">":{"docs":{},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"k":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.005875440658049354},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"u":{"docs":{},"n":{"docs":{},"r":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}},"e":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},"将":{"docs":{},"计":{"docs":{},"数":{"docs":{},"器":{"docs":{},"重":{"docs":{},"置":{"docs":{},"为":{"0":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}},"docs":{}}}}}}}}},"r":{"docs":{},"v":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.04304635761589404}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"中":{"docs":{},"也":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}},"具":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},",":{"docs":{},"其":{"docs":{},"值":{"docs":{},"为":{"1":{"docs":{},"。":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"具":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}},"存":{"docs":{},"储":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"不":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"固":{"docs":{},"定":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"值":{"docs":{},",":{"docs":{},"而":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"计":{"docs":{},"算":{"docs":{},"而":{"docs":{},"来":{"docs":{},"的":{"docs":{},"。":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"是":{"docs":{},"由":{"docs":{},"返":{"docs":{},"回":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"属":{"docs":{},"性":{"docs":{},"叫":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"(":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"?":{"docs":{},")":{"docs":{},"。":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"给":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{},"且":{"docs":{},"在":{"docs":{},"他":{"docs":{},"的":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"或":{"docs":{},"多":{"docs":{},"个":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"通":{"docs":{},"过":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"在":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},",":{"docs":{},"将":{"docs":{},"会":{"docs":{},"引":{"docs":{},"发":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"错":{"docs":{},"误":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"时":{"docs":{},"没":{"docs":{},"有":{"docs":{},"可":{"docs":{},"以":{"docs":{},"供":{"docs":{},"解":{"docs":{},"析":{"docs":{},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"方":{"docs":{},"法":{"docs":{},"会":{"docs":{},"打":{"docs":{},"印":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"房":{"docs":{},"间":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"现":{"docs":{},"在":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.03525264394829612},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.016597510373443983},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.9794589997710398},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.034210526315789476},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.011928429423459244},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.009900990099009901},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.02197802197802198},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00808080808080808},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.019867549668874173},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0047430830039525695},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.032520325203252036},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.040229885057471264},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.013126491646778043},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.026905829596412557},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.017543859649122806},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":1.128402177393532}},"f":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"缩":{"docs":{},"写":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"函":{"docs":{},"数":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":3.333333333333333}}}}}}}}}}}}}}}}}},")":{"docs":{},"\\":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"或":{"docs":{},"换":{"docs":{},"行":{"docs":{},"符":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}},"时":{"docs":{},",":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"是":{"docs":{},"将":{"docs":{},"控":{"docs":{},"制":{"docs":{},"权":{"docs":{},"从":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"或":{"docs":{},"方":{"docs":{},"法":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"调":{"docs":{},"用":{"docs":{},"者":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"。":{"docs":{},"(":{"docs":{},"这":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"或":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"后":{"docs":{},"面":{"docs":{},"带":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"时":{"docs":{},",":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"值":{"docs":{},"将":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"给":{"docs":{},"调":{"docs":{},"用":{"docs":{},"者":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"值":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"与":{"docs":{},"调":{"docs":{},"用":{"docs":{},"者":{"docs":{},"期":{"docs":{},"望":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"不":{"docs":{},"匹":{"docs":{},"配":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"时":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"只":{"docs":{},"写":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"这":{"docs":{},"个":{"docs":{},"关":{"docs":{},"键":{"docs":{},"词":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"v":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.03642384105960265}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.02368421052631579}}}}}},"c":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.011494252873563218}},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}},"也":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"矩":{"docs":{},"形":{"docs":{},"的":{"docs":{},"中":{"docs":{},"心":{"docs":{},"点":{"docs":{},"可":{"docs":{},"以":{"docs":{},"从":{"docs":{},"原":{"docs":{},"点":{"docs":{},"和":{"docs":{},"尺":{"docs":{},"寸":{"docs":{},"来":{"docs":{},"算":{"docs":{},"出":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"将":{"docs":{},"它":{"docs":{},"以":{"docs":{},"显":{"docs":{},"式":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"来":{"docs":{},"保":{"docs":{},"存":{"docs":{},"。":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"的":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"同":{"docs":{},"时":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"辅":{"docs":{},"助":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"和":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"都":{"docs":{},"把":{"0":{"docs":{},".":{"0":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"其":{"docs":{},"所":{"docs":{},"有":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"正":{"docs":{},"如":{"docs":{},"默":{"docs":{},"认":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"中":{"docs":{},"描":{"docs":{},"述":{"docs":{},"的":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"自":{"docs":{},"动":{"docs":{},"接":{"docs":{},"受":{"docs":{},"一":{"docs":{},"个":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"成":{"docs":{},"员":{"docs":{},"级":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"于":{"docs":{},"构":{"docs":{},"造":{"docs":{},"新":{"docs":{},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"i":{"docs":{},"v":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}},"方":{"docs":{},"法":{"docs":{},"只":{"docs":{},"是":{"docs":{},"将":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"的":{"docs":{},"硬":{"docs":{},"币":{"docs":{},"存":{"docs":{},"储":{"docs":{},"和":{"docs":{},"接":{"docs":{},"收":{"docs":{},"到":{"docs":{},"的":{"docs":{},"硬":{"docs":{},"币":{"docs":{},"数":{"docs":{},"目":{"docs":{},"相":{"docs":{},"加":{"docs":{},",":{"docs":{},"再":{"docs":{},"保":{"docs":{},"存":{"docs":{},"回":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"m":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"o":{"docs":{},"v":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"a":{"docs":{},"i":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}},"n":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.04878048780487805}},".":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"(":{"3":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"docs":{}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"在":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"j":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"中":{"docs":{},",":{"docs":{},"但":{"docs":{},"仍":{"docs":{},"可":{"docs":{},"被":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"在":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"实":{"docs":{},"例":{"docs":{},"时":{"docs":{},"能":{"docs":{},"够":{"docs":{},"通":{"docs":{},"过":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"类":{"docs":{},"型":{"docs":{},"中":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"名":{"docs":{},"称":{"docs":{},"单":{"docs":{},"独":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"属":{"docs":{},"性":{"docs":{},"能":{"docs":{},"正":{"docs":{},"确":{"docs":{},"得":{"docs":{},"输":{"docs":{},"出":{"docs":{},"对":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"牌":{"docs":{},"有":{"1":{"docs":{},"和":{"1":{"1":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"自":{"docs":{},"己":{"docs":{},"内":{"docs":{},"部":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"包":{"docs":{},"含":{"docs":{},"两":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"有":{"docs":{},"两":{"docs":{},"个":{"docs":{},"数":{"docs":{},"值":{"docs":{},",":{"docs":{},"其":{"docs":{},"余":{"docs":{},"牌":{"docs":{},"都":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"数":{"docs":{},"值":{"docs":{},"。":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"会":{"docs":{},"根":{"docs":{},"据":{"docs":{},"牌":{"docs":{},"的":{"docs":{},"面":{"docs":{},"值":{"docs":{},",":{"docs":{},"用":{"docs":{},"适":{"docs":{},"当":{"docs":{},"的":{"docs":{},"数":{"docs":{},"值":{"docs":{},"去":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"j":{"docs":{},",":{"docs":{},"q":{"docs":{},",":{"docs":{},"k":{"docs":{},",":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"会":{"docs":{},"使":{"docs":{},"用":{"docs":{},"特":{"docs":{},"殊":{"docs":{},"数":{"docs":{},"值":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"数":{"docs":{},"字":{"docs":{},"面":{"docs":{},"值":{"docs":{},"的":{"docs":{},"牌":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"描":{"docs":{},"述":{"docs":{},"扑":{"docs":{},"克":{"docs":{},"牌":{"docs":{},"从":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"~":{"1":{"0":{"docs":{},",":{"docs":{},"j":{"docs":{},",":{"docs":{},"q":{"docs":{},",":{"docs":{},"k":{"docs":{},",":{"1":{"3":{"docs":{},"张":{"docs":{},"牌":{"docs":{},",":{"docs":{},"并":{"docs":{},"分":{"docs":{},"别":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"表":{"docs":{},"示":{"docs":{},"牌":{"docs":{},"的":{"docs":{},"面":{"docs":{},"值":{"docs":{},"。":{"docs":{},"(":{"docs":{},"这":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"适":{"docs":{},"用":{"docs":{},"于":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{},"j":{"docs":{},",":{"docs":{},"q":{"docs":{},",":{"docs":{},"k":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}},"g":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099}},"e":{"docs":{},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}},"声":{"docs":{},"明":{"docs":{},"成":{"docs":{},"了":{"docs":{},"常":{"docs":{},"量":{"docs":{},"(":{"docs":{},"用":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},")":{"docs":{},",":{"docs":{},"即":{"docs":{},"使":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.011933174224343675}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"用":{"docs":{},"以":{"docs":{},"确":{"docs":{},"保":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}},"d":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747}}}}}},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"o":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"j":{"docs":{},"u":{"docs":{},"l":{"docs":{},"i":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0728476821192053}},"(":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.013245033112582781}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.023178807947019868}}}}}}},"s":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"类":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"很":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"类":{"docs":{},",":{"docs":{},"它":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"设":{"docs":{},"定":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}},"w":{"0":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"1":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.04945054945054945}},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"下":{"docs":{},"标":{"docs":{},"的":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}},"的":{"docs":{},"数":{"docs":{},"量":{"docs":{},"来":{"docs":{},"构":{"docs":{},"造":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.020089285714285716}}}}}}}}},"l":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.013126491646778043}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"用":{"docs":{},"以":{"docs":{},"返":{"docs":{},"回":{"docs":{},"骰":{"docs":{},"子":{"docs":{},"面":{"docs":{},"值":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},".":{"docs":{},"该":{"docs":{},"方":{"docs":{},"法":{"docs":{},"先":{"docs":{},"调":{"docs":{},"用":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"的":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.04736842105263158}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},".":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}}}},"s":{"1":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.008438818565400843},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.034210526315789476}}},"2":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.011251758087201125},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.034210526315789476}},")":{"docs":{},",":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}}}},"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"index.html#gitbook_8":{"ref":"index.html#gitbook_8","tf":10.4},"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":10.404761904761905},"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":10.00587544065805},"chapter1/chapter1.html#gitbook_11":{"ref":"chapter1/chapter1.html#gitbook_11","tf":10.75},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.008298755186721992},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.06451612903225806},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.031067961165048542},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.008438818565400843},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.034210526315789476},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.03125},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter2/chapter2.html#gitbook_49":{"ref":"chapter2/chapter2.html#gitbook_49","tf":10.666666666666666},"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.08333333333333333},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.020172910662824207}},"中":{"docs":{},",":{"docs":{},"类":{"docs":{},"可":{"docs":{},"以":{"docs":{},"调":{"docs":{},"用":{"docs":{},"和":{"docs":{},"访":{"docs":{},"问":{"docs":{},"超":{"docs":{},"类":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"可":{"docs":{},"以":{"docs":{},"重":{"docs":{},"写":{"docs":{},"(":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},")":{"docs":{},"这":{"docs":{},"些":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"来":{"docs":{},"优":{"docs":{},"化":{"docs":{},"或":{"docs":{},"修":{"docs":{},"改":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"行":{"docs":{},"为":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"型":{"docs":{},"信":{"docs":{},"息":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"反":{"docs":{},"方":{"docs":{},"向":{"docs":{},"流":{"docs":{},"动":{"docs":{},"—":{"docs":{},"—":{"docs":{},"从":{"docs":{},"根":{"docs":{},"节":{"docs":{},"点":{"docs":{},"传":{"docs":{},"向":{"docs":{},"叶":{"docs":{},"子":{"docs":{},"节":{"docs":{},"点":{"docs":{},"。":{"docs":{},"在":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"常":{"docs":{},"量":{"docs":{},"e":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"上":{"docs":{},"的":{"docs":{},"显":{"docs":{},"式":{"docs":{},"类":{"docs":{},"型":{"docs":{},"标":{"docs":{},"注":{"docs":{},"(":{"docs":{},":":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},")":{"docs":{},"导":{"docs":{},"致":{"docs":{},"数":{"docs":{},"字":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"2":{"docs":{},".":{"7":{"1":{"8":{"2":{"8":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"而":{"docs":{},"非":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"枚":{"docs":{},"举":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"一":{"docs":{},"等":{"docs":{},"(":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"采":{"docs":{},"用":{"docs":{},"了":{"docs":{},"很":{"docs":{},"多":{"docs":{},"传":{"docs":{},"统":{"docs":{},"上":{"docs":{},"只":{"docs":{},"被":{"docs":{},"类":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},")":{"docs":{},"所":{"docs":{},"支":{"docs":{},"持":{"docs":{},"的":{"docs":{},"特":{"docs":{},"征":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"其":{"docs":{},"他":{"docs":{},"类":{"docs":{},"型":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"(":{"docs":{},"例":{"docs":{},"如":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"能":{"docs":{},"够":{"docs":{},"定":{"docs":{},"义":{"docs":{},"方":{"docs":{},"法":{"docs":{},";":{"docs":{},"事":{"docs":{},"实":{"docs":{},"上":{"docs":{},"这":{"docs":{},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"与":{"docs":{},"c":{"docs":{},"/":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"的":{"docs":{},"主":{"docs":{},"要":{"docs":{},"区":{"docs":{},"别":{"docs":{},"之":{"docs":{},"一":{"docs":{},"。":{"docs":{},"在":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"中":{"docs":{},",":{"docs":{},"类":{"docs":{},"是":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"能":{"docs":{},"定":{"docs":{},"义":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"方":{"docs":{},"法":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"与":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"和":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"中":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"极":{"docs":{},"其":{"docs":{},"相":{"docs":{},"似":{"docs":{},"。":{"docs":{},"像":{"docs":{},"在":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"中":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"中":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"名":{"docs":{},"称":{"docs":{},"通":{"docs":{},"常":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"介":{"docs":{},"词":{"docs":{},"指":{"docs":{},"向":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"比":{"docs":{},"如":{"docs":{},":":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},",":{"docs":{},"b":{"docs":{},"y":{"docs":{},"等":{"docs":{},"等":{"docs":{},"。":{"docs":{},"前":{"docs":{},"面":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"类":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"b":{"docs":{},"y":{"docs":{},"方":{"docs":{},"法":{"docs":{},"就":{"docs":{},"是":{"docs":{},"这":{"docs":{},"样":{"docs":{},"的":{"docs":{},"。":{"docs":{},"介":{"docs":{},"词":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"让":{"docs":{},"方":{"docs":{},"法":{"docs":{},"在":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},"能":{"docs":{},"像":{"docs":{},"一":{"docs":{},"个":{"docs":{},"句":{"docs":{},"子":{"docs":{},"一":{"docs":{},"样":{"docs":{},"被":{"docs":{},"解":{"docs":{},"读":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"下":{"docs":{},"标":{"docs":{},"实":{"docs":{},"现":{"docs":{},"中":{"docs":{},",":{"docs":{},"在":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"部":{"docs":{},"分":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},"不":{"docs":{},"是":{"docs":{},"每":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"都":{"docs":{},"能":{"docs":{},"得":{"docs":{},"到":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"值":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"没":{"docs":{},"有":{"docs":{},"设":{"docs":{},"过":{"docs":{},"值":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"的":{"docs":{},"访":{"docs":{},"问":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"结":{"docs":{},"果":{"docs":{},"就":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},";":{"docs":{},"同":{"docs":{},"样":{"docs":{},"想":{"docs":{},"要":{"docs":{},"从":{"docs":{},"字":{"docs":{},"典":{"docs":{},"实":{"docs":{},"例":{"docs":{},"中":{"docs":{},"删":{"docs":{},"除":{"docs":{},"某":{"docs":{},"个":{"docs":{},"索":{"docs":{},"引":{"docs":{},"下":{"docs":{},"的":{"docs":{},"值":{"docs":{},"也":{"docs":{},"只":{"docs":{},"需":{"docs":{},"要":{"docs":{},"给":{"docs":{},"这":{"docs":{},"个":{"docs":{},"索":{"docs":{},"引":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"有":{"docs":{},"两":{"docs":{},"类":{"docs":{},"特":{"docs":{},"性":{"docs":{},",":{"docs":{},"用":{"docs":{},"于":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"以":{"docs":{},"及":{"docs":{},"用":{"docs":{},"于":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"特":{"docs":{},"性":{"docs":{},",":{"docs":{},"当":{"docs":{},"应":{"docs":{},"用":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"的":{"docs":{},"指":{"docs":{},"定":{"docs":{},"或":{"docs":{},"便":{"docs":{},"利":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"声":{"docs":{},"明":{"docs":{},"时":{"docs":{},",":{"docs":{},"表":{"docs":{},"明":{"docs":{},"它":{"docs":{},"的":{"docs":{},"每":{"docs":{},"个":{"docs":{},"子":{"docs":{},"类":{"docs":{},"都":{"docs":{},"必":{"docs":{},"须":{"docs":{},"实":{"docs":{},"现":{"docs":{},"那":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"。":{"docs":{},"再":{"docs":{},"比":{"docs":{},"如":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"推":{"docs":{},"断":{"docs":{},"出":{"docs":{},"这":{"docs":{},"个":{"docs":{},"常":{"docs":{},"量":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"详":{"docs":{},"情":{"docs":{},"参":{"docs":{},"见":{"docs":{},"类":{"docs":{},"型":{"docs":{},"安":{"docs":{},"全":{"docs":{},"和":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},"(":{"docs":{},"待":{"docs":{},"添":{"docs":{},"加":{"docs":{},"链":{"docs":{},"接":{"docs":{},")":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"没":{"docs":{},"有":{"docs":{},"给":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"插":{"docs":{},"值":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"类":{"docs":{},"似":{"docs":{},"c":{"docs":{},"语":{"docs":{},"言":{"docs":{},"的":{"docs":{},"流":{"docs":{},"程":{"docs":{},"控":{"docs":{},"制":{"docs":{},"结":{"docs":{},"构":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"将":{"docs":{},"任":{"docs":{},"务":{"docs":{},"执":{"docs":{},"行":{"docs":{},"多":{"docs":{},"次":{"docs":{},"的":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"和":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"循":{"docs":{},"环":{"docs":{},",":{"docs":{},"基":{"docs":{},"于":{"docs":{},"特":{"docs":{},"定":{"docs":{},"条":{"docs":{},"件":{"docs":{},"选":{"docs":{},"择":{"docs":{},"执":{"docs":{},"行":{"docs":{},"不":{"docs":{},"同":{"docs":{},"分":{"docs":{},"支":{"docs":{},"的":{"docs":{},"i":{"docs":{},"f":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"还":{"docs":{},"有":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"程":{"docs":{},"跳":{"docs":{},"转":{"docs":{},"到":{"docs":{},"其":{"docs":{},"他":{"docs":{},"代":{"docs":{},"码":{"docs":{},"的":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_27":{"ref":"chapter2/05_Control_Flow.html#gitbook_27","tf":0.5}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"一":{"docs":{},"种":{"docs":{},"优":{"docs":{},"雅":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"解":{"docs":{},"决":{"docs":{},"这":{"docs":{},"个":{"docs":{},"问":{"docs":{},"题":{"docs":{},",":{"docs":{},"称":{"docs":{},"之":{"docs":{},"为":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"占":{"docs":{},"用":{"docs":{},"列":{"docs":{},"表":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"两":{"docs":{},"种":{"docs":{},"办":{"docs":{},"法":{"docs":{},"用":{"docs":{},"来":{"docs":{},"解":{"docs":{},"决":{"docs":{},"你":{"docs":{},"在":{"docs":{},"使":{"docs":{},"用":{"docs":{},"类":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"时":{"docs":{},"所":{"docs":{},"遇":{"docs":{},"到":{"docs":{},"的":{"docs":{},"循":{"docs":{},"环":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"问":{"docs":{},"题":{"docs":{},":":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"(":{"docs":{},"w":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"统":{"docs":{},"一":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"语":{"docs":{},"法":{"docs":{},"足":{"docs":{},"够":{"docs":{},"灵":{"docs":{},"活":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"任":{"docs":{},"何":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"从":{"docs":{},"最":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"没":{"docs":{},"有":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"字":{"docs":{},"的":{"docs":{},"c":{"docs":{},"风":{"docs":{},"格":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"到":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"的":{"docs":{},"带":{"docs":{},"局":{"docs":{},"部":{"docs":{},"和":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"的":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"自":{"docs":{},"动":{"docs":{},"为":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"存":{"docs":{},"储":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"关":{"docs":{},"联":{"docs":{},"值":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"需":{"docs":{},"要":{"docs":{},"的":{"docs":{},"话":{"docs":{},",":{"docs":{},"每":{"docs":{},"个":{"docs":{},"成":{"docs":{},"员":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"各":{"docs":{},"不":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"。":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"这":{"docs":{},"种":{"docs":{},"特":{"docs":{},"性":{"docs":{},"跟":{"docs":{},"其":{"docs":{},"他":{"docs":{},"语":{"docs":{},"言":{"docs":{},"中":{"docs":{},"的":{"docs":{},"可":{"docs":{},"辨":{"docs":{},"识":{"docs":{},"联":{"docs":{},"合":{"docs":{},"(":{"docs":{},"d":{"docs":{},"i":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"字":{"docs":{},"典":{"docs":{},"(":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"链":{"docs":{},"和":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"中":{"docs":{},"的":{"docs":{},"消":{"docs":{},"息":{"docs":{},"为":{"docs":{},"空":{"docs":{},"有":{"docs":{},"些":{"docs":{},"相":{"docs":{},"像":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"检":{"docs":{},"测":{"docs":{},"器":{"docs":{},"能":{"docs":{},"够":{"docs":{},"演":{"docs":{},"绎":{"docs":{},"出":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"名":{"docs":{},"为":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}},"内":{"docs":{},"建":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"添":{"docs":{},"加":{"docs":{},"了":{"5":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}},"docs":{}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"已":{"docs":{},"经":{"docs":{},"提":{"docs":{},"供":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"通":{"docs":{},"过":{"docs":{},"下":{"docs":{},"标":{"docs":{},"来":{"docs":{},"查":{"docs":{},"找":{"docs":{},"一":{"docs":{},"个":{"docs":{},"自":{"docs":{},"己":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"。":{"docs":{},"这":{"docs":{},"三":{"docs":{},"个":{"docs":{},"功":{"docs":{},"能":{"docs":{},"都":{"docs":{},"达":{"docs":{},"到":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"要":{"docs":{},"求":{"docs":{},"。":{"docs":{},"也":{"docs":{},"就":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"去":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"只":{"docs":{},"要":{"docs":{},"通":{"docs":{},"过":{"docs":{},"简":{"docs":{},"单":{"docs":{},"声":{"docs":{},"明":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"适":{"docs":{},"用":{"docs":{},"于":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},"而":{"docs":{},"已":{"docs":{},"。":{"docs":{},"如":{"docs":{},"何":{"docs":{},"实":{"docs":{},"践":{"docs":{},"这":{"docs":{},"样":{"docs":{},"一":{"docs":{},"个":{"docs":{},"空":{"docs":{},"扩":{"docs":{},"展":{"docs":{},",":{"docs":{},"在":{"docs":{},"[":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"类":{"docs":{},"型":{"docs":{},"对":{"docs":{},"作":{"docs":{},"用":{"docs":{},"于":{"docs":{},"其":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"s":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"做":{"docs":{},"了":{"docs":{},"些":{"docs":{},"限":{"docs":{},"制":{"docs":{},"。":{"docs":{},"在":{"docs":{},"[":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"]":{"docs":{},"[":{"5":{"docs":{},"]":{"docs":{},"的":{"docs":{},"描":{"docs":{},"述":{"docs":{},"中":{"docs":{},",":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"s":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"必":{"docs":{},"须":{"docs":{},"有":{"docs":{},"一":{"docs":{},"种":{"docs":{},"方":{"docs":{},"法":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"其":{"docs":{},"是":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"的":{"docs":{},"表":{"docs":{},"示":{"docs":{},"。":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"之":{"docs":{},"所":{"docs":{},"以":{"docs":{},"需":{"docs":{},"要":{"docs":{},"其":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"s":{"docs":{},"是":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"是":{"docs":{},"为":{"docs":{},"了":{"docs":{},"以":{"docs":{},"便":{"docs":{},"于":{"docs":{},"其":{"docs":{},"检":{"docs":{},"查":{"docs":{},"其":{"docs":{},"是":{"docs":{},"否":{"docs":{},"包":{"docs":{},"含":{"docs":{},"某":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"如":{"docs":{},"无":{"docs":{},"此":{"docs":{},"需":{"docs":{},"求":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"即":{"docs":{},"不":{"docs":{},"会":{"docs":{},"告":{"docs":{},"诉":{"docs":{},"是":{"docs":{},"否":{"docs":{},"插":{"docs":{},"入":{"docs":{},"或":{"docs":{},"者":{"docs":{},"替":{"docs":{},"换":{"docs":{},"了":{"docs":{},"某":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"也":{"docs":{},"不":{"docs":{},"能":{"docs":{},"查":{"docs":{},"找":{"docs":{},"到":{"docs":{},"已":{"docs":{},"经":{"docs":{},"存":{"docs":{},"储":{"docs":{},"在":{"docs":{},"字":{"docs":{},"典":{"docs":{},"里":{"docs":{},"面":{"docs":{},"的":{"docs":{},"给":{"docs":{},"定":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"编":{"docs":{},"程":{"docs":{},"语":{"docs":{},"言":{"docs":{},"中":{"docs":{},"把":{"docs":{},"这":{"docs":{},"些":{"docs":{},"理":{"docs":{},"论":{"docs":{},"统":{"docs":{},"一":{"docs":{},"用":{"docs":{},"属":{"docs":{},"性":{"docs":{},"来":{"docs":{},"实":{"docs":{},"现":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}},"也":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"方":{"docs":{},"便":{"docs":{},"对":{"docs":{},"变":{"docs":{},"量":{"docs":{},"本":{"docs":{},"身":{"docs":{},"加":{"1":{"docs":{},"或":{"docs":{},"减":{"1":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"docs":{}}}},"docs":{}}}}}}}}}}}}},"支":{"docs":{},"持":{"docs":{},"基":{"docs":{},"于":{"docs":{},"c":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}},"大":{"docs":{},"部":{"docs":{},"分":{"docs":{},"标":{"docs":{},"准":{"docs":{},"c":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}}}}}}},"会":{"docs":{},"自":{"docs":{},"动":{"docs":{},"释":{"docs":{},"放":{"docs":{},"不":{"docs":{},"再":{"docs":{},"需":{"docs":{},"要":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"以":{"docs":{},"释":{"docs":{},"放":{"docs":{},"资":{"docs":{},"源":{"docs":{},"。":{"docs":{},"如":{"docs":{},"自":{"docs":{},"动":{"docs":{},"引":{"docs":{},"用":{"docs":{},"计":{"docs":{},"数":{"docs":{},"那":{"docs":{},"一":{"docs":{},"章":{"docs":{},"描":{"docs":{},"述":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"通":{"docs":{},"过":{"docs":{},"自":{"docs":{},"动":{"docs":{},"引":{"docs":{},"用":{"docs":{},"计":{"docs":{},"数":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"使":{"docs":{},"用":{"docs":{},"自":{"docs":{},"动":{"docs":{},"引":{"docs":{},"用":{"docs":{},"计":{"docs":{},"数":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},")":{"docs":{},"这":{"docs":{},"一":{"docs":{},"机":{"docs":{},"制":{"docs":{},"来":{"docs":{},"跟":{"docs":{},"踪":{"docs":{},"和":{"docs":{},"管":{"docs":{},"理":{"docs":{},"你":{"docs":{},"的":{"docs":{},"应":{"docs":{},"用":{"docs":{},"程":{"docs":{},"序":{"docs":{},"的":{"docs":{},"内":{"docs":{},"存":{"docs":{},"。":{"docs":{},"通":{"docs":{},"常":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"的":{"docs":{},"内":{"docs":{},"存":{"docs":{},"管":{"docs":{},"理":{"docs":{},"机":{"docs":{},"制":{"docs":{},"会":{"docs":{},"一":{"docs":{},"直":{"docs":{},"起":{"docs":{},"着":{"docs":{},"作":{"docs":{},"用":{"docs":{},",":{"docs":{},"你":{"docs":{},"无":{"docs":{},"须":{"docs":{},"自":{"docs":{},"己":{"docs":{},"来":{"docs":{},"考":{"docs":{},"虑":{"docs":{},"内":{"docs":{},"存":{"docs":{},"的":{"docs":{},"管":{"docs":{},"理":{"docs":{},"。":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"有":{"docs":{},"如":{"docs":{},"下":{"docs":{},"要":{"docs":{},"求":{"docs":{},":":{"docs":{},"只":{"docs":{},"要":{"docs":{},"在":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"内":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},",":{"docs":{},"就":{"docs":{},"要":{"docs":{},"用":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"或":{"docs":{},"者":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"(":{"docs":{},"而":{"docs":{},"不":{"docs":{},"只":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"或":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"提":{"docs":{},"醒":{"docs":{},"你":{"docs":{},"可":{"docs":{},"能":{"docs":{},"会":{"docs":{},"不":{"docs":{},"小":{"docs":{},"心":{"docs":{},"就":{"docs":{},"占":{"docs":{},"有":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"链":{"docs":{},"接":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"?":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"存":{"docs":{},"在":{"docs":{},"则":{"docs":{},"取":{"docs":{},"回":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"’":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"内":{"docs":{},"建":{"docs":{},"类":{"docs":{},"型":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"下":{"docs":{},"标":{"docs":{},"。":{"docs":{},"该":{"docs":{},"下":{"docs":{},"标":{"docs":{},"[":{"docs":{},"n":{"docs":{},"]":{"docs":{},"返":{"docs":{},"回":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"数":{"docs":{},"字":{"docs":{},"从":{"docs":{},"右":{"docs":{},"向":{"docs":{},"左":{"docs":{},"数":{"docs":{},"的":{"docs":{},"第":{"docs":{},"n":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"允":{"docs":{},"许":{"docs":{},"你":{"docs":{},"定":{"docs":{},"义":{"docs":{},"你":{"docs":{},"自":{"docs":{},"己":{"docs":{},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"类":{"docs":{},"、":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"作":{"docs":{},"用":{"docs":{},"于":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"如":{"docs":{},"同":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"字":{"docs":{},"典":{"docs":{},"(":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"有":{"docs":{},"两":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},",":{"docs":{},"另":{"docs":{},"外":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"值":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"自":{"docs":{},"己":{"docs":{},"写":{"docs":{},"字":{"docs":{},"典":{"docs":{},",":{"docs":{},"你":{"docs":{},"或":{"docs":{},"许":{"docs":{},"会":{"docs":{},"定":{"docs":{},"义":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"为":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"和":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},"要":{"docs":{},"求":{"docs":{},"任":{"docs":{},"何":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"实":{"docs":{},"现":{"docs":{},"等":{"docs":{},"式":{"docs":{},"符":{"docs":{},"(":{"docs":{},"=":{"docs":{},"=":{"docs":{},")":{"docs":{},"和":{"docs":{},"不":{"docs":{},"等":{"docs":{},"符":{"docs":{},"(":{"docs":{},"!":{"docs":{},"=":{"docs":{},")":{"docs":{},"对":{"docs":{},"任":{"docs":{},"何":{"docs":{},"两":{"docs":{},"个":{"docs":{},"该":{"docs":{},"类":{"docs":{},"型":{"docs":{},"进":{"docs":{},"行":{"docs":{},"比":{"docs":{},"较":{"docs":{},"。":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"标":{"docs":{},"准":{"docs":{},"类":{"docs":{},"型":{"docs":{},"自":{"docs":{},"动":{"docs":{},"支":{"docs":{},"持":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"细":{"docs":{},"节":{"docs":{},"讨":{"docs":{},"论":{"docs":{},",":{"docs":{},"见":{"docs":{},"章":{"docs":{},"节":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"考":{"docs":{},",":{"docs":{},"你":{"docs":{},"不":{"docs":{},"用":{"docs":{},"在":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"定":{"docs":{},"义":{"docs":{},"部":{"docs":{},"分":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"具":{"docs":{},"体":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"。":{"docs":{},"由":{"docs":{},"于":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"要":{"docs":{},"求":{"docs":{},",":{"docs":{},"只":{"docs":{},"要":{"docs":{},"通":{"docs":{},"过":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"查":{"docs":{},"找":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"参":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"推":{"docs":{},"断":{"docs":{},"出":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"需":{"docs":{},"要":{"docs":{},"强":{"docs":{},"大":{"docs":{},"特":{"docs":{},"征":{"docs":{},"中":{"docs":{},"的":{"docs":{},"其":{"docs":{},"中":{"docs":{},"一":{"docs":{},"个":{"docs":{},",":{"docs":{},"许":{"docs":{},"多":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"代":{"docs":{},"码":{"docs":{},"构":{"docs":{},"建":{"docs":{},"出":{"docs":{},"来":{"docs":{},"的":{"docs":{},"。":{"docs":{},"事":{"docs":{},"实":{"docs":{},"上":{"docs":{},",":{"docs":{},"你":{"docs":{},"已":{"docs":{},"经":{"docs":{},"使":{"docs":{},"用":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"贯":{"docs":{},"穿":{"docs":{},"着":{"docs":{},"整":{"docs":{},"个":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"u":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"言":{"docs":{},"相":{"docs":{},"对":{"docs":{},"小":{"docs":{},"点":{"docs":{},",":{"docs":{},"这":{"docs":{},"是":{"docs":{},"由":{"docs":{},"于":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"代":{"docs":{},"码":{"docs":{},"中":{"docs":{},"几":{"docs":{},"乎":{"docs":{},"无":{"docs":{},"处":{"docs":{},"不":{"docs":{},"在":{"docs":{},"的":{"docs":{},"许":{"docs":{},"多":{"docs":{},"常":{"docs":{},"见":{"docs":{},"的":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"以":{"docs":{},"及":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"都":{"docs":{},"由":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"来":{"docs":{},"定":{"docs":{},"义":{"docs":{},"。":{"docs":{},"虽":{"docs":{},"然":{"docs":{},"这":{"docs":{},"些":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"和":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"不":{"docs":{},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.041666666666666664}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"使":{"docs":{},"用":{"docs":{},"类":{"docs":{},"型":{"docs":{},"名":{"docs":{},"紧":{"docs":{},"接":{"docs":{},"中":{"docs":{},"括":{"docs":{},"号":{"docs":{},"[":{"docs":{},"]":{"docs":{},"来":{"docs":{},"简":{"docs":{},"化":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"存":{"docs":{},"在":{"docs":{},"两":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},":":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"和":{"docs":{},"复":{"docs":{},"合":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"指":{"docs":{},"定":{"docs":{},"义":{"docs":{},"时":{"docs":{},"可":{"docs":{},"以":{"docs":{},"给":{"docs":{},"定":{"docs":{},"名":{"docs":{},"字":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"包":{"docs":{},"括":{"docs":{},"类":{"docs":{},"、":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"、":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"和":{"docs":{},"协":{"docs":{},"议":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"用":{"docs":{},"户":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"类":{"docs":{},"m":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"类":{"docs":{},"型":{"docs":{},"m":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"。":{"docs":{},"除":{"docs":{},"了":{"docs":{},"用":{"docs":{},"户":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"!":{"docs":{},"作":{"docs":{},"为":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"命":{"docs":{},"名":{"docs":{},"类":{"docs":{},"型":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{},"y":{"docs":{},"u":{"docs":{},"n":{"docs":{},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"d":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"本":{"docs":{},"身":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"并":{"docs":{},"描":{"docs":{},"述":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"?":{"docs":{},"来":{"docs":{},"作":{"docs":{},"为":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"广":{"docs":{},"泛":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},",":{"docs":{},"从":{"docs":{},"而":{"docs":{},"允":{"docs":{},"许":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"很":{"docs":{},"多":{"docs":{},"变":{"docs":{},"量":{"docs":{},"和":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"或":{"docs":{},"部":{"docs":{},"分":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"本":{"docs":{},"身":{"docs":{},"定":{"docs":{},"义":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"存":{"docs":{},"在":{"docs":{},"两":{"docs":{},"种":{"docs":{},"复":{"docs":{},"合":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},":":{"docs":{},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"和":{"docs":{},"元":{"docs":{},"组":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"复":{"docs":{},"合":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"包":{"docs":{},"含":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"和":{"docs":{},"其":{"docs":{},"它":{"docs":{},"复":{"docs":{},"合":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"元":{"docs":{},"组":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.005875440658049354},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.025830258302583026},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.006324110671936759},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":2.2423951328850467}},"中":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"的":{"docs":{},"子":{"docs":{},"句":{"docs":{},"之":{"docs":{},"后":{"docs":{},",":{"docs":{},"程":{"docs":{},"序":{"docs":{},"会":{"docs":{},"退":{"docs":{},"出":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"并":{"docs":{},"不":{"docs":{},"会":{"docs":{},"继":{"docs":{},"续":{"docs":{},"向":{"docs":{},"下":{"docs":{},"运":{"docs":{},"行":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"每":{"docs":{},"个":{"docs":{},"子":{"docs":{},"句":{"docs":{},"结":{"docs":{},"尾":{"docs":{},"写":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"关":{"docs":{},"联":{"docs":{},"值":{"docs":{},"(":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"o":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":3.333333333333333}}}}}}}}}}}},"来":{"docs":{},"检":{"docs":{},"查":{"docs":{},",":{"docs":{},"然":{"docs":{},"而":{"docs":{},"这":{"docs":{},"次":{"docs":{},"关":{"docs":{},"联":{"docs":{},"值":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"提":{"docs":{},"取":{"docs":{},"作":{"docs":{},"为":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"分":{"docs":{},"支":{"docs":{},"代":{"docs":{},"码":{"docs":{},"中":{"docs":{},"提":{"docs":{},"取":{"docs":{},"每":{"docs":{},"个":{"docs":{},"关":{"docs":{},"联":{"docs":{},"值":{"docs":{},"作":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"常":{"docs":{},"量":{"docs":{},"(":{"docs":{},"用":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"前":{"docs":{},"缀":{"docs":{},")":{"docs":{},"或":{"docs":{},"者":{"docs":{},"作":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"(":{"docs":{},"用":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"强":{"docs":{},"制":{"docs":{},"形":{"docs":{},"式":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"检":{"docs":{},"查":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"(":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}},"控":{"docs":{},"制":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}}}}}}}}}}},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}},"控":{"docs":{},"制":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"能":{"docs":{},"的":{"docs":{},"值":{"docs":{},"都":{"docs":{},"必":{"docs":{},"须":{"docs":{},"至":{"docs":{},"少":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"与":{"docs":{},"之":{"docs":{},"对":{"docs":{},"应":{"docs":{},"。":{"docs":{},"在":{"docs":{},"某":{"docs":{},"些":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},"(":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"修":{"docs":{},"改":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}},"模":{"docs":{},"式":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"的":{"docs":{},"顺":{"docs":{},"序":{"docs":{},"和":{"docs":{},"书":{"docs":{},"写":{"docs":{},"源":{"docs":{},"代":{"docs":{},"码":{"docs":{},"的":{"docs":{},"顺":{"docs":{},"序":{"docs":{},"保":{"docs":{},"持":{"docs":{},"一":{"docs":{},"致":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"当":{"docs":{},"多":{"docs":{},"个":{"docs":{},"模":{"docs":{},"式":{"docs":{},"含":{"docs":{},"有":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"值":{"docs":{},"且":{"docs":{},"能":{"docs":{},"够":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"控":{"docs":{},"制":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"时":{"docs":{},",":{"docs":{},"程":{"docs":{},"序":{"docs":{},"只":{"docs":{},"会":{"docs":{},"执":{"docs":{},"行":{"docs":{},"源":{"docs":{},"代":{"docs":{},"码":{"docs":{},"中":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"包":{"docs":{},"含":{"docs":{},"默":{"docs":{},"认":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},")":{"docs":{},"块":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"其":{"docs":{},"它":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"都":{"docs":{},"无":{"docs":{},"法":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"控":{"docs":{},"制":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"时":{"docs":{},",":{"docs":{},"默":{"docs":{},"认":{"docs":{},"块":{"docs":{},"中":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"才":{"docs":{},"会":{"docs":{},"被":{"docs":{},"执":{"docs":{},"行":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"只":{"docs":{},"能":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"默":{"docs":{},"认":{"docs":{},"块":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"必":{"docs":{},"须":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"前":{"docs":{},"面":{"docs":{},"加":{"docs":{},"上":{"docs":{},"标":{"docs":{},"签":{"docs":{},",":{"docs":{},"它":{"docs":{},"由":{"docs":{},"标":{"docs":{},"签":{"docs":{},"名":{"docs":{},"和":{"docs":{},"紧":{"docs":{},"随":{"docs":{},"其":{"docs":{},"后":{"docs":{},"的":{"docs":{},"冒":{"docs":{},"号":{"docs":{},"(":{"docs":{},":":{"docs":{},")":{"docs":{},"组":{"docs":{},"成":{"docs":{},"。":{"docs":{},"在":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"后":{"docs":{},"面":{"docs":{},"跟":{"docs":{},"上":{"docs":{},"标":{"docs":{},"签":{"docs":{},"名":{"docs":{},"可":{"docs":{},"以":{"docs":{},"显":{"docs":{},"式":{"docs":{},"地":{"docs":{},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"语":{"docs":{},"句":{"docs":{},"或":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"更":{"docs":{},"改":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},",":{"docs":{},"把":{"docs":{},"控":{"docs":{},"制":{"docs":{},"权":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"指":{"docs":{},"定":{"docs":{},"标":{"docs":{},"签":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"关":{"docs":{},"于":{"docs":{},"这":{"docs":{},"两":{"docs":{},"条":{"docs":{},"语":{"docs":{},"句":{"docs":{},"用":{"docs":{},"法":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.01729106628242075}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}}}},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}},"a":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235}},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}},"s":{"docs":{},"(":{"docs":{},"&":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}}},"函":{"docs":{},"数":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"交":{"docs":{},"换":{"docs":{},"a":{"docs":{},"与":{"docs":{},"b":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"先":{"docs":{},"将":{"docs":{},"a":{"docs":{},"的":{"docs":{},"值":{"docs":{},"存":{"docs":{},"到":{"docs":{},"一":{"docs":{},"个":{"docs":{},"暂":{"docs":{},"时":{"docs":{},"常":{"docs":{},"量":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"a":{"docs":{},"中":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"将":{"docs":{},"b":{"docs":{},"的":{"docs":{},"值":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"a":{"docs":{},",":{"docs":{},"最":{"docs":{},"后":{"docs":{},"将":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"a":{"docs":{},"幅":{"docs":{},"值":{"docs":{},"给":{"docs":{},"b":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"定":{"docs":{},"义":{"docs":{},"任":{"docs":{},"何":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},",":{"docs":{},"但":{"docs":{},"仍":{"docs":{},"然":{"docs":{},"修":{"docs":{},"改":{"docs":{},"了":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"有":{"docs":{},"两":{"docs":{},"个":{"docs":{},"分":{"docs":{},"别":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"交":{"docs":{},"换":{"docs":{},"b":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"到":{"docs":{},"a":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"交":{"docs":{},"换":{"docs":{},"a":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"到":{"docs":{},"b":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"调":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"交":{"docs":{},"换":{"docs":{},"两":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"非":{"docs":{},"常":{"docs":{},"有":{"docs":{},"用":{"docs":{},"的":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"它":{"docs":{},"只":{"docs":{},"能":{"docs":{},"交":{"docs":{},"换":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"要":{"docs":{},"交":{"docs":{},"换":{"docs":{},"两":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"或":{"docs":{},"者":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"交":{"docs":{},"换":{"docs":{},"两":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}},"函":{"docs":{},"数":{"docs":{},"主":{"docs":{},"题":{"docs":{},"都":{"docs":{},"是":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},",":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"不":{"docs":{},"同":{"docs":{},"之":{"docs":{},"处":{"docs":{},"就":{"docs":{},"在":{"docs":{},"于":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"不":{"docs":{},"同":{"docs":{},",":{"docs":{},"分":{"docs":{},"别":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"、":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"和":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}},"e":{"docs":{},"s":{"docs":{},"(":{"docs":{},"&":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}},"<":{"docs":{},"t":{"docs":{},">":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}}}}}},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"节":{"docs":{},"点":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},"是":{"docs":{},"一":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"的":{"docs":{},"示":{"docs":{},"例":{"docs":{},"。":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"指":{"docs":{},"定":{"docs":{},"并":{"docs":{},"命":{"docs":{},"名":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"节":{"docs":{},"点":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"紧":{"docs":{},"随":{"docs":{},"在":{"docs":{},"函":{"docs":{},"数":{"docs":{},"名":{"docs":{},"后":{"docs":{},"面":{"docs":{},",":{"docs":{},"并":{"docs":{},"用":{"docs":{},"一":{"docs":{},"对":{"docs":{},"尖":{"docs":{},"括":{"docs":{},"号":{"docs":{},"括":{"docs":{},"起":{"docs":{},"来":{"docs":{},"(":{"docs":{},"如":{"docs":{},"<":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"中":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{},")":{"docs":{},",":{"docs":{},"或":{"docs":{},"作":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"或":{"docs":{},"用":{"docs":{},"作":{"docs":{},"函":{"docs":{},"数":{"docs":{},"主":{"docs":{},"体":{"docs":{},"中":{"docs":{},"的":{"docs":{},"注":{"docs":{},"释":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"被":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"所":{"docs":{},"代":{"docs":{},"表":{"docs":{},"的":{"docs":{},"节":{"docs":{},"点":{"docs":{},"类":{"docs":{},"型":{"docs":{},"不":{"docs":{},"管":{"docs":{},"函":{"docs":{},"数":{"docs":{},"任":{"docs":{},"何":{"docs":{},"时":{"docs":{},"候":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"都":{"docs":{},"会":{"docs":{},"被":{"docs":{},"实":{"docs":{},"际":{"docs":{},"类":{"docs":{},"型":{"docs":{},"所":{"docs":{},"替":{"docs":{},"换":{"docs":{},"(":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"当":{"docs":{},"函":{"docs":{},"数":{"docs":{},"第":{"docs":{},"一":{"docs":{},"次":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"t":{"docs":{},"被":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"替":{"docs":{},"换":{"docs":{},",":{"docs":{},"第":{"docs":{},"二":{"docs":{},"次":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"被":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"主":{"docs":{},"体":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"是":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},",":{"docs":{},"只":{"docs":{},"在":{"docs":{},"第":{"docs":{},"一":{"docs":{},"行":{"docs":{},"稍":{"docs":{},"微":{"docs":{},"有":{"docs":{},"那":{"docs":{},"么":{"docs":{},"一":{"docs":{},"点":{"docs":{},"点":{"docs":{},"不":{"docs":{},"同":{"docs":{},"于":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"除":{"docs":{},"了":{"docs":{},"只":{"docs":{},"要":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"两":{"docs":{},"个":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},"值":{"docs":{},"是":{"docs":{},"同":{"docs":{},"一":{"docs":{},"类":{"docs":{},"型":{"docs":{},"外":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"作":{"docs":{},"为":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"。":{"docs":{},"每":{"docs":{},"次":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"泛":{"docs":{},"型":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"或":{"docs":{},"一":{"docs":{},"个":{"docs":{},"存":{"docs":{},"储":{"docs":{},"单":{"docs":{},"一":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"集":{"docs":{},",":{"docs":{},"如":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},")":{"docs":{},",":{"docs":{},"通":{"docs":{},"常":{"docs":{},"用":{"docs":{},"一":{"docs":{},"单":{"docs":{},"个":{"docs":{},"字":{"docs":{},"母":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"w":{"docs":{},"i":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"k":{"docs":{},"e":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"s":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}},"-":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"-":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}},"y":{"docs":{},"g":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"b":{"docs":{},"y":{"docs":{},"e":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"d":{"docs":{},"a":{"docs":{},"v":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"依":{"docs":{},"然":{"docs":{},"返":{"docs":{},"回":{"docs":{},"了":{"docs":{},"值":{"docs":{},"。":{"docs":{},"没":{"docs":{},"有":{"docs":{},"定":{"docs":{},"义":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"特":{"docs":{},"殊":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"叫":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{},"。":{"docs":{},"它":{"docs":{},"其":{"docs":{},"实":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"空":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},"(":{"docs":{},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"(":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}},"a":{"docs":{},"g":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"(":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}},"。":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"展":{"docs":{},"示":{"docs":{},"的":{"docs":{},"是":{"docs":{},"用":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"和":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"b":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"时":{"docs":{},",":{"docs":{},"在":{"docs":{},"圆":{"docs":{},"括":{"docs":{},"号":{"docs":{},"中":{"docs":{},"传":{"docs":{},"给":{"docs":{},"它":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"参":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"s":{"docs":{},"a":{"docs":{},"y":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"包":{"docs":{},"含":{"docs":{},"在":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"版":{"docs":{},"本":{"docs":{},",":{"docs":{},"叫":{"docs":{},"w":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"g":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"b":{"docs":{},"y":{"docs":{},"e":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"直":{"docs":{},"接":{"docs":{},"输":{"docs":{},"出":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"体":{"docs":{},"中":{"docs":{},",":{"docs":{},"先":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"名":{"docs":{},"为":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"同":{"docs":{},"时":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"了":{"docs":{},"给":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"简":{"docs":{},"单":{"docs":{},"问":{"docs":{},"候":{"docs":{},"消":{"docs":{},"息":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},"用":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"把":{"docs":{},"这":{"docs":{},"个":{"docs":{},"问":{"docs":{},"候":{"docs":{},"返":{"docs":{},"回":{"docs":{},"出":{"docs":{},"去":{"docs":{},"。":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"e":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}}}}}},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}}}},"p":{"docs":{},"e":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}},"t":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":1.6724919093851132},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.027184466019417475},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},".":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.056910569105691054}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}}}}}}}}}}}}},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"l":{"docs":{},"f":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.8918424451140766},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.010101010101010102},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.02586206896551724},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.020202020202020204},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"e":{"docs":{},")":{"docs":{},">":{"docs":{},"\\":{"docs":{},"(":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},")":{"docs":{},"<":{"docs":{},"/":{"docs":{},"\\":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.006060606060606061}}}}}},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"中":{"docs":{},"调":{"docs":{},"用":{"docs":{},"了":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"某":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},"r":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}},"x":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}},"a":{"docs":{},"d":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00808080808080808}}}}},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}},"n":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}}}}}}},"被":{"docs":{},"用":{"docs":{},"来":{"docs":{},"区":{"docs":{},"别":{"docs":{},"实":{"docs":{},"例":{"docs":{},"变":{"docs":{},"量":{"docs":{},"。":{"docs":{},"当":{"docs":{},"你":{"docs":{},"创":{"docs":{},"建":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"像":{"docs":{},"传":{"docs":{},"入":{"docs":{},"函":{"docs":{},"数":{"docs":{},"参":{"docs":{},"数":{"docs":{},"一":{"docs":{},"样":{"docs":{},"给":{"docs":{},"类":{"docs":{},"传":{"docs":{},"入":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"。":{"docs":{},"每":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"都":{"docs":{},"需":{"docs":{},"要":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"—":{"docs":{},"—":{"docs":{},"无":{"docs":{},"论":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"声":{"docs":{},"明":{"docs":{},"(":{"docs":{},"就":{"docs":{},"像":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"还":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"就":{"docs":{},"像":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"不":{"docs":{},"论":{"docs":{},"何":{"docs":{},"时":{"docs":{},",":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"已":{"docs":{},"知":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"者":{"docs":{},"方":{"docs":{},"法":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"没":{"docs":{},"有":{"docs":{},"明":{"docs":{},"确":{"docs":{},"的":{"docs":{},"写":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"假":{"docs":{},"定":{"docs":{},"你":{"docs":{},"是":{"docs":{},"指":{"docs":{},"当":{"docs":{},"前":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"者":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"假":{"docs":{},"定":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"已":{"docs":{},"经":{"docs":{},"示":{"docs":{},"范":{"docs":{},"了":{"docs":{},":":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"三":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"都":{"docs":{},"使":{"docs":{},"用":{"docs":{},"的":{"docs":{},"是":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"一":{"docs":{},"个":{"docs":{},"全":{"docs":{},"新":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"上":{"docs":{},"面":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}},"前":{"docs":{},"缀":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"就":{"docs":{},"认":{"docs":{},"为":{"docs":{},"两":{"docs":{},"次":{"docs":{},"使":{"docs":{},"用":{"docs":{},"的":{"docs":{},"x":{"docs":{},"都":{"docs":{},"指":{"docs":{},"的":{"docs":{},"是":{"docs":{},"名":{"docs":{},"称":{"docs":{},"为":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}},"消":{"docs":{},"除":{"docs":{},"方":{"docs":{},"法":{"docs":{},"参":{"docs":{},"数":{"docs":{},"x":{"docs":{},"和":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}},"赋":{"docs":{},"值":{"docs":{},"(":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"完":{"docs":{},"全":{"docs":{},"等":{"docs":{},"同":{"docs":{},"于":{"docs":{},"这":{"docs":{},"个":{"docs":{},"实":{"docs":{},"力":{"docs":{},"变":{"docs":{},"量":{"docs":{},"本":{"docs":{},"身":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"隐":{"docs":{},"含":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"只":{"docs":{},"占":{"docs":{},"有":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}},"并":{"docs":{},"不":{"docs":{},"会":{"docs":{},"持":{"docs":{},"有":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"将":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"]":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"“":{"docs":{},"用":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"来":{"docs":{},"占":{"docs":{},"有":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}},"后":{"docs":{},"是":{"docs":{},"如":{"docs":{},"何":{"docs":{},"产":{"docs":{},"生":{"docs":{},"一":{"docs":{},"个":{"docs":{},"循":{"docs":{},"环":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"。":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"类":{"docs":{},",":{"docs":{},"用":{"docs":{},"一":{"docs":{},"种":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"模":{"docs":{},"型":{"docs":{},"表":{"docs":{},"示":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"或":{"docs":{},"其":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"必":{"docs":{},"须":{"docs":{},"将":{"docs":{},"该":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"标":{"docs":{},"注":{"docs":{},"为":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},".":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"本":{"docs":{},"身":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"同":{"docs":{},"样":{"docs":{},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},".":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"本":{"docs":{},"身":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"适":{"docs":{},"配":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"的":{"docs":{},"某":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"还":{"docs":{},"可":{"docs":{},"以":{"docs":{},"对":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"使":{"docs":{},"用":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483}},"e":{"docs":{},".":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"(":{"docs":{},"\"":{"6":{"docs":{},":":{"0":{"0":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.007168458781362007}}}}}}}}}}}}}}}}},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.009940357852882704},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"你":{"docs":{},"也":{"docs":{},"一":{"docs":{},"定":{"docs":{},"要":{"docs":{},"提":{"docs":{},"供":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"不":{"docs":{},"想":{"docs":{},"在":{"docs":{},"重":{"docs":{},"写":{"docs":{},"版":{"docs":{},"本":{"docs":{},"中":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"里":{"docs":{},"修":{"docs":{},"改":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"直":{"docs":{},"接":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"来":{"docs":{},"返":{"docs":{},"回":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"正":{"docs":{},"如":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"没":{"docs":{},"有":{"docs":{},"定":{"docs":{},"义":{"docs":{},"表":{"docs":{},"示":{"docs":{},"新":{"docs":{},"值":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},",":{"docs":{},"则":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"名":{"docs":{},"称":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"。":{"docs":{},"下":{"docs":{},"面":{"docs":{},"是":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"便":{"docs":{},"捷":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"与":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"副":{"docs":{},"本":{"docs":{},"合":{"docs":{},"成":{"docs":{},",":{"docs":{},"由":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"y":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"z":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"返":{"docs":{},"回":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"属":{"docs":{},"性":{"docs":{},"本":{"docs":{},"身":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"该":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"需":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"n":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.08333333333333333}},"e":{"docs":{},"­":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.08333333333333333}}}}}}}}}}}}}}}},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},")":{"docs":{},"被":{"docs":{},"为":{"docs":{},"类":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{},")":{"docs":{},"来":{"docs":{},"实":{"docs":{},"现":{"docs":{},".":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"逻":{"docs":{},"辑":{"docs":{},"被":{"docs":{},"转":{"docs":{},"移":{"docs":{},"到":{"docs":{},"了":{"docs":{},"协":{"docs":{},"议":{"docs":{},"方":{"docs":{},"法":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"h":{"docs":{},"a":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.007050528789659225}},".":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"类":{"docs":{},"缺":{"docs":{},"少":{"docs":{},"了":{"docs":{},"一":{"docs":{},"些":{"docs":{},"重":{"docs":{},"要":{"docs":{},"的":{"docs":{},"东":{"docs":{},"西":{"docs":{},":":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"类":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"[":{"1":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"docs":{}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.012925969447708578}}}}}}}},"s":{"docs":{},")":{"docs":{},"-":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.01527614571092832}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"e":{"docs":{},"时":{"docs":{},"候":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"用":{"docs":{},"来":{"docs":{},"标":{"docs":{},"记":{"docs":{},"一":{"docs":{},"个":{"docs":{},"会":{"docs":{},"修":{"docs":{},"改":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"(":{"1":{"7":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}},"docs":{}},"3":{"docs":{},".":{"1":{"4":{"1":{"5":{"9":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"<":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"i":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"l":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"h":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}},"s":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}},"x":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}},"z":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.011928429423459244},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.028735632183908046}},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}}}}}}},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}},"封":{"docs":{},"装":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"和":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"w":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}},"g":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.006696428571428571}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"1":{"0":{"0":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"docs":{}},"docs":{}},"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}}}}}}},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}},"中":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"和":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"。":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"参":{"docs":{},"数":{"docs":{},"是":{"docs":{},"类":{"docs":{},"型":{"docs":{},"c":{"1":{"docs":{},",":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"参":{"docs":{},"数":{"docs":{},"是":{"docs":{},"类":{"docs":{},"型":{"docs":{},"c":{"2":{"docs":{},"。":{"docs":{},"c":{"1":{"docs":{},"和":{"docs":{},"c":{"2":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"docs":{}}}},"docs":{}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}},"包":{"docs":{},"含":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"1":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"docs":{}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"的":{"docs":{},"重":{"docs":{},"写":{"docs":{},"实":{"docs":{},"现":{"docs":{},"中":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{},"来":{"docs":{},"调":{"docs":{},"用":{"docs":{},"超":{"docs":{},"类":{"docs":{},"版":{"docs":{},"本":{"docs":{},"的":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"或":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"重":{"docs":{},"写":{"docs":{},"实":{"docs":{},"现":{"docs":{},"中":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"来":{"docs":{},"访":{"docs":{},"问":{"docs":{},"超":{"docs":{},"类":{"docs":{},"版":{"docs":{},"本":{"docs":{},"的":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747}},">":{"docs":{},"(":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01845018450184502}}}}}}},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506}},".":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"x":{"docs":{},"(":{"1":{"docs":{},".":{"0":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"(":{"2":{"docs":{},".":{"0":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}},"docs":{}}},"docs":{}}}}}}}}},"x":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.011695906432748537}}}}}}}}},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"?":{"docs":{},"(":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"可":{"docs":{},"选":{"docs":{},"方":{"docs":{},"法":{"docs":{},"名":{"docs":{},"称":{"docs":{},"后":{"docs":{},"加":{"docs":{},"上":{"docs":{},"?":{"docs":{},"来":{"docs":{},"检":{"docs":{},"查":{"docs":{},"该":{"docs":{},"方":{"docs":{},"法":{"docs":{},"是":{"docs":{},"否":{"docs":{},"被":{"docs":{},"实":{"docs":{},"现":{"docs":{},".":{"docs":{},"可":{"docs":{},"选":{"docs":{},"方":{"docs":{},"法":{"docs":{},"和":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},"都":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.008620689655172414}},"e":{"docs":{},"(":{"docs":{},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}},"h":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"指":{"docs":{},"定":{"docs":{},"为":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}},":":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}},"a":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"k":{"docs":{},"e":{"docs":{},"s":{"docs":{},"a":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842}},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}}}}}}}}}}}}}}}}},"<":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.007473841554559043}},"和":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}},"s":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"[":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}},"都":{"docs":{},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"[":{"docs":{},"]":{"docs":{},"获":{"docs":{},"取":{"docs":{},"访":{"docs":{},"问":{"docs":{},":":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"[":{"0":{"docs":{},"]":{"docs":{},"是":{"docs":{},"指":{"docs":{},"第":{"0":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"“":{"docs":{},"a":{"docs":{},"l":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}},"docs":{}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}}},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"[":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}}},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"u":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.011695906432748537}}}}}}}}}}}}},"r":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":3.359649122807017}},"(":{"docs":{},"[":{"1":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"docs":{}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.021052631578947368}}}}}}}},"u":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"t":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01107011070110701}}}}},"n":{"docs":{},"g":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.02766798418972332}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}},".":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0047430830039525695}},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"计":{"docs":{},"算":{"docs":{},"数":{"docs":{},"组":{"docs":{},"l":{"docs":{},"i":{"docs":{},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}},"检":{"docs":{},"查":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"是":{"docs":{},"否":{"docs":{},"为":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"末":{"docs":{},"尾":{"docs":{},",":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018}}}},"r":{"docs":{},"k":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}},")":{"docs":{},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"2":{"0":{"docs":{},")":{"docs":{},"、":{"docs":{},"换":{"docs":{},"行":{"docs":{},"符":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.016597510373443983}},"l":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.012448132780082987}},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"属":{"docs":{},"性":{"docs":{},"时":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"会":{"docs":{},"去":{"docs":{},"检":{"docs":{},"查":{"docs":{},"新":{"docs":{},"值":{"docs":{},"与":{"docs":{},"限":{"docs":{},"制":{"docs":{},"值":{"4":{"0":{"docs":{},"m":{"docs":{},"p":{"docs":{},"h":{"docs":{},"的":{"docs":{},"大":{"docs":{},"小":{"docs":{},",":{"docs":{},"它":{"docs":{},"会":{"docs":{},"将":{"docs":{},"超":{"docs":{},"类":{"docs":{},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"和":{"4":{"0":{"docs":{},".":{"0":{"docs":{},"中":{"docs":{},"较":{"docs":{},"小":{"docs":{},"的":{"docs":{},"那":{"docs":{},"个":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"值":{"docs":{},"哪":{"docs":{},"个":{"docs":{},"较":{"docs":{},"小":{"docs":{},"由":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"函":{"docs":{},"数":{"docs":{},"决":{"docs":{},"定":{"docs":{},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"全":{"docs":{},"局":{"docs":{},"函":{"docs":{},"数":{"docs":{},"。":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"大":{"docs":{},"于":{"4":{"0":{"docs":{},"m":{"docs":{},"p":{"docs":{},"h":{"docs":{},"的":{"docs":{},"数":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"打":{"docs":{},"印":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"输":{"docs":{},"出":{"docs":{},",":{"docs":{},"你":{"docs":{},"会":{"docs":{},"发":{"docs":{},"现":{"docs":{},"速":{"docs":{},"度":{"docs":{},"被":{"docs":{},"限":{"docs":{},"制":{"docs":{},"在":{"4":{"0":{"docs":{},"m":{"docs":{},"p":{"docs":{},"h":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},"。":{"docs":{},"类":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"表":{"docs":{},"示":{"docs":{},"安":{"docs":{},"装":{"docs":{},"了":{"docs":{},"限":{"docs":{},"速":{"docs":{},"装":{"docs":{},"置":{"docs":{},"的":{"docs":{},"车":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"最":{"docs":{},"高":{"docs":{},"速":{"docs":{},"度":{"docs":{},"只":{"docs":{},"能":{"docs":{},"达":{"docs":{},"到":{"4":{"0":{"docs":{},"m":{"docs":{},"p":{"docs":{},"h":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"重":{"docs":{},"写":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"f":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.011750881316098707},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.011933174224343675}},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},".":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}},"的":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"属":{"docs":{},"性":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"点":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},".":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},"来":{"docs":{},"访":{"docs":{},"问":{"docs":{},",":{"docs":{},"这":{"docs":{},"会":{"docs":{},"调":{"docs":{},"用":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"跟":{"docs":{},"直":{"docs":{},"接":{"docs":{},"返":{"docs":{},"回":{"docs":{},"已":{"docs":{},"经":{"docs":{},"存":{"docs":{},"在":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"同":{"docs":{},",":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"通":{"docs":{},"过":{"docs":{},"计":{"docs":{},"算":{"docs":{},"然":{"docs":{},"后":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"表":{"docs":{},"示":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"的":{"docs":{},"中":{"docs":{},"心":{"docs":{},"点":{"docs":{},"。":{"docs":{},"如":{"docs":{},"代":{"docs":{},"码":{"docs":{},"所":{"docs":{},"示":{"docs":{},",":{"docs":{},"它":{"docs":{},"正":{"docs":{},"确":{"docs":{},"返":{"docs":{},"回":{"docs":{},"了":{"docs":{},"中":{"docs":{},"心":{"docs":{},"点":{"docs":{},"(":{"5":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"原":{"docs":{},"点":{"docs":{},"是":{"docs":{},"(":{"0":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"docs":{}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}},"r":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"p":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.11239193083573487}},"’":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}},"-":{"docs":{},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}}},"s":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"转":{"docs":{},"到":{"docs":{},"第":{"1":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}},"2":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}},"docs":{}}}}}}}}}}}}},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.025089605734767026}},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.005376344086021506}}}}},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}}}}}},"i":{"docs":{},"c":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.011928429423459244},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.007425742574257425},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.01775147928994083},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"来":{"docs":{},"定":{"docs":{},"义":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"类":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"来":{"docs":{},"为":{"docs":{},"类":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}},"c":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.007473841554559043}},"(":{"docs":{},"栈":{"docs":{},")":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"栈":{"docs":{},"是":{"docs":{},"一":{"docs":{},"系":{"docs":{},"列":{"docs":{},"值":{"docs":{},"域":{"docs":{},"的":{"docs":{},"集":{"docs":{},"合":{"docs":{},",":{"docs":{},"和":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"(":{"docs":{},"数":{"docs":{},"组":{"docs":{},")":{"docs":{},"相":{"docs":{},"似":{"docs":{},",":{"docs":{},"但":{"docs":{},"其":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"比":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"的":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"类":{"docs":{},"型":{"docs":{},"更":{"docs":{},"多":{"docs":{},"限":{"docs":{},"制":{"docs":{},"的":{"docs":{},"集":{"docs":{},"合":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"数":{"docs":{},"组":{"docs":{},"可":{"docs":{},"以":{"docs":{},"允":{"docs":{},"许":{"docs":{},"其":{"docs":{},"里":{"docs":{},"面":{"docs":{},"任":{"docs":{},"何":{"docs":{},"位":{"docs":{},"置":{"docs":{},"的":{"docs":{},"插":{"docs":{},"入":{"docs":{},"/":{"docs":{},"删":{"docs":{},"除":{"docs":{},"操":{"docs":{},"作":{"docs":{},",":{"docs":{},"而":{"docs":{},"栈":{"docs":{},",":{"docs":{},"只":{"docs":{},"允":{"docs":{},"许":{"docs":{},",":{"docs":{},"只":{"docs":{},"允":{"docs":{},"许":{"docs":{},"在":{"docs":{},"集":{"docs":{},"合":{"docs":{},"的":{"docs":{},"末":{"docs":{},"端":{"docs":{},"添":{"docs":{},"加":{"docs":{},"新":{"docs":{},"的":{"docs":{},"项":{"docs":{},"(":{"docs":{},"如":{"docs":{},"同":{"docs":{},"p":{"docs":{},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"值":{"docs":{},"进":{"docs":{},"栈":{"docs":{},")":{"docs":{},"。":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"栈":{"docs":{},"也":{"docs":{},"只":{"docs":{},"能":{"docs":{},"从":{"docs":{},"末":{"docs":{},"端":{"docs":{},"移":{"docs":{},"除":{"docs":{},"项":{"docs":{},"(":{"docs":{},"如":{"docs":{},"同":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"<":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}}}},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},".":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"c":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"d":{"docs":{},"o":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}}}}}}},"如":{"docs":{},"何":{"docs":{},"p":{"docs":{},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}},"单":{"docs":{},"例":{"docs":{},"来":{"docs":{},"存":{"docs":{},"储":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"压":{"docs":{},"了":{"docs":{},"三":{"docs":{},"个":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"进":{"docs":{},"栈":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"也":{"docs":{},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"单":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"包":{"docs":{},"含":{"docs":{},"三":{"docs":{},"个":{"docs":{},"同":{"docs":{},"栈":{"docs":{},"里":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"。":{"docs":{},"即":{"docs":{},"便":{"docs":{},"栈":{"docs":{},"和":{"docs":{},"数":{"docs":{},"组":{"docs":{},"否":{"docs":{},"是":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"但":{"docs":{},"他":{"docs":{},"们":{"docs":{},"都":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"他":{"docs":{},"们":{"docs":{},"都":{"docs":{},"包":{"docs":{},"含":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"值":{"docs":{},"。":{"docs":{},"你":{"docs":{},"因":{"docs":{},"此":{"docs":{},"可":{"docs":{},"以":{"docs":{},"调":{"docs":{},"用":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"用":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"作":{"docs":{},"为":{"docs":{},"它":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"函":{"docs":{},"数":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},"显":{"docs":{},"示":{"docs":{},"了":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"同":{"docs":{},"创":{"docs":{},"建":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"中":{"docs":{},"其":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"任":{"docs":{},"何":{"docs":{},"有":{"docs":{},"效":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"栈":{"docs":{},",":{"docs":{},"这":{"docs":{},"种":{"docs":{},"方":{"docs":{},"式":{"docs":{},"如":{"docs":{},"同":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},"基":{"docs":{},"本":{"docs":{},"上":{"docs":{},"和":{"docs":{},"非":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},"相":{"docs":{},"同":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},"的":{"docs":{},"节":{"docs":{},"点":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"为":{"docs":{},"t":{"docs":{},"代":{"docs":{},"替":{"docs":{},"了":{"docs":{},"实":{"docs":{},"际":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"包":{"docs":{},"含":{"docs":{},"在":{"docs":{},"一":{"docs":{},"对":{"docs":{},"尖":{"docs":{},"括":{"docs":{},"号":{"docs":{},"里":{"docs":{},"(":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"的":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"保":{"docs":{},"证":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"可":{"docs":{},"以":{"docs":{},"推":{"docs":{},"断":{"docs":{},"出":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"所":{"docs":{},"使":{"docs":{},"用":{"docs":{},"的":{"docs":{},"适":{"docs":{},"用":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"这":{"docs":{},"个":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"后":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"将":{"docs":{},"任":{"docs":{},"何":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"当":{"docs":{},"作":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"1":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.007766990291262136}}},"2":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}}},"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0282021151586369},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.012448132780082987},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.025089605734767026},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":1.7016181229773462},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.05063291139240506},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.07105263157894737},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.05656565656565657},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.019867549668874173},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.011857707509881422},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.01909307875894988},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.01046337817638266},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.008928571428571428}},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}},")":{"docs":{},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}}}},"”":{"docs":{},"的":{"docs":{},"意":{"docs":{},"思":{"docs":{},"是":{"docs":{},"“":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"任":{"docs":{},"意":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}},"和":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"解":{"docs":{},"析":{"docs":{},"可":{"docs":{},"选":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"t":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"作":{"docs":{},"用":{"docs":{},"是":{"docs":{},"将":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"并":{"docs":{},"不":{"docs":{},"是":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"数":{"docs":{},"。":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"1":{"2":{"3":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"数":{"docs":{},"字":{"1":{"2":{"3":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"可":{"docs":{},"以":{"docs":{},"理":{"docs":{},"解":{"docs":{},"为":{"docs":{},"“":{"docs":{},"一":{"docs":{},"个":{"docs":{},"没":{"docs":{},"有":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"你":{"docs":{},"绝":{"docs":{},"对":{"docs":{},"不":{"docs":{},"可":{"docs":{},"能":{"docs":{},"不":{"docs":{},"小":{"docs":{},"心":{"docs":{},"传":{"docs":{},"进":{"docs":{},"去":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}},"名":{"docs":{},"字":{"docs":{},"为":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"安":{"docs":{},"全":{"docs":{},"会":{"docs":{},"阻":{"docs":{},"止":{"docs":{},"你":{"docs":{},"不":{"docs":{},"小":{"docs":{},"心":{"docs":{},"传":{"docs":{},"入":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}},"的":{"docs":{},"左":{"docs":{},"边":{"docs":{},",":{"docs":{},"以":{"docs":{},"右":{"docs":{},"对":{"docs":{},"齐":{"docs":{},"到":{"docs":{},"总":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"中":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"值":{"docs":{},"存":{"docs":{},"在":{"docs":{},"局":{"docs":{},"部":{"docs":{},"常":{"docs":{},"量":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{},"中":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"然":{"docs":{},"后":{"docs":{},"将":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{},"多":{"docs":{},"的":{"docs":{},"填":{"docs":{},"充":{"docs":{},"(":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{},")":{"docs":{},"字":{"docs":{},"符":{"docs":{},"填":{"docs":{},"充":{"docs":{},"到":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"左":{"docs":{},"边":{"docs":{},",":{"docs":{},"并":{"docs":{},"返":{"docs":{},"回":{"docs":{},"结":{"docs":{},"果":{"docs":{},"。":{"docs":{},"它":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}},"?":{"docs":{},"。":{"docs":{},"如":{"docs":{},"上":{"docs":{},"所":{"docs":{},"述":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"在":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"调":{"docs":{},"用":{"docs":{},"后":{"docs":{},"最":{"docs":{},"终":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"依":{"docs":{},"然":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}}}}},"c":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.017892644135188866},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.009900990099009901},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.008620689655172414},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"u":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.019867549668874173}},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"?":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"在":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"前":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"两":{"docs":{},"层":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},",":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"?":{"docs":{},".":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"也":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162}},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422}},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422}},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}},"和":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"。":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"比":{"docs":{},"输":{"docs":{},"入":{"docs":{},"值":{"docs":{},"大":{"docs":{},"一":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"比":{"docs":{},"输":{"docs":{},"入":{"docs":{},"值":{"docs":{},"小":{"docs":{},"一":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"是":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622}}}}}}}}}}}},"类":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"s":{"docs":{},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"包":{"docs":{},"含":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"r":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"c":{"docs":{},"c":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"e":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"h":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.06504065040650407}},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"对":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"和":{"docs":{},"c":{"docs":{},"l":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"返":{"docs":{},"回":{"docs":{},"“":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"”":{"docs":{},",":{"docs":{},"对":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"返":{"docs":{},"回":{"docs":{},"“":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"描":{"docs":{},"述":{"docs":{},"扑":{"docs":{},"克":{"docs":{},"牌":{"docs":{},"的":{"docs":{},"四":{"docs":{},"种":{"docs":{},"花":{"docs":{},"色":{"docs":{},",":{"docs":{},"并":{"docs":{},"分":{"docs":{},"别":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}},"o":{"docs":{},"f":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"(":{"4":{"2":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"docs":{}},"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}},"r":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.012448132780082987}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.008298755186721992}}}}}}}}}},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.008298755186721992}}}}}},"[":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.008298755186721992},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.007905138339920948}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"(":{"docs":{},"子":{"docs":{},"类":{"docs":{},"化":{"docs":{},"?":{"docs":{},"待":{"docs":{},"定":{"docs":{},")":{"docs":{},"重":{"docs":{},"写":{"docs":{},"(":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"访":{"docs":{},"问":{"docs":{},"超":{"docs":{},"类":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"及":{"docs":{},"下":{"docs":{},"标":{"docs":{},"重":{"docs":{},"写":{"docs":{},"方":{"docs":{},"法":{"docs":{},"重":{"docs":{},"写":{"docs":{},"属":{"docs":{},"性":{"docs":{},"重":{"docs":{},"写":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"重":{"docs":{},"写":{"docs":{},"属":{"docs":{},"性":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":5}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":10.005494505494505},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"(":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.016483516483516484}}}}}}},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}},"d":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},",":{"docs":{},"显":{"docs":{},"式":{"docs":{},"声":{"docs":{},"明":{"docs":{},"入":{"docs":{},"参":{"docs":{},"(":{"docs":{},"一":{"docs":{},"个":{"docs":{},"或":{"docs":{},"多":{"docs":{},"个":{"docs":{},")":{"docs":{},"和":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"与":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"是":{"docs":{},"下":{"docs":{},"标":{"docs":{},"可":{"docs":{},"以":{"docs":{},"设":{"docs":{},"定":{"docs":{},"为":{"docs":{},"读":{"docs":{},"写":{"docs":{},"或":{"docs":{},"只":{"docs":{},"读":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"方":{"docs":{},"式":{"docs":{},"又":{"docs":{},"有":{"docs":{},"点":{"docs":{},"像":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"y":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},"w":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}}}}},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"e":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}},"n":{"docs":{},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}},"k":{"docs":{},"e":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.010739856801909307}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"并":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.007159904534606206}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}},"了":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{},"协":{"docs":{},"议":{"docs":{},".":{"docs":{},"在":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794}}}}}}}},"k":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}},"r":{"docs":{},"c":{"docs":{},"=":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"d":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"l":{"docs":{},"i":{"docs":{},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"/":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"/":{"docs":{},"i":{"docs":{},"o":{"docs":{},"s":{"docs":{},"/":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"/":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"p":{"docs":{},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"/":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"u":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"/":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"/":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"_":{"docs":{},"q":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}},"docs":{}}}},"u":{"docs":{},"p":{"docs":{},"c":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}},"docs":{}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"v":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"y":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}},"u":{"0":{"0":{"0":{"1":{"docs":{},"f":{"4":{"9":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}},"2":{"6":{"6":{"5":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"docs":{}},"docs":{}},"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.008928571428571428},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"index.html#gitbook_8":{"ref":"index.html#gitbook_8","tf":0.06666666666666667},"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter1/chapter1.html#gitbook_11":{"ref":"chapter1/chapter1.html#gitbook_11","tf":0.25},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/05_Control_Flow.html#gitbook_27":{"ref":"chapter2/05_Control_Flow.html#gitbook_27","tf":0.5},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/09_Classes_and_Structures.html#gitbook_31":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_31","tf":0.5},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087},"chapter2/chapter2.html#gitbook_49":{"ref":"chapter2/chapter2.html#gitbook_49","tf":0.3333333333333333},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.041666666666666664},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}},"r":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":1.7346278317152102},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.008928571428571428}},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.011650485436893204}},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},")":{"docs":{},"和":{"docs":{},"变":{"docs":{},"体":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"体":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}},"标":{"docs":{},"签":{"docs":{},"联":{"docs":{},"合":{"docs":{},"(":{"docs":{},"t":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}},"o":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"w":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.010101010101010102}}}}},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.008960573476702509},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}},"u":{"docs":{},"s":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.009900990099009901}},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.013245033112582781}}}}}},".":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},".":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}},"p":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.024896265560165973},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391}},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}},"m":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}},"c":{"docs":{},"-":{"docs":{},"a":{"docs":{},"格":{"docs":{},"式":{"docs":{},"的":{"docs":{},"一":{"docs":{},"维":{"docs":{},"码":{"docs":{},",":{"docs":{},"它":{"docs":{},"使":{"docs":{},"用":{"docs":{},"数":{"docs":{},"字":{"0":{"docs":{},"到":{"9":{"docs":{},".":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"条":{"docs":{},"形":{"docs":{},"码":{"docs":{},"都":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"代":{"docs":{},"表":{"docs":{},"“":{"docs":{},"数":{"docs":{},"字":{"docs":{},"系":{"docs":{},"统":{"docs":{},"”":{"docs":{},"的":{"docs":{},"数":{"docs":{},"字":{"docs":{},",":{"docs":{},"该":{"docs":{},"数":{"docs":{},"字":{"docs":{},"后":{"docs":{},"接":{"1":{"0":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}}}}}}}}}}}}},"码":{"docs":{},"作":{"docs":{},"为":{"docs":{},"三":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"值":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},",":{"docs":{},"和":{"docs":{},"把":{"docs":{},"q":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"y":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}},"(":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"接":{"docs":{},"受":{"docs":{},"一":{"docs":{},"个":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"现":{"docs":{},"有":{"docs":{},"的":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"。":{"docs":{},"注":{"docs":{},"意":{"docs":{},",":{"docs":{},"你":{"docs":{},"并":{"docs":{},"不":{"docs":{},"能":{"docs":{},"传":{"docs":{},"入":{"docs":{},"任":{"docs":{},"意":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"只":{"docs":{},"能":{"docs":{},"传":{"docs":{},"入":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"进":{"docs":{},"行":{"docs":{},"相":{"docs":{},"加":{"docs":{},"。":{"docs":{},"目":{"docs":{},"标":{"docs":{},"常":{"docs":{},"量":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"推":{"docs":{},"测":{"docs":{},"为":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"是":{"docs":{},"两":{"docs":{},"个":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"docs":{}},"docs":{}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"3":{"2":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"8":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.008960573476702509},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}},"i":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}},",":{"docs":{},"除":{"docs":{},"非":{"docs":{},"你":{"docs":{},"真":{"docs":{},"的":{"docs":{},"需":{"docs":{},"要":{"docs":{},"存":{"docs":{},"储":{"docs":{},"一":{"docs":{},"个":{"docs":{},"和":{"docs":{},"当":{"docs":{},"前":{"docs":{},"平":{"docs":{},"台":{"docs":{},"原":{"docs":{},"生":{"docs":{},"字":{"docs":{},"长":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"无":{"docs":{},"符":{"docs":{},"号":{"docs":{},"整":{"docs":{},"数":{"docs":{},"。":{"docs":{},"除":{"docs":{},"了":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},",":{"docs":{},"最":{"docs":{},"好":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"即":{"docs":{},"使":{"docs":{},"你":{"docs":{},"要":{"docs":{},"存":{"docs":{},"储":{"docs":{},"的":{"docs":{},"值":{"docs":{},"已":{"docs":{},"知":{"docs":{},"是":{"docs":{},"非":{"docs":{},"负":{"docs":{},"的":{"docs":{},"。":{"docs":{},"统":{"docs":{},"一":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"v":{"docs":{},"i":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}},"+":{"0":{"0":{"0":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"2":{"4":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"6":{"1":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"docs":{},"a":{"8":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"b":{"2":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"b":{"5":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}}},"docs":{}},"docs":{}}}}},"7":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"b":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"docs":{}},"docs":{}}}}},"docs":{},"c":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"b":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}}}}}},"c":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"d":{"6":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}}},"docs":{}},"docs":{}}}}},"docs":{}},"d":{"8":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"f":{"6":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}}},"docs":{}},"docs":{}}}}},"docs":{}},"f":{"8":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"docs":{}},"docs":{}}}}},"docs":{}}},"1":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"2":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"3":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"3":{"6":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"7":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"6":{"7":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"1":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"6":{"8":{"1":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"8":{"0":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"8":{"0":{"docs":{},"f":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"d":{"docs":{},"b":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}},"docs":{}}}}}},"docs":{}},"docs":{},"f":{"4":{"3":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}},"docs":{}},"9":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"docs":{}},"docs":{}},"d":{"docs":{},"c":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"d":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}},"docs":{}}}}},"docs":{}}},"e":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}},"docs":{}}}}},"docs":{}},"docs":{}}},"2":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"docs":{},"b":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"0":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}}},"2":{"docs":{},"a":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"2":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}},"docs":{}},"docs":{}}}}}},"3":{"docs":{},"f":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"4":{"0":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}},"5":{"4":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}},"6":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"6":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"7":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"docs":{},"c":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{},"d":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"docs":{}},"docs":{}}}}},"docs":{}}},"1":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"1":{"8":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"4":{"6":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"4":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"6":{"6":{"5":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"docs":{}},"7":{"7":{"6":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"7":{"9":{"3":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{},"c":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"docs":{},"d":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"e":{"8":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}},"docs":{}}}}},"docs":{}},"docs":{}}},"3":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"3":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"4":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"3":{"0":{"0":{"7":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"2":{"1":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"3":{"0":{"2":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"3":{"1":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"3":{"0":{"3":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"4":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"d":{"7":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"docs":{}}}}}},"docs":{}},"docs":{}},"docs":{}},"4":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"4":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"5":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"5":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"6":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"6":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"7":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"7":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"8":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"8":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"9":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"9":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{},"d":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"d":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"8":{"3":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}},"docs":{}},"docs":{},"c":{"3":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"docs":{}}},"a":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"a":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"b":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"b":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"c":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"c":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"e":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"e":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"f":{"9":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"d":{"3":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}}}}}}},"docs":{}},"docs":{}},"docs":{},"d":{"4":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"d":{"docs":{},"c":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}},"docs":{}},"docs":{},"f":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"e":{"1":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}}}}}}},"docs":{}}},"e":{"2":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"e":{"2":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"docs":{}}}}}}},"docs":{}},"3":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"e":{"4":{"4":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}},"docs":{}}}}}}},"docs":{}},"4":{"7":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}},"docs":{}},"docs":{}}}},"s":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.013438735177865613},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"s":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}},"t":{"docs":{},"f":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}},"docs":{}},"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}},"docs":{},"-":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.015533980582524271}}},"docs":{}},"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.015533980582524271}},"u":{"docs":{},"t":{"docs":{},"f":{"docs":{},"-":{"1":{"6":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":1.6666666666666665}}}}}}}}},"docs":{}},"docs":{}}}}}},"docs":{}}}},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}}}}}},"w":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"w":{"docs":{},"d":{"docs":{},"c":{"docs":{"index.html#gitbook_8":{"ref":"index.html#gitbook_8","tf":0.06666666666666667}}}}},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.01969057665260197},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.015625},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.006060606060606061},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}},"<":{"docs":{},"/":{"docs":{},"p":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}},"k":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474}}},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.011834319526627219}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}},"c":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},",":{"docs":{},"只":{"docs":{},"在":{"docs":{},"冒":{"docs":{},"号":{"docs":{},"后":{"docs":{},"面":{"docs":{},"写":{"docs":{},"接":{"docs":{},"口":{"docs":{},"或":{"docs":{},"者":{"docs":{},"类":{"docs":{},"名":{"docs":{},"。":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"作":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"队":{"docs":{},"列":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"使":{"docs":{},"你":{"docs":{},"能":{"docs":{},"够":{"docs":{},"要":{"docs":{},"求":{"docs":{},"一":{"docs":{},"个":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"一":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"(":{"docs":{},"或":{"docs":{},")":{"docs":{},"那":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"和":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"写":{"docs":{},"一":{"docs":{},"个":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"紧":{"docs":{},"随":{"docs":{},"放":{"docs":{},"置":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},",":{"docs":{},"写":{"docs":{},"在":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}},"。":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"由":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}},"中":{"docs":{},"的":{"docs":{},"要":{"docs":{},"求":{"docs":{},"用":{"docs":{},"于":{"docs":{},"指":{"docs":{},"明":{"docs":{},"该":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"继":{"docs":{},"承":{"docs":{},"自":{"docs":{},"某":{"docs":{},"个":{"docs":{},"类":{"docs":{},"或":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"某":{"docs":{},"个":{"docs":{},"协":{"docs":{},"议":{"docs":{},"或":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"有":{"docs":{},"助":{"docs":{},"于":{"docs":{},"表":{"docs":{},"达":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"上":{"docs":{},"的":{"docs":{},"简":{"docs":{},"单":{"docs":{},"约":{"docs":{},"束":{"docs":{},"(":{"docs":{},"如":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"­":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.024896265560165973}}}},"n":{"docs":{},"e":{"docs":{},"v":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474}}}}}}},"i":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}}},"l":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}}}}}},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"=":{"docs":{},"\"":{"1":{"6":{"9":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}},"docs":{}},"docs":{}},"2":{"4":{"3":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"docs":{}},"5":{"2":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}},"docs":{}},"docs":{}},"3":{"8":{"8":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"docs":{}},"docs":{}},"docs":{}}}}}},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"的":{"docs":{},"实":{"docs":{},"际":{"docs":{},"例":{"docs":{},"子":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"或":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"实":{"docs":{},"现":{"docs":{},"是":{"docs":{},"不":{"docs":{},"恰":{"docs":{},"当":{"docs":{},"。":{"docs":{},"此":{"docs":{},"外":{"docs":{},"还":{"docs":{},"要":{"docs":{},"注":{"docs":{},"意":{"docs":{},",":{"docs":{},"你":{"docs":{},"不":{"docs":{},"可":{"docs":{},"以":{"docs":{},"同":{"docs":{},"时":{"docs":{},"提":{"docs":{},"供":{"docs":{},"重":{"docs":{},"写":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"重":{"docs":{},"写":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"观":{"docs":{},"察":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"的":{"docs":{},"变":{"docs":{},"化":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"你":{"docs":{},"已":{"docs":{},"经":{"docs":{},"为":{"docs":{},"那":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"定":{"docs":{},"制":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"你":{"docs":{},"在":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"会":{"docs":{},"将":{"docs":{},"新":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"作":{"docs":{},"为":{"docs":{},"固":{"docs":{},"定":{"docs":{},"参":{"docs":{},"数":{"docs":{},"传":{"docs":{},"入":{"docs":{},",":{"docs":{},"在":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"代":{"docs":{},"码":{"docs":{},"中":{"docs":{},"可":{"docs":{},"以":{"docs":{},"为":{"docs":{},"这":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"指":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"不":{"docs":{},"指":{"docs":{},"定":{"docs":{},"则":{"docs":{},"参":{"docs":{},"数":{"docs":{},"仍":{"docs":{},"然":{"docs":{},"可":{"docs":{},"用":{"docs":{},",":{"docs":{},"这":{"docs":{},"时":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"名":{"docs":{},"称":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"将":{"docs":{},"表":{"docs":{},"示":{"docs":{},"新":{"docs":{},"值":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}},"h":{"docs":{},"h":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"y":{"docs":{},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"a":{"docs":{},"y":{"docs":{},"(":{"docs":{},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"a":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"b":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"形":{"docs":{},"参":{"docs":{},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},",":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.005625879043600563}}}}}},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.4679292185915677},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"i":{"docs":{},"n":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.8745157124408093},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"n":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}},"e":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.006696428571428571}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.005376344086021506}},"e":{"docs":{},"变":{"docs":{},"量":{"docs":{},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"类":{"docs":{},"型":{"docs":{},"标":{"docs":{},"注":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"这":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"s":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}}},"a":{"docs":{},"k":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}},"或":{"docs":{},"者":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"和":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"(":{"docs":{},"如":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"或":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}},"为":{"docs":{},"了":{"docs":{},"能":{"docs":{},"帮":{"docs":{},"助":{"docs":{},"你":{"docs":{},"管":{"docs":{},"理":{"docs":{},"内":{"docs":{},"存":{"docs":{},",":{"docs":{},"需":{"docs":{},"要":{"docs":{},"更":{"docs":{},"多":{"docs":{},"的":{"docs":{},"关":{"docs":{},"于":{"docs":{},"你":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"之":{"docs":{},"间":{"docs":{},"关":{"docs":{},"系":{"docs":{},"的":{"docs":{},"信":{"docs":{},"息":{"docs":{},"。":{"docs":{},"本":{"docs":{},"章":{"docs":{},"描":{"docs":{},"述":{"docs":{},"了":{"docs":{},"这":{"docs":{},"些":{"docs":{},"情":{"docs":{},"况":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"为":{"docs":{},"你":{"docs":{},"示":{"docs":{},"范":{"docs":{},"怎":{"docs":{},"样":{"docs":{},"启":{"docs":{},"用":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"会":{"docs":{},"分":{"docs":{},"配":{"docs":{},"一":{"docs":{},"大":{"docs":{},"块":{"docs":{},"内":{"docs":{},"存":{"docs":{},"用":{"docs":{},"来":{"docs":{},"储":{"docs":{},"存":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"信":{"docs":{},"息":{"docs":{},"。":{"docs":{},"内":{"docs":{},"存":{"docs":{},"中":{"docs":{},"会":{"docs":{},"包":{"docs":{},"含":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"信":{"docs":{},"息":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"这":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"所":{"docs":{},"有":{"docs":{},"相":{"docs":{},"关":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"此":{"docs":{},"外":{"docs":{},",":{"docs":{},"当":{"docs":{},"实":{"docs":{},"例":{"docs":{},"不":{"docs":{},"再":{"docs":{},"被":{"docs":{},"使":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"销":{"docs":{},"毁":{"docs":{},"后":{"docs":{},"自":{"docs":{},"动":{"docs":{},"将":{"docs":{},"其":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}},"第":{"docs":{},"三":{"docs":{},"个":{"docs":{},",":{"docs":{},"也":{"docs":{},"即":{"docs":{},"最":{"docs":{},"后":{"docs":{},"一":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"被":{"docs":{},"断":{"docs":{},"开":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"销":{"docs":{},"毁":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"这":{"docs":{},"也":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"你":{"docs":{},"不":{"docs":{},"再":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"跟":{"docs":{},"踪":{"docs":{},"你":{"docs":{},"所":{"docs":{},"新":{"docs":{},"创":{"docs":{},"建":{"docs":{},"的":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"数":{"docs":{},"量":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"会":{"docs":{},"在":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"计":{"docs":{},"算":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"正":{"docs":{},"在":{"docs":{},"被":{"docs":{},"多":{"docs":{},"少":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"常":{"docs":{},"量":{"docs":{},"和":{"docs":{},"变":{"docs":{},"量":{"docs":{},"所":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"哪":{"docs":{},"怕":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"数":{"docs":{},"为":{"docs":{},"一":{"docs":{},",":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"无":{"docs":{},"法":{"docs":{},"在":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"销":{"docs":{},"毁":{"docs":{},"后":{"docs":{},"将":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},"设":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"非":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"不":{"docs":{},"允":{"docs":{},"许":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"销":{"docs":{},"毁":{"docs":{},"被":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"行":{"docs":{},"为":{"docs":{},"阻":{"docs":{},"止":{"docs":{},"了":{"docs":{},"引":{"docs":{},"用":{"docs":{},"变":{"docs":{},"为":{"docs":{},"循":{"docs":{},"环":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"声":{"docs":{},"明":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"时":{"docs":{},",":{"docs":{},"在":{"docs":{},"前":{"docs":{},"面":{"docs":{},"加":{"docs":{},"上":{"docs":{},"w":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00954653937947494},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"r":{"docs":{},"a":{"docs":{},"y":{"3":{"docs":{},"d":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"[":{"0":{"docs":{},"]":{"docs":{},"是":{"docs":{},"指":{"docs":{},"[":{"docs":{},"[":{"1":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}},"docs":{}}}}}}},"docs":{}}}},"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}},"性":{"docs":{},"质":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"存":{"docs":{},"储":{"docs":{},"值":{"docs":{},"。":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"提":{"docs":{},"供":{"docs":{},"两":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},":":{"docs":{},"p":{"docs":{},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"和":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{},",":{"docs":{},"从":{"docs":{},"栈":{"docs":{},"中":{"docs":{},"压":{"docs":{},"进":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"和":{"docs":{},"移":{"docs":{},"除":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"方":{"docs":{},"法":{"docs":{},"标":{"docs":{},"记":{"docs":{},"为":{"docs":{},"可":{"docs":{},"变":{"docs":{},"的":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"他":{"docs":{},"们":{"docs":{},"需":{"docs":{},"要":{"docs":{},"修":{"docs":{},"改":{"docs":{},"(":{"docs":{},"或":{"docs":{},"转":{"docs":{},"换":{"docs":{},")":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403}}}}}},"<":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"<":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"替":{"docs":{},"代":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.020553359683794466},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152}}}}}}},"y":{"docs":{},"r":{"docs":{},"i":{"docs":{},"o":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}},"i":{"docs":{},"c":{"docs":{},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"(":{"1":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}},"3":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}},"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.008695652173913044}}}}}}},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"i":{"docs":{},"c":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.012448132780082987}},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},"就":{"docs":{},"会":{"docs":{},"自":{"docs":{},"动":{"docs":{},"地":{"docs":{},"设":{"docs":{},"置":{"docs":{},"g":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"为":{"docs":{},"新":{"docs":{},"的":{"docs":{},"速":{"docs":{},"度":{"docs":{},"选":{"docs":{},"择":{"docs":{},"一":{"docs":{},"个":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"挡":{"docs":{},"位":{"docs":{},"。":{"docs":{},"具":{"docs":{},"体":{"docs":{},"来":{"docs":{},"说":{"docs":{},"就":{"docs":{},"是":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},"将":{"docs":{},"新":{"docs":{},"的":{"docs":{},"速":{"docs":{},"度":{"docs":{},"值":{"docs":{},"除":{"docs":{},"以":{"1":{"0":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"向":{"docs":{},"下":{"docs":{},"取":{"docs":{},"得":{"docs":{},"最":{"docs":{},"接":{"docs":{},"近":{"docs":{},"的":{"docs":{},"整":{"docs":{},"数":{"docs":{},"值":{"docs":{},",":{"docs":{},"最":{"docs":{},"后":{"docs":{},"加":{"1":{"docs":{},"来":{"docs":{},"得":{"docs":{},"到":{"docs":{},"档":{"docs":{},"位":{"docs":{},"g":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"速":{"docs":{},"度":{"docs":{},"为":{"1":{"0":{"docs":{},".":{"0":{"docs":{},"时":{"docs":{},",":{"docs":{},"挡":{"docs":{},"位":{"docs":{},"为":{"1":{"docs":{},";":{"docs":{},"速":{"docs":{},"度":{"docs":{},"为":{"3":{"5":{"docs":{},".":{"0":{"docs":{},"时":{"docs":{},",":{"docs":{},"挡":{"docs":{},"位":{"docs":{},"为":{"4":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}},"docs":{}}}}}}},"docs":{}}},"docs":{}},"docs":{}}}}}},"docs":{}}}}}}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},"。":{"docs":{},"a":{"docs":{},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"表":{"docs":{},"示":{"docs":{},"自":{"docs":{},"动":{"docs":{},"挡":{"docs":{},"汽":{"docs":{},"车":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"根":{"docs":{},"据":{"docs":{},"当":{"docs":{},"前":{"docs":{},"的":{"docs":{},"速":{"docs":{},"度":{"docs":{},"自":{"docs":{},"动":{"docs":{},"选":{"docs":{},"择":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"挡":{"docs":{},"位":{"docs":{},"。":{"docs":{},"a":{"docs":{},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"也":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"定":{"docs":{},"制":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.02197802197802198},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"见":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"章":{"docs":{},"节":{"docs":{},")":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"自":{"docs":{},"动":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"函":{"docs":{},"数":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"特":{"docs":{},"定":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"上":{"docs":{},"的":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"而":{"docs":{},"非":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"本":{"docs":{},"身":{"docs":{},"。":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"来":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"很":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"s":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}},"e":{"docs":{},".":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"别":{"docs":{},"名":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"是":{"docs":{},"别":{"docs":{},"名":{"docs":{},",":{"docs":{},"a":{"docs":{},"u":{"docs":{},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{},"s":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"是":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},".":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"会":{"docs":{},"给":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"u":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"赋":{"docs":{},"一":{"docs":{},"个":{"docs":{},"初":{"docs":{},"值":{"0":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.009940357852882704}},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}}}}}}}}}}}}},"也":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"表":{"docs":{},"示":{"docs":{},"立":{"docs":{},"体":{"docs":{},"声":{"docs":{},"系":{"docs":{},"统":{"docs":{},"的":{"docs":{},"两":{"docs":{},"个":{"docs":{},"声":{"docs":{},"道":{"docs":{},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{},"和":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"j":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}},".":{"docs":{},".":{"docs":{},"b":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}}},"b":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}}}},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.024390243902439025}},"e":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"t":{"1":{"docs":{},"s":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}}}}}}}}}}}}},"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.02524271844660194}},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.005376344086021506}},"e":{"docs":{},"r":{"docs":{},"常":{"docs":{},"量":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"i":{"docs":{},"f":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"分":{"docs":{},"支":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"。":{"docs":{},"它":{"docs":{},"已":{"docs":{},"经":{"docs":{},"被":{"docs":{},"可":{"docs":{},"选":{"docs":{},"包":{"docs":{},"含":{"docs":{},"的":{"docs":{},"值":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"过":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"再":{"docs":{},"使":{"docs":{},"用":{"docs":{},"!":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"它":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794}}}}}}},"d":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"o":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"e":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}},"s":{"docs":{},"(":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}},"和":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"有":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"这":{"docs":{},"个":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"过":{"docs":{},"程":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"y":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"都":{"docs":{},"传":{"docs":{},"入":{"docs":{},"两":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"(":{"4":{"docs":{},")":{"docs":{},"(":{"5":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}},"docs":{}}}},"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.023178807947019868}},"。":{"docs":{},"它":{"docs":{},"有":{"docs":{},"三":{"docs":{},"个":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"属":{"docs":{},"性":{"docs":{},"他":{"docs":{},"们":{"docs":{},"额":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"?":{"docs":{},"。":{"docs":{},"前":{"docs":{},"面":{"docs":{},"两":{"docs":{},"个":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"属":{"docs":{},"性":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"时":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"(":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},")":{"docs":{},"。":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"你":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"它":{"docs":{},"获":{"docs":{},"取":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"中":{"docs":{},"的":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}},"还":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"?":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"检":{"docs":{},"查":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"有":{"docs":{},"值":{"docs":{},"则":{"docs":{},"将":{"docs":{},"其":{"docs":{},"返":{"docs":{},"回":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"如":{"docs":{},"果":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"设":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"来":{"docs":{},"作":{"docs":{},"为":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"并":{"docs":{},"为":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}},"j":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.007050528789659225}}}}}},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.02894736842105263},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.007425742574257425},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375}},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}},"和":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"。":{"docs":{},"默":{"docs":{},"认":{"docs":{},"地":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"只":{"docs":{},"把":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"当":{"docs":{},"作":{"docs":{},"一":{"docs":{},"个":{"docs":{},"局":{"docs":{},"部":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"把":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}},";":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.013392857142857142}}}}}}}},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"e":{"docs":{},"r":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.007032348804500703},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.01195814648729447}}}}},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}},"中":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"2":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"docs":{}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}}}}}}}}}},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"m":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"(":{"docs":{},"[":{"1":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"docs":{}}}}}}}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.009486166007905139},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.8333333333333333}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"代":{"docs":{},"表":{"docs":{},"任":{"docs":{},"何":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"表":{"docs":{},"示":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"除":{"docs":{},"了":{"docs":{},"方":{"docs":{},"法":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}},"o":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}},"s":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"1":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"2":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"docs":{}}}}},"d":{"docs":{},"/":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}},"i":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}},"p":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483}},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.01818181818181818},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}},"u":{"docs":{},"m":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}}}}}}},"方":{"docs":{},"法":{"docs":{},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"s":{"docs":{},",":{"docs":{},"它":{"docs":{},"一":{"docs":{},"般":{"docs":{},"接":{"docs":{},"收":{"docs":{},"一":{"docs":{},"个":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"[":{"docs":{},"]":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"说":{"docs":{},"“":{"docs":{},"一":{"docs":{},"个":{"docs":{},"任":{"docs":{},"何":{"docs":{},"对":{"docs":{},"象":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"”":{"docs":{},"。":{"docs":{},"这":{"docs":{},"是":{"docs":{},"因":{"docs":{},"为":{"docs":{},"o":{"docs":{},"c":{"docs":{},"没":{"docs":{},"有":{"docs":{},"明":{"docs":{},"确":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"化":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"但":{"docs":{},"是":{"docs":{},",":{"docs":{},"你":{"docs":{},"常":{"docs":{},"常":{"docs":{},"可":{"docs":{},"以":{"docs":{},"确":{"docs":{},"定":{"docs":{},"包":{"docs":{},"含":{"docs":{},"在":{"docs":{},"仅":{"docs":{},"从":{"docs":{},"你":{"docs":{},"知":{"docs":{},"道":{"docs":{},"的":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.022222222222222223},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}}}}}}},"实":{"docs":{},"例":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"并":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"的":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"来":{"docs":{},"自":{"docs":{},"于":{"docs":{},"变":{"docs":{},"量":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"断":{"docs":{},"开":{"docs":{},"这":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"再":{"docs":{},"也":{"docs":{},"没":{"docs":{},"有":{"docs":{},"指":{"docs":{},"向":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.007168458781362007},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.007159904534606206}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"i":{"docs":{},"s":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"(":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"写":{"docs":{},"一":{"docs":{},"个":{"docs":{},"断":{"docs":{},"言":{"docs":{},"。":{"docs":{},"给":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"函":{"docs":{},"数":{"docs":{},"传":{"docs":{},"入":{"docs":{},"一":{"docs":{},"个":{"docs":{},"结":{"docs":{},"果":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"或":{"docs":{},"者":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"以":{"docs":{},"及":{"docs":{},"一":{"docs":{},"条":{"docs":{},"信":{"docs":{},"息":{"docs":{},",":{"docs":{},"当":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"e":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.005376344086021506}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"、":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"、":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"、":{"docs":{},"i":{"docs":{},"n":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"、":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"、":{"docs":{},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"t":{"docs":{},"、":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"、":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"、":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"、":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"、":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"、":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"、":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"、":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"、":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"、":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"、":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"、":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"(":{"docs":{},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{},"e":{"docs":{},")":{"docs":{},"、":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"(":{"docs":{},"u":{"docs":{},"n":{"docs":{},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{},"e":{"docs":{},")":{"docs":{},"、":{"docs":{},"w":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"、":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}},"c":{"docs":{},"i":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"字":{"docs":{},"符":{"docs":{},"型":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},",":{"docs":{},"并":{"docs":{},"被":{"docs":{},"设":{"docs":{},"置":{"docs":{},"了":{"docs":{},"一":{"docs":{},"些":{"docs":{},"比":{"docs":{},"较":{"docs":{},"常":{"docs":{},"见":{"docs":{},"的":{"docs":{},"a":{"docs":{},"s":{"docs":{},"c":{"docs":{},"i":{"docs":{},"i":{"docs":{},"控":{"docs":{},"制":{"docs":{},"字":{"docs":{},"符":{"docs":{},"。":{"docs":{},"字":{"docs":{},"符":{"docs":{},"值":{"docs":{},"的":{"docs":{},"描":{"docs":{},"述":{"docs":{},"请":{"docs":{},"详":{"docs":{},"见":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"和":{"docs":{},"字":{"docs":{},"符":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"l":{"docs":{},"a":{"docs":{},"z":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"只":{"docs":{},"有":{"docs":{},"当":{"docs":{},"元":{"docs":{},"素":{"docs":{},"确":{"docs":{},"实":{"docs":{},"需":{"docs":{},"要":{"docs":{},"处":{"docs":{},"理":{"docs":{},"为":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"输":{"docs":{},"出":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"时":{"docs":{},",":{"docs":{},"才":{"docs":{},"需":{"docs":{},"要":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"。":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"在":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"中":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"只":{"docs":{},"有":{"docs":{},"当":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"完":{"docs":{},"成":{"docs":{},"以":{"docs":{},"及":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"确":{"docs":{},"实":{"docs":{},"存":{"docs":{},"在":{"docs":{},"后":{"docs":{},",":{"docs":{},"才":{"docs":{},"能":{"docs":{},"访":{"docs":{},"问":{"docs":{},"l":{"docs":{},"a":{"docs":{},"z":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"由":{"docs":{},"于":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"是":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"改":{"docs":{},"变":{"docs":{},"特":{"docs":{},"定":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"持":{"docs":{},"有":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"但":{"docs":{},"是":{"docs":{},",":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"在":{"docs":{},"其":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"体":{"docs":{},"内":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"(":{"docs":{},"引":{"docs":{},"用":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},")":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"占":{"docs":{},"有":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},",":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"又":{"docs":{},"反":{"docs":{},"过":{"docs":{},"来":{"docs":{},"持":{"docs":{},"有":{"docs":{},"了":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"这":{"docs":{},"样":{"docs":{},"两":{"docs":{},"个":{"docs":{},"对":{"docs":{},"象":{"docs":{},"就":{"docs":{},"产":{"docs":{},"生":{"docs":{},"了":{"docs":{},"循":{"docs":{},"环":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"(":{"docs":{},"更":{"docs":{},"多":{"docs":{},"关":{"docs":{},"于":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"占":{"docs":{},"有":{"docs":{},"值":{"docs":{},"的":{"docs":{},"信":{"docs":{},"息":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"代":{"docs":{},"表":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"标":{"docs":{},"签":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"值":{"docs":{},"存":{"docs":{},"在":{"docs":{},",":{"docs":{},"该":{"docs":{},"标":{"docs":{},"签":{"docs":{},"就":{"docs":{},"包":{"docs":{},"含":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},";":{"docs":{},"如":{"docs":{},"果":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"不":{"docs":{},"存":{"docs":{},"在":{"docs":{},",":{"docs":{},"该":{"docs":{},"标":{"docs":{},"签":{"docs":{},"就":{"docs":{},"不":{"docs":{},"包":{"docs":{},"含":{"docs":{},"文":{"docs":{},"本":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"段":{"docs":{},"落":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"根":{"docs":{},"据":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"是":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"下":{"docs":{},"转":{"docs":{},"并":{"docs":{},"解":{"docs":{},"包":{"docs":{},"到":{"docs":{},"不":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"p":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}},"?":{"docs":{},")":{"docs":{},"。":{"docs":{},"可":{"docs":{},"选":{"docs":{},"形":{"docs":{},"式":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"检":{"docs":{},"查":{"docs":{},"总":{"docs":{},"是":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},",":{"docs":{},"当":{"docs":{},"实":{"docs":{},"例":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"协":{"docs":{},"议":{"docs":{},"时":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},"类":{"docs":{},"型":{"docs":{},";":{"docs":{},"否":{"docs":{},"则":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375}}}}}},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}}}}}},"、":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"、":{"docs":{},"i":{"docs":{},"s":{"docs":{},"、":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"、":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"、":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"、":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"、":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"、":{"docs":{},"_":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"_":{"docs":{},"_":{"docs":{},"、":{"docs":{},"_":{"docs":{},"_":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"_":{"docs":{},"_":{"docs":{},"、":{"docs":{},"_":{"docs":{},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"_":{"docs":{},"、":{"docs":{},"_":{"docs":{},"_":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"_":{"docs":{},"_":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"k":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}},"函":{"docs":{},"数":{"docs":{},"将":{"docs":{},"参":{"docs":{},"数":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"变":{"docs":{},"量":{"docs":{},"参":{"docs":{},"数":{"docs":{},"。":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"右":{"docs":{},"对":{"docs":{},"齐":{"docs":{},"输":{"docs":{},"入":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"到":{"docs":{},"一":{"docs":{},"个":{"docs":{},"长":{"docs":{},"的":{"docs":{},"输":{"docs":{},"出":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"中":{"docs":{},"。":{"docs":{},"左":{"docs":{},"侧":{"docs":{},"空":{"docs":{},"余":{"docs":{},"的":{"docs":{},"地":{"docs":{},"方":{"docs":{},"用":{"docs":{},"指":{"docs":{},"定":{"docs":{},"的":{"docs":{},"填":{"docs":{},"充":{"docs":{},"字":{"docs":{},"符":{"docs":{},"填":{"docs":{},"充":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"被":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"了":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"-":{"docs":{},"-":{"docs":{},"-":{"docs":{},"-":{"docs":{},"-":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"s":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"e":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}},"e":{"docs":{},"x":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}},"s":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"b":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842}}}}}}}}}}}}}}}},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}}}}}}}}}}},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}},"=":{"docs":{},"\"":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.006696428571428571}}}}}}}},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}}}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235}},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"检":{"docs":{},"查":{"docs":{},"是":{"docs":{},"否":{"docs":{},"两":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"单":{"docs":{},"例":{"docs":{},"包":{"docs":{},"含":{"docs":{},"具":{"docs":{},"有":{"docs":{},"相":{"docs":{},"同":{"docs":{},"顺":{"docs":{},"序":{"docs":{},"的":{"docs":{},"相":{"docs":{},"同":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"的":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"首":{"docs":{},"先":{"docs":{},"检":{"docs":{},"查":{"docs":{},"两":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"是":{"docs":{},"否":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"同":{"docs":{},"样":{"docs":{},"数":{"docs":{},"目":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"他":{"docs":{},"们":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"数":{"docs":{},"目":{"docs":{},"不":{"docs":{},"同":{"docs":{},",":{"docs":{},"没":{"docs":{},"有":{"docs":{},"办":{"docs":{},"法":{"docs":{},"进":{"docs":{},"行":{"docs":{},"匹":{"docs":{},"配":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"就":{"docs":{},"会":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"w":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}},"w":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"b":{"docs":{},"c":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"g":{"docs":{},"h":{"docs":{},"i":{"docs":{},"j":{"docs":{},"k":{"docs":{},"l":{"docs":{},"m":{"docs":{},"n":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}}}}}}}}}}}}}}},"o":{"docs":{},"v":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.054945054945054944},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"e":{"docs":{},"-":{"docs":{},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}},"e":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.02197802197802198}}}}}},"s":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}},"[":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},",":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}},"+":{"docs":{},"+":{"docs":{},".":{"docs":{},"b":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"b":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"c":{"1":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}},".":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235}}}}}}}}}},"必":{"docs":{},"须":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"同":{"docs":{},"样":{"docs":{},"是":{"docs":{},"c":{"2":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}},"docs":{}}}}},"必":{"docs":{},"须":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}},"2":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}},".":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}}}}},"必":{"docs":{},"须":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}},"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.017921146953405017},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.024553571428571428},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"a":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.07142857142857142},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.013592233009708738},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"的":{"docs":{},"基":{"docs":{},"础":{"docs":{},"上":{"docs":{},"构":{"docs":{},"建":{"docs":{},"框":{"docs":{},"架":{"docs":{},"栈":{"docs":{},"并":{"docs":{},"将":{"docs":{},"其":{"docs":{},"标":{"docs":{},"准":{"docs":{},"化":{"docs":{},"。":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"里":{"docs":{},"的":{"docs":{},"n":{"docs":{},"s":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"函":{"docs":{},"数":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.005625879043600563},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.017326732673267328},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.022277227722772276},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"b":{"docs":{},"y":{"docs":{},"(":{"2":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"5":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506}}},"docs":{}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}}}}}},"'":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.007425742574257425}}},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}},"替":{"docs":{},"换":{"docs":{},"版":{"docs":{},"本":{"docs":{},"(":{"docs":{},"它":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"更":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"b":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"这":{"docs":{},"个":{"docs":{},"类":{"docs":{},"还":{"docs":{},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"变":{"docs":{},"属":{"docs":{},"性":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.008353221957040573}},"e":{"docs":{},"含":{"docs":{},"有":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"方":{"docs":{},"法":{"docs":{},"和":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"x":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},",":{"docs":{},"该":{"docs":{},"类":{"docs":{},"使":{"docs":{},"用":{"docs":{},"外":{"docs":{},"部":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"源":{"docs":{},"来":{"docs":{},"提":{"docs":{},"供":{"docs":{},"增":{"docs":{},"量":{"docs":{},"值":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"在":{"docs":{},"下":{"docs":{},"边":{"docs":{},",":{"docs":{},"它":{"docs":{},"含":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"(":{"docs":{},"u":{"docs":{},"n":{"docs":{},"u":{"docs":{},"s":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"\"":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"处":{"docs":{},"理":{"docs":{},"任":{"docs":{},"何":{"docs":{},"一":{"docs":{},"个":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"值":{"docs":{},"将":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"包":{"docs":{},"含":{"docs":{},"三":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"型":{"docs":{},"值":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},"(":{"docs":{},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.01616161616161616},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"y":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}},".":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}},"和":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"产":{"docs":{},"生":{"docs":{},"循":{"docs":{},"环":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"每":{"docs":{},"个":{"docs":{},"类":{"docs":{},"将":{"docs":{},"另":{"docs":{},"外":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"保":{"docs":{},"存":{"docs":{},"为":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"模":{"docs":{},"型":{"docs":{},"中":{"docs":{},",":{"docs":{},"每":{"docs":{},"个":{"docs":{},"国":{"docs":{},"家":{"docs":{},"必":{"docs":{},"须":{"docs":{},"有":{"docs":{},"首":{"docs":{},"都":{"docs":{},",":{"docs":{},"而":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"城":{"docs":{},"市":{"docs":{},"必":{"docs":{},"须":{"docs":{},"属":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"国":{"docs":{},"家":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"实":{"docs":{},"现":{"docs":{},"这":{"docs":{},"种":{"docs":{},"关":{"docs":{},"系":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"类":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"而":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"类":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"调":{"docs":{},"用":{"docs":{},"了":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"完":{"docs":{},"全":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"完":{"docs":{},"后":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"才":{"docs":{},"能":{"docs":{},"把":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"传":{"docs":{},"给":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"用":{"docs":{},"于":{"docs":{},"存":{"docs":{},"储":{"docs":{},"当":{"docs":{},"前":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"方":{"docs":{},"法":{"docs":{},"用":{"docs":{},"来":{"docs":{},"为":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"获":{"docs":{},"取":{"docs":{},"容":{"docs":{},"器":{"docs":{},"里":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"的":{"docs":{},"数":{"docs":{},"量":{"docs":{},",":{"docs":{},"并":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.05187319884726225}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"的":{"docs":{},"值":{"docs":{},"在":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"执":{"docs":{},"行":{"docs":{},"前":{"docs":{},"就":{"docs":{},"已":{"docs":{},"计":{"docs":{},"算":{"docs":{},"出":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"docs":{},"在":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"执":{"docs":{},"行":{"docs":{},"后":{"docs":{},"才":{"docs":{},"计":{"docs":{},"算":{"docs":{},"出":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"符":{"docs":{},"合":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"i":{"docs":{},"c":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"。":{"docs":{},"同":{"docs":{},"时":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}},"e":{"docs":{},"d":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.007168458781362007}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0047430830039525695}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}}},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"t":{"docs":{},"s":{"docs":{},"]":{"docs":{},"[":{"8":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"docs":{}}}}}}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.008438818565400843},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.017241379310344827}}}}},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0071146245059288534},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.02242152466367713}},"s":{"docs":{},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},"#":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"的":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"写":{"docs":{},"作":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},",":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}},"泛":{"docs":{},"型":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"指":{"docs":{},"定":{"docs":{},"存":{"docs":{},"储":{"docs":{},"在":{"docs":{},"其":{"docs":{},"里":{"docs":{},"面":{"docs":{},"的":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"必":{"docs":{},"须":{"docs":{},"保":{"docs":{},"证":{"docs":{},"只":{"docs":{},"有":{"docs":{},"正":{"docs":{},"确":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"可":{"docs":{},"以":{"docs":{},"加":{"docs":{},"进":{"docs":{},"容":{"docs":{},"器":{"docs":{},"里":{"docs":{},",":{"docs":{},"必":{"docs":{},"须":{"docs":{},"明":{"docs":{},"确":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"其":{"docs":{},"下":{"docs":{},"标":{"docs":{},"返":{"docs":{},"回":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"需":{"docs":{},"要":{"docs":{},"一":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"指":{"docs":{},"定":{"docs":{},"容":{"docs":{},"器":{"docs":{},"里":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"将":{"docs":{},"会":{"docs":{},"保":{"docs":{},"留":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"知":{"docs":{},"道":{"docs":{},"特":{"docs":{},"定":{"docs":{},"容":{"docs":{},"器":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"需":{"docs":{},"要":{"docs":{},"指":{"docs":{},"定":{"docs":{},"任":{"docs":{},"何":{"docs":{},"通":{"docs":{},"过":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}},"-":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.01440922190201729}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.008928571428571428}}}}}}}}}},"x":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":1.1341658661543388}},"e":{"docs":{},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}},"语":{"docs":{},"句":{"docs":{},"用":{"docs":{},"于":{"docs":{},"终":{"docs":{},"止":{"docs":{},"循":{"docs":{},"环":{"docs":{},"中":{"docs":{},"当":{"docs":{},"前":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"的":{"docs":{},"执":{"docs":{},"行":{"docs":{},",":{"docs":{},"但":{"docs":{},"不":{"docs":{},"会":{"docs":{},"终":{"docs":{},"止":{"docs":{},"该":{"docs":{},"循":{"docs":{},"环":{"docs":{},"的":{"docs":{},"执":{"docs":{},"行":{"docs":{},"。":{"docs":{},"使":{"docs":{},"用":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"时":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"只":{"docs":{},"写":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"这":{"docs":{},"个":{"docs":{},"关":{"docs":{},"键":{"docs":{},"词":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"后":{"docs":{},"面":{"docs":{},"跟":{"docs":{},"上":{"docs":{},"标":{"docs":{},"签":{"docs":{},"名":{"docs":{},"(":{"docs":{},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"待":{"docs":{},"添":{"docs":{},"加":{"docs":{},"链":{"docs":{},"接":{"docs":{},"一":{"docs":{},"章":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"<":{"docs":{},"/":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}},"-":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.022727272727272728}}}}}}}}}}}}}}}}},"g":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}},"d":{"docs":{},"e":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.014336917562724014},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.014760147601476014},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}},">":{"docs":{},"$":{"0":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"、":{"docs":{},"<":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"$":{"1":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"、":{"docs":{},"<":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"$":{"2":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}},"docs":{}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}},"docs":{}},"`":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"<":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"`":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"。":{"docs":{},"反":{"docs":{},"引":{"docs":{},"号":{"docs":{},"不":{"docs":{},"属":{"docs":{},"于":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},",":{"docs":{},"<":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"`":{"docs":{},"x":{"docs":{},"`":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"b":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.020172910662824207}}}}}}}}}},"m":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.008960573476702509},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}},"p":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"e":{"docs":{},"-":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}},".":{"docs":{},"w":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},">":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}},"等":{"docs":{},"同":{"docs":{},"于":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}},"表":{"docs":{},"示":{"docs":{},"任":{"docs":{},"何":{"docs":{},"用":{"docs":{},"于":{"docs":{},"替":{"docs":{},"代":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"t":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"实":{"docs":{},"参":{"docs":{},"必":{"docs":{},"须":{"docs":{},"满":{"docs":{},"足":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"等":{"docs":{},"等":{"docs":{},")":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"依":{"docs":{},"然":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"对":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"及":{"docs":{},"其":{"docs":{},"关":{"docs":{},"联":{"docs":{},"约":{"docs":{},"束":{"docs":{},"提":{"docs":{},"供":{"docs":{},"更":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"的":{"docs":{},"约":{"docs":{},"束":{"docs":{},"。":{"docs":{},"如":{"docs":{},",":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},",":{"docs":{},"采":{"docs":{},"用":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"l":{"0":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"1":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_26":{"ref":"chapter2/04_Collection_Types.html#gitbook_26","tf":5.5},"chapter2/09_Classes_and_Structures.html#gitbook_31":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_31","tf":0.5},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},",":{"docs":{},"列":{"docs":{},"表":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},")":{"docs":{},"或":{"docs":{},"序":{"docs":{},"列":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.12087912087912088}},"s":{"docs":{},"个":{"docs":{},"数":{"docs":{},"的":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"存":{"docs":{},"储":{"docs":{},",":{"docs":{},"将":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"大":{"docs":{},"小":{"docs":{},"和":{"docs":{},"数":{"docs":{},"组":{"docs":{},"每":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"0":{"docs":{},".":{"0":{"docs":{},",":{"docs":{},"都":{"docs":{},"传":{"docs":{},"入":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"正":{"docs":{},"确":{"docs":{},"大":{"docs":{},"小":{"docs":{},"的":{"docs":{},"新":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"关":{"docs":{},"于":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"方":{"docs":{},"法":{"docs":{},"和":{"docs":{},"析":{"docs":{},"构":{"docs":{},"方":{"docs":{},"法":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"n":{"docs":{},"=":{"docs":{},"\"":{"4":{"docs":{},"\"":{"docs":{},">":{"4":{"docs":{},"<":{"docs":{},"/":{"docs":{},"t":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}}}}}},"docs":{}}}},"docs":{}}}}}}}},"w":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.07692307692307693}},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.023668639053254437}}}}}},"p":{"docs":{},"u":{"docs":{},"r":{"docs":{},"s":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.01775147928994083}}}}}}}}}}},"p":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}},"的":{"docs":{},"兼":{"docs":{},"容":{"docs":{},"性":{"docs":{},"的":{"docs":{},"限":{"docs":{},"制":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808}}}}}}}}}}}}}}},"a":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"'":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.013592233009708738}}}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":3.3359649122807014}}}}}},"i":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"在":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"中":{"docs":{},"给":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"后":{"docs":{},",":{"docs":{},"整":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"过":{"docs":{},"程":{"docs":{},"就":{"docs":{},"完":{"docs":{},"成":{"docs":{},"了":{"docs":{},"。":{"docs":{},"这":{"docs":{},"代":{"docs":{},"表":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"被":{"docs":{},"后":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"就":{"docs":{},"能":{"docs":{},"引":{"docs":{},"用":{"docs":{},"并":{"docs":{},"传":{"docs":{},"递":{"docs":{},"显":{"docs":{},"式":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"。":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"在":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"时":{"docs":{},",":{"docs":{},"就":{"docs":{},"能":{"docs":{},"将":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"作":{"docs":{},"为":{"docs":{},"参":{"docs":{},"数":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.006060606060606061}}}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.024896265560165973}},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"副":{"docs":{},"完":{"docs":{},"整":{"docs":{},"的":{"docs":{},"扑":{"docs":{},"克":{"docs":{},"牌":{"docs":{},"并":{"docs":{},"把":{"docs":{},"每":{"docs":{},"张":{"docs":{},"牌":{"docs":{},"的":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"和":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}},"中":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"方":{"docs":{},"法":{"docs":{},"并":{"docs":{},"非":{"docs":{},"完":{"docs":{},"全":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},",":{"docs":{},"而":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"超":{"docs":{},"类":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"中":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},",":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"是":{"0":{"docs":{},".":{"0":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"“":{"docs":{},"时":{"docs":{},"速":{"docs":{},"是":{"0":{"docs":{},"英":{"docs":{},"里":{"docs":{},"”":{"docs":{},"。":{"docs":{},"&":{"docs":{},"#":{"3":{"9":{"docs":{},";":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"&":{"docs":{},"#":{"3":{"9":{"docs":{},";":{"docs":{},"有":{"docs":{},"自":{"docs":{},"己":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},",":{"docs":{},"它":{"docs":{},"将":{"docs":{},"乘":{"docs":{},"客":{"docs":{},"的":{"docs":{},"最":{"docs":{},"大":{"docs":{},"数":{"docs":{},"量":{"docs":{},"设":{"docs":{},"为":{"5":{"docs":{},",":{"docs":{},"轮":{"docs":{},"子":{"docs":{},"数":{"docs":{},"量":{"docs":{},"设":{"docs":{},"为":{"4":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}},"docs":{}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}},"docs":{}},"docs":{}}}}}}}},"docs":{}}}}}}}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"新":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"打":{"docs":{},"印":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}},"重":{"docs":{},"写":{"docs":{},"了":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},"与":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"中":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"方":{"docs":{},"法":{"docs":{},"一":{"docs":{},"致":{"docs":{},",":{"docs":{},"声":{"docs":{},"明":{"docs":{},"前":{"docs":{},"面":{"docs":{},"加":{"docs":{},"上":{"docs":{},"了":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.024676850763807285},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.07749077490774908},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.009900990099009901},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.011067193675889328},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.04065040650406504},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.017241379310344827},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.008353221957040573},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.01440922190201729}},"s":{"docs":{},"里":{"docs":{},"用":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"-":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}}},"块":{"docs":{},"中":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"执":{"docs":{},"行":{"docs":{},"完":{"docs":{},"毕":{"docs":{},"后":{"docs":{},",":{"docs":{},"程":{"docs":{},"序":{"docs":{},"会":{"docs":{},"终":{"docs":{},"止":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"会":{"docs":{},"继":{"docs":{},"续":{"docs":{},"执":{"docs":{},"行":{"docs":{},"下":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"。":{"docs":{},"这":{"docs":{},"就":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"执":{"docs":{},"行":{"docs":{},"下":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},",":{"docs":{},"需":{"docs":{},"要":{"docs":{},"显":{"docs":{},"式":{"docs":{},"地":{"docs":{},"在":{"docs":{},"你":{"docs":{},"需":{"docs":{},"要":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"里":{"docs":{},"使":{"docs":{},"用":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"关":{"docs":{},"于":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"更":{"docs":{},"多":{"docs":{},"信":{"docs":{},"息":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}}}},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":1.6840579710144925},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"层":{"docs":{},"次":{"docs":{},"作":{"docs":{},"为":{"docs":{},"例":{"docs":{},"子":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.8333333333333333}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"f":{"docs":{},"i":{"docs":{},"s":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"n":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"b":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}},"'":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}},"l":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23396460929578386},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0047430830039525695},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},".":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162}}},"属":{"docs":{},"性":{"docs":{},"之":{"docs":{},"后":{"docs":{},"被":{"docs":{},"设":{"docs":{},"置":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"值":{"docs":{},"(":{"1":{"5":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"docs":{}},"docs":{}}}}}}}}}}}}}}},".":{"docs":{},"i":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}},"x":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"'":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}},"和":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"值":{"docs":{},"计":{"docs":{},"算":{"docs":{},"一":{"docs":{},"个":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"原":{"docs":{},"点":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},"调":{"docs":{},"用":{"docs":{},"该":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"自":{"docs":{},"动":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},":":{"docs":{},"s":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}}},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"c":{"docs":{},"k":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.014760147601476014},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.8459815546772068},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"s":{"docs":{},"n":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}},"e":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.02524271844660194},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.007032348804500703},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.008620689655172414},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.006696428571428571}},"e":{"docs":{},"r":{"1":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.009708737864077669}}},"2":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}},"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}},"s":{"docs":{},")":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"空":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"可":{"docs":{},"变":{"docs":{},"性":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"是":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"使":{"docs":{},"用":{"docs":{},"字":{"docs":{},"符":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"计":{"docs":{},"算":{"docs":{},"字":{"docs":{},"符":{"docs":{},"数":{"docs":{},"量":{"docs":{},"连":{"docs":{},"接":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"和":{"docs":{},"字":{"docs":{},"符":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"插":{"docs":{},"值":{"docs":{},"比":{"docs":{},"较":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"相":{"docs":{},"等":{"docs":{},"前":{"docs":{},"缀":{"docs":{},"/":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"相":{"docs":{},"等":{"docs":{},"大":{"docs":{},"写":{"docs":{},"和":{"docs":{},"小":{"docs":{},"写":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":1.6666666666666665}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422}}}}}}}},".":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"是":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"型":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"中":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"成":{"docs":{},"员":{"docs":{},"值":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"计":{"docs":{},"算":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"即":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"返":{"docs":{},"回":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"新":{"docs":{},"的":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"\\":{"0":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}}}}}}}}},"i":{"docs":{},"n":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":5.003311258278146}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"是":{"docs":{},"一":{"docs":{},"种":{"docs":{},"可":{"docs":{},"以":{"docs":{},"请":{"docs":{},"求":{"docs":{},"和":{"docs":{},"调":{"docs":{},"用":{"docs":{},"属":{"docs":{},"性":{"docs":{},"、":{"docs":{},"方":{"docs":{},"法":{"docs":{},"及":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"的":{"docs":{},"过":{"docs":{},"程":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"性":{"docs":{},"体":{"docs":{},"现":{"docs":{},"于":{"docs":{},"请":{"docs":{},"求":{"docs":{},"或":{"docs":{},"调":{"docs":{},"用":{"docs":{},"的":{"docs":{},"目":{"docs":{},"标":{"docs":{},"当":{"docs":{},"前":{"docs":{},"可":{"docs":{},"能":{"docs":{},"为":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},")":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"的":{"docs":{},"目":{"docs":{},"标":{"docs":{},"有":{"docs":{},"值":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"调":{"docs":{},"用":{"docs":{},"就":{"docs":{},"会":{"docs":{},"成":{"docs":{},"功":{"docs":{},";":{"docs":{},"相":{"docs":{},"反":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"选":{"docs":{},"择":{"docs":{},"的":{"docs":{},"目":{"docs":{},"标":{"docs":{},"为":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},")":{"docs":{},",":{"docs":{},"则":{"docs":{},"这":{"docs":{},"种":{"docs":{},"调":{"docs":{},"用":{"docs":{},"将":{"docs":{},"返":{"docs":{},"回":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},")":{"docs":{},"。":{"docs":{},"多":{"docs":{},"次":{"docs":{},"请":{"docs":{},"求":{"docs":{},"或":{"docs":{},"调":{"docs":{},"用":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"链":{"docs":{},"接":{"docs":{},"在":{"docs":{},"一":{"docs":{},"起":{"docs":{},"形":{"docs":{},"成":{"docs":{},"一":{"docs":{},"个":{"docs":{},"链":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"任":{"docs":{},"何":{"docs":{},"一":{"docs":{},"个":{"docs":{},"节":{"docs":{},"点":{"docs":{},"为":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"o":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}}}},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}}}}}}}},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842}}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.010575793184488837},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.03734439834024896},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.02186878727634195},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.012376237623762377},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.022222222222222223},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.019867549668874173},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.8491436100131752},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.01909307875894988},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.011695906432748537}},"前":{"docs":{},"添":{"docs":{},"加":{"docs":{},"@":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"特":{"docs":{},"性":{"docs":{},"(":{"docs":{},"@":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}},")":{"docs":{},"来":{"docs":{},"将":{"docs":{},"整":{"docs":{},"个":{"docs":{},"类":{"docs":{},"标":{"docs":{},"记":{"docs":{},"为":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}},")":{"docs":{},"、":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"(":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},")":{"docs":{},"这":{"docs":{},"些":{"docs":{},"目":{"docs":{},"标":{"docs":{},"中":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"认":{"docs":{},"为":{"docs":{},"是":{"docs":{},"访":{"docs":{},"问":{"docs":{},"对":{"docs":{},"象":{"docs":{},"、":{"docs":{},"集":{"docs":{},"合":{"docs":{},"或":{"docs":{},"序":{"docs":{},"列":{"docs":{},"的":{"docs":{},"快":{"docs":{},"捷":{"docs":{},"方":{"docs":{},"式":{"docs":{},"。":{"docs":{},"举":{"docs":{},"例":{"docs":{},"来":{"docs":{},"说":{"docs":{},",":{"docs":{},"用":{"docs":{},"下":{"docs":{},"标":{"docs":{},"访":{"docs":{},"问":{"docs":{},"一":{"docs":{},"个":{"docs":{},"数":{"docs":{},"组":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"=":{"docs":{},"\"":{"docs":{},"x":{"docs":{},"-":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"它":{"docs":{},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}},"、":{"docs":{},"d":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"、":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"、":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"、":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"、":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"、":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"、":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"、":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"、":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"、":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"、":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"、":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"a":{"docs":{},"s":{"docs":{},"、":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152}}}}},"u":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"u":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.009940357852882704},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506}},"值":{"docs":{},"大":{"docs":{},"于":{"docs":{},"任":{"docs":{},"何":{"docs":{},"之":{"docs":{},"前":{"docs":{},"任":{"docs":{},"意":{"docs":{},"a":{"docs":{},"u":{"docs":{},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{},"实":{"docs":{},"例":{"docs":{},"中":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"将":{"docs":{},"新":{"docs":{},"值":{"docs":{},"保":{"docs":{},"存":{"docs":{},"在":{"docs":{},"静":{"docs":{},"态":{"docs":{},"属":{"docs":{},"性":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"包":{"docs":{},"含":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}},"的":{"docs":{},"新":{"docs":{},"值":{"docs":{},"大":{"docs":{},"于":{"docs":{},"允":{"docs":{},"许":{"docs":{},"的":{"docs":{},"阈":{"docs":{},"值":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"将":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"的":{"docs":{},"值":{"docs":{},"限":{"docs":{},"定":{"docs":{},"为":{"docs":{},"阈":{"docs":{},"值":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"a":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"会":{"docs":{},"在":{"docs":{},"更":{"docs":{},"新":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"之":{"docs":{},"前":{"docs":{},"检":{"docs":{},"查":{"docs":{},"所":{"docs":{},"请":{"docs":{},"求":{"docs":{},"的":{"docs":{},"新":{"docs":{},"等":{"docs":{},"级":{"docs":{},"是":{"docs":{},"否":{"docs":{},"已":{"docs":{},"经":{"docs":{},"解":{"docs":{},"锁":{"docs":{},"。":{"docs":{},"a":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"方":{"docs":{},"法":{"docs":{},"返":{"docs":{},"回":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},"以":{"docs":{},"指":{"docs":{},"示":{"docs":{},"是":{"docs":{},"否":{"docs":{},"确":{"docs":{},"实":{"docs":{},"能":{"docs":{},"够":{"docs":{},"设":{"docs":{},"置":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.008438818565400843}},"e":{"docs":{},"逐":{"docs":{},"渐":{"docs":{},"接":{"docs":{},"近":{"docs":{},"到":{"0":{"docs":{},"是":{"docs":{},"需":{"docs":{},"要":{"docs":{},"向":{"docs":{},"正":{"docs":{},"数":{"docs":{},"走":{"docs":{},"还":{"docs":{},"是":{"docs":{},"向":{"docs":{},"负":{"docs":{},"数":{"docs":{},"走":{"docs":{},"。":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"是":{"3":{"docs":{},",":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}},"i":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}},"t":{"docs":{},"i":{"docs":{},"z":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}},"b":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}},"的":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"三":{"docs":{},"维":{"docs":{},"空":{"docs":{},"间":{"docs":{},"的":{"docs":{},"立":{"docs":{},"方":{"docs":{},"体":{"docs":{},",":{"docs":{},"包":{"docs":{},"含":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"、":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"t":{"docs":{},"h":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"还":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"v":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"只":{"docs":{},"读":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"用":{"docs":{},"来":{"docs":{},"返":{"docs":{},"回":{"docs":{},"立":{"docs":{},"方":{"docs":{},"体":{"docs":{},"的":{"docs":{},"体":{"docs":{},"积":{"docs":{},",":{"docs":{},"设":{"docs":{},"置":{"docs":{},"v":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"毫":{"docs":{},"无":{"docs":{},"意":{"docs":{},"义":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"无":{"docs":{},"法":{"docs":{},"确":{"docs":{},"定":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"、":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.01818181818181818},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}},"和":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}},"之":{"docs":{},"间":{"docs":{},"的":{"docs":{},"关":{"docs":{},"系":{"docs":{},"与":{"docs":{},"前":{"docs":{},"面":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"关":{"docs":{},"系":{"docs":{},"截":{"docs":{},"然":{"docs":{},"不":{"docs":{},"同":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"数":{"docs":{},"据":{"docs":{},"模":{"docs":{},"型":{"docs":{},"中":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"客":{"docs":{},"户":{"docs":{},"可":{"docs":{},"能":{"docs":{},"有":{"docs":{},"或":{"docs":{},"者":{"docs":{},"没":{"docs":{},"有":{"docs":{},"信":{"docs":{},"用":{"docs":{},"卡":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"一":{"docs":{},"张":{"docs":{},"信":{"docs":{},"用":{"docs":{},"卡":{"docs":{},"总":{"docs":{},"是":{"docs":{},"关":{"docs":{},"联":{"docs":{},"着":{"docs":{},"一":{"docs":{},"个":{"docs":{},"客":{"docs":{},"户":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"表":{"docs":{},"示":{"docs":{},"这":{"docs":{},"种":{"docs":{},"关":{"docs":{},"系":{"docs":{},",":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"类":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"类":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"非":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"展":{"docs":{},"示":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"值":{"docs":{},"允":{"docs":{},"许":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"而":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"允":{"docs":{},"许":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"持":{"docs":{},"有":{"docs":{},"对":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"而":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"持":{"docs":{},"有":{"docs":{},"对":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"该":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"销":{"docs":{},"毁":{"docs":{},"了":{"docs":{},"。":{"docs":{},"其":{"docs":{},"后":{"docs":{},",":{"docs":{},"再":{"docs":{},"也":{"docs":{},"没":{"docs":{},"有":{"docs":{},"指":{"docs":{},"向":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"当":{"docs":{},"你":{"docs":{},"断":{"docs":{},"开":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},"变":{"docs":{},"量":{"docs":{},"持":{"docs":{},"有":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"再":{"docs":{},"也":{"docs":{},"没":{"docs":{},"有":{"docs":{},"指":{"docs":{},"向":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"用":{"docs":{},"它":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"将":{"docs":{},"新":{"docs":{},"创":{"docs":{},"建":{"docs":{},"的":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"客":{"docs":{},"户":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}},"和":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"在":{"docs":{},"被":{"docs":{},"创":{"docs":{},"建":{"docs":{},"时":{"docs":{},"不":{"docs":{},"会":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"予":{"docs":{},"一":{"docs":{},"个":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"整":{"docs":{},"数":{"docs":{},"值":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"和":{"docs":{},"w":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"不":{"docs":{},"是":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"得":{"docs":{},"等":{"docs":{},"于":{"0":{"docs":{},",":{"1":{"docs":{},",":{"2":{"docs":{},"和":{"3":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},"的":{"docs":{},",":{"docs":{},"这":{"docs":{},"些":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"在":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"言":{"docs":{},",":{"docs":{},"你":{"docs":{},"就":{"docs":{},"会":{"docs":{},"知":{"docs":{},"道":{"docs":{},",":{"docs":{},"在":{"docs":{},"c":{"docs":{},"语":{"docs":{},"言":{"docs":{},"中":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"指":{"docs":{},"定":{"docs":{},"相":{"docs":{},"关":{"docs":{},"名":{"docs":{},"称":{"docs":{},"为":{"docs":{},"一":{"docs":{},"组":{"docs":{},"整":{"docs":{},"型":{"docs":{},"值":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"中":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"更":{"docs":{},"加":{"docs":{},"灵":{"docs":{},"活":{"docs":{},",":{"docs":{},"不":{"docs":{},"必":{"docs":{},"给":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"(":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}},"中":{"docs":{},"的":{"docs":{},"比":{"docs":{},"较":{"docs":{},"运":{"docs":{},"算":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00808080808080808}},"z":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}},"y":{"docs":{},"!":{"docs":{},")":{"docs":{},"的":{"docs":{},"方":{"docs":{},"式":{"docs":{},",":{"docs":{},"将":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"显":{"docs":{},"示":{"docs":{},"展":{"docs":{},"开":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"这":{"docs":{},"表":{"docs":{},"示":{"docs":{},"像":{"docs":{},"其":{"docs":{},"他":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"将":{"docs":{},"实":{"docs":{},"例":{"docs":{},"保":{"docs":{},"存":{"docs":{},"为":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"e":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"d":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},",":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"基":{"docs":{},"础":{"docs":{},"类":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"都":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"前":{"docs":{},"者":{"docs":{},"把":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"写":{"docs":{},"为":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"后":{"docs":{},"者":{"docs":{},"则":{"docs":{},"把":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"等":{"docs":{},"效":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"从":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}},"继":{"docs":{},"承":{"docs":{},"而":{"docs":{},"来":{"docs":{},"的":{"docs":{},"新":{"docs":{},"协":{"docs":{},"议":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}},"f":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.006696428571428571}},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.008960573476702509},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"a":{"docs":{},"t":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}}}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}},";":{"docs":{},")":{"docs":{},"元":{"docs":{},"组":{"docs":{},"把":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}}}},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}},"b":{"docs":{},"y":{"docs":{},"f":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622}},".":{"docs":{},"v":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":1.1197566442523215}},"循":{"docs":{},"环":{"docs":{},"和":{"docs":{},"半":{"docs":{},"闭":{"docs":{},"区":{"docs":{},"间":{"docs":{},"操":{"docs":{},"作":{"docs":{},"(":{"docs":{},".":{"docs":{},".":{"docs":{},")":{"docs":{},"来":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"每":{"docs":{},"个":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"检":{"docs":{},"查":{"docs":{},"是":{"docs":{},"否":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"不":{"docs":{},"等":{"docs":{},"于":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"不":{"docs":{},"等":{"docs":{},",":{"docs":{},"则":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"不":{"docs":{},"匹":{"docs":{},"配":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}},"i":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}},"语":{"docs":{},"句":{"docs":{},"允":{"docs":{},"许":{"docs":{},"在":{"docs":{},"重":{"docs":{},"复":{"docs":{},"执":{"docs":{},"行":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"的":{"docs":{},"同":{"docs":{},"时":{"docs":{},",":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"集":{"docs":{},"合":{"docs":{},"(":{"docs":{},"或":{"docs":{},"符":{"docs":{},"合":{"docs":{},"s":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"开":{"docs":{},"始":{"docs":{},"前":{"docs":{},"会":{"docs":{},"调":{"docs":{},"用":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"一":{"docs":{},"个":{"docs":{},"生":{"docs":{},"成":{"docs":{},"器":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"这":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"符":{"docs":{},"合":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},")":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"接":{"docs":{},"下":{"docs":{},"来":{"docs":{},"循":{"docs":{},"环":{"docs":{},"开":{"docs":{},"始":{"docs":{},",":{"docs":{},"调":{"docs":{},"用":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"n":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"其":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"不":{"docs":{},"是":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},",":{"docs":{},"它":{"docs":{},"将":{"docs":{},"会":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"执":{"docs":{},"行":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},",":{"docs":{},"执":{"docs":{},"行":{"docs":{},"完":{"docs":{},"毕":{"docs":{},"后":{"docs":{},"回":{"docs":{},"到":{"docs":{},"循":{"docs":{},"环":{"docs":{},"开":{"docs":{},"始":{"docs":{},"处":{"docs":{},";":{"docs":{},"否":{"docs":{},"则":{"docs":{},",":{"docs":{},"将":{"docs":{},"不":{"docs":{},"会":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"也":{"docs":{},"不":{"docs":{},"会":{"docs":{},"执":{"docs":{},"行":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},",":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.011527377521613832}}}}}}},"c":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474}},"e":{"docs":{},"-":{"docs":{},"u":{"docs":{},"n":{"docs":{},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.008695652173913044}}},"—":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}},"语":{"docs":{},"句":{"docs":{},"、":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"语":{"docs":{},"句":{"docs":{},"、":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"和":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"执":{"docs":{},"行":{"docs":{},"后":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"还":{"docs":{},"是":{"docs":{},"会":{"docs":{},"被":{"docs":{},"计":{"docs":{},"算":{"docs":{},",":{"docs":{},"这":{"docs":{},"是":{"docs":{},"因":{"docs":{},"为":{"docs":{},"每":{"docs":{},"次":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},"执":{"docs":{},"行":{"docs":{},"完":{"docs":{},"毕":{"docs":{},"后":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}}}}}},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"u":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}},"l":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.026785714285714284},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}},"e":{"docs":{},"。":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},",":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":1.1139929554915147}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":1.1168747998719182}},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}},"语":{"docs":{},"句":{"docs":{},"可":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"的":{"docs":{},"任":{"docs":{},"意":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"里":{"docs":{},",":{"docs":{},"但":{"docs":{},"不":{"docs":{},"能":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"最":{"docs":{},"后":{"docs":{},"一":{"docs":{},"个":{"docs":{},"&":{"docs":{},"#":{"3":{"9":{"docs":{},";":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"&":{"docs":{},"#":{"3":{"9":{"docs":{},";":{"docs":{},"块":{"docs":{},"。":{"docs":{},"同":{"docs":{},"时":{"docs":{},",":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"也":{"docs":{},"不":{"docs":{},"能":{"docs":{},"把":{"docs":{},"控":{"docs":{},"制":{"docs":{},"权":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"可":{"docs":{},"选":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"于":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"传":{"docs":{},"递":{"docs":{},"控":{"docs":{},"制":{"docs":{},"权":{"docs":{},"。":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"会":{"docs":{},"把":{"docs":{},"控":{"docs":{},"制":{"docs":{},"权":{"docs":{},"从":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"下":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"传":{"docs":{},"递":{"docs":{},"是":{"docs":{},"无":{"docs":{},"条":{"docs":{},"件":{"docs":{},"的":{"docs":{},",":{"docs":{},"即":{"docs":{},"使":{"docs":{},"下":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"与":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}},",":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}}},"i":{"docs":{},"b":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"c":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.019867549668874173},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.013245033112582781}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.012448132780082987},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"下":{"docs":{},"标":{"docs":{},",":{"docs":{},"在":{"docs":{},"编":{"docs":{},"译":{"docs":{},"时":{"docs":{},"会":{"docs":{},"报":{"docs":{},"错":{"docs":{},"。":{"docs":{},"在":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"中":{"docs":{},",":{"docs":{},"你":{"docs":{},"添":{"docs":{},"加":{"docs":{},"到":{"docs":{},"类":{"docs":{},"里":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"下":{"docs":{},"标":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"里":{"docs":{},"标":{"docs":{},"记":{"docs":{},"为":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"防":{"docs":{},"止":{"docs":{},"它":{"docs":{},"们":{"docs":{},"被":{"docs":{},"重":{"docs":{},"写":{"docs":{},",":{"docs":{},"只":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"声":{"docs":{},"明":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"@":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"特":{"docs":{},"性":{"docs":{},"即":{"docs":{},"可":{"docs":{},"。":{"docs":{},"(":{"docs":{},"例":{"docs":{},"如":{"docs":{},":":{"docs":{},"@":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.007159904534606206}}}}}}}}},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"(":{"docs":{},"[":{"3":{"docs":{},".":{"1":{"4":{"1":{"5":{"9":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{},"\"":{"docs":{},"m":{"docs":{},"i":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"<":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},">":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}},"中":{"docs":{},"这":{"docs":{},"个":{"docs":{},"单":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"写":{"docs":{},"做":{"docs":{},":":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"现":{"docs":{},"在":{"docs":{},"则":{"docs":{},"可":{"docs":{},"以":{"docs":{},"成":{"docs":{},"功":{"docs":{},"的":{"docs":{},"编":{"docs":{},"译":{"docs":{},"过":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"作":{"docs":{},"用":{"docs":{},"于":{"docs":{},"任":{"docs":{},"何":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"如":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"或":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"用":{"docs":{},"某":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"。":{"docs":{},"请":{"docs":{},"注":{"docs":{},"意":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"仍":{"docs":{},"然":{"docs":{},"返":{"docs":{},"回":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"非":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"功":{"docs":{},"能":{"docs":{},"是":{"docs":{},"去":{"docs":{},"查":{"docs":{},"找":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"给":{"docs":{},"定":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"若":{"docs":{},"查":{"docs":{},"找":{"docs":{},"到":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},",":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"该":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"在":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"值":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},",":{"docs":{},"反":{"docs":{},"之":{"docs":{},"则":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"x":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}}}}}}}},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},".":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"(":{"2":{"docs":{},".":{"0":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"并":{"docs":{},"指":{"docs":{},"定":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"为":{"4":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"docs":{}}}}}}}},"表":{"docs":{},"示":{"3":{"2":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"docs":{}},"docs":{}}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"-":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.006696428571428571}},"-":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.006696428571428571}}}}}}},"p":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}}}}}}}}}},"w":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},")":{"docs":{},"中":{"docs":{},"介":{"docs":{},"绍":{"docs":{},",":{"docs":{},"当":{"docs":{},"考":{"docs":{},"虑":{"docs":{},"一":{"docs":{},"个":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"们":{"docs":{},"时":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"必":{"docs":{},"须":{"docs":{},"全":{"docs":{},"面":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"了":{"docs":{},".":{"docs":{},"w":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},",":{"docs":{},"上":{"docs":{},"面":{"docs":{},"那":{"docs":{},"段":{"docs":{},"代":{"docs":{},"码":{"docs":{},"将":{"docs":{},"无":{"docs":{},"法":{"docs":{},"通":{"docs":{},"过":{"docs":{},"编":{"docs":{},"译":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"没":{"docs":{},"有":{"docs":{},"考":{"docs":{},"虑":{"docs":{},"到":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"含":{"docs":{},"有":{"docs":{},"关":{"docs":{},"于":{"docs":{},"该":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"的":{"docs":{},"介":{"docs":{},"绍":{"docs":{},")":{"docs":{},".":{"docs":{},"新":{"docs":{},"版":{"docs":{},"本":{"docs":{},"使":{"docs":{},"用":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"中":{"docs":{},"的":{"docs":{},"骰":{"docs":{},"子":{"docs":{},",":{"docs":{},"实":{"docs":{},"现":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"s":{"docs":{},"u":{"docs":{},"m":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"y":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.010752688172043012}},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"从":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"!":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"改":{"docs":{},"为":{"docs":{},"了":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"b":{"docs":{},"o":{"docs":{},"n":{"docs":{},"j":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"!":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"试":{"docs":{},"图":{"docs":{},"找":{"docs":{},"到":{"docs":{},"具":{"docs":{},"有":{"docs":{},"特":{"docs":{},"定":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"通":{"docs":{},"过":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"7":{"docs":{},"识":{"docs":{},"别":{"docs":{},"u":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0282021151586369},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.02074688796680498},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.03938115330520394},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.013157894736842105},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.039603960396039604},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.01775147928994083},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.009933774834437087},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.008620689655172414},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.027446300715990454},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.03288490284005979},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.02046783625730994},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"来":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"名":{"docs":{},"字":{"docs":{},"和":{"docs":{},"参":{"docs":{},"数":{"docs":{},"来":{"docs":{},"调":{"docs":{},"用":{"docs":{},"函":{"docs":{},"数":{"docs":{},"。":{"docs":{},"使":{"docs":{},"用":{"docs":{},"-":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.49043273476597},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.01046337817638266},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"s":{"docs":{},")":{"docs":{},"函":{"docs":{},"数":{"docs":{},"参":{"docs":{},"数":{"docs":{},"与":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"与":{"docs":{},"调":{"docs":{},"用":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"定":{"docs":{},"义":{"docs":{},"在":{"docs":{},"全":{"docs":{},"局":{"docs":{},"域":{"docs":{},"中":{"docs":{},"。":{"docs":{},"你":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"把":{"docs":{},"函":{"docs":{},"数":{"docs":{},"定":{"docs":{},"义":{"docs":{},"在":{"docs":{},"别":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"体":{"docs":{},"中":{"docs":{},",":{"docs":{},"称":{"docs":{},"作":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"包":{"docs":{},"括":{"docs":{},"在":{"docs":{},"没":{"docs":{},"有":{"docs":{},"权":{"docs":{},"限":{"docs":{},"获":{"docs":{},"取":{"docs":{},"原":{"docs":{},"始":{"docs":{},"源":{"docs":{},"代":{"docs":{},"码":{"docs":{},"的":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"能":{"docs":{},"力":{"docs":{},"(":{"docs":{},"即":{"docs":{},"逆":{"docs":{},"向":{"docs":{},"建":{"docs":{},"模":{"docs":{},")":{"docs":{},"。":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"和":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"中":{"docs":{},"的":{"docs":{},"分":{"docs":{},"类":{"docs":{},"(":{"docs":{},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"类":{"docs":{},"似":{"docs":{},"。":{"docs":{},"(":{"docs":{},"不":{"docs":{},"过":{"docs":{},"与":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"是":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}},")":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"相":{"docs":{},"当":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"柯":{"docs":{},"里":{"docs":{},"化":{"docs":{},"函":{"docs":{},"数":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},")":{"docs":{},"(":{"docs":{},")":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"作":{"docs":{},"为":{"docs":{},"前":{"docs":{},"缀":{"docs":{},"。":{"docs":{},"指":{"docs":{},"定":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"时":{"docs":{},",":{"docs":{},"用":{"docs":{},"返":{"docs":{},"回":{"docs":{},"箭":{"docs":{},"头":{"docs":{},"-":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"之":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},";":{"docs":{},"声":{"docs":{},"明":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"在":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"之":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375}},"e":{"docs":{},"实":{"docs":{},"现":{"docs":{},"为":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"只":{"docs":{},"读":{"docs":{},"属":{"docs":{},"性":{"docs":{},".":{"docs":{},"它":{"docs":{},"的":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"都":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"必":{"docs":{},"备":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.007159904534606206}}}}}}}}},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},")":{"docs":{},"\\":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"docs":{},"a":{"docs":{},")":{"docs":{},"、":{"docs":{},"回":{"docs":{},"车":{"docs":{},"符":{"docs":{},"(":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}},"c":{"docs":{},")":{"docs":{},"以":{"docs":{},"及":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},")":{"docs":{},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"0":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}}},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}},"h":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.005875440658049354},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.007766990291262136},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.02531645569620253},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.006696428571428571},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.011494252873563218},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"-":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}}}},"p":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}}}},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}},"s":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"成":{"docs":{},"员":{"docs":{},":":{"docs":{},"给":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"常":{"docs":{},"量":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"时":{"docs":{},",":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"需":{"docs":{},"要":{"docs":{},"用":{"docs":{},"全":{"docs":{},"名":{"docs":{},"来":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"常":{"docs":{},"量":{"docs":{},"没":{"docs":{},"有":{"docs":{},"显":{"docs":{},"式":{"docs":{},"指":{"docs":{},"定":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"里":{"docs":{},",":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"使":{"docs":{},"用":{"docs":{},"缩":{"docs":{},"写":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"来":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"的":{"docs":{},"值":{"docs":{},"已":{"docs":{},"经":{"docs":{},"知":{"docs":{},"道":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"m":{"docs":{},"b":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.008298755186721992},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.009940357852882704},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"’":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"'":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}},"x":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"-":{"docs":{},"d":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.03794642857142857}}}}}}},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286}},"a":{"docs":{},"l":{"docs":{},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.009940357852882704},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.008620689655172414}},"=":{"docs":{},"\"":{"1":{"2":{"0":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}},"docs":{}},"6":{"9":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}},"docs":{}},"docs":{}},"3":{"5":{"7":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"docs":{}},"8":{"7":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"docs":{}},"docs":{}},"docs":{}}}}}}}},"a":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747}},"协":{"docs":{},"议":{"docs":{},"时":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"a":{"docs":{},"s":{"docs":{},"?":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"将":{"docs":{},"其":{"docs":{},"可":{"docs":{},"选":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}},"/":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}}}}}}}}},"h":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.008928571428571428}}}}},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"e":{"docs":{},"和":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"产":{"docs":{},"生":{"docs":{},"的":{"docs":{},"。":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"实":{"docs":{},"参":{"docs":{},"必":{"docs":{},"须":{"docs":{},"满":{"docs":{},"足":{"docs":{},"它":{"docs":{},"所":{"docs":{},"替":{"docs":{},"代":{"docs":{},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"约":{"docs":{},"束":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"任":{"docs":{},"何":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"所":{"docs":{},"指":{"docs":{},"定":{"docs":{},"的":{"docs":{},"额":{"docs":{},"外":{"docs":{},"的":{"docs":{},"要":{"docs":{},"求":{"docs":{},"。":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"要":{"docs":{},"求":{"docs":{},"满":{"docs":{},"足":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"也":{"docs":{},"必":{"docs":{},"须":{"docs":{},"满":{"docs":{},"足":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.011160714285714286}}}}}}}}}},"l":{"docs":{},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"f":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01107011070110701}}}}}}}},"w":{"docs":{},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"m":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"当":{"docs":{},"做":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"o":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}},"s":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}},"i":{"docs":{},"z":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"p":{"2":{"0":{"0":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}},"s":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"4":{"0":{"4":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.007168458781362007}},".":{"0":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"1":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"docs":{}}}}}}}},"docs":{}},"docs":{}},"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.005376344086021506}}}},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.012121212121212121}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}}}}}},"d":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"消":{"docs":{},"息":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"别":{"docs":{},"打":{"docs":{},"印":{"docs":{},",":{"docs":{},"证":{"docs":{},"明":{"docs":{},"了":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},"是":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},"解":{"docs":{},"决":{"docs":{},"循":{"docs":{},"环":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"这":{"docs":{},"样":{"docs":{},"这":{"docs":{},"样":{"docs":{},"编":{"docs":{},"写":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"现":{"docs":{},"和":{"docs":{},"之":{"docs":{},"前":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"一":{"docs":{},"致":{"docs":{},",":{"docs":{},"只":{"docs":{},"是":{"docs":{},"在":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"中":{"docs":{},"多":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"占":{"docs":{},"有":{"docs":{},"列":{"docs":{},"表":{"docs":{},"。":{"docs":{},"这":{"docs":{},"里":{"docs":{},",":{"docs":{},"占":{"docs":{},"有":{"docs":{},"列":{"docs":{},"表":{"docs":{},"是":{"docs":{},"[":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"产":{"docs":{},"生":{"docs":{},"了":{"docs":{},"类":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}},"只":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"(":{"docs":{},"如":{"docs":{},"果":{"docs":{},"有":{"docs":{},"的":{"docs":{},"话":{"docs":{},")":{"docs":{},"参":{"docs":{},"数":{"docs":{},"来":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"一":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"。":{"docs":{},"该":{"docs":{},"类":{"docs":{},"也":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"析":{"docs":{},"构":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"当":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"这":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},"代":{"docs":{},"表":{"docs":{},"段":{"docs":{},"落":{"docs":{},"的":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"p":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"代":{"docs":{},"表":{"docs":{},"换":{"docs":{},"行":{"docs":{},"的":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"b":{"docs":{},"r":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"。":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"还":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"设":{"docs":{},"置":{"docs":{},"和":{"docs":{},"展":{"docs":{},"现":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"还":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"l":{"docs":{},"a":{"docs":{},"z":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"引":{"docs":{},"用":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"闭":{"docs":{},"包":{"docs":{},",":{"docs":{},"将":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"组":{"docs":{},"合":{"docs":{},"成":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.009900990099009901}},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.009900990099009901}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.8372859025032937},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}}}}},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"=":{"docs":{},"\"":{"docs":{},"#":{"docs":{},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"1":{"docs":{},"\"":{"docs":{},">":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"语":{"docs":{},"句":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152}}}}}}}}}}}}}},"2":{"docs":{},"\"":{"docs":{},">":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"实":{"docs":{},"参":{"docs":{},"语":{"docs":{},"句":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}},"o":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.011650485436893204},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747}},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.09523809523809523},"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.017921146953405017},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},",":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}},"经":{"docs":{},"验":{"docs":{},",":{"docs":{},"应":{"docs":{},"该":{"docs":{},"知":{"docs":{},"道":{"docs":{},"有":{"2":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"docs":{}}}}}}}}},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"时":{"docs":{},"很":{"docs":{},"相":{"docs":{},"似":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"约":{"docs":{},"定":{"docs":{},"还":{"docs":{},"让":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}},"里":{"docs":{},"面":{"docs":{},",":{"docs":{},"你":{"docs":{},"只":{"docs":{},"能":{"docs":{},"为":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"的":{"docs":{},"类":{"docs":{},"定":{"docs":{},"义":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"-":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},"表":{"docs":{},"示":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},",":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"非":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"类":{"docs":{},",":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"类":{"docs":{},"和":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"包":{"docs":{},"含":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},",":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},",":{"docs":{},"析":{"docs":{},"构":{"docs":{},"器":{"docs":{},",":{"docs":{},"以":{"docs":{},"下":{"docs":{},"下":{"docs":{},"标":{"docs":{},"。":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"告":{"docs":{},"诉":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"该":{"docs":{},"声":{"docs":{},"明":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"-":{"docs":{},"c":{"docs":{},"]":{"docs":{},"(":{"6":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}}}}}}}}},"s":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"并":{"docs":{},"不":{"docs":{},"会":{"docs":{},"被":{"docs":{},"改":{"docs":{},"变":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"当":{"docs":{},"它":{"docs":{},"们":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"时":{"docs":{},"只":{"docs":{},"被":{"docs":{},"视":{"docs":{},"为":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"只":{"docs":{},"有":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},".":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"是":{"docs":{},"否":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.02197802197802198}},"前":{"docs":{},"缀":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"生":{"docs":{},"效":{"docs":{},".":{"docs":{},"且":{"docs":{},"@":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"协":{"docs":{},"议":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"暴":{"docs":{},"露":{"docs":{},"给":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},",":{"docs":{},"在":{"docs":{},"[":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}},"特":{"docs":{},"性":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"一":{"docs":{},"个":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"特":{"docs":{},"性":{"docs":{},"就":{"docs":{},"会":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"地":{"docs":{},"应":{"docs":{},"用":{"docs":{},"到":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"无":{"docs":{},"需":{"docs":{},"显":{"docs":{},"式":{"docs":{},"地":{"docs":{},"用":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"应":{"docs":{},"用":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"或":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"它":{"docs":{},"也":{"docs":{},"会":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"地":{"docs":{},"应":{"docs":{},"用":{"docs":{},"于":{"docs":{},"那":{"docs":{},"个":{"docs":{},"类":{"docs":{},"或":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"标":{"docs":{},"记":{"docs":{},"了":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"的":{"docs":{},"类":{"docs":{},",":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"会":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"地":{"docs":{},"为":{"docs":{},"它":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},"添":{"docs":{},"加":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"。":{"docs":{},"标":{"docs":{},"记":{"docs":{},"了":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"不":{"docs":{},"能":{"docs":{},"继":{"docs":{},"承":{"docs":{},"自":{"docs":{},"没":{"docs":{},"有":{"docs":{},"标":{"docs":{},"记":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"由":{"docs":{},"标":{"docs":{},"记":{"docs":{},"符":{"docs":{},"组":{"docs":{},"成":{"docs":{},"。":{"docs":{},"当":{"docs":{},"你":{"docs":{},"想":{"docs":{},"把":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"所":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"的":{"docs":{},"实":{"docs":{},"体":{"docs":{},"以":{"docs":{},"一":{"docs":{},"个":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"暴":{"docs":{},"露":{"docs":{},"给":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},",":{"docs":{},"你":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"特":{"docs":{},"性":{"docs":{},"参":{"docs":{},"数":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"来":{"docs":{},"命":{"docs":{},"名":{"docs":{},"类":{"docs":{},",":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"。":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"把":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"中":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"暴":{"docs":{},"露":{"docs":{},"给":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},",":{"docs":{},"名":{"docs":{},"字":{"docs":{},"是":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":5.004149377593361},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},",":{"docs":{},"这":{"docs":{},"样":{"docs":{},"一":{"docs":{},"来":{"docs":{},",":{"docs":{},"当":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"改":{"docs":{},"变":{"docs":{},"时":{"docs":{},",":{"docs":{},"类":{"docs":{},"就":{"docs":{},"会":{"docs":{},"被":{"docs":{},"通":{"docs":{},"知":{"docs":{},"到":{"docs":{},"。":{"docs":{},"可":{"docs":{},"以":{"docs":{},"为":{"docs":{},"任":{"docs":{},"何":{"docs":{},"属":{"docs":{},"性":{"docs":{},"添":{"docs":{},"加":{"docs":{},"属":{"docs":{},"性":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},",":{"docs":{},"无":{"docs":{},"论":{"docs":{},"它":{"docs":{},"原":{"docs":{},"本":{"docs":{},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.047619047619047616},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"c":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"[":{"docs":{},"\"":{"docs":{},"j":{"docs":{},"a":{"docs":{},"y":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"-":{"docs":{},"d":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.006696428571428571}}}}}}},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}},"a":{"docs":{},"l":{"docs":{},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.041666666666666664},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.044642857142857144},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.06051873198847262}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.016129032258064516},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":5.009933774834437},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.014229249011857707},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"e":{"docs":{},"改":{"docs":{},"成":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"会":{"docs":{},"是":{"docs":{},"什":{"docs":{},"么":{"docs":{},"?":{"docs":{},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"当":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"时":{"docs":{},"给":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"<":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}},"特":{"docs":{},"性":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"那":{"docs":{},"些":{"docs":{},"标":{"docs":{},"记":{"docs":{},"了":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"类":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"a":{"docs":{},"d":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"枚":{"docs":{},"举":{"docs":{},",":{"docs":{},"有":{"docs":{},"两":{"docs":{},"种":{"docs":{},"形":{"docs":{},"式":{"docs":{},",":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"和":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},"t":{"docs":{},")":{"docs":{},",":{"docs":{},"又":{"docs":{},"来":{"docs":{},"代":{"docs":{},"表":{"docs":{},"可":{"docs":{},"能":{"docs":{},"出":{"docs":{},"现":{"docs":{},"或":{"docs":{},"可":{"docs":{},"能":{"docs":{},"不":{"docs":{},"出":{"docs":{},"现":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"任":{"docs":{},"意":{"docs":{},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"显":{"docs":{},"式":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},"(":{"docs":{},"或":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"的":{"docs":{},"转":{"docs":{},"换":{"docs":{},")":{"docs":{},"为":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"当":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"时":{"docs":{},",":{"docs":{},"确":{"docs":{},"保":{"docs":{},"使":{"docs":{},"用":{"docs":{},"括":{"docs":{},"号":{"docs":{},"给":{"docs":{},"?":{"docs":{},"提":{"docs":{},"供":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"作":{"docs":{},"用":{"docs":{},"范":{"docs":{},"围":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},"说":{"docs":{},",":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"数":{"docs":{},"组":{"docs":{},",":{"docs":{},"应":{"docs":{},"写":{"docs":{},"作":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"[":{"docs":{},"]":{"docs":{},")":{"docs":{},"?":{"docs":{},",":{"docs":{},"写":{"docs":{},"成":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}},"<":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.014619883040935672}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.012648221343873518},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.015625}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}}}}},")":{"docs":{},"、":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}},"或":{"docs":{},"二":{"docs":{},"元":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"e":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}},"e":{"docs":{},"和":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"i":{"docs":{},"p":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"会":{"docs":{},"被":{"docs":{},"推":{"docs":{},"测":{"docs":{},"为":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"初":{"docs":{},"值":{"docs":{},"是":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"。":{"docs":{},"就":{"docs":{},"像":{"docs":{},"之":{"docs":{},"前":{"docs":{},"提":{"docs":{},"到":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"创":{"docs":{},"建":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},"给":{"docs":{},"它":{"docs":{},"们":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"或":{"docs":{},"者":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"那":{"docs":{},"你":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"给":{"docs":{},"常":{"docs":{},"量":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"标":{"docs":{},"明":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}},".":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162}}}},"i":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}},"x":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}}}}}},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.02074688796680498},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"e":{"docs":{},"标":{"docs":{},"记":{"docs":{},"—":{"docs":{},"—":{"docs":{},"如":{"docs":{},"果":{"docs":{},"没":{"docs":{},"有":{"docs":{},"添":{"docs":{},"加":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"就":{"docs":{},"重":{"docs":{},"写":{"docs":{},"父":{"docs":{},"类":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"话":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"会":{"docs":{},"报":{"docs":{},"错":{"docs":{},"。":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"同":{"docs":{},"样":{"docs":{},"会":{"docs":{},"检":{"docs":{},"测":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"。":{"docs":{},"这":{"docs":{},"么":{"docs":{},"做":{"docs":{},",":{"docs":{},"你":{"docs":{},"就":{"docs":{},"表":{"docs":{},"明":{"docs":{},"了":{"docs":{},"你":{"docs":{},"是":{"docs":{},"想":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"重":{"docs":{},"写":{"docs":{},"版":{"docs":{},"本":{"docs":{},",":{"docs":{},"而":{"docs":{},"非":{"docs":{},"错":{"docs":{},"误":{"docs":{},"地":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"。":{"docs":{},"意":{"docs":{},"外":{"docs":{},"的":{"docs":{},"重":{"docs":{},"写":{"docs":{},"行":{"docs":{},"为":{"docs":{},"可":{"docs":{},"能":{"docs":{},"会":{"docs":{},"导":{"docs":{},"致":{"docs":{},"不":{"docs":{},"可":{"docs":{},"预":{"docs":{},"知":{"docs":{},"的":{"docs":{},"错":{"docs":{},"误":{"docs":{},",":{"docs":{},"任":{"docs":{},"何":{"docs":{},"缺":{"docs":{},"少":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"会":{"docs":{},"提":{"docs":{},"醒":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}},"n":{"docs":{},"l":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.007425742574257425}},".":{"docs":{},"n":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506}}}}}}}}}}}}}}},"k":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"e":{"docs":{},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}}}}}},",":{"docs":{},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},".":{"docs":{},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01107011070110701},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.010526315789473684},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.032520325203252036},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.005625879043600563}}}}},"t":{"docs":{},"a":{"docs":{},"w":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}}}}}}},"l":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}}}},"d":{"docs":{},"y":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}}}}},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.026905829596412557},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.02197802197802198},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.06818181818181818}},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.023809523809523808},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}},"d":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}},"和":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"方":{"docs":{},"法":{"docs":{},"可":{"docs":{},"能":{"docs":{},"会":{"docs":{},"失":{"docs":{},"败":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"它":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"被":{"docs":{},"写":{"docs":{},"作":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"。":{"docs":{},"问":{"docs":{},"号":{"docs":{},"暗":{"docs":{},"示":{"docs":{},"包":{"docs":{},"含":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},"可":{"docs":{},"能":{"docs":{},"包":{"docs":{},"含":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},"也":{"docs":{},"可":{"docs":{},"能":{"docs":{},"不":{"docs":{},"包":{"docs":{},"含":{"docs":{},"值":{"docs":{},"。":{"docs":{},"(":{"docs":{},"不":{"docs":{},"能":{"docs":{},"包":{"docs":{},"含":{"docs":{},"其":{"docs":{},"他":{"docs":{},"任":{"docs":{},"何":{"docs":{},"值":{"docs":{},"比":{"docs":{},"如":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"值":{"docs":{},"或":{"docs":{},"者":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"。":{"docs":{},"只":{"docs":{},"能":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"尝":{"docs":{},"试":{"docs":{},"将":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"i":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.005625879043600563}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},":":{"docs":{},"\"":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.005625879043600563}},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.013916500994035786}},"s":{"docs":{},"设":{"docs":{},"置":{"docs":{},"新":{"docs":{},"值":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"e":{"docs":{},",":{"docs":{},"含":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},".":{"docs":{},"通":{"docs":{},"过":{"docs":{},"名":{"docs":{},"称":{"docs":{},"猜":{"docs":{},"测":{"docs":{},",":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"协":{"docs":{},"议":{"docs":{},"时":{"docs":{},",":{"docs":{},"必":{"docs":{},"须":{"docs":{},"在":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"或":{"docs":{},"接":{"docs":{},"头":{"docs":{},"体":{"docs":{},"的":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"含":{"docs":{},"有":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"标":{"docs":{},"记":{"docs":{},",":{"docs":{},"用":{"docs":{},"以":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}},"方":{"docs":{},"法":{"docs":{},"前":{"docs":{},"含":{"docs":{},"有":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"s":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}}}}}},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"类":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"中":{"docs":{},"可":{"docs":{},"选":{"docs":{},"方":{"docs":{},"法":{"docs":{},"`":{"docs":{},"`":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"那":{"docs":{},"些":{"docs":{},"包":{"docs":{},"含":{"docs":{},"可":{"docs":{},"选":{"docs":{},"成":{"docs":{},"员":{"docs":{},"需":{"docs":{},"求":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"。":{"docs":{},"更":{"docs":{},"多":{"docs":{},"关":{"docs":{},"于":{"docs":{},"如":{"docs":{},"何":{"docs":{},"使":{"docs":{},"用":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"特":{"docs":{},"性":{"docs":{},"以":{"docs":{},"及":{"docs":{},"如":{"docs":{},"何":{"docs":{},"访":{"docs":{},"问":{"docs":{},"可":{"docs":{},"选":{"docs":{},"协":{"docs":{},"议":{"docs":{},"成":{"docs":{},"员":{"docs":{},"的":{"docs":{},"指":{"docs":{},"导":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"当":{"docs":{},"你":{"docs":{},"不":{"docs":{},"确":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},".":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}}}}}}}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}},"k":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.02074688796680498}},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}},"类":{"docs":{},"也":{"docs":{},"继":{"docs":{},"承":{"docs":{},"了":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}},"b":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"l":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}},"(":{"docs":{},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"z":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},")":{"docs":{},"\\":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"9":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}},"docs":{},"b":{"docs":{},")":{"docs":{},"、":{"docs":{},"换":{"docs":{},"页":{"docs":{},"符":{"docs":{},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}},"k":{"docs":{},"e":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}},"e":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"m":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483}}}}}}}},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}}}}}},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}},".":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403}}}}}}}},"r":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":1.6686084142394821}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.01195814648729447}}}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}},"x":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.020202020202020204}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"/":{"docs":{},"p":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"或":{"docs":{},"者":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"p":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"还":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"p":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.007159904534606206}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"含":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}},"的":{"docs":{},"值":{"docs":{},"被":{"docs":{},"用":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"[":{"6":{"docs":{},"]":{"docs":{},"。":{"docs":{},"这":{"docs":{},"句":{"docs":{},"话":{"docs":{},"访":{"docs":{},"问":{"docs":{},"了":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"第":{"docs":{},"六":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"1":{"8":{"docs":{},"或":{"docs":{},"者":{"6":{"docs":{},"的":{"3":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"docs":{}}},"docs":{}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}},"f":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}}}}},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"e":{"docs":{},"作":{"docs":{},"为":{"docs":{},"数":{"docs":{},"据":{"docs":{},"源":{"docs":{},"开":{"docs":{},"实":{"docs":{},"例":{"docs":{},"化":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}},")":{"docs":{},"带":{"docs":{},"标":{"docs":{},"签":{"docs":{},"的":{"docs":{},"语":{"docs":{},"句":{"docs":{},"控":{"docs":{},"制":{"docs":{},"传":{"docs":{},"递":{"docs":{},"语":{"docs":{},"句":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":1.1111111111111112}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}},"s":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0071146245059288534},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}},"s":{"docs":{},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"0":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},".":{"0":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}},"docs":{}}},"3":{"docs":{},".":{"1":{"4":{"1":{"5":{"9":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"4":{"2":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}},"docs":{}},"docs":{},"\"":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}},"(":{"3":{"docs":{},".":{"0":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}},"docs":{}}},"docs":{}},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"的":{"docs":{},"每":{"docs":{},"一":{"docs":{},"项":{"docs":{},"的":{"docs":{},"并":{"docs":{},"用":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"查":{"docs":{},"找":{"docs":{},"每":{"docs":{},"一":{"docs":{},"项":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"这":{"docs":{},"几":{"docs":{},"种":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"直":{"docs":{},"接":{"docs":{},"遍":{"docs":{},"历":{"docs":{},",":{"docs":{},"并":{"docs":{},"调":{"docs":{},"用":{"docs":{},"其":{"docs":{},"中":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}},"被":{"docs":{},"认":{"docs":{},"为":{"docs":{},"是":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},",":{"docs":{},"h":{"docs":{},"a":{"docs":{},"m":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"等":{"docs":{},"类":{"docs":{},"型":{"docs":{},".":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"中":{"docs":{},"调":{"docs":{},"用":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"s":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"(":{"docs":{},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}},"例":{"docs":{},"子":{"docs":{},"是":{"docs":{},"基":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"固":{"docs":{},"定":{"docs":{},"的":{"docs":{},"数":{"docs":{},"学":{"docs":{},"公":{"docs":{},"式":{"docs":{},"。":{"docs":{},"它":{"docs":{},"并":{"docs":{},"不":{"docs":{},"适":{"docs":{},"合":{"docs":{},"开":{"docs":{},"放":{"docs":{},"写":{"docs":{},"权":{"docs":{},"限":{"docs":{},"来":{"docs":{},"对":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"[":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"只":{"docs":{},"读":{"docs":{},"下":{"docs":{},"标":{"docs":{},"的":{"docs":{},"用":{"docs":{},"法":{"docs":{},",":{"docs":{},"该":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"用":{"docs":{},"来":{"docs":{},"展":{"docs":{},"示":{"docs":{},"传":{"docs":{},"入":{"docs":{},"整":{"docs":{},"数":{"docs":{},"的":{"docs":{},"n":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"索":{"docs":{},"引":{"docs":{},"值":{"docs":{},"三":{"docs":{},"倍":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"数":{"docs":{},"值":{"3":{"docs":{},"作":{"docs":{},"为":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"入":{"docs":{},"参":{"docs":{},"表":{"docs":{},"示":{"docs":{},"这":{"docs":{},"个":{"docs":{},"值":{"docs":{},"将":{"docs":{},"成":{"docs":{},"为":{"docs":{},"实":{"docs":{},"例":{"docs":{},"成":{"docs":{},"员":{"docs":{},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.008928571428571428}},"i":{"docs":{},"a":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483}},"e":{"docs":{},".":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},".":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}},"g":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}},"u":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.044642857142857144},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}},"。":{"docs":{},"从":{"docs":{},"字":{"docs":{},"面":{"docs":{},"意":{"docs":{},"思":{"docs":{},"来":{"docs":{},"说":{"docs":{},",":{"docs":{},"断":{"docs":{},"言":{"docs":{},"“":{"docs":{},"断":{"docs":{},"言":{"docs":{},"”":{"docs":{},"一":{"docs":{},"个":{"docs":{},"条":{"docs":{},"件":{"docs":{},"是":{"docs":{},"否":{"docs":{},"为":{"docs":{},"真":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"断":{"docs":{},"言":{"docs":{},"来":{"docs":{},"保":{"docs":{},"证":{"docs":{},"在":{"docs":{},"运":{"docs":{},"行":{"docs":{},"其":{"docs":{},"他":{"docs":{},"代":{"docs":{},"码":{"docs":{},"之":{"docs":{},"前":{"docs":{},",":{"docs":{},"某":{"docs":{},"些":{"docs":{},"重":{"docs":{},"要":{"docs":{},"的":{"docs":{},"条":{"docs":{},"件":{"docs":{},"已":{"docs":{},"经":{"docs":{},"被":{"docs":{},"满":{"docs":{},"足":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"条":{"docs":{},"件":{"docs":{},"判":{"docs":{},"断":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"代":{"docs":{},"码":{"docs":{},"运":{"docs":{},"行":{"docs":{},"会":{"docs":{},"继":{"docs":{},"续":{"docs":{},"进":{"docs":{},"行":{"docs":{},";":{"docs":{},"如":{"docs":{},"果":{"docs":{},"条":{"docs":{},"件":{"docs":{},"判":{"docs":{},"断":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},")":{"docs":{},",":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"将":{"docs":{},"会":{"docs":{},"被":{"docs":{},"执":{"docs":{},"行":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"转":{"docs":{},"到":{"docs":{},"第":{"3":{"docs":{},"步":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"为":{"docs":{},"假":{"docs":{},"(":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"和":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"都":{"docs":{},"不":{"docs":{},"会":{"docs":{},"被":{"docs":{},"执":{"docs":{},"行":{"docs":{},",":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"转":{"docs":{},"到":{"docs":{},"第":{"1":{"docs":{},"步":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"为":{"docs":{},"假":{"docs":{},"(":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}},"2":{"docs":{},"步":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"为":{"docs":{},"假":{"docs":{},"(":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.016597510373443983}}}}},"i":{"docs":{},"l":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.034210526315789476},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}},"e":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"a":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"e":{"docs":{},")":{"docs":{},"的":{"docs":{},"叶":{"docs":{},"子":{"docs":{},"节":{"docs":{},"点":{"docs":{},"传":{"docs":{},"向":{"docs":{},"根":{"docs":{},"节":{"docs":{},"点":{"docs":{},"。":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}},"y":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474}}}},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"d":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"l":{"docs":{},"i":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}},"p":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}},"e":{"docs":{},"-":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"e":{"docs":{},"-":{"docs":{},"b":{"docs":{},"o":{"docs":{},"d":{"docs":{},"i":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}},"y":{"docs":{},"[":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}},"e":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"i":{"docs":{},"p":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.005376344086021506}},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}}}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0071146245059288534},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},",":{"docs":{},"然":{"docs":{},"而":{"docs":{},"常":{"docs":{},"量":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"不":{"docs":{},"能":{"docs":{},"直":{"docs":{},"接":{"docs":{},"相":{"docs":{},"加":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"们":{"docs":{},"类":{"docs":{},"型":{"docs":{},"不":{"docs":{},"同":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},"要":{"docs":{},"调":{"docs":{},"用":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"(":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},")":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"数":{"docs":{},"字":{"docs":{},"并":{"docs":{},"用":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/04_Collection_Types.html#gitbook_26":{"ref":"chapter2/04_Collection_Types.html#gitbook_26","tf":5},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.47496156739606843},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.4521093413689195},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":3.3862977602108035},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":5.013452914798206},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":10.078947368421053},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152}},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.007473841554559043},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}},"s":{"docs":{},")":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/04_Collection_Types.html#gitbook_26":{"ref":"chapter2/04_Collection_Types.html#gitbook_26","tf":0.5}}}}}}}}}}}}}}}}}}},")":{"docs":{},"使":{"docs":{},"用":{"docs":{},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"作":{"docs":{},"为":{"docs":{},"参":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}}}}}},"嵌":{"docs":{},"套":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}},"—":{"docs":{},"—":{"docs":{},"比":{"docs":{},"如":{"docs":{},"表":{"docs":{},"示":{"docs":{},"数":{"docs":{},"字":{"docs":{},"、":{"docs":{},"字":{"docs":{},"符":{"docs":{},"和":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"—":{"docs":{},"—":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"就":{"docs":{},"是":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},"知":{"docs":{},"道":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"有":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"去":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"新":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"如":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"、":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},"外":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"浮":{"docs":{},"点":{"docs":{},"数":{"docs":{},"、":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"、":{"docs":{},"元":{"docs":{},"组":{"docs":{},"、":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"类":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"可":{"docs":{},"选":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"甚":{"docs":{},"至":{"docs":{},"是":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"类":{"docs":{},"型":{"docs":{},"中":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"值":{"docs":{},"和":{"docs":{},"指":{"docs":{},"定":{"docs":{},"的":{"docs":{},"范":{"docs":{},"围":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},")":{"docs":{},"等":{"docs":{},"。":{"docs":{},"关":{"docs":{},"于":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"些":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"待":{"docs":{},"添":{"docs":{},"加":{"docs":{},"链":{"docs":{},"接":{"docs":{},"一":{"docs":{},"章":{"docs":{},"的":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"声":{"docs":{},"明":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"时":{"docs":{},",":{"docs":{},"在":{"docs":{},"前":{"docs":{},"面":{"docs":{},"加":{"docs":{},"上":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"。":{"docs":{},",":{"docs":{},"即":{"docs":{},"使":{"docs":{},"是":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"本":{"docs":{},"是":{"docs":{},"没":{"docs":{},"有":{"docs":{},"定":{"docs":{},"义":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},",":{"docs":{},"你":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"f":{"docs":{},"语":{"docs":{},"句":{"docs":{},"来":{"docs":{},"检":{"docs":{},"查":{"docs":{},"是":{"docs":{},"否":{"docs":{},"能":{"docs":{},"成":{"docs":{},"功":{"docs":{},"调":{"docs":{},"用":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"方":{"docs":{},"法":{"docs":{},":":{"docs":{},"如":{"docs":{},"果":{"docs":{},"方":{"docs":{},"法":{"docs":{},"通":{"docs":{},"过":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"调":{"docs":{},"用":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"的":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"将":{"docs":{},"会":{"docs":{},"是":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"没":{"docs":{},"有":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"将":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"译":{"docs":{},"者":{"docs":{},"注":{"docs":{},":":{"docs":{},"指":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"中":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},")":{"docs":{},"的":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}}},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.014619883040935672}},"e":{"docs":{},"r":{"docs":{},"­":{"docs":{},":":{"docs":{},"­":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"-":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"-":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"-":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}},"=":{"docs":{},"=":{"docs":{},"­":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"-":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"e":{"docs":{},"­":{"docs":{},":":{"docs":{},"­":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"-":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"-":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"-":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}},"。":{"docs":{},"协":{"docs":{},"议":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"元":{"docs":{},"类":{"docs":{},"型":{"docs":{},"—":{"docs":{},"—":{"docs":{},"并":{"docs":{},"不":{"docs":{},"是":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"适":{"docs":{},"配":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"具":{"docs":{},"体":{"docs":{},"类":{"docs":{},"型":{"docs":{},"—":{"docs":{},"—":{"docs":{},"是":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},"名":{"docs":{},"字":{"docs":{},"紧":{"docs":{},"跟":{"docs":{},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"类":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"元":{"docs":{},"类":{"docs":{},"型":{"docs":{},"就":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},".":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},",":{"docs":{},"协":{"docs":{},"议":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"的":{"docs":{},"元":{"docs":{},"类":{"docs":{},"型":{"docs":{},"就":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.024553571428571428}},">":{"1":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}},"*":{"docs":{},"<":{"docs":{},"/":{"docs":{},"t":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}}}}},"2":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"3":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"4":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"5":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"6":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"7":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"8":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"9":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"docs":{}}},")":{"docs":{},"是":{"docs":{},"用":{"docs":{},"尖":{"docs":{},"括":{"docs":{},"号":{"docs":{},"括":{"docs":{},"起":{"docs":{},"来":{"docs":{},"的":{"docs":{},"(":{"docs":{},"<":{"docs":{},"t":{"docs":{},">":{"docs":{},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"尖":{"docs":{},"括":{"docs":{},"号":{"docs":{},"告":{"docs":{},"诉":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"那":{"docs":{},"个":{"docs":{},"t":{"docs":{},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"所":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"节":{"docs":{},"点":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"t":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"节":{"docs":{},"点":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"不":{"docs":{},"会":{"docs":{},"去":{"docs":{},"查":{"docs":{},"找":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"命":{"docs":{},"名":{"docs":{},"为":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"分":{"docs":{},"别":{"docs":{},"代":{"docs":{},"表":{"docs":{},"t":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"“":{"docs":{},"某":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},"”":{"docs":{},"的":{"docs":{},"节":{"docs":{},"点":{"docs":{},"提":{"docs":{},"供":{"docs":{},"给":{"docs":{},"后":{"docs":{},"来":{"docs":{},"用":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"将":{"docs":{},"来":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"里":{"docs":{},"任":{"docs":{},"何":{"docs":{},"地":{"docs":{},"方":{"docs":{},"表":{"docs":{},"示":{"docs":{},"为":{"docs":{},"“":{"docs":{},"t":{"docs":{},"”":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},")":{"docs":{},"来":{"docs":{},"代":{"docs":{},"替":{"docs":{},"实":{"docs":{},"际":{"docs":{},"类":{"docs":{},"型":{"docs":{},"名":{"docs":{},"(":{"docs":{},"如":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"、":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"或":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},"。":{"docs":{},"节":{"docs":{},"点":{"docs":{},"类":{"docs":{},"型":{"docs":{},"名":{"docs":{},"并":{"docs":{},"不":{"docs":{},"是":{"docs":{},"表":{"docs":{},"示":{"docs":{},"t":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"其":{"docs":{},"规":{"docs":{},"定":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"同":{"docs":{},"一":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"t":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"管":{"docs":{},"t":{"docs":{},"表":{"docs":{},"示":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"只":{"docs":{},"有":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"在":{"docs":{},"每":{"docs":{},"次":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},"所":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"实":{"docs":{},"际":{"docs":{},"类":{"docs":{},"型":{"docs":{},"决":{"docs":{},"定":{"docs":{},"了":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"被":{"docs":{},"用":{"docs":{},"作":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"参":{"docs":{},"数":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"因":{"docs":{},"此":{"docs":{},"可":{"docs":{},"以":{"docs":{},"推":{"docs":{},"断":{"docs":{},"出":{"docs":{},"被":{"docs":{},"用":{"docs":{},"作":{"docs":{},"这":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"容":{"docs":{},"器":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"的":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"需":{"docs":{},"要":{"docs":{},"t":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"子":{"docs":{},"类":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"约":{"docs":{},"束":{"docs":{},";":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"u":{"docs":{},",":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"需":{"docs":{},"要":{"docs":{},"u":{"docs":{},"必":{"docs":{},"须":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"@":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.02197802197802198}}}}}}}}}}}},"u":{"docs":{},",":{"docs":{},"v":{"docs":{},",":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},",":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"u":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"同":{"docs":{},"时":{"docs":{},"要":{"docs":{},"求":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"等":{"docs":{},"同":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"这":{"docs":{},"样":{"docs":{},"来":{"docs":{},"表":{"docs":{},"达":{"docs":{},":":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"x":{"2":{"4":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"docs":{"chapter1/01_swift.html#gitbook_9":{"ref":"chapter1/01_swift.html#gitbook_9","tf":0.047619047619047616},"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.007168458781362007},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.019801980198019802},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.011160714285714286},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}},".":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}},"n":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.014064697609001406},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.078125},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.02391629297458894},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.011695906432748537},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286}},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"j":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}},"j":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018}},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}},"二":{"docs":{},"十":{"docs":{},"一":{"docs":{},"点":{"docs":{},")":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"模":{"docs":{},"拟":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"j":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"中":{"docs":{},"的":{"docs":{},"扑":{"docs":{},"克":{"docs":{},"牌":{"docs":{},"点":{"docs":{},"数":{"docs":{},"。":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"j":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"包":{"docs":{},"含":{"2":{"docs":{},"个":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"类":{"docs":{},"型":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"没":{"docs":{},"有":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},",":{"docs":{},"在":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"自":{"docs":{},"身":{"docs":{},"有":{"docs":{},"两":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"—":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"与":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{},",":{"docs":{},"也":{"docs":{},"同":{"docs":{},"样":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},",":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"属":{"docs":{},"性":{"docs":{},"用":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"和":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{},"的":{"docs":{},"中":{"docs":{},"内":{"docs":{},"容":{"docs":{},"来":{"docs":{},"构":{"docs":{},"建":{"docs":{},"对":{"docs":{},"这":{"docs":{},"张":{"docs":{},"扑":{"docs":{},"克":{"docs":{},"牌":{"docs":{},"名":{"docs":{},"字":{"docs":{},"和":{"docs":{},"数":{"docs":{},"值":{"docs":{},"的":{"docs":{},"描":{"docs":{},"述":{"docs":{},",":{"docs":{},"并":{"docs":{},"用":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"规":{"docs":{},"则":{"docs":{},"中":{"docs":{},",":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"牌":{"docs":{},"可":{"docs":{},"以":{"docs":{},"表":{"docs":{},"示":{"1":{"docs":{},"或":{"docs":{},"者":{"1":{"1":{"docs":{},",":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"牌":{"docs":{},"的":{"docs":{},"这":{"docs":{},"一":{"docs":{},"特":{"docs":{},"征":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"在":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"型":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"的":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.08333333333333333}}}}}},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.02631578947368421},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.007425742574257425},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"。":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},"是":{"docs":{},"指":{"docs":{},"逻":{"docs":{},"辑":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"们":{"docs":{},"只":{"docs":{},"能":{"docs":{},"是":{"docs":{},"真":{"docs":{},"或":{"docs":{},"者":{"docs":{},"假":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"地":{"docs":{},"方":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"非":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}},")":{"docs":{},"默":{"docs":{},"认":{"docs":{},"都":{"docs":{},"是":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"h":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}},"n":{"docs":{},"j":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.007168458781362007}}}}}}},"d":{"docs":{},"i":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"y":{"docs":{},")":{"docs":{},"中":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"指":{"docs":{},"向":{"docs":{},"这":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"本":{"docs":{},"身":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"某":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"来":{"docs":{},"说":{"docs":{},",":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"[":{"0":{"3":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"6":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}},"1":{"0":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"9":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}},"2":{"4":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}},"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"d":{"docs":{},"[":{"0":{"9":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}},"1":{"4":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}},"2":{"2":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}},"docs":{}}}}}},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.02074688796680498}},"e":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"新":{"docs":{},"类":{"docs":{},"是":{"docs":{},"在":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"的":{"docs":{},"基":{"docs":{},"础":{"docs":{},"上":{"docs":{},"创":{"docs":{},"建":{"docs":{},"起":{"docs":{},"来":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},"你":{"docs":{},"需":{"docs":{},"要":{"docs":{},"将":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"放":{"docs":{},"在":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"不":{"docs":{},"仅":{"docs":{},"可":{"docs":{},"以":{"docs":{},"继":{"docs":{},"承":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"还":{"docs":{},"可":{"docs":{},"以":{"docs":{},"继":{"docs":{},"承":{"docs":{},"它":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"你":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"调":{"docs":{},"用":{"docs":{},"它":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},",":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"是":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"超":{"docs":{},"类":{"docs":{},"。":{"docs":{},"新":{"docs":{},"的":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"自":{"docs":{},"动":{"docs":{},"获":{"docs":{},"得":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"的":{"docs":{},"特":{"docs":{},"性":{"docs":{},",":{"docs":{},"比":{"docs":{},"如":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"和":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"子":{"docs":{},"类":{"docs":{},"中":{"docs":{},"定":{"docs":{},"制":{"docs":{},"这":{"docs":{},"些":{"docs":{},"特":{"docs":{},"性":{"docs":{},",":{"docs":{},"或":{"docs":{},"添":{"docs":{},"加":{"docs":{},"新":{"docs":{},"的":{"docs":{},"特":{"docs":{},"性":{"docs":{},"来":{"docs":{},"更":{"docs":{},"好":{"docs":{},"地":{"docs":{},"描":{"docs":{},"述":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"子":{"docs":{},"类":{"docs":{},":":{"docs":{},"双":{"docs":{},"人":{"docs":{},"自":{"docs":{},"行":{"docs":{},"车":{"docs":{},"(":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"m":{"docs":{},")":{"docs":{},"。":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"m":{"docs":{},"从":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"继":{"docs":{},"承":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"而":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"是":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"从":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"继":{"docs":{},"承":{"docs":{},"而":{"docs":{},"来":{"docs":{},"的":{"docs":{},"。":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"m":{"docs":{},"并":{"docs":{},"不":{"docs":{},"修":{"docs":{},"改":{"docs":{},"轮":{"docs":{},"子":{"docs":{},"的":{"docs":{},"数":{"docs":{},"量":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"仍":{"docs":{},"是":{"docs":{},"一":{"docs":{},"辆":{"docs":{},"自":{"docs":{},"行":{"docs":{},"车":{"docs":{},",":{"docs":{},"有":{"2":{"docs":{},"个":{"docs":{},"轮":{"docs":{},"子":{"docs":{},"。":{"docs":{},"但":{"docs":{},"它":{"docs":{},"需":{"docs":{},"要":{"docs":{},"修":{"docs":{},"改":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"来":{"docs":{},"设":{"docs":{},"置":{"docs":{},"它":{"docs":{},"定":{"docs":{},"制":{"docs":{},"的":{"docs":{},"特":{"docs":{},"性":{"docs":{},"(":{"docs":{},"自":{"docs":{},"行":{"docs":{},"车":{"docs":{},"只":{"docs":{},"有":{"2":{"docs":{},"个":{"docs":{},"轮":{"docs":{},"子":{"docs":{},")":{"docs":{},"。":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"调":{"docs":{},"用":{"docs":{},"了":{"docs":{},"它":{"docs":{},"父":{"docs":{},"类":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{},",":{"docs":{},"以":{"docs":{},"此":{"docs":{},"确":{"docs":{},"保":{"docs":{},"在":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"试":{"docs":{},"图":{"docs":{},"修":{"docs":{},"改":{"docs":{},"那":{"docs":{},"些":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"前":{"docs":{},",":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"继":{"docs":{},"承":{"docs":{},"了":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"-":{"docs":{},"d":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.006696428571428571}}}}}}},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}},"a":{"docs":{},"l":{"docs":{},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286}}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"9":{"docs":{},"试":{"docs":{},"图":{"docs":{},"访":{"docs":{},"问":{"docs":{},"一":{"docs":{},"个":{"docs":{},"行":{"docs":{},"星":{"docs":{},"。":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}},"docs":{}}}}}}},"来":{"docs":{},"检":{"docs":{},"查":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}},")":{"docs":{},"到":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}},"自":{"docs":{},"动":{"docs":{},"拆":{"docs":{},"包":{"docs":{},"并":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"常":{"docs":{},"量":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.010526315789473684}},"s":{"docs":{},"(":{"docs":{},"s":{"1":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}},"docs":{}}}}}}}},"s":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842}}}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}},"e":{"docs":{},".":{"docs":{},"u":{"docs":{},"p":{"docs":{},"c":{"docs":{},"a":{"docs":{},"(":{"8":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}},"docs":{}},"和":{"docs":{},"其":{"docs":{},"整":{"docs":{},"数":{"docs":{},"值":{"docs":{},"被":{"docs":{},"新":{"docs":{},"的":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},".":{"docs":{},"q":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"和":{"docs":{},"其":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"值":{"docs":{},"所":{"docs":{},"替":{"docs":{},"代":{"docs":{},"。":{"docs":{},"条":{"docs":{},"形":{"docs":{},"码":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"和":{"docs":{},"变":{"docs":{},"量":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"一":{"docs":{},"个":{"docs":{},".":{"docs":{},"u":{"docs":{},"p":{"docs":{},"c":{"docs":{},"a":{"docs":{},"或":{"docs":{},"者":{"docs":{},"一":{"docs":{},"个":{"docs":{},".":{"docs":{},"q":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"u":{"docs":{},"p":{"docs":{},"c":{"docs":{},"a":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"关":{"docs":{},"联":{"docs":{},"值":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"q":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"k":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.04142011834319527}},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.01775147928994083}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"e":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"r":{"docs":{},"s":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.011834319526627219}}}}}}}}}}}}}}}}},"和":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{},"e":{"docs":{},"r":{"docs":{},"。":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"管":{"docs":{},"理":{"docs":{},"一":{"docs":{},"个":{"docs":{},"虚":{"docs":{},"拟":{"docs":{},"货":{"docs":{},"币":{"docs":{},"的":{"docs":{},"流":{"docs":{},"通":{"docs":{},",":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"流":{"docs":{},"通":{"docs":{},"中":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"永":{"docs":{},"远":{"docs":{},"不":{"docs":{},"可":{"docs":{},"能":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"超":{"docs":{},"过":{"1":{"0":{"docs":{},",":{"0":{"0":{"0":{"docs":{},"的":{"docs":{},"硬":{"docs":{},"币":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"中":{"docs":{},"有":{"docs":{},"且":{"docs":{},"只":{"docs":{},"能":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"存":{"docs":{},"在":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"根":{"docs":{},"据":{"docs":{},"它":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"属":{"docs":{},"性":{"docs":{},"来":{"docs":{},"跟":{"docs":{},"踪":{"docs":{},"当":{"docs":{},"前":{"docs":{},"它":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"的":{"docs":{},"硬":{"docs":{},"币":{"docs":{},"数":{"docs":{},"量":{"docs":{},"。":{"docs":{},"银":{"docs":{},"行":{"docs":{},"还":{"docs":{},"提":{"docs":{},"供":{"docs":{},"两":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"—":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"和":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"e":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794}}},"i":{"docs":{},"c":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"-":{"docs":{},"t":{"docs":{},"o":{"docs":{},"k":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.07692307692307693}},"s":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.054945054945054944}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.01440922190201729}},"、":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"、":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"、":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"、":{"docs":{},"d":{"docs":{},"o":{"docs":{},"、":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"、":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"、":{"docs":{},"i":{"docs":{},"f":{"docs":{},"、":{"docs":{},"i":{"docs":{},"n":{"docs":{},"、":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"、":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"、":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"、":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"、":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}},"时":{"docs":{},",":{"docs":{},"则":{"docs":{},"会":{"docs":{},"终":{"docs":{},"止":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"或":{"docs":{},"上":{"docs":{},"下":{"docs":{},"文":{"docs":{},"中":{"docs":{},"包":{"docs":{},"含":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"用":{"docs":{},"于":{"docs":{},"终":{"docs":{},"止":{"docs":{},"上":{"docs":{},"下":{"docs":{},"文":{"docs":{},"中":{"docs":{},"包":{"docs":{},"含":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"、":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"、":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"和":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"后":{"docs":{},"面":{"docs":{},"带":{"docs":{},"标":{"docs":{},"签":{"docs":{},"名":{"docs":{},"时":{"docs":{},",":{"docs":{},"可":{"docs":{},"用":{"docs":{},"于":{"docs":{},"终":{"docs":{},"止":{"docs":{},"由":{"docs":{},"这":{"docs":{},"个":{"docs":{},"标":{"docs":{},"签":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"循":{"docs":{},"环":{"docs":{},"或":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"可":{"docs":{},"以":{"docs":{},"改":{"docs":{},"变":{"docs":{},"循":{"docs":{},"环":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"。":{"docs":{},"有":{"docs":{},"关":{"docs":{},"这":{"docs":{},"两":{"docs":{},"条":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"于":{"docs":{},"终":{"docs":{},"止":{"docs":{},"循":{"docs":{},"环":{"docs":{},"或":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"执":{"docs":{},"行":{"docs":{},"。":{"docs":{},"使":{"docs":{},"用":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"时":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"只":{"docs":{},"写":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"这":{"docs":{},"个":{"docs":{},"关":{"docs":{},"键":{"docs":{},"词":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"后":{"docs":{},"面":{"docs":{},"跟":{"docs":{},"上":{"docs":{},"标":{"docs":{},"签":{"docs":{},"名":{"docs":{},"(":{"docs":{},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"待":{"docs":{},"添":{"docs":{},"加":{"docs":{},"链":{"docs":{},"接":{"docs":{},"一":{"docs":{},"章":{"docs":{},"的":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}}}}}}},"e":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.03636363636363636}},"h":{"docs":{},"a":{"docs":{},"v":{"docs":{},"i":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.43725785622040464},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}},"t":{"docs":{},"o":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"l":{"docs":{},"i":{"docs":{},"e":{"docs":{},"v":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"o":{"docs":{},"w":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0047430830039525695}}}}}},">":{"docs":{},"提":{"docs":{},"示":{"docs":{},"<":{"docs":{},"/":{"docs":{},"b":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099}}}}}}}},"u":{"docs":{},"g":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.013245033112582781}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.009933774834437087}},"e":{"docs":{},"r":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},",":{"docs":{},"不":{"docs":{},"是":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.009933774834437087}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.009933774834437087}},"e":{"docs":{},"r":{"docs":{},"作":{"docs":{},"为":{"docs":{},"地":{"docs":{},"址":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},",":{"docs":{},"是":{"docs":{},"定":{"docs":{},"义":{"docs":{},"某":{"docs":{},"个":{"docs":{},"建":{"docs":{},"筑":{"docs":{},"物":{"docs":{},"的":{"docs":{},"两":{"docs":{},"种":{"docs":{},"方":{"docs":{},"式":{"docs":{},"。":{"docs":{},"第":{"docs":{},"三":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":5.010989010989011}},"特":{"docs":{},"性":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}},":":{"docs":{},"i":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},",":{"docs":{},"i":{"docs":{},"b":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"i":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"i":{"docs":{},"b":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"特":{"docs":{},"性":{"docs":{},"与":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"与":{"docs":{},"x":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"同":{"docs":{},"步":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},"特":{"docs":{},"性":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"以":{"docs":{},"下":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"1":{"2":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}},"6":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},".":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}},"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.011650485436893204},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"a":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}}},"v":{"docs":{},"e":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}},"n":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842}}}}}}}},"t":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.011928429423459244},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},".":{"docs":{},"t":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.011928429423459244}},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622}},"e":{"docs":{},"r":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"不":{"docs":{},"从":{"docs":{},"文":{"docs":{},"件":{"docs":{},"中":{"docs":{},"导":{"docs":{},"入":{"docs":{},"数":{"docs":{},"据":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"当":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"创":{"docs":{},"建":{"docs":{},"时":{"docs":{},",":{"docs":{},"就":{"docs":{},"没":{"docs":{},"有":{"docs":{},"必":{"docs":{},"要":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"同":{"docs":{},"时":{"docs":{},",":{"docs":{},"更":{"docs":{},"有":{"docs":{},"意":{"docs":{},"义":{"docs":{},"的":{"docs":{},"是":{"docs":{},"当":{"docs":{},"用":{"docs":{},"到":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"功":{"docs":{},"能":{"docs":{},"是":{"docs":{},"从":{"docs":{},"文":{"docs":{},"件":{"docs":{},"导":{"docs":{},"入":{"docs":{},"数":{"docs":{},"据":{"docs":{},",":{"docs":{},"该":{"docs":{},"功":{"docs":{},"能":{"docs":{},"由":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"空":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"虽":{"docs":{},"然":{"docs":{},"没":{"docs":{},"有":{"docs":{},"写":{"docs":{},"出":{"docs":{},"全":{"docs":{},"部":{"docs":{},"代":{"docs":{},"码":{"docs":{},",":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"能":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"后":{"docs":{},"边":{"docs":{},"加":{"docs":{},"上":{"docs":{},"了":{"docs":{},"?":{"docs":{},"标":{"docs":{},"记":{"docs":{},"来":{"docs":{},"表":{"docs":{},"明":{"docs":{},"只":{"docs":{},"在":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"非":{"docs":{},"空":{"docs":{},"时":{"docs":{},"才":{"docs":{},"去":{"docs":{},"调":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"存":{"docs":{},"在":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"也":{"docs":{},"无":{"docs":{},"法":{"docs":{},"保":{"docs":{},"证":{"docs":{},"其":{"docs":{},"是":{"docs":{},"否":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23677754881758414},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01107011070110701},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}},"-":{"docs":{},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0047430830039525695},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}},"i":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.011834319526627219},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.01818181818181818}},"来":{"docs":{},"标":{"docs":{},"示":{"docs":{},"析":{"docs":{},"构":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"类":{"docs":{},"似":{"docs":{},"于":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"函":{"docs":{},"数":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.030303030303030304}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.012448132780082987},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}},"b":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}},"c":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.008620689655172414}}}}},"-":{"docs":{},"d":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.015625}}}}}}},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286}},"a":{"docs":{},"l":{"docs":{},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}},"p":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622}}}}},"l":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.009900990099009901}}},"x":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506}}}}},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}},"不":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}},"属":{"docs":{},"性":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.015625}}}},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}},"i":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}}},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"<":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}},"的":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"上":{"docs":{},",":{"docs":{},"当":{"docs":{},"然":{"docs":{},"其":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"(":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"协":{"docs":{},"议":{"docs":{},")":{"docs":{},"。":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"基":{"docs":{},"本":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"如":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"特":{"docs":{},"化":{"docs":{},"版":{"docs":{},"本":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}},"e":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.017899761336515514}},"(":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}}}}}},".":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00954653937947494}},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375}}}}}}},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}},"e":{"docs":{},"r":{"docs":{},",":{"docs":{},"实":{"docs":{},"现":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}},"协":{"docs":{},"议":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"任":{"docs":{},"何":{"docs":{},"包":{"docs":{},"含":{"docs":{},"骰":{"docs":{},"子":{"docs":{},"的":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"采":{"docs":{},"纳":{"docs":{},".":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"追":{"docs":{},"踪":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.007159904534606206}},"l":{"docs":{},":":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}},"也":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},"用":{"docs":{},"来":{"docs":{},"设":{"docs":{},"置":{"docs":{},"它":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"状":{"docs":{},"态":{"docs":{},".":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"中":{"docs":{},"含":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"的":{"docs":{},"形":{"docs":{},"参":{"docs":{},".":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"此":{"docs":{},"传":{"docs":{},"入":{"docs":{},"任":{"docs":{},"意":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}},"拥":{"docs":{},"有":{"docs":{},"名":{"docs":{},"为":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"和":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}},"的":{"docs":{},"类":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"代":{"docs":{},"表":{"docs":{},"桌":{"docs":{},"游":{"docs":{},"中":{"docs":{},"的":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"现":{"docs":{},"在":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"视":{"docs":{},"为":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"现":{"docs":{},"并":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162}},"属":{"docs":{},"性":{"docs":{},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"将":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"会":{"docs":{},"将":{"docs":{},"旧":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"作":{"docs":{},"为":{"docs":{},"参":{"docs":{},"数":{"docs":{},"传":{"docs":{},"入":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"为":{"docs":{},"该":{"docs":{},"参":{"docs":{},"数":{"docs":{},"命":{"docs":{},"名":{"docs":{},"或":{"docs":{},"者":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"s":{"docs":{},"的":{"docs":{},"值":{"docs":{},"改":{"docs":{},"变":{"docs":{},"后":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"它":{"docs":{},"把":{"docs":{},"新":{"docs":{},"的":{"docs":{},"值":{"docs":{},"和":{"docs":{},"旧":{"docs":{},"的":{"docs":{},"值":{"docs":{},"进":{"docs":{},"行":{"docs":{},"对":{"docs":{},"比":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"总":{"docs":{},"的":{"docs":{},"步":{"docs":{},"数":{"docs":{},"增":{"docs":{},"加":{"docs":{},"了":{"docs":{},",":{"docs":{},"就":{"docs":{},"输":{"docs":{},"出":{"docs":{},"一":{"docs":{},"个":{"docs":{},"消":{"docs":{},"息":{"docs":{},"表":{"docs":{},"示":{"docs":{},"增":{"docs":{},"加":{"docs":{},"了":{"docs":{},"多":{"docs":{},"少":{"docs":{},"步":{"docs":{},"。":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"没":{"docs":{},"有":{"docs":{},"提":{"docs":{},"供":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.013157894736842105}},"e":{"docs":{},"s":{"docs":{},"[":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421}}}}}}}}}}}}}}},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.010276679841897233}},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01845018450184502}},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"当":{"docs":{},"它":{"docs":{},"等":{"docs":{},"于":{"docs":{},".":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"打":{"docs":{},"印":{"docs":{},"“":{"docs":{},"l":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"推":{"docs":{},"断":{"docs":{},"当":{"docs":{},"它":{"docs":{},"被":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"能":{"docs":{},"值":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"。":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"更":{"docs":{},"短":{"docs":{},"的":{"docs":{},"点":{"docs":{},"(":{"docs":{},".":{"docs":{},")":{"docs":{},"语":{"docs":{},"法":{"docs":{},"将":{"docs":{},"其":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"o":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.011067193675889328}}}}}}}},"f":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474}}}}}},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"v":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}},"o":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.012925969447708578},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.012448132780082987},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.008960573476702509},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.012376237623762377},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.012648221343873518},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.017241379310344827},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.010739856801909307},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.008771929824561403},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"写":{"docs":{},"一":{"docs":{},"个":{"docs":{},"扩":{"docs":{},"展":{"docs":{},",":{"docs":{},"添":{"docs":{},"加":{"docs":{},"a":{"docs":{},"b":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"或":{"docs":{},"者":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}},"精":{"docs":{},"确":{"docs":{},"度":{"docs":{},"很":{"docs":{},"高":{"docs":{},",":{"docs":{},"至":{"docs":{},"少":{"docs":{},"有":{"1":{"5":{"docs":{},"位":{"docs":{},"数":{"docs":{},"字":{"docs":{},",":{"docs":{},"而":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"最":{"docs":{},"少":{"docs":{},"只":{"docs":{},"有":{"6":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"docs":{}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}},"表":{"docs":{},"示":{"6":{"4":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"docs":{}},"docs":{}}},"型":{"docs":{},"的":{"docs":{},"值":{"1":{"docs":{},".":{"0":{"docs":{},"被":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"“":{"1":{"docs":{},"米":{"docs":{},"”":{"docs":{},"。":{"docs":{},"这":{"docs":{},"就":{"docs":{},"是":{"docs":{},"为":{"docs":{},"什":{"docs":{},"么":{"docs":{},"m":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"—":{"docs":{},"—":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"1":{"docs":{},".":{"docs":{},"m":{"docs":{},"被":{"docs":{},"认":{"docs":{},"为":{"docs":{},"是":{"docs":{},"计":{"docs":{},"算":{"1":{"docs":{},".":{"0":{"docs":{},"的":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}},"docs":{}}},"docs":{}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}},"docs":{}}},"docs":{},"看":{"docs":{},"作":{"docs":{},"是":{"docs":{},"某":{"docs":{},"单":{"docs":{},"位":{"docs":{},"下":{"docs":{},"的":{"docs":{},"长":{"docs":{},"度":{"docs":{},"值":{"docs":{},"。":{"docs":{},"即":{"docs":{},"使":{"docs":{},"它":{"docs":{},"们":{"docs":{},"被":{"docs":{},"实":{"docs":{},"现":{"docs":{},"为":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"但":{"docs":{},"这":{"docs":{},"些":{"docs":{},"属":{"docs":{},"性":{"docs":{},"仍":{"docs":{},"可":{"docs":{},"以":{"docs":{},"接":{"docs":{},"一":{"docs":{},"个":{"docs":{},"带":{"docs":{},"有":{"docs":{},"d":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}}}},")":{"docs":{},"。":{"docs":{},"在":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"a":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"指":{"docs":{},"定":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"表":{"docs":{},"示":{"6":{"4":{"docs":{},"位":{"docs":{},"浮":{"docs":{},"点":{"docs":{},"数":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.011650485436893204},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"c":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}}}}}}}}}}},"t":{"docs":{},"f":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}},"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}},"docs":{}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}},"、":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},"(":{"docs":{},".":{"docs":{},")":{"docs":{},"语":{"docs":{},"法":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"在":{"docs":{},"其":{"docs":{},"它":{"docs":{},"模":{"docs":{},"块":{"docs":{},"(":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"或":{"docs":{},"其":{"docs":{},"它":{"docs":{},"类":{"docs":{},"型":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"内":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"下":{"docs":{},"面":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"引":{"docs":{},"用":{"docs":{},"在":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},"模":{"docs":{},"块":{"docs":{},"中":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"m":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"'":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"’":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"w":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.016600790513833993}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"和":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.8333333333333333}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"s":{"docs":{},"n":{"docs":{},"'":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}},"o":{"docs":{},"t":{"docs":{},"n":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"o":{"docs":{},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":1.1255203330131285}},"e":{"docs":{},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}},"c":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}}}},"e":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.008928571428571428}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}}},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.005875440658049354},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.025830258302583026},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},"e":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}}}}}}}}}}}}}}},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}},"a":{"docs":{},"p":{"docs":{},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.011160714285714286}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}}}},".":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},";":{"docs":{},"和":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}},"表":{"docs":{},"示":{"docs":{},"t":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"t":{"docs":{},"的":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},".":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"e":{"docs":{},"a":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"(":{"docs":{},"t":{"docs":{},"有":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"因":{"docs":{},"为":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"而":{"docs":{},"t":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},">":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"安":{"docs":{},"全":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"在":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"函":{"docs":{},"数":{"docs":{},"中":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"其":{"docs":{},"保":{"docs":{},"证":{"docs":{},"支":{"docs":{},"持":{"docs":{},"等":{"docs":{},"式":{"docs":{},"操":{"docs":{},"作":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"说":{"docs":{},"明":{"docs":{},"这":{"docs":{},"个":{"docs":{},"事":{"docs":{},"实":{"docs":{},",":{"docs":{},"当":{"docs":{},"你":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"时":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"写":{"docs":{},"一":{"docs":{},"个":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"“":{"docs":{},"任":{"docs":{},"何":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}},"i":{"docs":{},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"a":{"docs":{},"l":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"(":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}},"n":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.008695652173913044},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.005875440658049354}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"m":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"l":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}},"r":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}},",":{"docs":{},"那":{"docs":{},"这":{"docs":{},"个":{"docs":{},"数":{"docs":{},"相":{"docs":{},"当":{"docs":{},"于":{"docs":{},"基":{"docs":{},"数":{"docs":{},"和":{"1":{"0":{"docs":{},"^":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"docs":{}},"2":{"docs":{},"^":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}},"docs":{}}}}}}}}}}}},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.0345821325648415}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},"。":{"docs":{},"起":{"docs":{},"保":{"docs":{},"护":{"docs":{},"作":{"docs":{},"用":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"是":{"docs":{},"这":{"docs":{},"样":{"docs":{},"构":{"docs":{},"成":{"docs":{},"的":{"docs":{},":":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"后":{"docs":{},"面":{"docs":{},"跟":{"docs":{},"着":{"docs":{},"一":{"docs":{},"个":{"docs":{},"作":{"docs":{},"为":{"docs":{},"额":{"docs":{},"外":{"docs":{},"测":{"docs":{},"试":{"docs":{},"条":{"docs":{},"件":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"当":{"docs":{},"且":{"docs":{},"仅":{"docs":{},"当":{"docs":{},"控":{"docs":{},"制":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"的":{"docs":{},"某":{"docs":{},"个":{"docs":{},"模":{"docs":{},"式":{"docs":{},"且":{"docs":{},"起":{"docs":{},"保":{"docs":{},"护":{"docs":{},"作":{"docs":{},"用":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"为":{"docs":{},"真":{"docs":{},"时":{"docs":{},",":{"docs":{},"对":{"docs":{},"应":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"中":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"才":{"docs":{},"会":{"docs":{},"被":{"docs":{},"执":{"docs":{},"行":{"docs":{},"。":{"docs":{},"在":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"控":{"docs":{},"制":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"只":{"docs":{},"会":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"含":{"docs":{},"两":{"docs":{},"个":{"docs":{},"相":{"docs":{},"等":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},",":{"docs":{},"如":{"docs":{},"(":{"1":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"会":{"docs":{},"首":{"docs":{},"先":{"docs":{},"被":{"docs":{},"计":{"docs":{},"算":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"与":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"的":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},")":{"docs":{},"进":{"docs":{},"行":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"程":{"docs":{},"序":{"docs":{},"将":{"docs":{},"会":{"docs":{},"执":{"docs":{},"行":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"里":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"。":{"docs":{},"另":{"docs":{},"外":{"docs":{},",":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"都":{"docs":{},"不":{"docs":{},"能":{"docs":{},"为":{"docs":{},"空":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},"在":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"中":{"docs":{},"至":{"docs":{},"少":{"docs":{},"有":{"docs":{},"一":{"docs":{},"条":{"docs":{},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"不":{"docs":{},"想":{"docs":{},"在":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"中":{"docs":{},"执":{"docs":{},"行":{"docs":{},"代":{"docs":{},"码":{"docs":{},",":{"docs":{},"只":{"docs":{},"需":{"docs":{},"在":{"docs":{},"块":{"docs":{},"里":{"docs":{},"写":{"docs":{},"一":{"docs":{},"条":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":10.031609195402298},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":10.007159904534607},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"]":{"docs":{},"[":{"6":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"7":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"docs":{}}}}}}}},"r":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23677754881758414},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.8769909599655618}}}}}},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"e":{"docs":{},"c":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.01440922190201729}}}}}}},"w":{"docs":{},"w":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"a":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842}}}},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.014760147601476014}},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}}}}}}}},"s":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01107011070110701}}}},"c":{"docs":{},"h":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.008695652173913044},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}}}}},"l":{"docs":{},"v":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"-":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}}},"语":{"docs":{},"句":{"docs":{},"也":{"docs":{},"可":{"docs":{},"包":{"docs":{},"含":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}},",":{"docs":{},"当":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}}}}}},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}}},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"e":{"docs":{},"d":{"docs":{},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286}}}}}}}}}}}}}}}}},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.011650485436893204},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"e":{"docs":{},"t":{"docs":{},"g":{"docs":{},"a":{"docs":{},"s":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}},"s":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.008298755186721992}}}}}}},"(":{"docs":{},"或":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"值":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}},"没":{"docs":{},"有":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.16666666666666666}}}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.125}},"e":{"docs":{},"r":{"docs":{},"-":{"docs":{},"b":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.125}}}}}}}},"方":{"docs":{},"法":{"docs":{},"​":{"docs":{},"​":{"docs":{},"块":{"docs":{},"可":{"docs":{},"以":{"docs":{},"由":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"后":{"docs":{},"跟":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"构":{"docs":{},"成":{"docs":{},",":{"docs":{},"用":{"docs":{},"大":{"docs":{},"括":{"docs":{},"号":{"docs":{},"括":{"docs":{},"起":{"docs":{},"来":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"由":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"后":{"docs":{},"跟":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.041666666666666664}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"但":{"docs":{},"它":{"docs":{},"并":{"docs":{},"不":{"docs":{},"要":{"docs":{},"求":{"docs":{},"属":{"docs":{},"性":{"docs":{},"是":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}},"时":{"docs":{},",":{"docs":{},"即":{"docs":{},"使":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"它":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"中":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"写":{"docs":{},"在":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"表":{"docs":{},"示":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"是":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"型":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"于":{"docs":{},"所":{"docs":{},"有":{"docs":{},"接":{"docs":{},"受":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.02074688796680498}}}},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.008353221957040573},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.06060606060606061}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},".":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"c":{"docs":{},"-":{"docs":{},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},"e":{"docs":{},"[":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"]":{"docs":{},".":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"-":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}},"­":{"docs":{},",":{"docs":{},"­":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"-":{"docs":{},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.030303030303030304}},"e":{"docs":{},"r":{"docs":{},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}},"­":{"docs":{},",":{"docs":{},"­":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"-":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"-":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}},"b":{"docs":{},"y":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.008620689655172414}}}}}},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}},"(":{"docs":{},"\"":{"docs":{},"b":{"docs":{},"o":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"结":{"docs":{},"束":{"docs":{},"它":{"docs":{},"的":{"docs":{},"执":{"docs":{},"行":{"docs":{},"并":{"docs":{},"返":{"docs":{},"回":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}},"i":{"docs":{},"d":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.016483516483516484}},"[":{"docs":{},"(":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_51":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_51","tf":0.08333333333333333},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.015151515151515152},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.043227665706051875}}}}}}}},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.012658227848101266},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.021052631578947368},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.10989010989010989},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.02631578947368421},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.011160714285714286},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},";":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}},"g":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.023668639053254437},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.014319809069212411}},"(":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}},",":{"docs":{},"d":{"1":{"2":{"docs":{},",":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"h":{"docs":{},"a":{"docs":{},"m":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"-":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}},"中":{"docs":{},",":{"docs":{},"当":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"是":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"k":{"docs":{},"e":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}},"使":{"docs":{},"用":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"参":{"docs":{},"数":{"docs":{},"来":{"docs":{},"打":{"docs":{},"印":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"的":{"docs":{},"一":{"docs":{},"些":{"docs":{},"介":{"docs":{},"绍":{"docs":{},"信":{"docs":{},"息":{"docs":{},".":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"只":{"docs":{},"能":{"docs":{},"访":{"docs":{},"问":{"docs":{},"和":{"docs":{},"使":{"docs":{},"用":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}}}}}},"是":{"docs":{},"被":{"docs":{},"视":{"docs":{},"为":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},"它":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"方":{"docs":{},"法":{"docs":{},"可":{"docs":{},"以":{"docs":{},"访":{"docs":{},"问":{"docs":{},"和":{"docs":{},"打":{"docs":{},"印":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"的":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"b":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}}}}}},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"u":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},",":{"docs":{},"即":{"docs":{},"便":{"docs":{},"你":{"docs":{},"没":{"docs":{},"有":{"docs":{},"实":{"docs":{},"现":{"docs":{},"它":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},":":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"的":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"是":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"集":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"数":{"docs":{},"组":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"数":{"docs":{},"组":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"甚":{"docs":{},"至":{"docs":{},"于":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"任":{"docs":{},"何":{"docs":{},"其":{"docs":{},"他":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"数":{"docs":{},"据":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},",":{"docs":{},"你":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"创":{"docs":{},"建":{"docs":{},"存":{"docs":{},"储":{"docs":{},"任":{"docs":{},"何":{"docs":{},"指":{"docs":{},"定":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"字":{"docs":{},"典":{"docs":{},"(":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.008645533141210375}}}}}}},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}}}}}}}}}}}}}}},"j":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018}}}}},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.04040404040404041},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}},"!":{"docs":{},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}}}}}}},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}},"变":{"docs":{},"量":{"docs":{},"被":{"docs":{},"设":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"后":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}},",":{"docs":{},"并":{"docs":{},"分":{"docs":{},"别":{"docs":{},"被":{"docs":{},"设":{"docs":{},"定":{"docs":{},"为":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"都":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"后":{"docs":{},",":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}},"docs":{}},"docs":{}}}}}}}},"现":{"docs":{},"在":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"向":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"而":{"docs":{},"变":{"docs":{},"量":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"向":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"保":{"docs":{},"存":{"docs":{},"某":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"客":{"docs":{},"户":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"由":{"docs":{},"于":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"变":{"docs":{},"量":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"里":{"docs":{},"的":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"这":{"docs":{},"里":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"两":{"docs":{},"层":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"来":{"docs":{},"联":{"docs":{},"系":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"和":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"'":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.013245033112582781}}},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.013245033112582781}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"!":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}},"?":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"?":{"docs":{},".":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},")":{"docs":{},"?":{"docs":{},".":{"docs":{},"u":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.009933774834437087}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}},"[":{"0":{"docs":{},"]":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391}}}}}}}},"docs":{}}},"不":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"时":{"docs":{},",":{"docs":{},"会":{"docs":{},"运":{"docs":{},"行":{"docs":{},"通":{"docs":{},"过":{"docs":{},",":{"docs":{},"且":{"docs":{},"会":{"docs":{},"将":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"值":{"docs":{},"现":{"docs":{},"在":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"然":{"docs":{},"而":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"现":{"docs":{},"在":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"?":{"docs":{},".":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"后":{"docs":{},"面":{"docs":{},",":{"docs":{},"在":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"括":{"docs":{},"号":{"docs":{},"的":{"docs":{},"前":{"docs":{},"面":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391}},".":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391}},"e":{"docs":{},".":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.013245033112582781}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.011834319526627219}},"(":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}},"s":{"1":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}},"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.007032348804500703}}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.014064697609001406}},"的":{"docs":{},"值":{"docs":{},"没":{"docs":{},"有":{"docs":{},"被":{"docs":{},"指":{"docs":{},"定":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"会":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"(":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}},"中":{"docs":{},",":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"的":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"和":{"docs":{},"s":{"1":{"docs":{},"的":{"docs":{},"局":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},",":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"t":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"的":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"和":{"docs":{},"s":{"2":{"docs":{},"的":{"docs":{},"局":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},",":{"docs":{},"第":{"docs":{},"三":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"和":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"版":{"docs":{},"本":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"版":{"docs":{},"本":{"docs":{},"中":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"为":{"docs":{},"它":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"提":{"docs":{},"供":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}},"n":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}}}}}}}}}}}},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}}}}}},"k":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"a":{"docs":{},"y":{"docs":{},"l":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}},"n":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}},"e":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842}}},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.014367816091954023}}},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018}}}},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}},"o":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"s":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.011160714285714286}}}}}}}}}}}}}}}}}}},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}},"u":{"docs":{},"b":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}}}},"m":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.005875440658049354},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}},"k":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.018421052631578946}},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.007894736842105263}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}},"x":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.02074688796680498}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"u":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}}}}}}}}}}}},"i":{"docs":{},"m":{"docs":{},"u":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}},"s":{"docs":{},"或":{"docs":{},"者":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},")":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"定":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"(":{"docs":{},"比":{"docs":{},"如":{"docs":{},"数":{"docs":{},"字":{"1":{"0":{"docs":{},"或":{"docs":{},"者":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"新":{"docs":{},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"并":{"docs":{},"给":{"docs":{},"它":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"1":{"0":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},",":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"字":{"docs":{},"是":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"并":{"docs":{},"将":{"docs":{},"它":{"docs":{},"的":{"docs":{},"值":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"0":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}},"s":{"docs":{},",":{"docs":{},"它":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"所":{"docs":{},"有":{"docs":{},"a":{"docs":{},"u":{"docs":{},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}}},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.011650485436893204}}}}}},"a":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081}}}}}}}}}}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"t":{"docs":{},"h":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"2":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}},"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"‘":{"docs":{},"一":{"docs":{},"个":{"docs":{},"有":{"docs":{},"两":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"型":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"并":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"’":{"docs":{},",":{"docs":{},"并":{"docs":{},"让":{"docs":{},"这":{"docs":{},"个":{"docs":{},"新":{"docs":{},"变":{"docs":{},"量":{"docs":{},"指":{"docs":{},"向":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.016483516483516484}},"(":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}},"[":{"0":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"1":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"2":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"docs":{}},"下":{"docs":{},"标":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"同":{"docs":{},"时":{"docs":{},"调":{"docs":{},"用":{"docs":{},"了":{"docs":{},"下":{"docs":{},"标":{"docs":{},"入":{"docs":{},"参":{"docs":{},"的":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"是":{"docs":{},"否":{"docs":{},"有":{"docs":{},"效":{"docs":{},"的":{"docs":{},"判":{"docs":{},"断":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"方":{"docs":{},"便":{"docs":{},"进":{"docs":{},"行":{"docs":{},"断":{"docs":{},"言":{"docs":{},",":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"i":{"docs":{},"s":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"确":{"docs":{},"认":{"docs":{},"入":{"docs":{},"参":{"docs":{},"的":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"或":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"在":{"docs":{},"阅":{"docs":{},"读":{"docs":{},"顺":{"docs":{},"序":{"docs":{},"从":{"docs":{},"左":{"docs":{},"上":{"docs":{},"到":{"docs":{},"右":{"docs":{},"下":{"docs":{},"的":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{},"实":{"docs":{},"例":{"docs":{},"中":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"实":{"docs":{},"例":{"docs":{},"g":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"两":{"docs":{},"个":{"docs":{},"入":{"docs":{},"参":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"入":{"docs":{},"参":{"docs":{},"分":{"docs":{},"别":{"docs":{},"是":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"s":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"s":{"docs":{},",":{"docs":{},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"足":{"docs":{},"够":{"docs":{},"容":{"docs":{},"纳":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"右":{"docs":{},"上":{"docs":{},"值":{"docs":{},"为":{"1":{"docs":{},".":{"5":{"docs":{},",":{"docs":{},"坐":{"docs":{},"下":{"docs":{},"值":{"docs":{},"为":{"3":{"docs":{},".":{"2":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}},"docs":{}}},"docs":{}}}}}}},"docs":{}}},"docs":{}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},",":{"docs":{},"将":{"docs":{},"呈":{"docs":{},"现":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"二":{"docs":{},"维":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"h":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235}},")":{"docs":{},"”":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"“":{"docs":{},"最":{"docs":{},"大":{"docs":{},"适":{"docs":{},"合":{"docs":{},"”":{"docs":{},"(":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.018421052631578946}}},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609}}}}}}}},"d":{"docs":{},"e":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.005747126436781609},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}},"e":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.4620103314679294},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}},")":{"docs":{},",":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}},"类":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}},"s":{"docs":{},")":{"docs":{},",":{"docs":{},"用":{"docs":{},"于":{"docs":{},"提":{"docs":{},"供":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"所":{"docs":{},"代":{"docs":{},"表":{"docs":{},"的":{"docs":{},"值":{"docs":{},"相":{"docs":{},"关":{"docs":{},"联":{"docs":{},"的":{"docs":{},"功":{"docs":{},"能":{"docs":{},"。":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"定":{"docs":{},"义":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"来":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"成":{"docs":{},"员":{"docs":{},"值":{"docs":{},";":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"原":{"docs":{},"始":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"基":{"docs":{},"础":{"docs":{},"上":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"功":{"docs":{},"能":{"docs":{},";":{"docs":{},"可":{"docs":{},"以":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"协":{"docs":{},"议":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.43478260869565216}}}}}}}}}}},"。":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"中":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"为":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"类":{"docs":{},"、":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"定":{"docs":{},"义":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},":":{"docs":{},"e":{"docs":{},"a":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"修":{"docs":{},"改":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"(":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.43478260869565216}}}}}}}}}}}}}}}}},"在":{"docs":{},"变":{"docs":{},"异":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"给":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"(":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.43478260869565216}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.43478260869565216}}}}}}}}}}},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"局":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"和":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"(":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.43478260869565216}}}}}}}}}}}}}}}}}}}}}}},"]":{"docs":{},"[":{"1":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}}}},")":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},",":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"用":{"docs":{},"来":{"docs":{},"移":{"docs":{},"动":{"docs":{},"一":{"docs":{},"个":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"。":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"方":{"docs":{},"法":{"docs":{},"在":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},"修":{"docs":{},"改":{"docs":{},"了":{"docs":{},"这":{"docs":{},"个":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"。":{"docs":{},"方":{"docs":{},"法":{"docs":{},"定":{"docs":{},"义":{"docs":{},"是":{"docs":{},"加":{"docs":{},"上":{"docs":{},"那":{"docs":{},"个":{"docs":{},"了":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.43478260869565216}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.017241379310344827}}}},"a":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}},"e":{"docs":{},"-":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"o":{"docs":{},"f":{"docs":{},"l":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}}}}}}}},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.010752688172043012},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}},"r":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}}}}}},"d":{"docs":{},"i":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.020553359683794466}},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"能":{"docs":{},"够":{"docs":{},"使":{"docs":{},"用":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}},"因":{"docs":{},"为":{"docs":{},"不":{"docs":{},"确":{"docs":{},"定":{"docs":{},",":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.449634093844167},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0059665871121718375},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.016442451420029897}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"方":{"docs":{},"法":{"docs":{},"可":{"docs":{},"以":{"docs":{},"从":{"docs":{},"内":{"docs":{},"部":{"docs":{},"变":{"docs":{},"异":{"docs":{},"它":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},";":{"docs":{},"并":{"docs":{},"且":{"docs":{},"它":{"docs":{},"做":{"docs":{},"的":{"docs":{},"任":{"docs":{},"何":{"docs":{},"改":{"docs":{},"变":{"docs":{},"在":{"docs":{},"方":{"docs":{},"法":{"docs":{},"结":{"docs":{},"束":{"docs":{},"时":{"docs":{},"都":{"docs":{},"会":{"docs":{},"回":{"docs":{},"写":{"docs":{},"到":{"docs":{},"原":{"docs":{},"始":{"docs":{},"结":{"docs":{},"构":{"docs":{},"。":{"docs":{},"方":{"docs":{},"法":{"docs":{},"会":{"docs":{},"给":{"docs":{},"它":{"docs":{},"隐":{"docs":{},"含":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"时":{"docs":{},",":{"docs":{},"在":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"或":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"该":{"docs":{},"方":{"docs":{},"法":{"docs":{},"时":{"docs":{},"中":{"docs":{},",":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.005376344086021506}},"g":{"docs":{},"u":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}},"p":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.235371079056684}},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.011650485436893204},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.01098901098901099}}},"y":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}},"s":{"docs":{},"(":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}},"s":{"docs":{},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}},"n":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"数":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036}}}}}},"和":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}},"u":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.004464285714285714}}}}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.006696428571428571}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}},"x":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"p":{"docs":{},"h":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.016597510373443983}}}},"o":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}},"e":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"o":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.005625879043600563}},"(":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}}}}}}}}}}},"指":{"docs":{},"向":{"docs":{},"了":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"用":{"docs":{},"来":{"docs":{},"数":{"docs":{},"到":{"0":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506}}}}}}}}},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"分":{"docs":{},"支":{"docs":{},"结":{"docs":{},"构":{"docs":{},"(":{"docs":{},"他":{"docs":{},"的":{"docs":{},"x":{"docs":{},"和":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.05928853754940711}},"e":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.003952569169960474}}}}}},".":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0047430830039525695}}}}}}},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"三":{"docs":{},"个":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"l":{"docs":{},"i":{"docs":{},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"在":{"docs":{},"它":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"时":{"docs":{},"根":{"docs":{},"据":{"docs":{},"它":{"docs":{},"的":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"标":{"docs":{},"记":{"docs":{},"符":{"docs":{},"和":{"docs":{},"里":{"docs":{},"面":{"docs":{},"的":{"docs":{},"内":{"docs":{},"容":{"docs":{},"(":{"docs":{},"p":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"将":{"docs":{},"用":{"docs":{},"于":{"docs":{},"打":{"docs":{},"印":{"docs":{},"一":{"docs":{},"个":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"描":{"docs":{},"述":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"它":{"docs":{},"的":{"docs":{},"导":{"docs":{},"演":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"。":{"docs":{},"当":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"真":{"docs":{},"的":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"(":{"docs":{},"这":{"docs":{},"个":{"docs":{},"是":{"docs":{},"为":{"docs":{},"了":{"docs":{},"判":{"docs":{},"断":{"docs":{},"下":{"docs":{},"转":{"docs":{},"是":{"docs":{},"否":{"docs":{},"成":{"docs":{},"功":{"docs":{},"。":{"docs":{},")":{"docs":{},"可":{"docs":{},"选":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"是":{"docs":{},"这":{"docs":{},"样":{"docs":{},"写":{"docs":{},"的":{"docs":{},"“":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}},"d":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0049504950495049506},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}},"y":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}},"e":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}},"m":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.005875440658049354},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.022326674500587545},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.24099695810028457},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.8794662074903142},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.011160714285714286},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.03232323232323232},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.03642384105960265},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.008695652173913044},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.014319809069212411},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.011527377521613832}},"d":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123}},"e":{"docs":{},"的":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"子":{"docs":{},"类":{"docs":{},"c":{"docs":{},"i":{"docs":{},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"接":{"docs":{},"收":{"docs":{},"两":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"半":{"docs":{},"径":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"实":{"docs":{},"现":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"和":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"含":{"docs":{},"有":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},";":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"含":{"docs":{},"有":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},".":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},")":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}},"简":{"docs":{},"写":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"(":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}}}}}}},"默":{"docs":{},"认":{"docs":{},"参":{"docs":{},"数":{"docs":{},"值":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}}}},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.002232142857142857}}}}},"(":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}},"=":{"docs":{},"\"":{"docs":{},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"1":{"docs":{},"\"":{"docs":{},">":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"实":{"docs":{},"参":{"docs":{},"语":{"docs":{},"句":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}},">":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"<":{"docs":{},"a":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":5}}}}}}}}}}}}}}}}}}}}}}}},"2":{"docs":{},"\"":{"docs":{},">":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"实":{"docs":{},"参":{"docs":{},"语":{"docs":{},"句":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":5.007575757575758}}}}}}}}}}}}}},"docs":{}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"v":{"docs":{},"i":{"docs":{},"g":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}}}}}},"e":{"docs":{},"w":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.003976143141153081},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.011834319526627219},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}}}}}}}}}}},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"相":{"docs":{},"同":{"docs":{},"。":{"docs":{},"与":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"是":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"的":{"docs":{},"入":{"docs":{},"参":{"docs":{},"声":{"docs":{},"明":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"就":{"docs":{},"算":{"docs":{},"不":{"docs":{},"写":{"docs":{},",":{"docs":{},"在":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"中":{"docs":{},"依":{"docs":{},"然":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}}},"s":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}},"p":{"docs":{},"t":{"docs":{},"u":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}},"r":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}},"x":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}},"方":{"docs":{},"法":{"docs":{},"时":{"docs":{},",":{"docs":{},"开":{"docs":{},"关":{"docs":{},"在":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"电":{"docs":{},"源":{"docs":{},"状":{"docs":{},"态":{"docs":{},"(":{"docs":{},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{},",":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},",":{"docs":{},"h":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}},"e":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}},"i":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":5.021505376344086},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.024242424242424242},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.016260162601626018},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.014619883040935672}},",":{"docs":{},"?":{"docs":{},"后":{"docs":{},"面":{"docs":{},"的":{"docs":{},"东":{"docs":{},"西":{"docs":{},"都":{"docs":{},"会":{"docs":{},"被":{"docs":{},"忽":{"docs":{},"略":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"整":{"docs":{},"个":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}},"条":{"docs":{},"件":{"docs":{},"会":{"docs":{},"判":{"docs":{},"断":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"大":{"docs":{},"括":{"docs":{},"号":{"docs":{},"中":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"会":{"docs":{},"被":{"docs":{},"跳":{"docs":{},"过":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"不":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"会":{"docs":{},"将":{"docs":{},"值":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}},"但":{"docs":{},"是":{"docs":{},"后":{"docs":{},"面":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"运":{"docs":{},"行":{"docs":{},"需":{"docs":{},"要":{"docs":{},"一":{"docs":{},"个":{"docs":{},"非":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}},"不":{"docs":{},"是":{"docs":{},"指":{"docs":{},"针":{"docs":{},"—":{"docs":{},"—":{"docs":{},"它":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"确":{"docs":{},"定":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"值":{"docs":{},"缺":{"docs":{},"失":{"docs":{},"。":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"话":{"docs":{},"请":{"docs":{},"不":{"docs":{},"要":{"docs":{},"使":{"docs":{},"用":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"解":{"docs":{},"析":{"docs":{},"可":{"docs":{},"选":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"生":{"docs":{},"命":{"docs":{},"周":{"docs":{},"期":{"docs":{},"中":{"docs":{},"判":{"docs":{},"断":{"docs":{},"是":{"docs":{},"否":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"使":{"docs":{},"用":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},"的":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"后":{"docs":{},"再":{"docs":{},"也":{"docs":{},"不":{"docs":{},"会":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"方":{"docs":{},"式":{"docs":{},"断":{"docs":{},"开":{"docs":{},"两":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"(":{"docs":{},"包":{"docs":{},"括":{"docs":{},"最":{"docs":{},"先":{"docs":{},"的":{"docs":{},"那":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},")":{"docs":{},",":{"docs":{},"只":{"docs":{},"留":{"docs":{},"下":{"docs":{},"一":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"选":{"docs":{},"项":{"docs":{},"会":{"docs":{},"导":{"docs":{},"致":{"docs":{},"运":{"docs":{},"行":{"docs":{},"错":{"docs":{},"误":{"docs":{},"(":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}},"时":{"docs":{},",":{"docs":{},"将":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"内":{"docs":{},"的":{"docs":{},"占":{"docs":{},"有":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"总":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"当":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"销":{"docs":{},"毁":{"docs":{},"后":{"docs":{},",":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"值":{"docs":{},"会":{"docs":{},"自":{"docs":{},"动":{"docs":{},"置":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"没":{"docs":{},"有":{"docs":{},"任":{"docs":{},"何":{"docs":{},"一":{"docs":{},"个":{"docs":{},"析":{"docs":{},"构":{"docs":{},"函":{"docs":{},"数":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"。":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"循":{"docs":{},"环":{"docs":{},"阻":{"docs":{},"止":{"docs":{},"了":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"和":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"了":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"使":{"docs":{},"用":{"docs":{},"和":{"docs":{},"前":{"docs":{},"面":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"来":{"docs":{},"获":{"docs":{},"得":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},",":{"docs":{},"它":{"docs":{},"将":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"包":{"docs":{},"含":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"1":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},",":{"docs":{},"不":{"docs":{},"论":{"docs":{},"你":{"docs":{},"调":{"docs":{},"用":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"、":{"docs":{},"方":{"docs":{},"法":{"docs":{},"、":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"等":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"docs":{},"不":{"docs":{},"是":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"值":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"结":{"docs":{},"果":{"docs":{},"都":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"值":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"利":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"来":{"docs":{},"检":{"docs":{},"测":{"docs":{},"你":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"是":{"docs":{},"否":{"docs":{},"调":{"docs":{},"用":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"有":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"即":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.008130081300813009}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}}},"-":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"v":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949}}}}}}}}}},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.008438818565400843},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.007952286282306162},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.027227722772277228},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.047337278106508875},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.013452914798206279}}},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01107011070110701}},"”":{"docs":{},"。":{"docs":{},"当":{"docs":{},"它":{"docs":{},"等":{"docs":{},"于":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"打":{"docs":{},"印":{"docs":{},"“":{"docs":{},"w":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"和":{"docs":{},"w":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},")":{"docs":{},"是":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"值":{"docs":{},"(":{"docs":{},"或":{"docs":{},"者":{"docs":{},"成":{"docs":{},"员":{"docs":{},")":{"docs":{},"。":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.04395604395604396}},"特":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"或":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"将":{"docs":{},"它":{"docs":{},"重":{"docs":{},"写":{"docs":{},"(":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},")":{"docs":{},"为":{"docs":{},"用":{"docs":{},"该":{"docs":{},"特":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"已":{"docs":{},"经":{"docs":{},"用":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"特":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"或":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"你":{"docs":{},"则":{"docs":{},"不":{"docs":{},"可":{"docs":{},"以":{"docs":{},"将":{"docs":{},"它":{"docs":{},"重":{"docs":{},"写":{"docs":{},"为":{"docs":{},"没":{"docs":{},"使":{"docs":{},"用":{"docs":{},"该":{"docs":{},"特":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"。":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"规":{"docs":{},"则":{"docs":{},"试":{"docs":{},"用":{"docs":{},"于":{"docs":{},"当":{"docs":{},"你":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.005979073243647235}}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.01616161616161616}},"!":{"docs":{},".":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00404040404040404}}}}}}}},"docs":{}},"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.01645123384253819},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.007032348804500703},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.031578947368421054},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.01818181818181818},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.033112582781456956},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0007905138339920949},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.005847953216374269}},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.007050528789659225}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.01485148514851485}}}},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.00477326968973747}},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"0":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}},"docs":{}}}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.02074688796680498}}}}}}},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}},"s":{"docs":{},"[":{"docs":{},"\"":{"docs":{},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"并":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"出":{"docs":{},"了":{"docs":{},"包":{"docs":{},"含":{"docs":{},"三":{"docs":{},"对":{"docs":{},"键":{"docs":{},"值":{"docs":{},"的":{"docs":{},"字":{"docs":{},"典":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"s":{"docs":{},"的":{"docs":{},"字":{"docs":{},"典":{"docs":{},"存":{"docs":{},"放":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},"为":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.005494505494505495}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.023668639053254437}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.019867549668874173}},"s":{"docs":{},"是":{"docs":{},"非":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},")":{"docs":{},"时":{"docs":{},"这":{"docs":{},"一":{"docs":{},"点":{"docs":{},"也":{"docs":{},"成":{"docs":{},"立":{"docs":{},"。":{"docs":{},"只":{"docs":{},"要":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"的":{"docs":{},"请":{"docs":{},"求":{"docs":{},"就":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"最":{"docs":{},"后":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"总":{"docs":{},"是":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"操":{"docs":{},"作":{"docs":{},"有":{"docs":{},"可":{"docs":{},"能":{"docs":{},"失":{"docs":{},"败":{"docs":{},",":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"类":{"docs":{},"型":{"docs":{},"值":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"称":{"docs":{},"作":{"docs":{},"“":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"”":{"docs":{},"。":{"docs":{},"当":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"是":{"docs":{},"空":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},"(":{"docs":{},"上":{"docs":{},"例":{"docs":{},")":{"docs":{},",":{"docs":{},"选":{"docs":{},"择":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"将":{"docs":{},"会":{"docs":{},"为":{"docs":{},"空":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"会":{"docs":{},"出":{"docs":{},"先":{"docs":{},"无":{"docs":{},"法":{"docs":{},"访":{"docs":{},"问":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.005263157894736842}}}}}},"的":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},".":{"docs":{},".":{"docs":{},"型":{"docs":{},"可":{"docs":{},"变":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"在":{"docs":{},"函":{"docs":{},"数":{"docs":{},"体":{"docs":{},"内":{"docs":{},"可":{"docs":{},"以":{"docs":{},"当":{"docs":{},"做":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"的":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"y":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.01107011070110701}}}}}}}},"值":{"docs":{},"和":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"例":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"方":{"docs":{},"式":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"这":{"docs":{},"样":{"docs":{},"可":{"docs":{},"以":{"docs":{},"确":{"docs":{},"保":{"docs":{},"当":{"docs":{},"创":{"docs":{},"建":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"时":{"docs":{},"总":{"docs":{},"是":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}},"s":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},")":{"docs":{},"来":{"docs":{},"暗":{"docs":{},"示":{"docs":{},"值":{"docs":{},"缺":{"docs":{},"失":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"方":{"docs":{},"法":{"docs":{},"假":{"docs":{},"设":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"调":{"docs":{},"用":{"docs":{},"者":{"docs":{},"知":{"docs":{},"道":{"docs":{},"并":{"docs":{},"记":{"docs":{},"得":{"docs":{},"对":{"docs":{},"特":{"docs":{},"殊":{"docs":{},"值":{"docs":{},"进":{"docs":{},"行":{"docs":{},"判":{"docs":{},"断":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}},"e":{"docs":{},"d":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"子":{"docs":{},"类":{"docs":{},"中":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"变":{"docs":{},"量":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"表":{"docs":{},"明":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"和":{"docs":{},"实":{"docs":{},"现":{"docs":{},"由":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.019417475728155338}}}}}}}},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}},"y":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"特":{"docs":{},"性":{"docs":{},"的":{"docs":{},"行":{"docs":{},"为":{"docs":{},"与":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"中":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}},"n":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}}},"c":{"docs":{},"c":{"1":{"7":{"0":{"1":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}},".":{"docs":{},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}},"v":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.004219409282700422},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.04935370152761457},"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.029045643153526972},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.014336917562724014},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.011650485436893204},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.011251758087201125},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.010526315789473684},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0536779324055666},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.027227722772277228},"chapter2/12_Subscripts.html#gitbook_34":{"ref":"chapter2/12_Subscripts.html#gitbook_34","tf":0.016483516483516484},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.011160714285714286},"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.01775147928994083},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.04040404040404041},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.029801324503311258},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0047430830039525695},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.024390243902439025},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.034482758620689655},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.03937947494033413},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.02391629297458894},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099},"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.02046783625730994},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}},"i":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23396460929578386},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0029895366218236174}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.005825242718446602}}}}},"-":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.002881844380403458}}}}}}}}}}}},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813}}}}},"或":{"docs":{},"者":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.0036900369003690036}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"定":{"docs":{},"义":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"只":{"docs":{},"读":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"他":{"docs":{},"们":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"是":{"docs":{},"固":{"docs":{},"定":{"docs":{},"的":{"docs":{},"。":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},")":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"常":{"docs":{},"量":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"用":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.010752688172043012},"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.012658227848101266},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":3.370233702337023},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.02186878727634195},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.4521093413689195},"chapter2/16_Automatic_Reference_Counting.html#gitbook_38":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_38","tf":0.00202020202020202},"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.006622516556291391},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.020553359683794466},"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.04878048780487805},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103},"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.017937219730941704},"chapter3/06_Attributes.html#gitbook_50":{"ref":"chapter3/06_Attributes.html#gitbook_50","tf":0.01098901098901099}},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"函":{"docs":{},"数":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}},"可":{"docs":{},"变":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}},"多":{"docs":{},"重":{"docs":{},"输":{"docs":{},"入":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}}},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"参":{"docs":{},"数":{"docs":{},"的":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.23255813953488372}}}}}}}}}}}}}}}}}}}},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":3.333333333333333}}}}}}}}}},"(":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_41":{"ref":"chapter2/19_Nested_Types.html#gitbook_41","tf":0.024390243902439025}}}}}}}}},")":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"些":{"docs":{},"量":{"docs":{},"是":{"docs":{},"不":{"docs":{},"能":{"docs":{},"被":{"docs":{},"修":{"docs":{},"改":{"docs":{},"的":{"docs":{},"。":{"docs":{},"当":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"作":{"docs":{},"为":{"docs":{},"输":{"docs":{},"入":{"docs":{},"输":{"docs":{},"出":{"docs":{},"参":{"docs":{},"数":{"docs":{},"时":{"docs":{},",":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"参":{"docs":{},"数":{"docs":{},"前":{"docs":{},"加":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},",":{"docs":{},"当":{"docs":{},"其":{"docs":{},"不":{"docs":{},"可":{"docs":{},"访":{"docs":{},"问":{"docs":{},"时":{"docs":{},",":{"docs":{},"?":{"docs":{},"之":{"docs":{},"后":{"docs":{},"语":{"docs":{},"句":{"docs":{},"不":{"docs":{},"会":{"docs":{},"执":{"docs":{},"行":{"docs":{},",":{"docs":{},"并":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.0011933174224343676}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.008968609865470852}},"”":{"docs":{},"。":{"docs":{},"不":{"docs":{},"是":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"中":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"等":{"docs":{},"式":{"docs":{},"符":{"docs":{},"(":{"docs":{},"=":{"docs":{},"=":{"docs":{},")":{"docs":{},"进":{"docs":{},"行":{"docs":{},"比":{"docs":{},"较":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"你":{"docs":{},"自":{"docs":{},"己":{"docs":{},"的":{"docs":{},"类":{"docs":{},"或":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"一":{"docs":{},"个":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"模":{"docs":{},"型":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"没":{"docs":{},"法":{"docs":{},"猜":{"docs":{},"到":{"docs":{},"对":{"docs":{},"于":{"docs":{},"这":{"docs":{},"个":{"docs":{},"类":{"docs":{},"或":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"而":{"docs":{},"言":{"docs":{},"“":{"docs":{},"等":{"docs":{},"于":{"docs":{},"”":{"docs":{},"的":{"docs":{},"意":{"docs":{},"思":{"docs":{},"。":{"docs":{},"正":{"docs":{},"因":{"docs":{},"如":{"docs":{},"此":{"docs":{},",":{"docs":{},"这":{"docs":{},"部":{"docs":{},"分":{"docs":{},"代":{"docs":{},"码":{"docs":{},"不":{"docs":{},"能":{"docs":{},"可":{"docs":{},"能":{"docs":{},"保":{"docs":{},"证":{"docs":{},"工":{"docs":{},"作":{"docs":{},"于":{"docs":{},"每":{"docs":{},"个":{"docs":{},"可":{"docs":{},"能":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.0014947683109118087}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"y":{"docs":{},"p":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.007575757575757576}}}}}}}}},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0023501762632197414}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.004700352526439483}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0011750881316098707}}},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.003883495145631068}}}}},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0023715415019762848}}}}}}},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.024896265560165973}},"e":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},",":{"docs":{},"叫":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},",":{"docs":{},"它":{"docs":{},"重":{"docs":{},"写":{"docs":{},"了":{"docs":{},"从":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"&":{"docs":{},"#":{"3":{"9":{"docs":{},";":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"&":{"docs":{},"#":{"3":{"9":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"基":{"docs":{},"类":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"基":{"docs":{},"类":{"docs":{},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"对":{"docs":{},"所":{"docs":{},"有":{"docs":{},"车":{"docs":{},"辆":{"docs":{},"都":{"docs":{},"通":{"docs":{},"用":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"和":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"属":{"docs":{},"性":{"docs":{},"在":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"中":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"对":{"docs":{},"自":{"docs":{},"行":{"docs":{},"车":{"docs":{},"来":{"docs":{},"说":{"docs":{},"已":{"docs":{},"经":{"docs":{},"是":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"中":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"改":{"docs":{},"变":{"docs":{},"它":{"docs":{},"。":{"docs":{},"而":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"原":{"docs":{},"来":{"docs":{},"的":{"docs":{},"值":{"docs":{},"对":{"docs":{},"自":{"docs":{},"行":{"docs":{},"车":{"docs":{},"来":{"docs":{},"说":{"docs":{},"是":{"docs":{},"不":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"中":{"docs":{},"将":{"docs":{},"它":{"docs":{},"更":{"docs":{},"改":{"docs":{},"为":{"2":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"为":{"docs":{},"任":{"docs":{},"意":{"docs":{},"的":{"docs":{},"一":{"docs":{},"辆":{"docs":{},"车":{"docs":{},"设":{"docs":{},"置":{"docs":{},"一":{"docs":{},"些":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_12":{"ref":"chapter2/13_Inheritance.html#gitbook_12","tf":0.004149377593360996}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{"chapter2/08_Enumerations.html#gitbook_30":{"ref":"chapter2/08_Enumerations.html#gitbook_30","tf":0.007380073800738007}}},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}},"方":{"docs":{},"法":{"docs":{},"在":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"分":{"docs":{},"发":{"docs":{},"硬":{"docs":{},"币":{"docs":{},"之":{"docs":{},"前":{"docs":{},"检":{"docs":{},"查":{"docs":{},"是":{"docs":{},"否":{"docs":{},"有":{"docs":{},"足":{"docs":{},"够":{"docs":{},"的":{"docs":{},"硬":{"docs":{},"币":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"没":{"docs":{},"有":{"docs":{},"足":{"docs":{},"够":{"docs":{},"多":{"docs":{},"的":{"docs":{},"硬":{"docs":{},"币":{"docs":{},",":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"比":{"docs":{},"请":{"docs":{},"求":{"docs":{},"时":{"docs":{},"小":{"docs":{},"的":{"docs":{},"数":{"docs":{},"字":{"docs":{},"(":{"docs":{},"如":{"docs":{},"果":{"docs":{},"没":{"docs":{},"有":{"docs":{},"硬":{"docs":{},"币":{"docs":{},"留":{"docs":{},"在":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"中":{"docs":{},"就":{"docs":{},"返":{"docs":{},"回":{"0":{"docs":{},")":{"docs":{},"。":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"方":{"docs":{},"法":{"docs":{},"声":{"docs":{},"明":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"这":{"docs":{},"样":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"方":{"docs":{},"法":{"docs":{},"体":{"docs":{},"的":{"docs":{},"内":{"docs":{},"部":{"docs":{},"修":{"docs":{},"改":{"docs":{},"数":{"docs":{},"字":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"。":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_37":{"ref":"chapter2/15_Deinitialization.html#gitbook_37","tf":0.005917159763313609}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}},"。":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"中":{"docs":{},",":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407}}}}}}}}}}}}}}},"(":{"docs":{},"参":{"docs":{},"见":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}},"?":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"当":{"docs":{},"通":{"docs":{},"过":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"调":{"docs":{},"用":{"docs":{},"方":{"docs":{},"法":{"docs":{},"时":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"总":{"docs":{},"是":{"docs":{},"自":{"docs":{},"判":{"docs":{},"断":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_39":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_39","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"空":{"docs":{},"元":{"docs":{},"组":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},")":{"docs":{},"的":{"docs":{},"别":{"docs":{},"名":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"括":{"docs":{},"号":{"docs":{},"内":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"该":{"docs":{},"类":{"docs":{},"型":{"docs":{},"就":{"docs":{},"是":{"docs":{},"括":{"docs":{},"号":{"docs":{},"内":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_52":{"ref":"chapter3/03_Types.html#gitbook_52","tf":0.0029239766081871343}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.008438818565400843},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.014367816091954023}},"代":{"docs":{},"替":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},".":{"docs":{},"v":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.005964214711729622}}}}}},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.0019880715705765406}}}}}},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{"chapter2/22_Generics.html#gitbook_45":{"ref":"chapter2/22_Generics.html#gitbook_45","tf":0.004484304932735426}}}}}},"y":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_10":{"ref":"chapter1/02_a_swift_tour.html#gitbook_10","tf":0.0035252643948296123},"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/10_Properties.html#gitbook_32":{"ref":"chapter2/10_Properties.html#gitbook_32","tf":0.011928429423459244},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.03217821782178218},"chapter2/02_Basic_Operators.html#gitbook_35":{"ref":"chapter2/02_Basic_Operators.html#gitbook_35","tf":0.011160714285714286},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0031620553359683794},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.014367816091954023},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_58","tf":0.022727272727272728},"chapter3/10_Statements.html#gitbook_61":{"ref":"chapter3/10_Statements.html#gitbook_61","tf":0.005763688760806916}},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_14":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_14","tf":0.001941747572815534}}}}}}}},"o":{"docs":{},"u":{"docs":{},"'":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.002386634844868735}}}}}}},"_":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0035842293906810036},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0028129395218002813},"chapter2/11_Methods.html#gitbook_33":{"ref":"chapter2/11_Methods.html#gitbook_33","tf":0.0024752475247524753},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_44":{"ref":"chapter2/21_Protocols.html#gitbook_44","tf":0.003579952267303103},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.013392857142857142}},"、":{"docs":{},"基":{"docs":{},"本":{"docs":{},"多":{"docs":{},"语":{"docs":{},"言":{"docs":{},"面":{"docs":{},"(":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"i":{"docs":{},"c":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.002232142857142857}}}}}}}}}}}}}}}},"z":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.0014064697609001407},"chapter2/20_Extensions.html#gitbook_42":{"ref":"chapter2/20_Extensions.html#gitbook_42","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_56":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_56","tf":0.004464285714285714}},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/01_The_Basics.html#gitbook_13":{"ref":"chapter2/01_The_Basics.html#gitbook_13","tf":0.0017921146953405018},"chapter2/06_Functions.html#gitbook_28":{"ref":"chapter2/06_Functions.html#gitbook_28","tf":0.005625879043600563},"chapter2/07_Closures.html#gitbook_29":{"ref":"chapter2/07_Closures.html#gitbook_29","tf":0.002631578947368421},"chapter2/18_Type_Casting.html#gitbook_40":{"ref":"chapter2/18_Type_Casting.html#gitbook_40","tf":0.0015810276679841897}}}}}}},"length":4391},"corpusTokens":["0","0),宽度高度都是10","0,$1,$2","0,1","0-1","0..3","0..count","0..self","0..somecontainer.count","0..time","0.0","0.0125","0.0254","0.1","0.14159","0.25","0.37464991998171","0.5","0.729023776863283","0.914399970739201","000123.456","005","005000.76","02","0746381295[9","08","09","0b","0b10001","0o","0o21","0x","0x11","0xc.3p0","0xfp-2","0xfp2","0x)。小数点两边必须有至少一个十进制数字(或者是十六进制的数字)。浮点原始值还有一个可选的指数,在十进制浮点数中通过大写或者小写的e来指定,在十六进制浮点数中通过大写或者小写的p","0——编译器会正确的推断出x的类型int。类似的,当完整的类型可以从上下文推断出来时,你也可以忽略类型的一部分。比如,如果你写了let","0中x的类型首先根据0的类型进行推断,然后将该类型信息传递到根节点(变量x","0为fals","0为true的时候代码运行才会继续,也就是说,当age的值非负的时候。如果age的值是负数,就像代码中那样,ag","0和maxpasseng","0是真的(true),这将使得choosestepfunction返回stepbackward函数。一个指向返回的函数的引用保存在了movenearertozero","0,你可以完全忽略类型而简写成var","0,这时闭包会将字符串输出,而map","1","1)都被锁定。每次有玩家完成一个等级,这个等级就对这个设备上的所有玩家解锁。leveltrack","1...4","1...5","1...amounttopad","1...digitindex","1...finalsquar","1.0","1.21875e1","1.25","1.25e-2","1.25e2","1.5","10","10.0","100","100.0","10000","10000.56","1000000","1000_000","103","107","10^-2","10^2","10^-2","10_000","10_000.56","10中,如果number为16,则返回6,58返回8,510返回0","10,同时maxinputlevelforallchannel","11","111","11,则会将右声道的currentlevel","12","12,gener","12-side","12.1875","12.5663708","123","1234567890123456","123456789[0]返回9","123456789[1]返回8","1234_5678_9012_3456","125.0","125.0;同样,1.25e-2","128054","128054,是一个十六进制1f436","13","139968.0","144","15","15),表示向右上方移动正方形到如图所示橙色正方形的位置。设置属性center的值会调用setter来修改属性origin的x和i","15.0","159","16","16,58,510","160","16变成了1,58变成了5,510变成了51","17","182","19","195.m","1],编译提也能推断出dict的类型是dictionary<str","1_000.0","1_000_000","1_000_000.000_000_1","1千米等于1,000米,所以km计算属性要把值乘以1_000.00来转化成单位米下的数值。类似地,1米有3.28024英尺,所以ft计算属性要把对应的double值除以3.28024","1后变成2","1的比较结果是bool类型,所以第二个例子可以通过类型检查。类似i","2","2.0","2.5","2.71828","20","200","2000","2001","2014","21","2100","22","240","243610.0","243_610","25","25.4.mm","255","29573.0","2^-2","2^2","2_000","3","3.0","3.1","3.14159","3.1415927","3.14159,0.1和-273.15","3.2","3.28084","3.59","3.69","3.75","3.79","3.ft","3.repetit","30","32","32位平台上,int和int32","32位平台上,uint和uint32","33","35.0","360","3877.0","39","39;*'","3可以直接和原始值0.14159","3没有显式声明类型,而表达式中出现了一个浮点原始值,所以表达式会被推测为doubl","3的6倍是18","4","4.0","4.75会变成4,-3.9会变成-3","40","40.0","404","42","42.0","42.km","42495.0","42和-23","42和3.14159","42并且没有标明类型,swift","43","4]],array3d[0][1]是指[3","4],array3d[0][1][1]则是指值4","4个string","5","5.0","5.2","50","5000.76","510","536","55357","56374","58","597","6","6,gener","6-side","60.0","60;同样,0xfp-2","64位平台上,int和int64","64位平台上,uint和uint64","68","69105","7","7.5","7.simpledescript","70","70.0","73","746381295[0","746381295[1","746381295[2","746381295[8","746381295[9","75","7900","7,类属性maxinputlevelforallchannel","8","8590951226","85909_51226","87","896","8:09","8、16、32和64","8位无符号整数类型是uint8,32位有符号整数类型是int32","8除于2.5等于3余0.5","9","9.3","9.9","90","94","9900","9的行星,通过fromraw返回的可选planet值将是nil","_","_、基本多语言面(basic","a++.b","a+b","a...b","a..b","a.adjust","a.simpledescript","aardvark","abcdefghijklmnop","abov","ac","access","ace.toraw","acerawvalu","act","act1scenecount","action","actual","actualnumb","actualnumber常量可以在if语句的第一个分支中使用。它已经被可选包含的值初始化过,所以不需要再使用!后缀来获取它的值。在这个例子中,actualnumb","ad","add","addit","addon","addone(numb","address","address。它有三个自判断属性他们额类型是string?。前面两个自判断属性buildingnam","address实例时的使用(john.residence.address)。john.residence属性是一个自判断类型,因此你需要在它获取address","address类中的buildingidentifi","address类还提供了一个buildingidentifier的方法,它的返回值类型为string?。这个方法检查buildingname和buildingnumber的属性,如果buildingname有值则将其返回,或者如果buildingnumb","address设定一个实例来作为john.residence.address的值,并为address的street","addthesecondnumb","addthesecondnumber(b","addtwoint","addtwoints(a","addtwoints和mathfunction有同样的类型,所以这个赋值过程在swift","addtwoints和multiplytwoints。这两个函数都传入两个int","addtwonumbers(4)(5","addtwonumbers(a","adescript","adjust","adopt","advanc","advancetolevel(level","ag","again","alex","alia","alias","alien","alignright(originalstr","alignright(var","alignright函数将参数string定义为变量参数。这意味着str","alignright的函数,用来右对齐输入的字符串到一个长的输出字符串中。左侧空余的地方用指定的填充字符填充。这个例子中,字符串"hello"被转换成了"-----hello"","allitemsmatch","allitemsmatch(stackofstr","allitemsmatch的泛型函数,用来检查是否两个container单例包含具有相同顺序的相同items。如果匹配到所有的items,那么返回一个为true的boolean","allitemsmatch首先检查两个容器是否拥有同样数目的items,如果他们的items数目不同,没有办法进行匹配,函数就会fals","allow","allowedentri","allowentri","alow","alsoincrementbyten","alsominussix","alt","alt=\"comput","alt=\"stat","alternativerect","alwai","amarathon","amount","amounttopad","amount和numberoftimes。默认地,swift只把amount当作一个局部名称,但是把numberoftim","amp","amp;&","and/or","andrea","anim","animal(leg","anna","annot","anoth","anothercontain","anothercontainer.count","anothercontainer[i","anothercontainer中的item","anothercontainer是一个c2","anotheremptystr","anotherint","anothermathfunct","anotherpi","anotherproctocol","anotherproperti","anotherprotocol","anotherprotocol>","anotherstr","answer1","answer2","ant","anycommonel","anycommonelements([1","anyobject","anyobjectanyobject类型ani","anyobject可以代表任何class","any可以表示任何类型,除了方法类型(funct","any和anyobject","apart","apartment(numb","apartment实例有一个叫number,类型为int的属性,并有一个可选的初始化为nil的tenant属性。ten","apartment实例的强引用来自于变量number73。如果你断开这个强引用,再也没有指向apart","api","apis,它一般接收一个anyobject[]类型的数组,或者说“一个任何对象类型的数组”。这是因为oc没有明确的类型化数组。但是,你常常可以确定包含在仅从你知道的api","app","appear","append(item","append方法添加一个新item","appl","applese","applesummari","appli","approach","appropri","arbitrari","arc","arc为了能帮助你管理内存,需要更多的关于你的代码之间关系的信息。本章描述了这些情况,并且为你示范怎样启用arc","arc会分配一大块内存用来储存实例的信息。内存中会包含实例的类型信息,以及这个实例所有相关属性的值。此外,当实例不再被使用时,arc","arc会在引用的实例被销毁后自动将其赋值为nil","arc会在第三个,也即最后一个强引用被断开的时候,销毁person实例,这也意味着你不再使用这个person","arc会跟踪你所新创建的person实例的引用数量,并且会在person","arc会跟踪和计算每一个实例正在被多少属性,常量和变量所引用。哪怕实例的引用数为一,arc","arc无法在实例被销毁后将无主引用设为nil,因为非可选类型的变量不允许被赋值为nil","arc销毁被引用的实例。这种行为阻止了引用变为循环强引用。声明属性或者变量时,在前面加上weak","area","argument","argyrio","arithmet","arithmeticmean(1","arithmeticmean(3","arithmeticmean(numb","arrai","array<int>>","array<int>替代泛型类型array<t>的类型形参t","array(count","array-typ","array3d","array3d[0]是指[[1","array提示check","class_protocol","class、deinit、enum、extension、func、import、init、let、protocol、static、struct、subscript、typealias、var","class前添加@final特性(@fin","class类型。它创建了一个可以存储ani","class)来将整个类标记为fin","claus","closur","club","cm","cocoa","cocoa的基础上构建框架栈并将其标准化。objective-c","cocoa里的nslog函数一样,println","code","code-block","code>$0$1$2`。例如,class`class`。反引号不属于标识符的一部分,`x`4(x","comparable等同于t","comparable表示任何用于替代类型形参t的类型实参必须满足compar","comparable,等等),但是依然可以用来对类型形参及其关联约束提供更复杂的约束。如,<t","compasspoint","compasspoint.west","compil","compile-tim","completedlevel(level","composit","composition),采用protocol<someprotocol","compound","comput","computedtypeproperti","concept","condit","condition(item","condition的值在statements执行前就已计算出,因此while语句中的stat","condition表达式的值是在statements表达式执行后才计算出,因此do-while语句中的stat","condition表达式的值的类型必须符合logicvalue协议。同时,condit","confid","conform","conformance-requir","conformance(arrai","equatable类型都可以安全的使用在findindex函数中,因为其保证支持等式操作。为了说明这个事实,当你定义一个函数时,你可以写一个equat","equatable,也就意味着“任何t类型都遵循equat","equilater","equilateraltriangl","equilateraltriangle(sidelength","equival","error","error(error","error(str","escaped-charact","even","everyth","ewa","eww","exampl","exampleclass","examplemodule.mytyp","exampleprotocol","execut","exist","expect","explicitdoubl","explicitli","exponentdoubl","export","express","expression)。起保护作用的表达式是这样构成的:关键字where后面跟着一个作为额外测试条件的表达式。因此,当且仅当控制表达式匹配一个case的某个模式且起保护作用的表达式为真时,对应case块中的statements才会被执行。在下面的例子中,控制表达式只会匹配含两个相等元素的元组,如(1","expression)会首先被计算,然后与每一个case的模式(pattern)进行匹配。如果匹配成功,程序将会执行对应的case块里的statements。另外,每一个case块都不能为空,也就是说在每一个case块中至少有一条语句。如果你不想在匹配到的case块中执行代码,只需在块里写一条break","expression),switch","expression-list","exp,那这个数相当于基数和10^exp","exp,那这个数相当于基数和2^exp","extens","extension][6","extension][7","extern","f","face","face,unicod","fail","failur","fall","fallthrough","fallthrough-stat","fallthrough语句可出现在switch语句中的任意case里,但不能出现在最后一个'case'块。同时,fallthrough语句也不能把控制权传递给使用了可选绑定的cas","fallthrough语句用于在switch语句中传递控制权。fallthrough语句会把控制权从switch语句中的一个case传递给下一个case。这种传递是无条件的,即使下一个case的值与switch","falltrhough","fals","false。同样的,item","feed","feed)\\n","feed)(u+000a)、回车符(carriag","feed)(u+000c)以及空(null)(u+0000","feet","fibonacci","file","filenam","film","final","finalsquar","final方法,属性或下标,在编译时会报错。在扩展中,你添加到类里的方法,属性或下标也可以在扩展的定义里标记为fin","final来防止它们被重写,只需要在声明关键字前加上@final特性即可。(例如:@fin","find","findindex([\"mik","findindex([3.14159","findindex(arrai","findindex中这个单个类型参数写做:t","findindex函数现在则可以成功的编译过,并且作用于任何遵循equatable的类型,如double或str","findindex,用某个类型t","findstringindex","findstringindex(arrai","findstringindex(str","findstringindex的泛型版本findindex。请注意这个函数仍然返回int","findstringindex的非泛型函数,该函数功能是去查找包含一给定string值的数组。若查找到匹配的字符串,findstringindex函数返回该字符串在数组中的索引值(int),反之则返回nil","first","firstforloop","firstprotocol","firstroomnam","firstvalu","five","fiveeight","fiveonezero","fixedincr","fixedlengthrang","fixedlengthrange(firstvalu","fixedlengthrange的实例包含一个名为firstvalue的变量存储属性和一个名为length的常量存储属性。在上面的例子中,length","fixedpoint","fixedpoint.movebyx(2.0","float","floating-point","floating-point-","floating-point-liter","floating-point-p","float并指定初始值为4","float表示32","flow","flow含有关于该游戏的介绍).新版本使用dice中的骰子,实现dicegame和dicegamedeleg","flow)中介绍,当考虑一个枚举的成员们时,一个switch语句必须全面。如果忽略了.west这种情况,上面那段代码将无法通过编译,因为它没有考虑到compasspoint","follow","for-in","for-in-stat","for-init","for-in循环和半闭区间操作(..)来迭代somecontainer中的所有items。对于每个item,函数检查是否somecontainer中的item不等于对应的anothercontainer中的item,如果这两个items不等,则这两个容器不匹配,返回fals","for-in语句允许在重复执行代码块的同时,迭代集合(或符合sequ","for-in语句在循环开始前会调用collection表达式的generate方法来获取一个生成器类型(这是一个符合generator协议的类型)的值。接下来循环开始,调用collection表达式的next方法。如果其返回值不是none,它将会被赋给item,然后执行statements,执行完毕后回到循环开始处;否则,将不会赋值给item也不会执行statements,for-in","for-stat","forc","force-unwrap","forincr","form","for—that","for语句、for-in语句、while语句和do-whil","for语句中,continue语句执行后,increment表达式还是会被计算,这是因为每次循环体执行完毕后incr","found","found"","found")元组把一个int值和一个str","foundat","foundindex","four","fourbyfivebytwo","fourbyfivebytwo.volum","friar","friendlywelcom","friendlywelcome的值从"hello!"改为了"bonjour!"","fromraw方法来试图找到具有特定原始值的枚举成员。这个例子通过原始值7识别uranu","fromthetop","fruit","fruitsummari","ft","fullnam","fullname实现为计算型只读属性.它的每一个实例都有一个名为name的必备属性和一个名为prefix","fullynam","func","function","function-typ","functionality)。这包括在没有权限获取原始源代码的情况下扩展类型的能力(即逆向建模)。扩展和objective-c中的分类(categories)类似。(不过与objective-c不同的是,swift","functions)函数参数与返回值(funct","functions)函数的定义与调用(defin","functions),它们定义在全局域中。你也可以把函数定义在别的函数体中,称作嵌套函数(nest","function)的类型相当于一个嵌套函数类型。例如,下面的柯里化函数addtwonumber()()的类型是int","func作为前缀。指定函数返回类型时,用返回箭头->","func关键字之前加上关键字class;声明结构体和枚举的类型方法,在方法的func关键字之前加上关键字stat","func来声明一个函数,使用名字和参数来调用函数。使用->","g","game","game(gam","game,d12,simothehamst","game.deleg","game.dice.sides)-sid","game.plai","gamedidend(gam","gamedidstart(gam","gamedidstart中,当game是snakesandladd","gamedidstart使用game参数来打印游戏的一些介绍信息.game的类型是dicegam","gamedidstart只能访问和使用dicegam","gameloop","game是被视为遵循了dicegame协议的属性,也就是说它拥有dice属性,所以gamedidstart方法可以访问和打印dice的sid","gear","gener","generator.random","generator是一个randomnumbergener","generic-argu","generic-argument-claus","generic-argument-clause[opt","generic-argument-clause[opt].type-identifi","generic-argument-list","generic-argument­,­generic-argument-list","generic-paramet","generic-parameter-list","generic-parameter­,­generic-parameter-list","getgaspric","gettable,但它并不要求属性是存储型属性(stor","gettable时,即使实现了它的sett","getter","getter-claus","getter-sett","getter-setter-block","getter-setter方法​​块可以由一个getter子句后跟一个可选的setter子句构成,用大括号括起来,或者由一个setter子句后跟一个gett","getters和sett","getter和sett","getter来获取值,一个可选的sett","getter没有sett","getter(或sett","get代码块中的代码写在subscript","get关键字表示。它们的返回值是double型,而且可以用于所有接受doubl","ghostbust","give","global","goe","gonna","good","goodby","grammar","great","greet","greet(\"bob","greet(nam","greeting被调用,该函数结束它的执行并返回greet","grid","grid[(row","gt","gt;>","gt;"","guard","guard-claus","guard-express","guide,即便你没有实现它。例如:swift的array和dictionary类型都是泛型集。你可以创建一个int数组,也可创建一个string数组,或者甚至于可以是任何其他swift的类型数据数组。同样的,你也可以创建存储任何指定类型的字典(dictionari","h","halfopenrangelength(start","hall","hamster","hamster(nam","hamster的实例可以被当做textrepresent","happi","harmless","hasanymatches(list","hasanymatches(numb","hasarea","hasarea协议时,通过as?操作符将其可选绑定(opt","hasarea协议的anim","hasdoorkei","hash","hashabl","hashable和valuetype产生的。每一个类型实参必须满足它所替代的泛型形参的所有约束,包括任何where语句所指定的额外的要求。上面的例子中,类型形参keytype要求满足hashable协议,因此string也必须满足hash","hashead","hashtabl","hasprefix","hasprefix/hassuffix","hawk","heart","hearts.simpledescript","heartsdescript","heartssymbol","hearts成员:给hearts常量赋值时,枚举成员suit.hearts需要用全名来引用,因为常量没有显式指定类型。在switch里,枚举成员使用缩写.hearts来引用,因为self的值已经知道是一个suit","height","height=\"120","height=\"169","height=\"357","height=\"387","hello","hello-world","help","here","here'","here’","hexadecim","hexadecimal-digit","hexadecimal-expon","hexadecimal-fract","hexadecimal-liter","hexadecimal-literal-charact","hexadecimaldoubl","hexadecimalinteg","hierarchi","high","highest","highestunlockedlevel","highland","horizont","horribl","hors","href=\"#label1\">泛型形参语句泛型实参语句泛型实参语句泛型实参语句where语句泛型实参语句hello","pad","paddeddoubl","paddedstr","paint","pair","paragraph","paragraph变量为nil,打破它持有的htmlelement实例的强引用,htmlel","paragraph变量定义为可选htmlelement,因此我们可以赋值nil","parakeet","paramet","parameter-claus","parameternam","parameters类型参数命名类型参数泛型类型类型约束类型约束语法类型约束行为关联类型关联类型行为扩展一个存在的类型为一指定关联类型wher","parameters)函数类型(funct","parameters)常量参数和变量参数(const","parameters)无参函数(funct","parameters)无返回值函数(funct","parameters)输入输出参数(in-out","part","particular","pass","passedretinascan","passeng","pattern","penguin","pepper","perform","perimet","person","person'","person(fullnam","person(nam","person?的变量,用来按照代码片段中的顺序,为新的person实例建立多个引用。由于这些变量是被定义为可选类型(person?,而不是person),它们的值会被自动初始化为nil,目前还不会引用到person","personnam","person和apart","person和apartment实例并将类实例赋值给john和number73","person和apartment的例子一致,但是有一个重要的区别。这一次,apartment的ten","person和apartment的例子展示了两个属性的值都允许为nil","person和resid","person和residence模型通过添加一个room和一个address","person完整的遵循了该协议.(如果协议未被完整遵循,swift","person实例依然保持对apartment实例的强引用,但是apartment实例只是对person实例的弱引用。这意味着当你断开john变量所保持的强引用时,再也没有指向person","person实例有一个类型为string,名字为name的属性,并有一个可选的初始化为nil的apartment属性。apart","person实例现在有了一个指向apartment实例的强引用,而apartment实例也有了一个指向person实例的强引用。因此,当你断开john和number73变量所持有的强引用时,引用计数并不会降为0,实例也不会被arc","person实例都拥有一个string类型,名为fullname的存储型属性,它满足了fullynam","person实例,它的resid","person并实现了fullynam","person类开始,并定义了一个叫nam","person类有一个构造函数,此构造函数为实例的name属性赋值并打印出信息,以表明初始化过程生效。person","person类的新实例被赋值给了reference1变量,所以reference1到person类的新实例之间建立了一个强引用。正是因为这个强引用,arc会保证person","person类的构造函数的时候,"john","pi","piec","place","placehold","plai","plane","planet","planet.earth","planet.earth.toraw","planet.fromraw(7","planet.fromraw(9)语句获得一个可选planet,如果可选planet可以被获得,把someplanet设置成该可选planet的内容。在这个范例中,无法检索到位置为9的行星,所以els","planet.fromraw(positiontofind","planet.uranu","planet.venus的原始值是2","planet这个枚举的一个细化,利用原始整型值来表示每个planet","player","player(coin","player(nam","player.completedlevel(1","player.tracker.advancetolevel(6","playernam","playeron","playerone!.coinsinpurs","playerone!.wincoins(2_000","playerone是可选的,所以由一个感叹号(!)来修饰,每当其wincoins方法被调用时,coinsinpurs","player实例都由一个指定数目硬币组成的启动额度初始化,这些硬币在bank初始化的过程中得到。如果没有足够的硬币可用,play","player实例随着一个100个硬币(如果有)的请求而被创建。这个player实例存储在一个名为playerone的可选player变量中。这里使用一个可选变量,是因为players可以随时离开游戏。设置为可选使得你可以跟踪当前是否有play","player已经赢得了2,000硬币。player的钱包现在有2,100硬币,bank只剩余7,900","player现在已经离开了游戏。这表明是要将可选的playerone变量设置为nil,意思是"没有player实例"。当这种情况发生的时候,playerone变量对player实例的引用被破坏了。没有其它属性或者变量引用player实例,因此为了清空它占用的内存从而释放它。在这发生前一步,其析构函数被自动调用,其硬币被返回到bank","player类使用leveltrack","player类创建一个新的leveltracker实例来检测这个用户的发展进度。他提供了completedlevel方法:一旦玩家完成某个指定等级就调用它。这个方法为所有玩家解锁下一等级,并且将当前玩家的进度更新为下一等级。(我们忽略了advancetolevel返回的布尔值,因为之前调用leveltracker.unlocklevel","player类定义了一个wincoins方法,该方法从bank获取一定数量的硬币,并把它们添加到player的钱包。player类还实现了一个析构函数,这个析构函数在player实例释放前一步被调用。这里析构函数只是将player的所有硬币都返回给bank","player类描述了游戏中的一个玩家。每一个player在任何时刻都有一定数量的硬币存储在他们的钱包中。这通过player的coinsinpurs","pleas","plusthre","pm","point","point(x","pointonefouronefivenin","point封装了一个(x","point来引用元组(int","point结构体定义了一个变异方法(mut","pop","popul","popviewcontrolleranim","pop并移除值"cuatro"","pop方法的返回值,该返回值将是一个t","portocol","posit","positiontofind","possibl","possibleinteg","possiblenumb","possiblenumber.toint","possiblenumber.toint返回的可选int包含一个值,创建一个叫做actualnumb","possibleplanet","possiblestr","postfix-oper","prefix","prefix-oper","prefix存在时,将prefix插入到name之前来为starship构建fullnam","preslei","prettytextrepresent","prettytextrepresentable协议继承自textrepresentable协议.任何实现prettytextrepresentable协议的类型,也需要遵循textrepresent","prime","principl","print","print(\"\\(codeunit","print(\"\\(scalar.valu","print(\"\\n","print(\"conson","print(\"oth","print(\"vowel","printandcount(\"hello","printandcount(stringtoprint","printandcount,输出一个字符串并返回int类型的字符数。第二个函数printwithoutcount","printclassnam","printhelloworld","printletterkinds(\"hello","printletterkinds(word","printletterkinds的输入是一个string值并对其字符进行迭代。在每次迭代过程中,考虑当前字符的kind计算属性,并打印出合适的类别描述。所以printletterkinds就可以用来打印一个完整单词中所有字母的类型,正如上述单词"hello"","println","println(\"'\\\\(word","println(\"3的6倍是\\(threetimestable[6","println(\"\\(country.name)'","println(\"\\(currentvalu","println(\"\\(index","println(\"\\(nam","println(\"\\(possiblenumb","println(\"\\(scalar","println(\"\\(total.vowel","println(\"a","println(\"about","println(\"access","println(\"ad","println(\"al","println(\"an","println(\"and","println(\"apart","println(\"area","println(\"automaticcar","println(\"bicycl","println(\"car","println(\"card","println(\"count","println(\"eww","println(\"goodby","println(\"happi","println(\"hello","println(\"here'","println(\"highest","println(\"it","println(\"john'","println(\"level","println(\"lot","println(\"media","println(\"mmm","println(\"mostli","println(\"movi","println(\"not","println(\"on","println(\"play","println(\"playeron","println(\"qr","println(\"random","println(\"result","println(\"rol","println(\"som","println(\"somebaseclass","println(\"someint","println(\"somesubclass","println(\"someth","println(\"song","println(\"speedlimitedcar","println(\"square.origin","println(\"start","println(\"tandem","println(\"th","println(\"theaceofspad","println(\"ther","println(\"thi","println(\"thre","println(\"un","println(\"unusualmenageri","println(\"upc-a","println(\"watch","println(\"welcom","println(\"wher","println(\"zero","println(assumedstr","println(audiochannel.maxinputlevelforallchannel","println(cat","println(charact","println(counter.count","println(d12.astext","println(definitestr","println(friendlywelcom","println(game.asprettytext","println(game.astext","println(halfopenrangelength(1","println(leftchannel.currentlevel","println(manager.importer.filenam","println(messag","println(paragraph!.ashtml","println(possiblestr","println(rightchannel.currentlevel","println(sayhello(\"anna","println(sayhello(\"brian","println(sayhelloagain(\"anna","println(sayhelloworld","println(someclass.computedtypeproperti","println(somestructure.storedtypeproperti","println(somethingtextrepresentable.astext","println(stringtoprint","println(thing.astext","println(“th","println函数输出传入的str","println是一个用来输出的全局函数,输出的内容会在最后带换行。如果你用xcode,println将会输出内容到“console”面板上。(另一种函数叫print","printmathresult(addtwoint","printmathresult(mathfunct","printmathresult函数的作用就是输出另一个合适类型的数学函数的调用结果。它不关心传入函数是如何实现的,它只关心这个传入的函数类型是正确的。这使得printmathresult可以以一种类型安全(type-saf","printmathresult函数,它有三个参数:第一个参数叫mathfunction,类型是(int","printmathresult被调用时,它被传入addtwoints函数和整数3和5。它用传入3和5调用addtwoints,并输出结果:8","printnumberofroom","prints\"hello","printwithoutcounting(\"hello","printwithoutcounting(stringtoprint","privat","procotol","productbarcod","productbarcode的新变量,并且赋给它一个barcode.upca的关联元组值(8","productcod","program","properti","properties)存储属性常量和存储属性延迟存储属性存储属性和实例变量计算属性便捷sett","properties),用于提供关于枚举当前值的附加信息,实例方法(inst","properties),方法(methods),构造过程(initialization),扩展(extensions),和协议(protocol","property),也可以指定协议中的属性的sett","property)在实例方法中修改值类型(modifi","property)还是计算型属性(calcul","property)还是计算型属性(comput","property),或下标(subscript)提供自己定制的实现(implementation)。我们把这种行为叫重写(overrid","protoc","protocol","protocol<protocol","protocol-composition-typ","protocol-identifi","protocol-identifier-list","protocol(item","repeatedvalu","repetit","repetitions(task","report","repres","represent","request","requir","requirement-claus","requirement-list","requirement­,­requirement-list","reserv","reset","reset将计数器重置为0","resid","residence中也提供了一个printnumberofroom","residence具有一个int类型的numberofrooms,其值为1。person具有一个自判断residence属性,它的类型是resid","residence存储了一个room实例的数组,它的numberofrooms属性值不是一个固定的存储值,而是通过计算而来的。numberofrooms属性值是由返回rooms数组的count","residence定义了一个自判断属性叫address(address?)。address","residence实例给john.resid","residence实例给john.residence,且在他的rooms数组中有一个或多个room实例,那么你可以使用可选链通过residence子脚本来获取在room","residence属性numberofrooms属性值,将会引发运行时错误,因为这时没有可以供解析的resid","residence的printnumberofrooms方法会打印numberofroom","residence类中定义的子脚本来获取john.residence数组中第一个房间的名字。因为john.residence现在是nil","result","result(str","result(sunris","retriev","return","return-stat","returnfifteen","returntyp","return参数名称缩写运算符函数trail","return时,仅仅是将控制权从该函数或方法传递给调用者,而不返回一个值。(这就是说,该函数或方法的返回类型为void","return语句后面带表达式时,表达式的值将会返回给调用者。如果表达式值的类型与调用者期望的类型不匹配,swift","return语句时,可以只写return这个关键词,也可以在return","return)\\r","return)或换行符(lin","return)(u+000d","revers","rh","rhsitem","rick","ridlei","right","rightchannel","rightchannel.currentlevel","rise","roll","roll是一个用以返回骰子面值的实例方法.该方法先调用generator的random","romeoandjuliet","room","room(","room(nam","roomcount","rooms.count","rooms[i","rooms数组的room类是一个很简单的类,它只有一个name属性和一个设定room","rooms数组,resid","rooms,它被初始化为一个room","row","row0","row1","rowheight","row和column下标的matrix","row和column的数量来构造一个新的matrix","runingtot","runningtot","runtim","s","s1","s2","s2),backward","safe","same","same-type-requir","samequot","sampl","sandwich","sankesandladders的实例都可以使用asprettytext","saturn","saygoodbye(\"dav","saygoodbye(personnam","saygoodbye函数依然返回了值。没有定义返回类型的函数会返回特殊的值,叫void。它其实是一个空的元组(tupl","sayhello(personnam","sayhelloagain(personnam","sayhelloworld","sayhello。上面的例子展示的是用"anna"和"brian"","sayhello函数时,在圆括号中传给它一个string类型的实参。因为这个函数返回一个string类型的值,sayhello可以被包含在println","sayhello函数的另一个版本,叫wavegoodbye,这个函数直接输出str","sayhello的函数体中,先定义了一个新的名为greeting的string常量,同时赋值了给personname的一个简单问候消息。然后用return关键字把这个问候返回出去。一旦return","scalar","scene","scene.hasprefix(\"act","scope","score","scott","second","secondforloop","see","self","self.anm","self.area","self.artist","self.capitalc","self.column","self.count","self.countri","self.custom","self.director","self.gener","self.init(origin","self.leg","self.nam","self.name)>\\(text)(somet","somestr","somestructur","somestructure.storedtypeproperti","somesubclass","somesuperclass","someth","somethingtextrepresent","sometuple的类型被指定为(doubl","sometuple:(doubl","sometyp","sometype(ofinitialvalu","sometypemethod","sometypeproperti","someu","somevalu","somevehicl","somewher","song","song(nam","song.artist","song.nam","songcount","songcount,用来计算数组librari","song检查item是否为song类型的实例。在循环末尾,moviecount","sort","sort([1","sort(nam","soup","south","space","space)(u+0020)、换行符(lin","spade","span","sparklingheart","special","specif","specifi","speed","speedlimitedcar","speedlimitedcar实例的speed属性时,属性setter的实现会去检查新值与限制值40mph的大小,它会将超类的speed设置为newvalue和40.0中较小的那个。这两个值哪个较小由min函数决定,它是swift标准库中的一个全局函数。min","speedlimitedcar实例的speed属性设置为一个大于40mph的数,然后打印description函数的输出,你会发现速度被限制在40mph","speedlimitedcar,它是car的子类。类speedlimitedcar表示安装了限速装置的车,它的最高速度只能达到40mph。你可以通过重写继承来的spe","spici","spider","squar","square(sidelength","square.cent","square.origin","square.origin.i","square.origin.x","square.sidelength","square的center属性可以通过点运算符(square.center)来访问,这会调用getter来获取属性的值。跟直接返回已经存在的值不同,getter实际上通过计算然后返回一个新的point实例表示square的中心点。如代码所示,它正确返回了中心点(5","square的rect实例,初始值原点是(0","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/barcode_qr_2x.png","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/barcode_upc_2x.png","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/computedproperties_2x.png","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/staticpropertiesvumeter_2x.png","stack","stack(栈)。一个栈是一系列值域的集合,和array(数组)相似,但其是一个比swift的array类型更多限制的集合。一个数组可以允许其里面任何位置的插入/删除操作,而栈,只允许,只允许在集合的末端添加新的项(如同push一个新值进栈)。同样的一个栈也只能从末端移除项(如同pop","stack(inout","swaptwovalues例子中,节点类型t是一种类型参数的示例。类型参数指定并命名为一个节点类型,并且紧随在函数名后面,并用一对尖括号括起来(如)。这个尖括号告诉swift那个t是swaptwovalues函数所定义的一个节点类型。因为t是一个节点,swift不会去查找每一个命名为t","t.element","t.generatortype.el","tab","tabl","tab(horizont","tab(vert","tab)\\t","tab)(u+0009","tab)(u+000b)、换页符(form","take","tandem","tandem.descript","tandem类也继承了descript","task","tast","tasti","td","td>1","td>1*2","td>3","td>4","td>5","td>6","td>7","td>8","td>9","tea","teamscor","temporari","temporarya","ten","tenant","terminolog","terrapin","test","test.area","test.simpledescript","testnumb","text","text</p>"或者"<p","text"还是nil,闭包会返回"<p>som","textrepresent","textrepresentabl","textrepresentable协议含有一个astext","theaceofspad","theaceofspades.descript","thing","things.append(\"hello","things.append((3.0","things.append(0","things.append(0.0","things.append(3.14159","things.append(42","things.append(movie(nam","things数组中的每一项的并用switch语句查找每一项的类型。这几种switch","things数组可以被直接遍历,并调用其中元素的astext","thing被认为是textrepresentable类型而不是dice,dicegame,hamster等类型.因此,可以在循环中调用它们的astext","those","thought","three","threedescript","threefeet","threeofspad","threeofspades.simpledescript","threeofspadesdescript","threesourc","threesource作为数据源开实例化一个count","threetimest","threetimestable[6]。这句话访问了threetimestable的第六个元素,返回18或者6的3","three的值被用来创建一个doubl","threshold","thresholdlevel","through","through)带标签的语句控制传递语句break","time","timest","timestable(multipli","timestable例子是基于一个固定的数学公式。它并不适合开放写权限来对threetimestable[someindex","timestable结构体中使用只读下标的用法,该结构体用来展示传入整数的n","timestable结构体创建了一个用来表示索引值三倍的实例。数值3作为结构体构造函数入参表示这个值将成为实例成员multipli","todai","toggl","togglabl","togglable,含有一个toggle方法的协议.通过名称猜测,toggl","togglabl协议时,必须在枚举或接头体的toggle方法前加上mut","toggle含有mutating标记,用以匹配toggl","toggle方法前含有mut","toint方法可能会失败,所以它返回一个可选的int,而不是一个int。一个可选的int被写作int?而不是int。问号暗示包含的值是可选,也就是说可能包含int值也可能不包含值。(不能包含其他任何值比如bool值或者string值。只能是int","toint方法来尝试将一个string转换成int","toobig","top","toraw","toraw和fromraw","tostr","tostring:\"world","total","total.conson","totalstep","totalsteps设置新值的时候,它的willset和didset","touch","towardszerosourc","towardzerosource类实现了counterdatasource中可选方法``incrementforcount","to那些包含可选成员需求的协议。更多关于如何使用optional特性以及如何访问可选协议成员的指导,例如,当你不确定一个conform","tr","tracker","tracker.advancetolevel(level","trail","transer","travel","tre","treat","tree)的叶子节点传向根节点。也就是说,var","triagl","triangl","triangle.perimet","triangle.sidelength","triangleandsquar","triangleandsquare(s","triangleandsquare.squar","triangleandsquare.square.sidelength","triangleandsquare.triangle.sidelength","trigger","tristateswitch","tristateswitch.low","true","true),statements将会被执行,然后转到第3步。如果为假(false),statements和increment都不会被执行,for","true),转到第1步。如果为假(false),do-whil","true),转到第2步。如果为假(false),whil","true。从字面意思来说,断言“断言”一个条件是否为真。你可以使用断言来保证在运行其他代码之前,某些重要的条件已经被满足。如果条件判断为true,代码运行会继续进行;如果条件判断为fals","true和fals","try","tuesdai","tulip","tupl","tuple-typ","tuple-type-bodi","tuple-type-body[opt","tuple-type-el","tuple-type-element-list","turn","turnip","turnipsaredelici","two","twothousand","twothousandandon","twothousand类型是uint16,然而常量one类型是uint8。它们不能直接相加,因为它们类型不同。所以要调用uint16(one)来创建一个新的uint16数字并用on","type","type)。你可以在声明属性或者变量时,在前面加上关键字unown","type-annot","type-identifi","type-identifier­:­protocol-composition-typ","type-identifier­:­type-identifi","type-identifier­==­type-identifi","type-inheritance-claus","type-inheritance-list","type-nam","type-name­:­protocol-composition-typ","type-name­:­type-identifi","type-saf","type.protocol","type.typ","typealia","types)undefinedundefin","types中知道结构体有默认的成员构造函数,所以你可以用默认的initializer去初始化新的常量theaceofspad","types)——比如表示数字、字符和字符串——实际上就是命名型类型,swift","types)使用函数类型(us","types)函数类型作为参数类型(funct","types)函数类型作为返回类型(funct","types)嵌套函数(nest","types,如int、character)外,你可以使用任何类型的值,包括浮点数、字符串、元组、自定义类的实例和可选(optional)类型,甚至是枚举类型中的成员值和指定的范围(range)等。关于在switch语句中使用这些类型,请参考控制流待添加链接一章的switch","type。协议类型的元类型——并不是运行时适配该协议的具体类型——是该协议名字紧跟.protocol。比如,类someclass的元类型就是someclass.type,协议someprotocol的元类型就是someprotocal.protocol","type的实例方法(译者注:指结构体和枚举中的方法)的func前加上mut","type)。,即使是这个方法本是没有定义返回值,你也可以使用if语句来检查是否能成功调用printnumberofrooms方法:如果方法通过可选链调用成功,printnumberofrooms的隐式返回值将会是void,如果没有成功,将返回nil","t分别代表tnt和string","t和u遵守generator协议,同时要求它们的关联类型等同,可以这样来表达:<t","t定义了一个名为“某种类型t”的节点提供给后来用。这种将来类型可以在结构体的定义里任何地方表示为“t”。在这种情况下,t","t来表示)来代替实际类型名(如int、string或double)。节点类型名并不是表示t必须是任何类型,但是其规定a和b必须是同一类型的t,而不管t表示任何类型。只有swaptwovalues函数在每次调用时所传入的实际类型决定了t","t被用作append方法的item参数和下标的返回类型。swift因此可以推断出被用作这个特定容器的itemtype的t","t,u,v,keytype,valuetyp","t,是@noreturn","t,有一个需要t必须是someclass子类的类型约束;第二个类型参数u,有一个需要u必须遵循someprotocol","u","u+000d","u+0024","u+0061","u+00a8","u+00aa","u+00ad","u+00af","u+00b2–u+00b5","u+00b7–u+00ba","u+00bc–u+00b","u+00c0–u+00d6","u+00d8–u+00f6","u+00f8–u+00ff","u+0100–u+02ff","u+0300–u+036f","u+0370–u+167f","u+10000–u+1fffd","u+1681–u+180d","u+180f–u+1dbf","u+1dc0–u+1dff","u+1e00–u+1fff","u+1f436","u+1f496","u+20000–u+2fffd","u+200b–u+200d","u+202a–u+202","u+203f–u+2040","u+2054","u+2060–u+206f","u+2070–u+20cf","u+20d0–u+20ff","u+2100–u+218f","u+2460–u+24ff","u+2665","u+2776–u+2793","u+2c00–u+2dff","u+2e80–u+2fff","u+30000–u+3fffd","u+3004–u+3007","u+3021–u+302f","u+3031–u+303f","u+3040–u+d7ff","u+40000–u+4fffd","u+50000–u+5fffd","u+60000–u+6fffd","u+70000–u+7fffd","u+80000–u+8fffd","u+90000–u+9fffd","u+a0000–u+afffd","u+b0000–u+bfffd","u+c0000–u+cfffd","u+d0000–u+dfffd","u+d83d","u+dc36","u+e0000–u+efffd","u+f900–u+fd3d","u+fd40–u+fdcf","u+fdf0–u+fe1f","u+fe20–u+fe2f","u+fe30–u+fe44","u+fe47–u+fffd","u.element>","u.generatortype.el","u0001f496","u2665","uinavigationcontrol","uint","uint16","uint16(on","uint16有一个构造器,可以接受一个uint8类型的值,所以这个构造器可以用现有的uint8来创建一个新的uint16。注意,你并不能传入任意类型的值,只能传入uint16","uint16,可以进行相加。目标常量twothousandandone的类型被推测为uint16,因为它是两个uint16","uint32","uint8","uint8.max","uint8.min","uint,除非你真的需要存储一个和当前平台原生字长相同的无符号整数。除了这种情况,最好使用int,即使你要存储的值已知是非负的。统一使用int","uitableviewdeleg","unabl","uncertainti","uncom","undefinedundefin","underli","unicod","unicodescalar","unicodescalarview","unions)和变体(vari","unions),或者变体(vari","unions),标签联合(tag","unlock","unlocklevel(level","unnnn","unnnnnnnn","uno","unown","unusualmenageri","unwrap","up","upc-a格式的一维码,它使用数字0到9.每一个条形码都有一个代表“数字系统”的数字,该数字后接10","upc-a码作为三个整型值的元组,和把qr","upca(int","upca(let","upca(numbersystem","upper","uppercamelcas","uppercas","uppercasestr","uranu","us","uss","utf-16","utf-8","utf-8utf-16unicod","utf16","utf16count","utf16view","utf8","utf8view","v","valu","value),当其不可访问时,?之后语句不会执行,并返回nil","values(first","values)函数参数名(funct","values)原始值(raw","values)可变参数(variad","values)多重输入参数(multipl","values)多重返回值函数(funct","values)默认值参数的外部参数名(extern","valuetofind","valuetofind”。不是所有的swift中的类型都可以用等式符(==)进行比较。例如,如果你创建一个你自己的类或结构体来表示一个复杂的数据模型,那么swift没法猜到对于这个类或结构体而言“等于”的意思。正因如此,这部分代码不能可能保证工作于每个可能的类型t","valuetyp","value),因为这些量是不能被修改的。当传入的参数作为输入输出参数时,需要在参数前加&","var","variabl","variable-declar","variablestr","variad","var关键字定义计算属性,包括只读计算属性,因为他们的值不是固定的。let","var定义),也可以是常量存储属性(用关键字let","var或者let","veget","vegetablecom","vehicl","vehicle的一个新的子类,叫car,它重写了从vehicle类继承来的'description'","vehicle的基类。这个基类声明了两个对所有车辆都通用的属性(numberofwheels和maxpassengers)。这些属性在description方法中使用,这个方法返回一个str","vehicle类中maxpassengers的默认值对自行车来说已经是正确的,因此在bicycle的初始化器中并没有改变它。而numberofwheels原来的值对自行车来说是不正确的,因此在初始化器中将它更改为2","vehicle类定义了初始化器(initi","vehicle类的初始化器为任意的一辆车设置一些初始化属性值(numberofwheel","vendcoins(var","vendcoins方法在bank分发硬币之前检查是否有足够的硬币。如果没有足够多的硬币,bank返回一个比请求时小的数字(如果没有硬币留在bank中就返回0)。vendcoins方法声明numberofcoinstovend为一个变量参数,这样就可以在方法体的内部修改数字,而不需要定义一个新的变量。vendcoin","venu","veri","verona","version","view","void","void。在swift中,void","void是空元组类型()的别名。如果括号内只有一个元素,那么该类型就是括号内元素的类型。比如,(int)的类型是int而不是(int","void(参见funct","void?,而不是void,因为当通过可选链调用方法时返回值总是自判断类型(opt","volum","vowel","vowel代替character.kind.vowel","vumet","w","wai","want","watch","water","watercress","weak","weak或者unowned关键字和实例的引用(如self或someinst","web","welcom","welcomemessag","welcomemessage变量添加了类型标注,表示这个变量可以存储str","well","west","wheel","whenev","where­requirement-list","where语句。where语句由关键字wher","where语句中的要求用于指明该类型形参继承自某个类或遵守某个协议或协议的一部分。尽管where语句有助于表达类型形参上的简单约束(如t","where语句作为一个类型参数队列的一部分。一个where语句使你能够要求一个关联类型遵循一个特定的协议,以及(或)那个特定的类型参数和关联类型可以是相同的。你可写一个where语句,通过紧随放置wher","where语句的一部分,写在关键字wher","where,只在冒号后面写接口或者类名。<t","whether","while-condit","while-stat","whisper","whitespac","width","width=\"169","width=\"243","width=\"252","width=\"388","widthlabel","willset","willset(newtotalstep","willset和didset","willset和didset的实际例子,其中定义了一个名为stepcount","willset或didset实现是不恰当。此外还要注意,你不可以同时提供重写的setter和重写的属性观察器。如果你想观察属性值的变化,并且你已经为那个属性提供了定制的setter,那么你在sett","willset监视器会将新的属性值作为固定参数传入,在willset的实现代码中可以为这个参数指定一个名称,如果不指定则参数仍然可用,这时使用默认名称newvalu","willset监视器将表示新值的参数自定义为newtotalstep","win","wincoins(coin","wiseword","wishhappybirthday(birthdayperson","wishhappybirthday(celebr","wishhappybirthday函数,该函数的形参celebrator的类型为protocol<named,aged>","within","withjoin","without","won","word","work","world","world"","world打开playground(item","result","result(str","result(sunris","return","returnfifteen","rh","rhsitem","sandwich","score","secondforloop","see","self","self.nam","self.sidelength","self被用来区别实例变量。当你创建实例的时候,像传入函数参数一样给类传入构造器的参数。每个属性都需要赋值——无论是通过声明(就像numberofsides)还是通过构造器(就像nam","sequenc","serverrespons","serverresponse.error(\"out","serverresponse.result(\"6:00","serverresponse和switch","set","setter","seven","shape","shape.numberofsid","shape.simpledescript","shapedescript","shape类缺少了一些重要的东西:一个构造函数来初始化类实例。使用init","shinyzhu","shoppinglist","shoppinglist[1","side","sidelength","simpl","simpleclass","simpledescript","simplestructur","simplestructure时候mutating关键字用来标记一个会修改结构体的方法。simpleclass","six","size","some(100","some(t","sort([1","soup","spade","spici","squar","square(sidelength","square.sidelength","standard","stanzhai","string","string(self.toraw","string(width","struct","structur","success","suit","suit.heart","suit.simpledescript","suit添加一个color方法,对spades和clubs返回“black”,对hearts和diamonds返回“r","sum","sumof","sumof(42","sumof(numb","sunris","sunset","super.init(nam","swift","switch","switch中匹配到的子句之后,程序会退出switch语句,并不会继续向下运行,所以不需要在每个子句结尾写break","t","t.generatortype.el","tast","tea","teamscor","ten","test","test.area","test.simpledescript","three","threedescript","threeofspad","threeofspades.simpledescript","threeofspadesdescript","time","todai","toraw和fromraw","triagl","triangl","triangle.perimet","triangle.sidelength","triangleandsquar","triangleandsquare(s","triangleandsquare.squar","triangleandsquare.square.sidelength","triangleandsquare.triangle.sidelength","true","tuesdai","tulip","two","type","u","u.generatortype.el","uncom","undefinedundefin","valu","var","veget","vegetablecom","veri","water","watercress","where,只在冒号后面写协议或者类名。<t","width","widthlabel","willset","willset和didset","world","x","x.hassuffix(\"pepp","xcode","y"],"chapter1/chapter1.html#gitbook_742":["swift","undefinedundefin"],"chapter2/13_Inheritance.html#gitbook_743":["0","0.0","0和maxpasseng","1","10.0","2","35.0","4","40.0","5","60.0","automat","automatic.descript","automatic.spe","automaticcar","automaticcar的speed属性,属性的didset观察器就会自动地设置gear属性,为新的速度选择一个合适的挡位。具体来说就是,属性观察器将新的速度值除以10,然后向下取得最接近的整数值,最后加1来得到档位gear的值。例如,速度为10.0时,挡位为1;速度为35.0时,挡位为4","automaticcar,它是car的子类。automaticcar表示自动挡汽车,它可以根据当前的速度自动选择合适的挡位。automaticcar也提供了定制的descript","base","bicycl","bicycle.descript","bicycle不仅可以继承vehicle的属性,还可以继承它的方法。如果你创建了一个bicycle类的实例,你就可以调用它继承来的descript","bicycle是vehicle的子类,vehicle是bicycle的超类。新的bicycle类自动获得vehicl","bicycle的一个子类:双人自行车(tandem)。tandem从bicycle继承了两个属性,而这两个属性是bicycle从vehicle继承而来的。tandem","bicycle类定义了一个构造器来设置它定制的特性(自行车只有2个轮子)。bicycle的构造器调用了它父类vehicl","bicycle,它继承了vehicl","calss","car","car.descript","car中的description方法并非完全自定义,而是通过super.description使用了超类vehicle中的descript","car声明了一个新的存储型属性speed,它是double类型的,默认值是0.0,表示“时速是0英里”。car有自己的初始化器,它将乘客的最大数量设为5,轮子数量设为4","car的新实例,并打印descript","car重写了继承来的description方法,它的声明与vehicle中的description方法一致,声明前面加上了overrid","class","class前添加@final特性(@fin","class)子类生成(subclassing)重写(overriding)访问超类的方法,属性及下标脚本重写方法重写属性重写属性的getters和setters重写属性观察器(properti","descript","didset","doubl","final","final来防止它们被重写,只需要在声明关键字前加上@final特性即可。(例如:@fin","func","gear","getter","getters和sett","getter和sett","hawstein","inherit","inheritance)定义一个基类(bas","inherit)另一个类的方法(methods),属性(property)和其它特性。当一个类继承其它类时,继承类叫子类(subclass),被继承类叫超类(或父类,superclass","init","instanc","int","int(spe","limitedcar","limitedcar.descript","limitedcar.spe","maxpasseng","maxpassengers和numberofwheels属性。你可以在子类中定制这些特性,或添加新的特性来更好地描述bicycl","menlongsheng","method),实例属性(inst","method),类方法(class","min(newvalu","mph","name=\"defining_a_base_class\">hello","paragraph","paragraph变量为nil,打破它持有的htmlelement实例的强引用,htmlel","paragraph变量定义为可选htmlelement,因此我们可以赋值nil","person","person(nam","person?的变量,用来按照代码片段中的顺序,为新的person实例建立多个引用。由于这些变量是被定义为可选类型(person?,而不是person),它们的值会被自动初始化为nil,目前还不会引用到person","person和apart","person和apartment实例并将类实例赋值给john和number73","person和apartment的例子一致,但是有一个重要的区别。这一次,apartment的ten","person和apartment的例子展示了两个属性的值都允许为nil","person实例依然保持对apartment实例的强引用,但是apartment实例只是对person实例的弱引用。这意味着当你断开john变量所保持的强引用时,再也没有指向person","person实例有一个类型为string,名字为name的属性,并有一个可选的初始化为nil的apartment属性。apart","person实例现在有了一个指向apartment实例的强引用,而apartment实例也有了一个指向person实例的强引用。因此,当你断开john和number73","person实例的引用数量,并且会在person","person实例,这也意味着你不再使用这个person","person类开始,并定义了一个叫nam","person类有一个构造函数,此构造函数为实例的name属性赋值并打印出信息,以表明初始化过程生效。person","person类的新实例被赋值给了reference1变量,所以reference1到person类的新实例之间建立了一个强引用。正是因为这个强引用,arc","person类的构造函数的时候,"john","print","println(\"\\(country.name)'","println(\"\\(nam","println(\"apart","println(\"card","println(paragraph!.ashtml","prints\"hello","quot","refer","reference1","reference2","reference3","reference)和无主引用(unown","return","self","self.capitalc","self.countri","self.custom","self.nam","self.name)>\\(text)(arrai","equatable类型都可以安全的使用在findindex函数中,因为其保证支持等式操作。为了说明这个事实,当你定义一个函数时,你可以写一个equat","equatable,也就意味着“任何t类型都遵循equat","equival","extens","fals","findindex([\"mik","findindex([3.14159","findindex(arrai","findindex中这个单个类型参数写做:t","findindex函数现在则可以成功的编译过,并且作用于任何遵循equatable的类型,如double或str","findindex,用某个类型t","findstringindex","findstringindex(arrai","findstringindex(str","findstringindex的泛型版本findindex。请注意这个函数仍然返回int","findstringindex的非泛型函数,该函数功能是去查找包含一给定string值的数组。若查找到匹配的字符串,findstringindex函数返回该字符串在数组中的索引值(int),反之则返回nil","for-in循环和半闭区间操作(..)来迭代somecontainer中的所有元素。对于每个元素,函数检查是否somecontainer中的元素不等于对应的anothercontainer中的元素,如果这两个元素不等,则这两个容器不匹配,返回fals","foundindex","fromthetop","func","function","goe","hello","here","implement","in-out)参数来交换a和b","index","inout","int","intstack","intstack指定了container的实现,适用的itemtype被用作int类型。对于这个contain","intstack类型只能用于int值,不过,其对于定义一个泛型stack","intstack类型实现了container协议的所有三个要求,在intstack","intstack类型的非泛型版本,适用于遵循contain","int数组,也可创建一个str","int索引值下标可以检索到每一个item","int这一行,一切仍旧可以工作,因为它清楚的知道itemtyp","int,将抽象的itemtype类型转换为具体的int","item","items.append(item","items.count","items.removelast","items[i","items的属性,使用空的t","itemtyp","itemtype。这个协议不会定义itemtype是什么的别名,这个信息留给了任何遵循协议的类型来提供。尽管如此,itemtype别名支持一种方法识别在一个容器里的items类型,以及定义一种使用在append方法和下标中的类型,以便保证任何期望的contain","itemtype的t","item是如何存储的或何种类型是允许的。这个协议只指定三个任何遵循contain","item的push方法,该参数必须是t","lifedim","llama","malcolm","match","mutat","name=\"associated_types\">(somet","somestr","someu","stack","stack(inout","swaptwovalues例子中,占位类型t是一种类型参数的示例。类型参数指定并命名为一个占位类型,并且紧随在函数名后面,使用一对尖括号括起来(如<t>","swaptwovalues函数中的参数a和b),或作为一个函数返回类型,或用作函数主体中的注释类型。在这种情况下,被类型参数所代表的占位类型不管函数任何时候被调用,都会被实际类型所替换(在上面swaptwovalues例子中,当函数第一次被调用时,t被int替换,第二次调用时,被str","swaptwovalues函数主体和swaptwoints函数是一样的,它只在第一行稍微有那么一点点不同于swaptwoint","swaptwovalues函数和stack","swaptwovalues函数的功能,你可以使用已存在的交换函数swap","swaptwovalues函数除了要求传入的两个任何类型值是同一类型外,也可以作为swaptwoints函数被调用。每次swaptwovalues被调用,t","swaptwovalues是受swap函数启发而实现的。swap","swaptwovalues泛型函数,或一个存储单一类型的泛型集,如数组),通常用一单个字母t","swift","swift的array已经提供append方法,一个count属性和通过下标来查找一个自己的元素。这三个功能都达到container协议的要求。也就意味着你可以扩展array去遵循container协议,只要通过简单声明arrai","swift类型参考,你不用在intstack定义部分声明一个具体的int的itemtype。由于intstack遵循container协议的所有要求,只要通过简单的查找append方法的item参数类型和下标返回的类型,swift就可以推断出合适的itemtyp","t","takalard","temporarya","terrapin","tre","true","typealia","t分别代表int和str","t和keytyp","t定义了一个名为“某种类型t”的节点提供给后来用。这种将来类型可以在结构体的定义里任何地方表示为“t”。在这种情况下,t","t是swaptwovalues函数所定义的一个类型。因为t是一个占位命名类型,swift","t来表示)来代替实际类型名(如in、string或doubl)。占位类型名没有提示t必须是什么类型,但是它提示了a和b必须是同一类型t,而不管t表示什么类型。只有swaptwovalues函数在每次调用时所传入的实际类型才能决定t","t被用作append方法的item参数和下标的返回类型。swift","t)是用尖括号括起来的(<t>","t,有一个需要t必须是someclass子类的类型约束;第二个类型参数u,有一个需要u必须遵循someprotocol","u","uinavigationcontroller类使用来模拟试图控制器的导航结构。你通过调用uinavigationcontroller的pushviewcontroller:animated:方法来为导航栈添加(add)新的试图控制器;而通过popviewcontrolleranimated:的方法来从导航栈中移除(pop","undefinedundefin","uno","valu","valuetofind","var","where语句作为一个类型参数队列的一部分。一个where语句使你能够要求一个关联类型遵循一个特定的协议,以及(或)那个特定的类型参数和关联类型可以是相同的。你可写一个where语句,通过紧随放置wher","where语句的一部分,写在关键字wher","world"],"chapter2/chapter2.html#gitbook_786":["swift","undefinedundefin"],"chapter2/23_Advanced_Operators.html#gitbook_787":["0","0.0","00000000","00000001","00000100","00001000","00010000","00010001","00111100","0b00000101","0b00001111","0b00010100","0b00111111","0b01011110","0b10110010","0b11110000","0b11111100","0x0000ff","0x00ff00","0x66","0x99","0xcc","0xcc6699","0xcc6699和0x0000ff进行按位与运算,得到0x000099,无需向右移位了,所以结果就是0x99,即十进制的153","0xcc6699和0x00ff00的按位操作得到0x006600。然后向右移动8們,得到0x66,即十进制的102","0xcc6699和0xff0000进行按位与&操作就可以得到红色部分。0xff0000中的0了遮盖了oxcc6699的第二和第三个字节,这样6699被忽略了,只留下0xcc0000","0xff0000","0。移位过程中保持符号会不变,负数在接近0","0,代表正数,另外7比特位二进制表示的实际值就刚好是4","0,或者对0","0,负数为1","1","1(11111111向右移1位)。蓝色的是被移位的,灰色是被抛弃的,橙色的0","1(11111111向左移1","1.0","1.0,1.0","10000000","102","11111110","11111111","12","127","128","128,即二进制的10000000。用溢出减法减去去1后,变成了01111111,即uint8所能承载的最大整数127","140","153","16","16。十六进制中每两个字符是8比特位,所以移动16位的结果是把0xcc0000变成0x0000cc。这和0xcc是相等的,都是十进制的204","1个比特位(称为符号位)来表达这个整数是正数还是负数。0代表正数,1","1位时乘于2,右移1位时除于2","1时才为1","1的条件是两个输入数的同一位不同,如果相同就设为0","1的条件是两个输入数的同一位都不为0(即任意一个为1,或都为1","1,代表负数,7个数值位要表达的二进制值是124,即128","2","2.0","2.0,4.0","20","204","255","2的n次方减去它的绝对值,n为数值位的位数。一个8比特的数有7个数值位,所以是2的7次方,即128","2的整数。向左移动一个整型的比特位相当于把这个数乘于2,向右移一位就是除于2","3","3.0","3.0,1.0","32767","4","4.0","4而不是0。优先级高的运算符要先计算,在swift和c","5","5.0","5.0,5.0","6","6.0","8","8.0","afterdoubl","afterincr","alsoposit","amp","amp;/和&%进行除0操作时就会得到0","anothertwothre","anothervector","art/bitshiftsigned_2x.png","art/bitshiftsignedaddition_2x.png","art/bitshiftsignedfour_2x.png","art/bitshiftsignedminusfour_2x.png","art/bitshiftsignedminusfourvalue_2x.png","art/bitshiftunsigned_2x.png","art/bitwiseand_2x.png","art/bitwisenot_2x.png","art/bitwiseor_2x.png","art/bitwisexor_2x.png","art/overflowaddition_2x.png","art/overflowsignedsubtraction_2x.png","art/overflowunsignedsubtraction_2x.png","art/vectoraddition_2x.png","assign","assignment属性,还需要把运算符的左参数设置成inout","associ","associativity)的值可取的值有left,right和non","associativity)的值默认为none,优先级(precedence)默认为100","a?b:c","bluecompon","bool","combinedbit","combinedvector","c语言中的数值计算,swift的数值计算默认是不可溢出的。溢出行为会被捕获并报告为错误。你是故意的?好吧,你可以使用swift为你准备的另一套默认允许溢出的数值运算符,如可溢出加&+。所有允许溢出的运算符都是以&","firstbit","firstbits和otherbits都有一个1跟另一个数不同的。所以按位异或的结果是把它这些位置为1,其他都置为0","firstsixbit","firstsixbits和lastsixbits中间4个位都为1。对它俩进行按位与运算后,就得到了00111100,即十进制的60","firstvector","func","function","greencompon","gt;>","gt;!&","infix","initialbit","initialbits操作,然后赋值给invertedbits这个新常量。这个新常量的值等于所有位都取反的initialbits,即1变成0,0变成1,变成了11110000,十进制值为240","inout","int16","int16.max","int16整型能承载的整数范围是-32768到32767","int8.min","invertedbit","lastsixbit","left","left.i","left.x","left和right,代表+左边和右边的两个vector2d对象。函数返回了一个新的vector2d的对象,这个对象的x和y分别等于两个参数对象的x和i","left,优先级为140","lt","lt;<","lt;<和右移运算符>>","middlefourbit","morebit","name=\"bitwise_operators\">$0$1$2`。例如,class`class`。反引号不属于标识符的一部分,`x`(x","comparable等同于t","comparable表示任何用于替代类型形参t的类型实参必须满足compar","comparable,等等),但是依然可以用来对类型形参及其关联约束提供更复杂的约束。如,<t","constrain","dictionary":{"docs":{},"$":{"0":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"、":{"docs":{},"<":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"$":{"1":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"、":{"docs":{},"<":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"$":{"2":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}},"docs":{}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}},"docs":{}},"`":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"<":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"`":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"。":{"docs":{},"反":{"docs":{},"引":{"docs":{},"号":{"docs":{},"不":{"docs":{},"属":{"docs":{},"于":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},",":{"docs":{},"<":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},">":{"docs":{},"`":{"docs":{},"x":{"docs":{},"`":{"docs":{},"<":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.28757302177376526},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},">":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}},"等":{"docs":{},"同":{"docs":{},"于":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}},"表":{"docs":{},"示":{"docs":{},"任":{"docs":{},"何":{"docs":{},"用":{"docs":{},"于":{"docs":{},"替":{"docs":{},"代":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"t":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"实":{"docs":{},"参":{"docs":{},"必":{"docs":{},"须":{"docs":{},"满":{"docs":{},"足":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"等":{"docs":{},"等":{"docs":{},")":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"依":{"docs":{},"然":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"对":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"及":{"docs":{},"其":{"docs":{},"关":{"docs":{},"联":{"docs":{},"约":{"docs":{},"束":{"docs":{},"提":{"docs":{},"供":{"docs":{},"更":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"的":{"docs":{},"约":{"docs":{},"束":{"docs":{},"。":{"docs":{},"如":{"docs":{},",":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},".":{"docs":{},"w":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}},"s":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"和":{"docs":{},"w":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"不":{"docs":{},"是":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"的":{"docs":{},"等":{"docs":{},"于":{"0":{"docs":{},",":{"1":{"docs":{},",":{"2":{"docs":{},"和":{"3":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},"的":{"docs":{},",":{"docs":{},"这":{"docs":{},"些":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"在":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}},"i":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251}},"e":{"docs":{},"-":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}},"u":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":2.004866180048662}}}}},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}}}}}},"m":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.006309148264984227}}}}}}},"l":{"0":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"1":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":5.004338394793926},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.010169491525423728}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},",":{"docs":{},"列":{"docs":{},"表":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},")":{"docs":{},"或":{"docs":{},"序":{"docs":{},"列":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.007611798287345386}}},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.11891891891891893},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588}},"s":{"docs":{},"个":{"docs":{},"数":{"docs":{},"的":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"存":{"docs":{},"储":{"docs":{},",":{"docs":{},"将":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"大":{"docs":{},"小":{"docs":{},"和":{"docs":{},"数":{"docs":{},"组":{"docs":{},"每":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"0":{"docs":{},".":{"0":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}},"(":{"0":{"docs":{},".":{"0":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}},"docs":{}}},"docs":{},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"包":{"docs":{},"含":{"docs":{},"三":{"docs":{},"个":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"三":{"docs":{},"个":{"docs":{},"常":{"docs":{},"量":{"docs":{},":":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"、":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{},"和":{"docs":{},"b":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"属":{"docs":{},"性":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"0":{"docs":{},".":{"0":{"docs":{},"到":{"1":{"docs":{},".":{"0":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"e":{"docs":{},"d":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"e":{"docs":{},"s":{"docs":{},"[":{"docs":{},"\"":{"docs":{},"p":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"e":{"docs":{},"[":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}}}}}}}}},"y":{"docs":{},"方":{"docs":{},"法":{"docs":{},"进":{"docs":{},"行":{"docs":{},"强":{"docs":{},"制":{"docs":{},"显":{"docs":{},"式":{"docs":{},"复":{"docs":{},"制":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"对":{"docs":{},"数":{"docs":{},"组":{"docs":{},"进":{"docs":{},"行":{"docs":{},"了":{"docs":{},"浅":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"(":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801}}},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.08387096774193549}},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.025806451612903226}}}}}},"p":{"docs":{},"u":{"docs":{},"r":{"docs":{},"s":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.025806451612903226}}}}}}}}}}}},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.008982035928143712},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.00881057268722467}}}}},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"'":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.013011152416356878}}}}}}},"i":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"在":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"中":{"docs":{},"给":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"后":{"docs":{},",":{"docs":{},"整":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"过":{"docs":{},"程":{"docs":{},"就":{"docs":{},"完":{"docs":{},"成":{"docs":{},"了":{"docs":{},"。":{"docs":{},"这":{"docs":{},"代":{"docs":{},"表":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"后":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"就":{"docs":{},"能":{"docs":{},"引":{"docs":{},"用":{"docs":{},"并":{"docs":{},"传":{"docs":{},"递":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"。":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"在":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"时":{"docs":{},",":{"docs":{},"就":{"docs":{},"能":{"docs":{},"将":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"作":{"docs":{},"为":{"docs":{},"参":{"docs":{},"数":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.006607929515418502},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.012024048096192385}}}}}}},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.021897810218978103}},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}},"中":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"方":{"docs":{},"法":{"docs":{},"并":{"docs":{},"非":{"docs":{},"完":{"docs":{},"全":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},",":{"docs":{},"而":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"超":{"docs":{},"类":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"中":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},",":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"是":{"0":{"docs":{},".":{"0":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"“":{"docs":{},"时":{"docs":{},"速":{"docs":{},"是":{"0":{"docs":{},"英":{"docs":{},"里":{"docs":{},"”":{"docs":{},"。":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"有":{"docs":{},"自":{"docs":{},"己":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},",":{"docs":{},"它":{"docs":{},"将":{"docs":{},"乘":{"docs":{},"客":{"docs":{},"的":{"docs":{},"最":{"docs":{},"大":{"docs":{},"数":{"docs":{},"量":{"docs":{},"设":{"docs":{},"为":{"5":{"docs":{},",":{"docs":{},"轮":{"docs":{},"子":{"docs":{},"数":{"docs":{},"量":{"docs":{},"设":{"docs":{},"为":{"4":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}},"docs":{}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"新":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"打":{"docs":{},"印":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}},"重":{"docs":{},"写":{"docs":{},"了":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},"与":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"中":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"方":{"docs":{},"法":{"docs":{},"一":{"docs":{},"致":{"docs":{},",":{"docs":{},"声":{"docs":{},"明":{"docs":{},"前":{"docs":{},"面":{"docs":{},"加":{"docs":{},"上":{"docs":{},"了":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.02383654937570942},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.07516650808753568},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0728476821192053},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.019438444924406047},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0390625},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.017241379310344827},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.00842358604091456},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.1465093411996068},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.03571428571428571},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.04208416833667335},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.10508474576271186}},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}},"s":{"docs":{},"里":{"docs":{},"用":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}}}}},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"层":{"docs":{},"次":{"docs":{},"作":{"docs":{},"为":{"docs":{},"例":{"docs":{},"子":{"docs":{},"检":{"docs":{},"查":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":3.333333333333333}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"f":{"docs":{},"i":{"docs":{},"s":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"e":{"docs":{},"g":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"类":{"docs":{},"似":{"docs":{},"。":{"docs":{},"(":{"docs":{},"不":{"docs":{},"过":{"docs":{},"与":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"是":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23498238195912613},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.34703022937870276}}}},"n":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"b":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}},"a":{"docs":{},"d":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}},"'":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},".":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.00929368029739777}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}}}}}},"s":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}},"s":{"docs":{},"(":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"f":{"docs":{},"a":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"v":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}},"。":{"docs":{},"它":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},":":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"f":{"docs":{},"a":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{},":":{"docs":{},")":{"docs":{},"和":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"v":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471}}},"属":{"docs":{},"性":{"docs":{},"之":{"docs":{},"后":{"docs":{},"被":{"docs":{},"设":{"docs":{},"置":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"值":{"docs":{},"(":{"1":{"5":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"docs":{}},"docs":{}}}}}}}}}}}}}}},".":{"docs":{},"i":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}},"x":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}}}},"和":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"值":{"docs":{},"计":{"docs":{},"算":{"docs":{},"一":{"docs":{},"个":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"原":{"docs":{},"点":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},"调":{"docs":{},"用":{"docs":{},"该":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"自":{"docs":{},"动":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},":":{"docs":{},"s":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588}},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"a":{"docs":{},"s":{"docs":{},"k":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"k":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.013245033112582781},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},"e":{"docs":{},"r":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415}},"实":{"docs":{},"例":{"docs":{},"创":{"docs":{},"建":{"docs":{},"时":{"docs":{},",":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"会":{"docs":{},"执":{"docs":{},"行":{"docs":{},",":{"docs":{},"一":{"docs":{},"系":{"docs":{},"列":{"docs":{},"颜":{"docs":{},"色":{"docs":{},"值":{"docs":{},"会":{"docs":{},"被":{"docs":{},"计":{"docs":{},"算":{"docs":{},"出":{"docs":{},"来":{"docs":{},"作":{"docs":{},"为":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"。":{"docs":{},"上":{"docs":{},"面":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"描":{"docs":{},"述":{"docs":{},"的":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"将":{"docs":{},"计":{"docs":{},"算":{"docs":{},"出":{"docs":{},"棋":{"docs":{},"盘":{"docs":{},"中":{"docs":{},"每":{"docs":{},"个":{"docs":{},"格":{"docs":{},"子":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"颜":{"docs":{},"色":{"docs":{},",":{"docs":{},"将":{"docs":{},"这":{"docs":{},"些":{"docs":{},"颜":{"docs":{},"色":{"docs":{},"值":{"docs":{},"保":{"docs":{},"存":{"docs":{},"到":{"docs":{},"一":{"docs":{},"个":{"docs":{},"临":{"docs":{},"时":{"docs":{},"数":{"docs":{},"组":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"中":{"docs":{},",":{"docs":{},"并":{"docs":{},"在":{"docs":{},"构":{"docs":{},"建":{"docs":{},"完":{"docs":{},"成":{"docs":{},"时":{"docs":{},"将":{"docs":{},"此":{"docs":{},"数":{"docs":{},"组":{"docs":{},"作":{"docs":{},"为":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"返":{"docs":{},"回":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"值":{"docs":{},"将":{"docs":{},"保":{"docs":{},"存":{"docs":{},"到":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"中":{"docs":{},",":{"docs":{},"并":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"i":{"docs":{},"s":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"n":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}}},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.8775889537971323},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.006660323501427212},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.00946372239747634}},"e":{"docs":{},"r":{"1":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.00929368029739777}}},"2":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}},"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}},"s":{"docs":{},")":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2857142857142857}}}}}}}}}}}}}},"(":{"docs":{},"字":{"docs":{},"符":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"的":{"docs":{},"集":{"docs":{},"合":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"的":{"docs":{},"可":{"docs":{},"能":{"docs":{},"性":{"docs":{},"都":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"出":{"docs":{},"来":{"docs":{},"是":{"docs":{},"不":{"docs":{},"现":{"docs":{},"实":{"docs":{},"的":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"分":{"docs":{},"支":{"docs":{},"来":{"docs":{},"包":{"docs":{},"含":{"docs":{},"所":{"docs":{},"有":{"docs":{},"上":{"docs":{},"面":{"docs":{},"没":{"docs":{},"有":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"字":{"docs":{},"符":{"docs":{},"的":{"docs":{},"情":{"docs":{},"况":{"docs":{},"。":{"docs":{},"由":{"docs":{},"于":{"docs":{},"这":{"docs":{},"个":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"分":{"docs":{},"支":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"执":{"docs":{},"行":{"docs":{},"任":{"docs":{},"何":{"docs":{},"动":{"docs":{},"作":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"它":{"docs":{},"只":{"docs":{},"写":{"docs":{},"了":{"docs":{},"一":{"docs":{},"条":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"落":{"docs":{},"入":{"docs":{},"到":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"分":{"docs":{},"支":{"docs":{},"中":{"docs":{},"后":{"docs":{},",":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"就":{"docs":{},"完":{"docs":{},"成":{"docs":{},"了":{"docs":{},"该":{"docs":{},"分":{"docs":{},"支":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"代":{"docs":{},"码":{"docs":{},"操":{"docs":{},"作":{"docs":{},",":{"docs":{},"代":{"docs":{},"码":{"docs":{},"继":{"docs":{},"续":{"docs":{},"向":{"docs":{},"下":{"docs":{},",":{"docs":{},"开":{"docs":{},"始":{"docs":{},"执":{"docs":{},"行":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364}}}}}}}},"值":{"docs":{},"或":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"值":{"docs":{},",":{"docs":{},"相":{"docs":{},"加":{"docs":{},"会":{"docs":{},"生":{"docs":{},"成":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"是":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"型":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"中":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"成":{"docs":{},"员":{"docs":{},"值":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"计":{"docs":{},"算":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"即":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"返":{"docs":{},"回":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"新":{"docs":{},"的":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"\\":{"0":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}},"docs":{}}}}}}}}},"i":{"docs":{},"n":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":5.003174603174603},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"是":{"docs":{},"一":{"docs":{},"种":{"docs":{},"可":{"docs":{},"以":{"docs":{},"请":{"docs":{},"求":{"docs":{},"和":{"docs":{},"调":{"docs":{},"用":{"docs":{},"属":{"docs":{},"性":{"docs":{},"、":{"docs":{},"方":{"docs":{},"法":{"docs":{},"及":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"的":{"docs":{},"过":{"docs":{},"程":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"性":{"docs":{},"体":{"docs":{},"现":{"docs":{},"于":{"docs":{},"请":{"docs":{},"求":{"docs":{},"或":{"docs":{},"调":{"docs":{},"用":{"docs":{},"的":{"docs":{},"目":{"docs":{},"标":{"docs":{},"当":{"docs":{},"前":{"docs":{},"可":{"docs":{},"能":{"docs":{},"为":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},")":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"目":{"docs":{},"标":{"docs":{},"有":{"docs":{},"值":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"调":{"docs":{},"用":{"docs":{},"就":{"docs":{},"会":{"docs":{},"成":{"docs":{},"功":{"docs":{},";":{"docs":{},"相":{"docs":{},"反":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"选":{"docs":{},"择":{"docs":{},"的":{"docs":{},"目":{"docs":{},"标":{"docs":{},"为":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},")":{"docs":{},",":{"docs":{},"则":{"docs":{},"这":{"docs":{},"种":{"docs":{},"调":{"docs":{},"用":{"docs":{},"将":{"docs":{},"返":{"docs":{},"回":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},")":{"docs":{},"。":{"docs":{},"多":{"docs":{},"次":{"docs":{},"请":{"docs":{},"求":{"docs":{},"或":{"docs":{},"调":{"docs":{},"用":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"链":{"docs":{},"接":{"docs":{},"在":{"docs":{},"一":{"docs":{},"起":{"docs":{},"形":{"docs":{},"成":{"docs":{},"一":{"docs":{},"个":{"docs":{},"链":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"任":{"docs":{},"何":{"docs":{},"一":{"docs":{},"个":{"docs":{},"节":{"docs":{},"点":{"docs":{},"为":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}},"o":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809}}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.011350737797956867},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.040145985401459854},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.015283842794759825},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.015267175572519083},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.012867647058823529},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.01904761904761905},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.02095238095238095},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.01684717208182912},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.012944983818770227},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.014317180616740088},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.01},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}},"前":{"docs":{},"添":{"docs":{},"加":{"docs":{},"@":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"特":{"docs":{},"性":{"docs":{},"(":{"docs":{},"@":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}},")":{"docs":{},"子":{"docs":{},"类":{"docs":{},"生":{"docs":{},"成":{"docs":{},"(":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"重":{"docs":{},"写":{"docs":{},"(":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"访":{"docs":{},"问":{"docs":{},"超":{"docs":{},"类":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"及":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"重":{"docs":{},"写":{"docs":{},"方":{"docs":{},"法":{"docs":{},"重":{"docs":{},"写":{"docs":{},"属":{"docs":{},"性":{"docs":{},"重":{"docs":{},"写":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"重":{"docs":{},"写":{"docs":{},"属":{"docs":{},"性":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":3.333333333333333}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"、":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},")":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"(":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},"这":{"docs":{},"些":{"docs":{},"目":{"docs":{},"标":{"docs":{},"中":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"认":{"docs":{},"为":{"docs":{},"是":{"docs":{},"访":{"docs":{},"问":{"docs":{},"对":{"docs":{},"象":{"docs":{},"、":{"docs":{},"集":{"docs":{},"合":{"docs":{},"或":{"docs":{},"序":{"docs":{},"列":{"docs":{},"的":{"docs":{},"快":{"docs":{},"捷":{"docs":{},"方":{"docs":{},"式":{"docs":{},",":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"再":{"docs":{},"调":{"docs":{},"用":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"和":{"docs":{},"访":{"docs":{},"问":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"举":{"docs":{},"例":{"docs":{},"来":{"docs":{},"说":{"docs":{},",":{"docs":{},"用":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"访":{"docs":{},"问":{"docs":{},"一":{"docs":{},"个":{"docs":{},"数":{"docs":{},"组":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"它":{"docs":{},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"该":{"docs":{},"属":{"docs":{},"性":{"docs":{},"为":{"docs":{},"类":{"docs":{},"成":{"docs":{},"员":{"docs":{},";":{"docs":{},"用":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"或":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"实":{"docs":{},"现":{"docs":{},"协":{"docs":{},"议":{"docs":{},"时":{"docs":{},",":{"docs":{},"则":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"表":{"docs":{},"示":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"为":{"docs":{},"类":{"docs":{},"成":{"docs":{},"员":{"docs":{},";":{"docs":{},"当":{"docs":{},"协":{"docs":{},"议":{"docs":{},"用":{"docs":{},"于":{"docs":{},"被":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"或":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"时":{"docs":{},",":{"docs":{},"则":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"声":{"docs":{},"明":{"docs":{},"类":{"docs":{},"的":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"用":{"docs":{},"来":{"docs":{},"声":{"docs":{},"明":{"docs":{},"类":{"docs":{},"的":{"docs":{},"静":{"docs":{},"态":{"docs":{},"变":{"docs":{},"量":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"类":{"docs":{},"和":{"docs":{},"静":{"docs":{},"态":{"docs":{},"变":{"docs":{},"量":{"docs":{},"在":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"现":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"的":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"方":{"docs":{},"法":{"docs":{},"时":{"docs":{},",":{"docs":{},"不":{"docs":{},"用":{"docs":{},"写":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},";":{"docs":{},"用":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},",":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"实":{"docs":{},"现":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"的":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"方":{"docs":{},"法":{"docs":{},"时":{"docs":{},",":{"docs":{},"必":{"docs":{},"须":{"docs":{},"写":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}},"属":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"整":{"docs":{},"个":{"docs":{},"协":{"docs":{},"议":{"docs":{},"声":{"docs":{},"明":{"docs":{},"。":{"docs":{},"任":{"docs":{},"意":{"docs":{},"继":{"docs":{},"承":{"docs":{},"自":{"docs":{},"标":{"docs":{},"记":{"docs":{},"有":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"、":{"docs":{},"d":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"、":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"、":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"、":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"、":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"、":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"、":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"、":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"、":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"、":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"、":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"、":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"a":{"docs":{},"s":{"docs":{},"、":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"协":{"docs":{},"议":{"docs":{},"声":{"docs":{},"明":{"docs":{},"中":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"或":{"docs":{},"必":{"docs":{},"需":{"docs":{},"的":{"docs":{},"静":{"docs":{},"态":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"执":{"docs":{},"行":{"docs":{},"这":{"docs":{},"些":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"类":{"docs":{},"也":{"docs":{},"用":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.023952095808383235},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.00881057268722467},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"值":{"docs":{},"(":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}}}}}}}},"闭":{"docs":{},"包":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}}}}}}}}}}}},")":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"可":{"docs":{},"执":{"docs":{},"行":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"(":{"docs":{},"跟":{"docs":{},"方":{"docs":{},"法":{"docs":{},"主":{"docs":{},"体":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"缩":{"docs":{},"写":{"docs":{},"(":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"s":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"u":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}},"u":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.010917030567685589},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028}},"值":{"docs":{},"大":{"docs":{},"于":{"docs":{},"任":{"docs":{},"何":{"docs":{},"之":{"docs":{},"前":{"docs":{},"任":{"docs":{},"意":{"docs":{},"a":{"docs":{},"u":{"docs":{},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{},"实":{"docs":{},"例":{"docs":{},"中":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"将":{"docs":{},"新":{"docs":{},"值":{"docs":{},"保":{"docs":{},"存":{"docs":{},"在":{"docs":{},"静":{"docs":{},"态":{"docs":{},"属":{"docs":{},"性":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"包":{"docs":{},"含":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}},"的":{"docs":{},"新":{"docs":{},"值":{"docs":{},"大":{"docs":{},"于":{"docs":{},"允":{"docs":{},"许":{"docs":{},"的":{"docs":{},"阈":{"docs":{},"值":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"将":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"的":{"docs":{},"值":{"docs":{},"限":{"docs":{},"定":{"docs":{},"为":{"docs":{},"阈":{"docs":{},"值":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"a":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"会":{"docs":{},"在":{"docs":{},"更":{"docs":{},"新":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"之":{"docs":{},"前":{"docs":{},"检":{"docs":{},"查":{"docs":{},"所":{"docs":{},"请":{"docs":{},"求":{"docs":{},"的":{"docs":{},"新":{"docs":{},"等":{"docs":{},"级":{"docs":{},"是":{"docs":{},"否":{"docs":{},"已":{"docs":{},"经":{"docs":{},"解":{"docs":{},"锁":{"docs":{},"。":{"docs":{},"a":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"方":{"docs":{},"法":{"docs":{},"返":{"docs":{},"回":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},"以":{"docs":{},"指":{"docs":{},"示":{"docs":{},"是":{"docs":{},"否":{"docs":{},"能":{"docs":{},"够":{"docs":{},"设":{"docs":{},"置":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.009696969696969697}}}}}},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.007692307692307693}}}}}}}}}}},"i":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}},"t":{"docs":{},"i":{"docs":{},"z":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}},"b":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}},"的":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"三":{"docs":{},"维":{"docs":{},"空":{"docs":{},"间":{"docs":{},"的":{"docs":{},"立":{"docs":{},"方":{"docs":{},"体":{"docs":{},",":{"docs":{},"包":{"docs":{},"含":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"、":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"t":{"docs":{},"h":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"还":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"v":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"只":{"docs":{},"读":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"用":{"docs":{},"来":{"docs":{},"返":{"docs":{},"回":{"docs":{},"立":{"docs":{},"方":{"docs":{},"体":{"docs":{},"的":{"docs":{},"体":{"docs":{},"积":{"docs":{},"。":{"docs":{},"设":{"docs":{},"置":{"docs":{},"v":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"毫":{"docs":{},"无":{"docs":{},"意":{"docs":{},"义":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"通":{"docs":{},"过":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"、":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"t":{"docs":{},"h":{"docs":{},"就":{"docs":{},"能":{"docs":{},"算":{"docs":{},"出":{"docs":{},"v":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"c":{"docs":{},"u":{"docs":{},"b":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.017142857142857144},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}},"和":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}},"之":{"docs":{},"间":{"docs":{},"的":{"docs":{},"关":{"docs":{},"系":{"docs":{},"与":{"docs":{},"前":{"docs":{},"面":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"关":{"docs":{},"系":{"docs":{},"截":{"docs":{},"然":{"docs":{},"不":{"docs":{},"同":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"数":{"docs":{},"据":{"docs":{},"模":{"docs":{},"型":{"docs":{},"中":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"客":{"docs":{},"户":{"docs":{},"可":{"docs":{},"能":{"docs":{},"有":{"docs":{},"或":{"docs":{},"者":{"docs":{},"没":{"docs":{},"有":{"docs":{},"信":{"docs":{},"用":{"docs":{},"卡":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"一":{"docs":{},"张":{"docs":{},"信":{"docs":{},"用":{"docs":{},"卡":{"docs":{},"总":{"docs":{},"是":{"docs":{},"关":{"docs":{},"联":{"docs":{},"着":{"docs":{},"一":{"docs":{},"个":{"docs":{},"客":{"docs":{},"户":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"表":{"docs":{},"示":{"docs":{},"这":{"docs":{},"种":{"docs":{},"关":{"docs":{},"系":{"docs":{},",":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"类":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"类":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"非":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"展":{"docs":{},"示":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"值":{"docs":{},"允":{"docs":{},"许":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"而":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"允":{"docs":{},"许":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"持":{"docs":{},"有":{"docs":{},"对":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"而":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"持":{"docs":{},"有":{"docs":{},"对":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"该":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"销":{"docs":{},"毁":{"docs":{},"了":{"docs":{},"。":{"docs":{},"其":{"docs":{},"后":{"docs":{},",":{"docs":{},"再":{"docs":{},"也":{"docs":{},"没":{"docs":{},"有":{"docs":{},"指":{"docs":{},"向":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"当":{"docs":{},"你":{"docs":{},"断":{"docs":{},"开":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},"变":{"docs":{},"量":{"docs":{},"持":{"docs":{},"有":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"再":{"docs":{},"也":{"docs":{},"没":{"docs":{},"有":{"docs":{},"指":{"docs":{},"向":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"用":{"docs":{},"它":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"将":{"docs":{},"新":{"docs":{},"创":{"docs":{},"建":{"docs":{},"的":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"客":{"docs":{},"户":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}},".":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}}}}}}},"的":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"属":{"docs":{},"性":{"docs":{},"确":{"docs":{},"已":{"docs":{},"改":{"docs":{},"为":{"docs":{},"了":{"2":{"0":{"4":{"8":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"其":{"docs":{},"值":{"docs":{},"为":{"docs":{},"之":{"docs":{},"前":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"h":{"docs":{},"d":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"c":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"的":{"docs":{},"值":{"docs":{},"其":{"docs":{},"实":{"docs":{},"是":{"docs":{},"h":{"docs":{},"d":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"副":{"docs":{},"本":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"h":{"docs":{},"d":{"docs":{},"本":{"docs":{},"身":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"h":{"docs":{},"d":{"docs":{},"和":{"docs":{},"c":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"有":{"docs":{},"着":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"宽":{"docs":{},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},")":{"docs":{},"和":{"docs":{},"高":{"docs":{},"(":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.007619047619047619}},"z":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}},"y":{"docs":{},"!":{"docs":{},")":{"docs":{},"的":{"docs":{},"方":{"docs":{},"式":{"docs":{},",":{"docs":{},"将":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"解":{"docs":{},"析":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"这":{"docs":{},"表":{"docs":{},"示":{"docs":{},"像":{"docs":{},"其":{"docs":{},"他":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"将":{"docs":{},"实":{"docs":{},"例":{"docs":{},"保":{"docs":{},"存":{"docs":{},"为":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"e":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"d":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},",":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"基":{"docs":{},"类":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"采":{"docs":{},"用":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"都":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"前":{"docs":{},"者":{"docs":{},"把":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"写":{"docs":{},"为":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}},"/":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}},"m":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}},"语":{"docs":{},"言":{"docs":{},"中":{"docs":{},"的":{"docs":{},"数":{"docs":{},"值":{"docs":{},"计":{"docs":{},"算":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"的":{"docs":{},"数":{"docs":{},"值":{"docs":{},"计":{"docs":{},"算":{"docs":{},"默":{"docs":{},"认":{"docs":{},"是":{"docs":{},"不":{"docs":{},"可":{"docs":{},"溢":{"docs":{},"出":{"docs":{},"的":{"docs":{},"。":{"docs":{},"溢":{"docs":{},"出":{"docs":{},"行":{"docs":{},"为":{"docs":{},"会":{"docs":{},"被":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"并":{"docs":{},"报":{"docs":{},"告":{"docs":{},"为":{"docs":{},"错":{"docs":{},"误":{"docs":{},"。":{"docs":{},"你":{"docs":{},"是":{"docs":{},"故":{"docs":{},"意":{"docs":{},"的":{"docs":{},"?":{"docs":{},"好":{"docs":{},"吧":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"为":{"docs":{},"你":{"docs":{},"准":{"docs":{},"备":{"docs":{},"的":{"docs":{},"另":{"docs":{},"一":{"docs":{},"套":{"docs":{},"默":{"docs":{},"认":{"docs":{},"允":{"docs":{},"许":{"docs":{},"溢":{"docs":{},"出":{"docs":{},"的":{"docs":{},"数":{"docs":{},"值":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},",":{"docs":{},"如":{"docs":{},"可":{"docs":{},"溢":{"docs":{},"出":{"docs":{},"加":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},";":{"docs":{},"+":{"docs":{},"。":{"docs":{},"所":{"docs":{},"有":{"docs":{},"允":{"docs":{},"许":{"docs":{},"溢":{"docs":{},"出":{"docs":{},"的":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"都":{"docs":{},"是":{"docs":{},"以":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"等":{"docs":{},"效":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"从":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}},"继":{"docs":{},"承":{"docs":{},"而":{"docs":{},"来":{"docs":{},"的":{"docs":{},"新":{"docs":{},"协":{"docs":{},"议":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}},"f":{"docs":{},"(":{"7":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}}}},"?":{"docs":{},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}}}}}}}}}}}}}}}}},"d":{"1":{"2":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}},"docs":{}},"6":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},".":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}},"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.00929368029739777},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"a":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"1":{"0":{"2":{"2":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.027777777777777776},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.03571428571428571}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}}},"n":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809}}}}}}}},"v":{"docs":{},"e":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114}}}},"t":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}},".":{"docs":{},"t":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.010917030567685589}},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}},"e":{"docs":{},"r":{"docs":{},"也":{"docs":{},"可":{"docs":{},"能":{"docs":{},"不":{"docs":{},"从":{"docs":{},"文":{"docs":{},"件":{"docs":{},"中":{"docs":{},"导":{"docs":{},"入":{"docs":{},"数":{"docs":{},"据":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},"当":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"创":{"docs":{},"建":{"docs":{},"时":{"docs":{},",":{"docs":{},"没":{"docs":{},"必":{"docs":{},"要":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"更":{"docs":{},"明":{"docs":{},"智":{"docs":{},"的":{"docs":{},"是":{"docs":{},"当":{"docs":{},"用":{"docs":{},"到":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"功":{"docs":{},"能":{"docs":{},"是":{"docs":{},"从":{"docs":{},"文":{"docs":{},"件":{"docs":{},"导":{"docs":{},"入":{"docs":{},"数":{"docs":{},"据":{"docs":{},",":{"docs":{},"该":{"docs":{},"功":{"docs":{},"能":{"docs":{},"由":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"类":{"docs":{},"提":{"docs":{},"供":{"docs":{},",":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"空":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"虽":{"docs":{},"然":{"docs":{},"没":{"docs":{},"有":{"docs":{},"写":{"docs":{},"出":{"docs":{},"全":{"docs":{},"部":{"docs":{},"代":{"docs":{},"码":{"docs":{},",":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"能":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"后":{"docs":{},"边":{"docs":{},"加":{"docs":{},"上":{"docs":{},"了":{"docs":{},"?":{"docs":{},"标":{"docs":{},"记":{"docs":{},"来":{"docs":{},"表":{"docs":{},"明":{"docs":{},"只":{"docs":{},"在":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"非":{"docs":{},"空":{"docs":{},"时":{"docs":{},"才":{"docs":{},"去":{"docs":{},"调":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"存":{"docs":{},"在":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"也":{"docs":{},"无":{"docs":{},"法":{"docs":{},"保":{"docs":{},"证":{"docs":{},"其":{"docs":{},"是":{"docs":{},"否":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.008563273073263558},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23619450317124735},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.01694915254237288}},")":{"docs":{},"分":{"docs":{},"支":{"docs":{},"满":{"docs":{},"足":{"docs":{},"该":{"docs":{},"要":{"docs":{},"求":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"默":{"docs":{},"认":{"docs":{},"分":{"docs":{},"支":{"docs":{},"必":{"docs":{},"须":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}},"i":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.012903225806451613},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.017142857142857144},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"i":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":10.006451612903225},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.02857142857142857}}},"来":{"docs":{},"标":{"docs":{},"示":{"docs":{},"析":{"docs":{},"构":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"类":{"docs":{},"似":{"docs":{},"于":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"函":{"docs":{},"数":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.010948905109489052},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}},"c":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414}}}}}}}}},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.027142857142857142},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":10.02004008016032}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}},"p":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353}}}}},"l":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}},"x":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}},"不":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"属":{"docs":{},"性":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}},"并":{"docs":{},"不":{"docs":{},"是":{"docs":{},"该":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"的":{"docs":{},"必":{"docs":{},"备":{"docs":{},"条":{"docs":{},"件":{"docs":{},",":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0170316301703163}}}}},"i":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"<":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"e":{"docs":{},"l":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}},"的":{"docs":{},"键":{"docs":{},"上":{"docs":{},",":{"docs":{},"当":{"docs":{},"然":{"docs":{},"其":{"docs":{},"键":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"(":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"对":{"docs":{},"作":{"docs":{},"用":{"docs":{},"于":{"docs":{},"其":{"docs":{},"键":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"做":{"docs":{},"了":{"docs":{},"些":{"docs":{},"限":{"docs":{},"制":{"docs":{},"。":{"docs":{},"在":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"描":{"docs":{},"述":{"docs":{},"中":{"docs":{},",":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"键":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"可":{"docs":{},"哈":{"docs":{},"希":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"必":{"docs":{},"须":{"docs":{},"有":{"docs":{},"一":{"docs":{},"种":{"docs":{},"方":{"docs":{},"法":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"其":{"docs":{},"被":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"的":{"docs":{},"表":{"docs":{},"示":{"docs":{},"。":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"之":{"docs":{},"所":{"docs":{},"以":{"docs":{},"需":{"docs":{},"要":{"docs":{},"其":{"docs":{},"键":{"docs":{},"是":{"docs":{},"可":{"docs":{},"哈":{"docs":{},"希":{"docs":{},"是":{"docs":{},"为":{"docs":{},"了":{"docs":{},"以":{"docs":{},"便":{"docs":{},"于":{"docs":{},"其":{"docs":{},"检":{"docs":{},"查":{"docs":{},"其":{"docs":{},"是":{"docs":{},"否":{"docs":{},"已":{"docs":{},"经":{"docs":{},"包":{"docs":{},"含":{"docs":{},"某":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"键":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"如":{"docs":{},"无":{"docs":{},"此":{"docs":{},"需":{"docs":{},"求":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"特":{"docs":{},"化":{"docs":{},"版":{"docs":{},"本":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"有":{"docs":{},"两":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"键":{"docs":{},",":{"docs":{},"另":{"docs":{},"外":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"值":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"自":{"docs":{},"己":{"docs":{},"写":{"docs":{},"字":{"docs":{},"典":{"docs":{},",":{"docs":{},"你":{"docs":{},"或":{"docs":{},"许":{"docs":{},"会":{"docs":{},"定":{"docs":{},"义":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"为":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"和":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.016216216216216217},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}}}}}}}}},"e":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.018050541516245487}},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.014272121788772598},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.007220216606498195}},"l":{"docs":{},"的":{"docs":{},"值":{"docs":{},"并":{"docs":{},"不":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"随":{"docs":{},"机":{"docs":{},"数":{"docs":{},",":{"docs":{},"而":{"docs":{},"是":{"docs":{},"以":{"0":{"docs":{},"为":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},",":{"docs":{},"之":{"docs":{},"后":{"docs":{},"每":{"docs":{},"一":{"docs":{},"次":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"循":{"docs":{},"环":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"的":{"docs":{},"值":{"docs":{},"使":{"docs":{},"用":{"docs":{},"前":{"docs":{},"置":{"docs":{},"自":{"docs":{},"增":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"(":{"docs":{},"+":{"docs":{},"+":{"docs":{},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}},"调":{"docs":{},"用":{"docs":{},"完":{"docs":{},"成":{"docs":{},"后":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"等":{"docs":{},"于":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"自":{"docs":{},"增":{"docs":{},"后":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"任":{"docs":{},"何":{"docs":{},"时":{"docs":{},"候":{"docs":{},"如":{"docs":{},"果":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"的":{"docs":{},"值":{"docs":{},"等":{"docs":{},"于":{"7":{"docs":{},"时":{"docs":{},",":{"docs":{},"就":{"docs":{},"超":{"docs":{},"过":{"docs":{},"了":{"docs":{},"骰":{"docs":{},"子":{"docs":{},"的":{"docs":{},"最":{"docs":{},"大":{"docs":{},"值":{"docs":{},",":{"docs":{},"会":{"docs":{},"被":{"docs":{},"重":{"docs":{},"置":{"docs":{},"为":{"1":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"的":{"docs":{},"取":{"docs":{},"值":{"docs":{},"顺":{"docs":{},"序":{"docs":{},"会":{"docs":{},"一":{"docs":{},"直":{"docs":{},"是":{"1":{"docs":{},",":{"2":{"docs":{},",":{"3":{"docs":{},",":{"4":{"docs":{},",":{"5":{"docs":{},",":{"6":{"docs":{},",":{"1":{"docs":{},",":{"2":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},":":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}},"(":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}}}}}},".":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.009626955475330927}},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"三":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"用":{"docs":{},"来":{"docs":{},"追":{"docs":{},"踪":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"过":{"docs":{},"程":{"docs":{},"。":{"docs":{},"被":{"docs":{},"放":{"docs":{},"置":{"docs":{},"于":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"的":{"docs":{},"逻":{"docs":{},"辑":{"docs":{},"中":{"docs":{},",":{"docs":{},"即":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}},"协":{"docs":{},"议":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"任":{"docs":{},"意":{"docs":{},"含":{"docs":{},"有":{"docs":{},"骰":{"docs":{},"子":{"docs":{},"的":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"中":{"docs":{},"实":{"docs":{},"现":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"追":{"docs":{},"踪":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"含":{"docs":{},"有":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"和":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"两":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"前":{"docs":{},"者":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"骰":{"docs":{},"子":{"docs":{},"有":{"docs":{},"几":{"docs":{},"个":{"docs":{},"面":{"docs":{},",":{"docs":{},"后":{"docs":{},"者":{"docs":{},"为":{"docs":{},"骰":{"docs":{},"子":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"随":{"docs":{},"机":{"docs":{},"数":{"docs":{},"生":{"docs":{},"成":{"docs":{},"器":{"docs":{},"。":{"docs":{},"由":{"docs":{},"于":{"docs":{},"后":{"docs":{},"者":{"docs":{},"为":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"类":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"代":{"docs":{},"表":{"docs":{},"桌":{"docs":{},"游":{"docs":{},"中":{"docs":{},"的":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"可":{"docs":{},"被":{"docs":{},"当":{"docs":{},"作":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}},"遵":{"docs":{},"循":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"属":{"docs":{},"性":{"docs":{},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"将":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"会":{"docs":{},"将":{"docs":{},"旧":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"作":{"docs":{},"为":{"docs":{},"参":{"docs":{},"数":{"docs":{},"传":{"docs":{},"入":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"为":{"docs":{},"该":{"docs":{},"参":{"docs":{},"数":{"docs":{},"命":{"docs":{},"名":{"docs":{},"或":{"docs":{},"者":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"s":{"docs":{},"的":{"docs":{},"值":{"docs":{},"改":{"docs":{},"变":{"docs":{},"后":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"它":{"docs":{},"把":{"docs":{},"新":{"docs":{},"的":{"docs":{},"值":{"docs":{},"和":{"docs":{},"旧":{"docs":{},"的":{"docs":{},"值":{"docs":{},"进":{"docs":{},"行":{"docs":{},"对":{"docs":{},"比":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"总":{"docs":{},"的":{"docs":{},"步":{"docs":{},"数":{"docs":{},"增":{"docs":{},"加":{"docs":{},"了":{"docs":{},",":{"docs":{},"就":{"docs":{},"输":{"docs":{},"出":{"docs":{},"一":{"docs":{},"个":{"docs":{},"消":{"docs":{},"息":{"docs":{},"表":{"docs":{},"示":{"docs":{},"增":{"docs":{},"加":{"docs":{},"了":{"docs":{},"多":{"docs":{},"少":{"docs":{},"步":{"docs":{},"。":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"没":{"docs":{},"有":{"docs":{},"提":{"docs":{},"供":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"在":{"docs":{},"变":{"docs":{},"量":{"docs":{},"或":{"docs":{},"属":{"docs":{},"性":{"docs":{},"自":{"docs":{},"身":{"docs":{},"的":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.011976047904191617}},"e":{"docs":{},"s":{"docs":{},"[":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.028077753779697623}},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.016556291390728478}},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"当":{"docs":{},"它":{"docs":{},"等":{"docs":{},"于":{"docs":{},".":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"打":{"docs":{},"印":{"docs":{},"“":{"docs":{},"l":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"推":{"docs":{},"断":{"docs":{},"当":{"docs":{},"它":{"docs":{},"被":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"能":{"docs":{},"值":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"。":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"更":{"docs":{},"短":{"docs":{},"的":{"docs":{},"点":{"docs":{},"(":{"docs":{},".":{"docs":{},")":{"docs":{},"语":{"docs":{},"法":{"docs":{},"将":{"docs":{},"其":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.023758099352051837}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}},"n":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}},"j":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}},"o":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.012485811577752554},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.010948905109489052},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.008849557522123894},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.006507592190889371},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.01272264631043257},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.012867647058823529},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.028077753779697623},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.017241379310344827},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.00842358604091456},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.012944983818770227},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"写":{"docs":{},"一":{"docs":{},"个":{"docs":{},"扩":{"docs":{},"展":{"docs":{},",":{"docs":{},"添":{"docs":{},"加":{"docs":{},"a":{"docs":{},"b":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}},"添":{"docs":{},"加":{"docs":{},"了":{"5":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}},"docs":{}}}}}},"(":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"或":{"docs":{},"者":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}},"精":{"docs":{},"确":{"docs":{},"度":{"docs":{},"很":{"docs":{},"高":{"docs":{},",":{"docs":{},"至":{"docs":{},"少":{"docs":{},"有":{"1":{"5":{"docs":{},"位":{"docs":{},"数":{"docs":{},"字":{"docs":{},",":{"docs":{},"而":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"最":{"docs":{},"少":{"docs":{},"只":{"docs":{},"有":{"6":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}},"表":{"docs":{},"示":{"6":{"4":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}},"docs":{}}},"[":{"docs":{},"]":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}},"和":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}},"型":{"docs":{},"的":{"docs":{},"值":{"1":{"docs":{},".":{"0":{"docs":{},"被":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"“":{"1":{"docs":{},"米":{"docs":{},"”":{"docs":{},"。":{"docs":{},"这":{"docs":{},"就":{"docs":{},"是":{"docs":{},"为":{"docs":{},"什":{"docs":{},"么":{"docs":{},"m":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"—":{"docs":{},"—":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"1":{"docs":{},".":{"docs":{},"m":{"docs":{},"被":{"docs":{},"认":{"docs":{},"为":{"docs":{},"是":{"docs":{},"计":{"docs":{},"算":{"1":{"docs":{},".":{"0":{"docs":{},"的":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}},"docs":{}}},"docs":{}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}},"docs":{}}},"docs":{},"看":{"docs":{},"作":{"docs":{},"是":{"docs":{},"某":{"docs":{},"单":{"docs":{},"位":{"docs":{},"下":{"docs":{},"的":{"docs":{},"长":{"docs":{},"度":{"docs":{},"值":{"docs":{},"。":{"docs":{},"即":{"docs":{},"使":{"docs":{},"它":{"docs":{},"们":{"docs":{},"被":{"docs":{},"实":{"docs":{},"现":{"docs":{},"为":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"但":{"docs":{},"这":{"docs":{},"些":{"docs":{},"属":{"docs":{},"性":{"docs":{},"仍":{"docs":{},"可":{"docs":{},"以":{"docs":{},"接":{"docs":{},"一":{"docs":{},"个":{"docs":{},"带":{"docs":{},"有":{"docs":{},"d":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"(":{"docs":{},"我":{"docs":{},"们":{"docs":{},"假":{"docs":{},"设":{"docs":{},"随":{"docs":{},"机":{"docs":{},"数":{"docs":{},"在":{"docs":{},"[":{"0":{"docs":{},",":{"1":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}},")":{"docs":{},"。":{"docs":{},"在":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"a":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"指":{"docs":{},"定":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"表":{"docs":{},"示":{"6":{"4":{"docs":{},"位":{"docs":{},"浮":{"docs":{},"点":{"docs":{},"数":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.00929368029739777},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"c":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}}}}}}}}}}},"t":{"docs":{},"f":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}},"、":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"和":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"k":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.003805899143672693},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":1.1382297551789078}},"e":{"docs":{},"循":{"docs":{},"环":{"docs":{},"来":{"docs":{},"替":{"docs":{},"代":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"循":{"docs":{},"环":{"docs":{},"。":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"、":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"、":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"的":{"docs":{},"值":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"同":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"'":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"(":{"docs":{},".":{"docs":{},")":{"docs":{},"语":{"docs":{},"法":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"在":{"docs":{},"其":{"docs":{},"它":{"docs":{},"模":{"docs":{},"块":{"docs":{},"(":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"或":{"docs":{},"其":{"docs":{},"它":{"docs":{},"类":{"docs":{},"型":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"内":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"下":{"docs":{},"面":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"引":{"docs":{},"用":{"docs":{},"在":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},"模":{"docs":{},"块":{"docs":{},"中":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"m":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}}}},"e":{"docs":{},"s":{"docs":{},"n":{"docs":{},"'":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}},"o":{"docs":{},"t":{"docs":{},"n":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"o":{"docs":{},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}},"`":{"docs":{},"`":{"docs":{},"o":{"docs":{},"`":{"docs":{},"`":{"docs":{},"g":{"docs":{},"`":{"docs":{},"`":{"docs":{},"!":{"docs":{},"和":{"docs":{},"":{"docs":{},"":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}},"u":{"docs":{},"b":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.013015184381778741}},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.008676789587852495}},".":{"docs":{},"\"":{"docs":{},"(":{"docs":{},"d":{"docs":{},"u":{"docs":{},"b":{"docs":{},"原":{"docs":{},"值":{"docs":{},"是":{"docs":{},"d":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}}},"c":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}},"e":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.01892744479495268},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"z":{"docs":{},"y":{"docs":{},"h":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}},"(":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}},"v":{"docs":{},"i":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"n":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114}}}},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}},".":{"docs":{},"\"":{"docs":{},"(":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.28757302177376526},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.023178807947019868},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.013245033112582781},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.015714285714285715}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646}}}}}}}},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"进":{"docs":{},"行":{"docs":{},"数":{"docs":{},"组":{"docs":{},"遍":{"docs":{},"历":{"docs":{},"。":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},")":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"语":{"docs":{},"法":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"值":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"相":{"docs":{},"关":{"docs":{},"值":{"docs":{},"(":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"o":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":3.333333333333333}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},".":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"-":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}}}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.012165450121654502}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}},"。":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.007220216606498195}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},";":{"docs":{},"和":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}},"表":{"docs":{},"示":{"docs":{},"t":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"t":{"docs":{},"的":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},".":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"e":{"docs":{},"a":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"(":{"docs":{},"t":{"docs":{},"有":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"因":{"docs":{},"为":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"而":{"docs":{},"t":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},">":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"安":{"docs":{},"全":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"在":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"函":{"docs":{},"数":{"docs":{},"中":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"其":{"docs":{},"保":{"docs":{},"证":{"docs":{},"支":{"docs":{},"持":{"docs":{},"等":{"docs":{},"式":{"docs":{},"操":{"docs":{},"作":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"说":{"docs":{},"明":{"docs":{},"这":{"docs":{},"个":{"docs":{},"事":{"docs":{},"实":{"docs":{},",":{"docs":{},"当":{"docs":{},"你":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"时":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"写":{"docs":{},"一":{"docs":{},"个":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"“":{"docs":{},"任":{"docs":{},"何":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2894317578332448},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},")":{"docs":{},"大":{"docs":{},"写":{"docs":{},"和":{"docs":{},"小":{"docs":{},"写":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"(":{"docs":{},"u":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2857142857142857}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"a":{"docs":{},"l":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"m":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},".":{"docs":{},"a":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"0":{"docs":{},",":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},".":{"docs":{},"b":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},".":{"docs":{},"c":{"docs":{},"的":{"docs":{},"值":{"docs":{},"被":{"docs":{},"显":{"docs":{},"式":{"docs":{},"的":{"docs":{},"设":{"docs":{},"定":{"docs":{},"为":{"5":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}},"d":{"docs":{},"的":{"docs":{},"值":{"docs":{},"会":{"docs":{},"自":{"docs":{},"动":{"docs":{},"增":{"docs":{},"长":{"docs":{},"为":{"6":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}},"r":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}},",":{"docs":{},"那":{"docs":{},"这":{"docs":{},"个":{"docs":{},"数":{"docs":{},"相":{"docs":{},"当":{"docs":{},"于":{"docs":{},"基":{"docs":{},"数":{"docs":{},"和":{"1":{"0":{"docs":{},"^":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"docs":{}},"2":{"docs":{},"^":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"docs":{}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5645375914836993},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3965897007443415},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.010169491525423728}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},"。":{"docs":{},"通":{"docs":{},"常":{"docs":{},"会":{"docs":{},"增":{"docs":{},"加":{"docs":{},"或":{"docs":{},"减":{"docs":{},"少":{"docs":{},"计":{"docs":{},"数":{"docs":{},"器":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"根":{"docs":{},"据":{"docs":{},"语":{"docs":{},"句":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"调":{"docs":{},"用":{"docs":{},"结":{"docs":{},"果":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"循":{"docs":{},"环":{"docs":{},"结":{"docs":{},"束":{"docs":{},",":{"docs":{},"继":{"docs":{},"续":{"docs":{},"执":{"docs":{},"行":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}}},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"函":{"docs":{},"数":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}}}}}}},"后":{"docs":{},"缀":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}},"圆":{"docs":{},"括":{"docs":{},"号":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}},"强":{"docs":{},"制":{"docs":{},"取":{"docs":{},"值":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"-":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}}}}},"显":{"docs":{},"式":{"docs":{},"成":{"docs":{},"员":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}},"超":{"docs":{},"类":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}},"通":{"docs":{},"配":{"docs":{},"符":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}},"闭":{"docs":{},"包":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}},"隐":{"docs":{},"式":{"docs":{},"成":{"docs":{},"员":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}},"s":{"docs":{},")":{"docs":{},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}},"二":{"docs":{},"元":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"调":{"docs":{},"用":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}},"前":{"docs":{},"缀":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}},"字":{"docs":{},"符":{"docs":{},"型":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}},"赋":{"docs":{},"值":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}},".":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"[":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}},")":{"docs":{},"。":{"docs":{},"起":{"docs":{},"保":{"docs":{},"护":{"docs":{},"作":{"docs":{},"用":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"是":{"docs":{},"这":{"docs":{},"样":{"docs":{},"构":{"docs":{},"成":{"docs":{},"的":{"docs":{},":":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"后":{"docs":{},"面":{"docs":{},"跟":{"docs":{},"着":{"docs":{},"一":{"docs":{},"个":{"docs":{},"作":{"docs":{},"为":{"docs":{},"额":{"docs":{},"外":{"docs":{},"测":{"docs":{},"试":{"docs":{},"条":{"docs":{},"件":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"当":{"docs":{},"且":{"docs":{},"仅":{"docs":{},"当":{"docs":{},"控":{"docs":{},"制":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.031609195402298854},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.00842358604091456},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.01},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},")":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"语":{"docs":{},"法":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":1.6666666666666665}}}}}}}}}}}}}}},"-":{"docs":{},"b":{"docs":{},"o":{"docs":{},"d":{"docs":{},"i":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}}}}}}}}},"r":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23619450317124735},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.8746542759154774},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}},"e":{"docs":{},"c":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.01694915254237288}}}}}},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}},"w":{"docs":{},"w":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809}}}},"g":{"docs":{},"g":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.019522776572668113},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415}},"s":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.013245033112582781}},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}}}}},"s":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}}},"c":{"docs":{},"h":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.015384615384615385},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}},"v":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}},"s":{"docs":{},"e":{"docs":{},"子":{"docs":{},"句":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.006779661016949152}}}}}}}}}}}}},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114}}}}}},"f":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}},"f":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.00946372239747634},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"d":{"5":{"7":{"8":{"8":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},",":{"docs":{},"超":{"docs":{},"过":{"3":{"0":{"docs":{},"人":{"docs":{},"参":{"docs":{},"与":{"docs":{},"翻":{"docs":{},"译":{"docs":{},"和":{"docs":{},"校":{"docs":{},"对":{"docs":{},"工":{"docs":{},"作":{"docs":{},",":{"docs":{},"项":{"docs":{},"目":{"docs":{},"最":{"docs":{},"高":{"docs":{},"排":{"docs":{},"名":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"u":{"docs":{},"b":{"docs":{},"总":{"docs":{},"榜":{"docs":{},"第":{"4":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}},"e":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":1.1314500941619585}},"循":{"docs":{},"环":{"docs":{},"来":{"docs":{},"遍":{"docs":{},"历":{"docs":{},"某":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"中":{"docs":{},"的":{"docs":{},"键":{"docs":{},"值":{"docs":{},"对":{"docs":{},"。":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"中":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"项":{"docs":{},"都":{"docs":{},"由":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"中":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"介":{"docs":{},"绍":{"docs":{},"请":{"docs":{},"参":{"docs":{},"见":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}},"请":{"docs":{},"参":{"docs":{},"见":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}},"用":{"docs":{},"来":{"docs":{},"更":{"docs":{},"简":{"docs":{},"单":{"docs":{},"地":{"docs":{},"遍":{"docs":{},"历":{"docs":{},"数":{"docs":{},"组":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},")":{"docs":{},",":{"docs":{},"字":{"docs":{},"典":{"docs":{},"(":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},")":{"docs":{},",":{"docs":{},"区":{"docs":{},"间":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"半":{"docs":{},"闭":{"docs":{},"区":{"docs":{},"间":{"docs":{},"操":{"docs":{},"作":{"docs":{},"(":{"docs":{},".":{"docs":{},".":{"docs":{},")":{"docs":{},"来":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"元":{"docs":{},"素":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"每":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"检":{"docs":{},"查":{"docs":{},"是":{"docs":{},"否":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"不":{"docs":{},"等":{"docs":{},"于":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"不":{"docs":{},"等":{"docs":{},",":{"docs":{},"则":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"不":{"docs":{},"匹":{"docs":{},"配":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"条":{"docs":{},"件":{"docs":{},"递":{"docs":{},"增":{"docs":{},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.9090909090909092}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"遍":{"docs":{},"历":{"docs":{},"一":{"docs":{},"个":{"docs":{},"区":{"docs":{},"间":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{},"序":{"docs":{},"列":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{},"集":{"docs":{},"合":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},",":{"docs":{},"系":{"docs":{},"列":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"或":{"docs":{},"常":{"docs":{},"量":{"docs":{},"申":{"docs":{},"明":{"docs":{},"时":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"包":{"docs":{},"含":{"docs":{},"通":{"docs":{},"配":{"docs":{},"符":{"docs":{},"模":{"docs":{},"式":{"docs":{},",":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"模":{"docs":{},"式":{"docs":{},"或":{"docs":{},"者":{"docs":{},"其":{"docs":{},"他":{"docs":{},"包":{"docs":{},"含":{"docs":{},"这":{"docs":{},"两":{"docs":{},"种":{"docs":{},"模":{"docs":{},"式":{"docs":{},"的":{"docs":{},"模":{"docs":{},"式":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"下":{"docs":{},"面":{"docs":{},"这":{"docs":{},"段":{"docs":{},"代":{"docs":{},"码":{"docs":{},"是":{"docs":{},"不":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"允":{"docs":{},"许":{"docs":{},"在":{"docs":{},"重":{"docs":{},"复":{"docs":{},"执":{"docs":{},"行":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"的":{"docs":{},"同":{"docs":{},"时":{"docs":{},",":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"集":{"docs":{},"合":{"docs":{},"(":{"docs":{},"或":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"s":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"循":{"docs":{},"环":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}},"e":{"docs":{},"-":{"docs":{},"u":{"docs":{},"n":{"docs":{},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}},"d":{"docs":{},"-":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}}},"和":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"循":{"docs":{},"环":{"docs":{},",":{"docs":{},"基":{"docs":{},"于":{"docs":{},"特":{"docs":{},"定":{"docs":{},"条":{"docs":{},"件":{"docs":{},"选":{"docs":{},"择":{"docs":{},"执":{"docs":{},"行":{"docs":{},"不":{"docs":{},"同":{"docs":{},"代":{"docs":{},"码":{"docs":{},"分":{"docs":{},"支":{"docs":{},"的":{"docs":{},"i":{"docs":{},"f":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"还":{"docs":{},"有":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"程":{"docs":{},"跳":{"docs":{},"转":{"docs":{},"到":{"docs":{},"其":{"docs":{},"他":{"docs":{},"代":{"docs":{},"码":{"docs":{},"的":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"循":{"docs":{},"环":{"docs":{},"用":{"docs":{},"来":{"docs":{},"按":{"docs":{},"照":{"docs":{},"指":{"docs":{},"定":{"docs":{},"的":{"docs":{},"次":{"docs":{},"数":{"docs":{},"多":{"docs":{},"次":{"docs":{},"执":{"docs":{},"行":{"docs":{},"一":{"docs":{},"系":{"docs":{},"列":{"docs":{},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}},"条":{"docs":{},"件":{"docs":{},"递":{"docs":{},"增":{"docs":{},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},"中":{"docs":{},",":{"docs":{},"在":{"docs":{},"调":{"docs":{},"用":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"语":{"docs":{},"句":{"docs":{},"、":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"语":{"docs":{},"句":{"docs":{},"、":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"和":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"执":{"docs":{},"行":{"docs":{},"后":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"作":{"docs":{},"用":{"docs":{},"域":{"docs":{},"以":{"docs":{},"内":{"docs":{},"有":{"docs":{},"效":{"docs":{},"。":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.008849557522123894},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}},"a":{"docs":{},"t":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},";":{"docs":{},")":{"docs":{},"元":{"docs":{},"组":{"docs":{},"把":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}}},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}},"b":{"docs":{},"y":{"docs":{},"f":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353}},".":{"docs":{},"v":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"d":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.011029411764705883}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}},"、":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"以":{"docs":{},"及":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"。":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"构":{"docs":{},"建":{"docs":{},"了":{"docs":{},"食":{"docs":{},"谱":{"docs":{},"中":{"docs":{},"的":{"docs":{},"一":{"docs":{},"味":{"docs":{},"调":{"docs":{},"味":{"docs":{},"剂":{"docs":{},"。":{"docs":{},"它":{"docs":{},"引":{"docs":{},"入":{"docs":{},"了":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"数":{"docs":{},"量":{"docs":{},"属":{"docs":{},"性":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"(":{"docs":{},"以":{"docs":{},"及":{"docs":{},"从":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"继":{"docs":{},"承":{"docs":{},"过":{"docs":{},"来":{"docs":{},"的":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},")":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"中":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"接":{"docs":{},"受":{"docs":{},"单":{"docs":{},"一":{"docs":{},"参":{"docs":{},"数":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"指":{"docs":{},"定":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"新":{"docs":{},"的":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"用":{"docs":{},"来":{"docs":{},"封":{"docs":{},"装":{"docs":{},"食":{"docs":{},"物":{"docs":{},"名":{"docs":{},"字":{"docs":{},"的":{"docs":{},"类":{"docs":{},"。":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"类":{"docs":{},"引":{"docs":{},"入":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},"u":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}},"l":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.009732360097323601},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.006779661016949152}},"e":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"我":{"docs":{},"们":{"docs":{},"是":{"docs":{},"知":{"docs":{},"道":{"docs":{},"紧":{"docs":{},"急":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},"重":{"docs":{},"置":{"docs":{},"的":{"docs":{},"密":{"docs":{},"码":{"docs":{},"的":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"整":{"docs":{},"个":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"值":{"docs":{},"还":{"docs":{},"是":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"整":{"docs":{},"个":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"值":{"docs":{},"就":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"。":{"docs":{},"事":{"docs":{},"实":{"docs":{},"上":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},",":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}},"l":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":1.1145009416195857}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.007611798287345386},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":1.1348399246704333}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"。":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"使":{"docs":{},"用":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"详":{"docs":{},"情":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"贯":{"docs":{},"穿":{"docs":{},"(":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"关":{"docs":{},"于":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}},"可":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}},"用":{"docs":{},"于":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"传":{"docs":{},"递":{"docs":{},"控":{"docs":{},"制":{"docs":{},"权":{"docs":{},"。":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"会":{"docs":{},"把":{"docs":{},"控":{"docs":{},"制":{"docs":{},"权":{"docs":{},"从":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"区":{"docs":{},"间":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.9090909090909092}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"字":{"docs":{},"符":{"docs":{},"的":{"docs":{},"u":{"docs":{},"t":{"docs":{},"f":{"docs":{},"-":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}}}}}}}},"的":{"4":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}},",":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.012867647058823529}},"时":{"docs":{},"为":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"b":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"c":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.01904761904761905},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}}}}}}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.006507592190889371}}}}}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"采":{"docs":{},"用":{"docs":{},"了":{"docs":{},"很":{"docs":{},"多":{"docs":{},"传":{"docs":{},"统":{"docs":{},"上":{"docs":{},"只":{"docs":{},"被":{"docs":{},"类":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},")":{"docs":{},"所":{"docs":{},"支":{"docs":{},"持":{"docs":{},"的":{"docs":{},"特":{"docs":{},"征":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.012698412698412698}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}}}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}},"s":{"docs":{},"和":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{},"s":{"docs":{},"都":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"1":{"docs":{},"跟":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"数":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},"按":{"docs":{},"位":{"docs":{},"异":{"docs":{},"或":{"docs":{},"的":{"docs":{},"结":{"docs":{},"果":{"docs":{},"是":{"docs":{},"把":{"docs":{},"它":{"docs":{},"这":{"docs":{},"些":{"docs":{},"位":{"docs":{},"置":{"docs":{},"为":{"1":{"docs":{},",":{"docs":{},"其":{"docs":{},"他":{"docs":{},"都":{"docs":{},"置":{"docs":{},"为":{"0":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}},"s":{"docs":{},"和":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{},"s":{"docs":{},"中":{"docs":{},"间":{"4":{"docs":{},"个":{"docs":{},"位":{"docs":{},"都":{"docs":{},"为":{"1":{"docs":{},"。":{"docs":{},"对":{"docs":{},"它":{"docs":{},"俩":{"docs":{},"进":{"docs":{},"行":{"docs":{},"按":{"docs":{},"位":{"docs":{},"与":{"docs":{},"运":{"docs":{},"算":{"docs":{},"后":{"docs":{},",":{"docs":{},"就":{"docs":{},"得":{"docs":{},"到":{"docs":{},"了":{"0":{"0":{"1":{"1":{"1":{"1":{"0":{"0":{"docs":{},",":{"docs":{},"即":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"的":{"6":{"0":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}},"docs":{}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"e":{"docs":{},"r":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"为":{"1":{"0":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"n":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"为":{"4":{"2":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.021897810218978103},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}},"来":{"docs":{},"防":{"docs":{},"止":{"docs":{},"它":{"docs":{},"们":{"docs":{},"被":{"docs":{},"重":{"docs":{},"写":{"docs":{},",":{"docs":{},"只":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"声":{"docs":{},"明":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"@":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"特":{"docs":{},"性":{"docs":{},"即":{"docs":{},"可":{"docs":{},"。":{"docs":{},"(":{"docs":{},"例":{"docs":{},"如":{"docs":{},":":{"docs":{},"@":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.010466222645099905},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.007220216606498195}},"e":{"docs":{},"、":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"、":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"和":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"方":{"docs":{},"式":{"docs":{},"相":{"docs":{},"同":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"只":{"docs":{},"会":{"docs":{},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"结":{"docs":{},"束":{"docs":{},"后":{"docs":{},"进":{"docs":{},"行":{"docs":{},"计":{"docs":{},"算":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"中":{"docs":{},",":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"表":{"docs":{},"现":{"docs":{},"得":{"docs":{},"比":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"循":{"docs":{},"环":{"docs":{},"更":{"docs":{},"好":{"docs":{},"。":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"方":{"docs":{},"式":{"docs":{},"会":{"docs":{},"在":{"docs":{},"条":{"docs":{},"件":{"docs":{},"判":{"docs":{},"断":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"没":{"docs":{},"有":{"docs":{},"超":{"docs":{},"出":{"docs":{},"后":{"docs":{},"直":{"docs":{},"接":{"docs":{},"运":{"docs":{},"行":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"这":{"docs":{},"表":{"docs":{},"明":{"docs":{},"你":{"docs":{},"必":{"docs":{},"须":{"docs":{},"刚":{"docs":{},"好":{"docs":{},"落":{"docs":{},"在":{"docs":{},"方":{"docs":{},"格":{"2":{"5":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"(":{"docs":{},"[":{"3":{"docs":{},".":{"1":{"4":{"1":{"5":{"9":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{},"\"":{"docs":{},"m":{"docs":{},"i":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"<":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},">":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}},"中":{"docs":{},"这":{"docs":{},"个":{"docs":{},"单":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"写":{"docs":{},"做":{"docs":{},":":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"现":{"docs":{},"在":{"docs":{},"则":{"docs":{},"可":{"docs":{},"以":{"docs":{},"成":{"docs":{},"功":{"docs":{},"的":{"docs":{},"编":{"docs":{},"译":{"docs":{},"过":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"作":{"docs":{},"用":{"docs":{},"于":{"docs":{},"任":{"docs":{},"何":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"如":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"或":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"用":{"docs":{},"某":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"。":{"docs":{},"请":{"docs":{},"注":{"docs":{},"意":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"仍":{"docs":{},"然":{"docs":{},"返":{"docs":{},"回":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"非":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"功":{"docs":{},"能":{"docs":{},"是":{"docs":{},"去":{"docs":{},"查":{"docs":{},"找":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"给":{"docs":{},"定":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"若":{"docs":{},"查":{"docs":{},"找":{"docs":{},"到":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},",":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"该":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"在":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"值":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},",":{"docs":{},"反":{"docs":{},"之":{"docs":{},"则":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}},")":{"docs":{},",":{"docs":{},"它":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"是":{"docs":{},"当":{"docs":{},"前":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}},"x":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},".":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"(":{"2":{"docs":{},".":{"0":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"并":{"docs":{},"指":{"docs":{},"定":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"为":{"4":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"docs":{}}}}}}}},"表":{"docs":{},"示":{"3":{"2":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}},"docs":{}}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"-":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.00946372239747634}}}}}}}}}}}}},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},")":{"docs":{},"中":{"docs":{},"介":{"docs":{},"绍":{"docs":{},",":{"docs":{},"当":{"docs":{},"考":{"docs":{},"虑":{"docs":{},"一":{"docs":{},"个":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"们":{"docs":{},"时":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"必":{"docs":{},"须":{"docs":{},"全":{"docs":{},"面":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"了":{"docs":{},".":{"docs":{},"w":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},",":{"docs":{},"上":{"docs":{},"面":{"docs":{},"那":{"docs":{},"段":{"docs":{},"代":{"docs":{},"码":{"docs":{},"将":{"docs":{},"无":{"docs":{},"法":{"docs":{},"通":{"docs":{},"过":{"docs":{},"编":{"docs":{},"译":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"没":{"docs":{},"有":{"docs":{},"考":{"docs":{},"虑":{"docs":{},"到":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}},"a":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}},"r":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"s":{"docs":{},"u":{"docs":{},"m":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"y":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.010619469026548672}},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"从":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"!":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"改":{"docs":{},"为":{"docs":{},"了":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"b":{"docs":{},"o":{"docs":{},"n":{"docs":{},"j":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"!":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"试":{"docs":{},"图":{"docs":{},"找":{"docs":{},"到":{"docs":{},"具":{"docs":{},"有":{"docs":{},"特":{"docs":{},"定":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"通":{"docs":{},"过":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"7":{"docs":{},"识":{"docs":{},"别":{"docs":{},"u":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"a":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{},",":{"docs":{},"内":{"docs":{},"部":{"docs":{},"名":{"docs":{},"字":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{},";":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"也":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"其":{"docs":{},"外":{"docs":{},"部":{"docs":{},"名":{"docs":{},"字":{"docs":{},"为":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"v":{"docs":{},"i":{"docs":{},"n":{"docs":{},",":{"docs":{},"内":{"docs":{},"部":{"docs":{},"名":{"docs":{},"字":{"docs":{},"为":{"docs":{},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"v":{"docs":{},"i":{"docs":{},"n":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"都":{"docs":{},"将":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"值":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"摄":{"docs":{},"氏":{"docs":{},"温":{"docs":{},"度":{"docs":{},"值":{"docs":{},",":{"docs":{},"并":{"docs":{},"保":{"docs":{},"存":{"docs":{},"在":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.007692307692307693}}}}}},"e":{"docs":{},"e":{"docs":{},"z":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.02724177071509648},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.01824817518248175},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.014970059880239521},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.03515151515151515},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.04071246819338423},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.01935483870967742},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.009523809523809525},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.027677496991576414},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.039711191335740074},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.01744186046511628},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.022653721682847898},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.015714285714285715},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.4929950669485553},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.014317180616740088},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714}},"s":{"docs":{},")":{"docs":{},"尾":{"docs":{},"随":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"(":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"参":{"docs":{},"数":{"docs":{},"与":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"与":{"docs":{},"调":{"docs":{},"用":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"定":{"docs":{},"义":{"docs":{},"在":{"docs":{},"全":{"docs":{},"局":{"docs":{},"域":{"docs":{},"中":{"docs":{},"。":{"docs":{},"你":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"把":{"docs":{},"函":{"docs":{},"数":{"docs":{},"定":{"docs":{},"义":{"docs":{},"在":{"docs":{},"别":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"体":{"docs":{},"中":{"docs":{},",":{"docs":{},"称":{"docs":{},"作":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"语":{"docs":{},"法":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}}}}}}}}}}}},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"相":{"docs":{},"当":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"柯":{"docs":{},"里":{"docs":{},"化":{"docs":{},"函":{"docs":{},"数":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},")":{"docs":{},"(":{"docs":{},")":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},",":{"docs":{},"_":{"docs":{},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"_":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"名":{"docs":{},"字":{"docs":{},"和":{"docs":{},"参":{"docs":{},"数":{"docs":{},"来":{"docs":{},"调":{"docs":{},"用":{"docs":{},"函":{"docs":{},"数":{"docs":{},"。":{"docs":{},"使":{"docs":{},"用":{"docs":{},"-":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"之":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},";":{"docs":{},"声":{"docs":{},"明":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"在":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"之":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}}}}},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}},"e":{"docs":{},"d":{"docs":{},"协":{"docs":{},"议":{"docs":{},"含":{"docs":{},"有":{"docs":{},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},"其":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"者":{"docs":{},"必":{"docs":{},"须":{"docs":{},"含":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"w":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}},"e":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},")":{"docs":{},"\\":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"docs":{},"a":{"docs":{},")":{"docs":{},"、":{"docs":{},"回":{"docs":{},"车":{"docs":{},"符":{"docs":{},"(":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}},"c":{"docs":{},")":{"docs":{},"以":{"docs":{},"及":{"docs":{},"空":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},")":{"docs":{},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"0":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}}},".":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}},"(":{"7":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{},")":{"docs":{},"和":{"docs":{},"f":{"docs":{},"(":{"docs":{},"x":{"docs":{},":":{"7":{"docs":{},")":{"docs":{},"都":{"docs":{},"是":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"x":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"有":{"docs":{},"效":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"f":{"docs":{},"(":{"7":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}},"x":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}}},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.00929368029739777},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"e":{"docs":{},"e":{"docs":{},"k":{"5":{"docs":{},"n":{"docs":{},"a":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"docs":{}}},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.007220216606498195},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.04081632653061224},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},".":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}}}}},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"一":{"docs":{},"个":{"docs":{},"生":{"docs":{},"成":{"docs":{},"器":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"这":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"g":{"docs":{},"a":{"docs":{},"s":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.01824817518248175},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.010917030567685589},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}},"s":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"。":{"docs":{},"(":{"docs":{},"译":{"docs":{},"者":{"docs":{},"注":{"docs":{},":":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}},"e":{"docs":{},"r":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"申":{"docs":{},"明":{"docs":{},"包":{"docs":{},"含":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}},"要":{"docs":{},"求":{"docs":{},"。":{"docs":{},"结":{"docs":{},"果":{"docs":{},"就":{"docs":{},"是":{"docs":{},"你":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"协":{"docs":{},"议":{"docs":{},"里":{"docs":{},"它":{"docs":{},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"地":{"docs":{},"方":{"docs":{},"实":{"docs":{},"现":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"一":{"docs":{},"致":{"docs":{},"性":{"docs":{},"类":{"docs":{},"型":{"docs":{},"以":{"docs":{},"各":{"docs":{},"种":{"docs":{},"方":{"docs":{},"式":{"docs":{},"满":{"docs":{},"足":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"属":{"docs":{},"性":{"docs":{},"声":{"docs":{},"明":{"docs":{},"包":{"docs":{},"含":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"关":{"docs":{},"键":{"docs":{},"词":{"docs":{},",":{"docs":{},"一":{"docs":{},"致":{"docs":{},"性":{"docs":{},"类":{"docs":{},"型":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"可":{"docs":{},"读":{"docs":{},"写":{"docs":{},"(":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"变":{"docs":{},"量":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"属":{"docs":{},"性":{"docs":{},"不":{"docs":{},"能":{"docs":{},"以":{"docs":{},"常":{"docs":{},"量":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"只":{"docs":{},"读":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"实":{"docs":{},"现":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"属":{"docs":{},"性":{"docs":{},"声":{"docs":{},"明":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"包":{"docs":{},"含":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"声":{"docs":{},"明":{"docs":{},"值":{"docs":{},"包":{"docs":{},"含":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.14285714285714285}}}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.10714285714285714},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"e":{"docs":{},"r":{"docs":{},"-":{"docs":{},"b":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.10714285714285714}}}}}}}},"方":{"docs":{},"法":{"docs":{},"​":{"docs":{},"​":{"docs":{},"块":{"docs":{},"可":{"docs":{},"以":{"docs":{},"由":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"后":{"docs":{},"跟":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"构":{"docs":{},"成":{"docs":{},",":{"docs":{},"用":{"docs":{},"大":{"docs":{},"括":{"docs":{},"号":{"docs":{},"括":{"docs":{},"起":{"docs":{},"来":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"由":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"后":{"docs":{},"跟":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.03571428571428571}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.008571428571428572},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.012024048096192385}}}}}}}}}}}}}}}}}}}},"/":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}},"获":{"docs":{},"取":{"docs":{},"某":{"docs":{},"个":{"docs":{},"值":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"通":{"docs":{},"过":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}}}}}}}}}}}}},"用":{"docs":{},"于":{"docs":{},"读":{"docs":{},"取":{"docs":{},"值":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"用":{"docs":{},"于":{"docs":{},"写":{"docs":{},"入":{"docs":{},"值":{"docs":{},"。":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},",":{"docs":{},"当":{"docs":{},"仅":{"docs":{},"需":{"docs":{},"要":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"时":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"将":{"docs":{},"二":{"docs":{},"者":{"docs":{},"都":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"且":{"docs":{},"直":{"docs":{},"接":{"docs":{},"返":{"docs":{},"回":{"docs":{},"请":{"docs":{},"求":{"docs":{},"的":{"docs":{},"值":{"docs":{},"即":{"docs":{},"可":{"docs":{},"。":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},",":{"docs":{},"就":{"docs":{},"必":{"docs":{},"须":{"docs":{},"使":{"docs":{},"用":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"读":{"docs":{},"取":{"docs":{},"变":{"docs":{},"量":{"docs":{},"值":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"用":{"docs":{},"来":{"docs":{},"写":{"docs":{},"入":{"docs":{},"变":{"docs":{},"量":{"docs":{},"值":{"docs":{},"。":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"子":{"docs":{},"句":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"择":{"docs":{},"的":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"选":{"docs":{},"择":{"docs":{},"是":{"docs":{},"否":{"docs":{},"包":{"docs":{},"含":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"但":{"docs":{},"它":{"docs":{},"不":{"docs":{},"要":{"docs":{},"求":{"docs":{},"属":{"docs":{},"性":{"docs":{},"是":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"中":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"写":{"docs":{},"在":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}},"部":{"docs":{},"分":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},",":{"docs":{},"上":{"docs":{},"例":{"docs":{},"中":{"docs":{},"的":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"s":{"docs":{},"字":{"docs":{},"典":{"docs":{},"通":{"docs":{},"过":{"docs":{},"附":{"docs":{},"属":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"或":{"docs":{},"者":{"docs":{},"说":{"docs":{},"“":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"”":{"docs":{},",":{"docs":{},"不":{"docs":{},"是":{"docs":{},"每":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"都":{"docs":{},"能":{"docs":{},"得":{"docs":{},"到":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"值":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"没":{"docs":{},"有":{"docs":{},"设":{"docs":{},"过":{"docs":{},"值":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"的":{"docs":{},"访":{"docs":{},"问":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"结":{"docs":{},"果":{"docs":{},"就":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},";":{"docs":{},"同":{"docs":{},"样":{"docs":{},"想":{"docs":{},"要":{"docs":{},"从":{"docs":{},"字":{"docs":{},"典":{"docs":{},"实":{"docs":{},"例":{"docs":{},"中":{"docs":{},"删":{"docs":{},"除":{"docs":{},"某":{"docs":{},"个":{"docs":{},"索":{"docs":{},"引":{"docs":{},"下":{"docs":{},"的":{"docs":{},"值":{"docs":{},"也":{"docs":{},"只":{"docs":{},"需":{"docs":{},"要":{"docs":{},"给":{"docs":{},"这":{"docs":{},"个":{"docs":{},"索":{"docs":{},"引":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"表":{"docs":{},"示":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"是":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"型":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"于":{"docs":{},"所":{"docs":{},"有":{"docs":{},"接":{"docs":{},"受":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.01824817518248175}}}}},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}},"b":{"docs":{},"y":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414}}}}}},"e":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251}},"(":{"docs":{},"\"":{"docs":{},"b":{"docs":{},"o":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}}},"a":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}},"t":{"docs":{},"m":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"h":{"docs":{},"n":{"docs":{},"k":{"docs":{},"l":{"docs":{},"k":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}},"a":{"docs":{},"h":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}},"m":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.07142857142857142}}}}}}},"i":{"docs":{},"d":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.016216216216216217}},"[":{"docs":{},"(":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811}}}}}}}}}},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.023952095808383235},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.012121212121212121},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.032362459546925564},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.015772870662460567},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.008571428571428572},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.014028056112224449}},";":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}},"g":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}},"!":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.025806451612903226},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.01444043321299639}},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.003805899143672693},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}},"去":{"docs":{},"跳":{"docs":{},"转":{"docs":{},"到":{"docs":{},"下":{"docs":{},"一":{"docs":{},"次":{"docs":{},"循":{"docs":{},"环":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"时":{"docs":{},",":{"docs":{},"这":{"docs":{},"里":{"docs":{},"使":{"docs":{},"用":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{},"标":{"docs":{},"签":{"docs":{},"并":{"docs":{},"不":{"docs":{},"是":{"docs":{},"严":{"docs":{},"格":{"docs":{},"必":{"docs":{},"须":{"docs":{},"的":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"中":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"会":{"docs":{},"影":{"docs":{},"响":{"docs":{},"到":{"docs":{},"哪":{"docs":{},"个":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},"是":{"docs":{},"没":{"docs":{},"有":{"docs":{},"歧":{"docs":{},"义":{"docs":{},"的":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"使":{"docs":{},"用":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{},"标":{"docs":{},"签":{"docs":{},"也":{"docs":{},"是":{"docs":{},"没":{"docs":{},"有":{"docs":{},"危":{"docs":{},"害":{"docs":{},"的":{"docs":{},"。":{"docs":{},"这":{"docs":{},"样":{"docs":{},"做":{"docs":{},"符":{"docs":{},"合":{"docs":{},"标":{"docs":{},"签":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"规":{"docs":{},"则":{"docs":{},",":{"docs":{},"同":{"docs":{},"时":{"docs":{},"参":{"docs":{},"照":{"docs":{},"旁":{"docs":{},"边":{"docs":{},"的":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"结":{"docs":{},"束":{"docs":{},"本":{"docs":{},"次":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}},"跳":{"docs":{},"转":{"docs":{},"控":{"docs":{},"制":{"docs":{},"去":{"docs":{},"执":{"docs":{},"行":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}},",":{"docs":{},"d":{"1":{"2":{"docs":{},",":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"h":{"docs":{},"a":{"docs":{},"m":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"-":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}},"方":{"docs":{},"法":{"docs":{},"从":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"参":{"docs":{},"数":{"docs":{},"获":{"docs":{},"取":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"信":{"docs":{},"息":{"docs":{},"并":{"docs":{},"输":{"docs":{},"出":{"docs":{},"。":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"在":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"被":{"docs":{},"当":{"docs":{},"做":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"k":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"只":{"docs":{},"能":{"docs":{},"访":{"docs":{},"问":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}},"h":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"b":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}}}}}},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}},"n":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.010169491525423728}}}}}}},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.006779661016949152}}}}}}}}}}}}}}},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"a":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"y":{"docs":{},"i":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}}}},"p":{"docs":{},"p":{"docs":{},"y":{"docs":{},"m":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"w":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635}},"协":{"docs":{},"议":{"docs":{},"时":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"a":{"docs":{},"s":{"docs":{},"?":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"将":{"docs":{},"其":{"docs":{},"可":{"docs":{},"选":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}},"/":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}},"d":{"docs":{},"o":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.009732360097323601}}},"y":{"docs":{},")":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"但":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"值":{"docs":{},"(":{"docs":{},"k":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"s":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},")":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"整":{"docs":{},"个":{"docs":{},"表":{"docs":{},"达":{"docs":{},"是":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.009732360097323601}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}},"e":{"docs":{},"和":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"产":{"docs":{},"生":{"docs":{},"的":{"docs":{},"。":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"实":{"docs":{},"参":{"docs":{},"必":{"docs":{},"须":{"docs":{},"满":{"docs":{},"足":{"docs":{},"它":{"docs":{},"所":{"docs":{},"替":{"docs":{},"代":{"docs":{},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"约":{"docs":{},"束":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"任":{"docs":{},"何":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"子":{"docs":{},"句":{"docs":{},"所":{"docs":{},"指":{"docs":{},"定":{"docs":{},"的":{"docs":{},"额":{"docs":{},"外":{"docs":{},"的":{"docs":{},"要":{"docs":{},"求":{"docs":{},"。":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"要":{"docs":{},"求":{"docs":{},"满":{"docs":{},"足":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"也":{"docs":{},"必":{"docs":{},"须":{"docs":{},"满":{"docs":{},"足":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"f":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}},"r":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087}}}}}}}},"m":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.006016847172081829}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"可":{"docs":{},"以":{"docs":{},"作":{"docs":{},"为":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"h":{"docs":{},"a":{"docs":{},"o":{"docs":{},"z":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}},"s":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}},"i":{"docs":{},"z":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.007434944237918215},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.02181818181818182},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0072992700729927005},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.011494252873563218},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"-":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}},"p":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}},"s":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}},"成":{"docs":{},"员":{"docs":{},":":{"docs":{},"给":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"常":{"docs":{},"量":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"时":{"docs":{},",":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"需":{"docs":{},"要":{"docs":{},"用":{"docs":{},"全":{"docs":{},"名":{"docs":{},"来":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"常":{"docs":{},"量":{"docs":{},"没":{"docs":{},"有":{"docs":{},"显":{"docs":{},"式":{"docs":{},"指":{"docs":{},"定":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"里":{"docs":{},",":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"使":{"docs":{},"用":{"docs":{},"缩":{"docs":{},"写":{"docs":{},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"来":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"的":{"docs":{},"值":{"docs":{},"已":{"docs":{},"经":{"docs":{},"知":{"docs":{},"道":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"m":{"docs":{},"b":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618}}}}}}},"d":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.056782334384858045},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.025714285714285714},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.07214428857715431}}}},"x":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"a":{"docs":{},"l":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"'":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.010917030567685589},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.011029411764705883},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414}},"=":{"docs":{},"\"":{"1":{"2":{"0":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"docs":{}},"6":{"9":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"docs":{}},"docs":{}},"3":{"5":{"7":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"docs":{}},"8":{"7":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"docs":{}},"docs":{}},"docs":{}}}}},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}}}}}},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"=":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"u":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"/":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"-":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"-":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"-":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"u":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"/":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"/":{"docs":{},"g":{"docs":{},"h":{"docs":{},"-":{"docs":{},"p":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"/":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"/":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"1":{"docs":{},"/":{"docs":{},"g":{"docs":{},"u":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},".":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{},"g":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},".":{"docs":{},"z":{"docs":{},"i":{"docs":{},"p":{"docs":{},"\"":{"docs":{},">":{"docs":{},"打":{"docs":{},"开":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{},"g":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"p":{"2":{"0":{"0":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},"s":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"4":{"0":{"4":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.007079646017699115}},".":{"0":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"1":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}}}}}}}},"docs":{}},"docs":{}},"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.005309734513274336}},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"u":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},")":{"docs":{},"箭":{"docs":{},"头":{"docs":{},"(":{"docs":{},"→":{"docs":{},")":{"docs":{},"用":{"docs":{},"来":{"docs":{},"标":{"docs":{},"记":{"docs":{},"语":{"docs":{},"法":{"docs":{},"产":{"docs":{},"式":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"理":{"docs":{},"]":{"docs":{},"(":{"docs":{},"h":{"docs":{},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"u":{"docs":{},"b":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.03571428571428571}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.009523809523809525}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.011428571428571429}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}},"d":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"的":{"docs":{},"消":{"docs":{},"息":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"别":{"docs":{},"打":{"docs":{},"印":{"docs":{},",":{"docs":{},"证":{"docs":{},"明":{"docs":{},"了":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},"是":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},"解":{"docs":{},"决":{"docs":{},"循":{"docs":{},"环":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"这":{"docs":{},"样":{"docs":{},"编":{"docs":{},"写":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"现":{"docs":{},"和":{"docs":{},"之":{"docs":{},"前":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"一":{"docs":{},"致":{"docs":{},",":{"docs":{},"只":{"docs":{},"是":{"docs":{},"在":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"中":{"docs":{},"多":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"列":{"docs":{},"表":{"docs":{},"。":{"docs":{},"这":{"docs":{},"里":{"docs":{},",":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"列":{"docs":{},"表":{"docs":{},"是":{"docs":{},"[":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"产":{"docs":{},"生":{"docs":{},"了":{"docs":{},"类":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}},"只":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"(":{"docs":{},"如":{"docs":{},"果":{"docs":{},"有":{"docs":{},"的":{"docs":{},"话":{"docs":{},")":{"docs":{},"参":{"docs":{},"数":{"docs":{},"来":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"一":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"。":{"docs":{},"该":{"docs":{},"类":{"docs":{},"也":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"析":{"docs":{},"构":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"当":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"这":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},"代":{"docs":{},"表":{"docs":{},"段":{"docs":{},"落":{"docs":{},"的":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"p":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"代":{"docs":{},"表":{"docs":{},"换":{"docs":{},"行":{"docs":{},"的":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"b":{"docs":{},"r":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"。":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"还":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"还":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"l":{"docs":{},"a":{"docs":{},"z":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"引":{"docs":{},"用":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"闭":{"docs":{},"包":{"docs":{},",":{"docs":{},"将":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057}},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}},"d":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}},".":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}},"实":{"docs":{},"例":{"docs":{},"中":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"属":{"docs":{},"性":{"docs":{},"还":{"docs":{},"是":{"1":{"9":{"2":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"其":{"docs":{},"值":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"全":{"docs":{},"高":{"docs":{},"清":{"docs":{},"视":{"docs":{},"频":{"docs":{},"分":{"docs":{},"辨":{"docs":{},"率":{"docs":{},"(":{"1":{"9":{"2":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}},"赋":{"docs":{},"予":{"docs":{},"给":{"docs":{},"c":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"是":{"docs":{},"将":{"docs":{},"h":{"docs":{},"d":{"docs":{},"中":{"docs":{},"所":{"docs":{},"存":{"docs":{},"储":{"docs":{},"的":{"docs":{},"值":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"进":{"docs":{},"行":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"将":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"存":{"docs":{},"储":{"docs":{},"到":{"docs":{},"新":{"docs":{},"的":{"docs":{},"c":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"实":{"docs":{},"例":{"docs":{},"中":{"docs":{},"。":{"docs":{},"结":{"docs":{},"果":{"docs":{},"就":{"docs":{},"是":{"docs":{},"两":{"docs":{},"个":{"docs":{},"完":{"docs":{},"全":{"docs":{},"独":{"docs":{},"立":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"碰":{"docs":{},"巧":{"docs":{},"包":{"docs":{},"含":{"docs":{},"有":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"数":{"docs":{},"值":{"docs":{},"。":{"docs":{},"由":{"docs":{},"于":{"docs":{},"两":{"docs":{},"者":{"docs":{},"相":{"docs":{},"互":{"docs":{},"独":{"docs":{},"立":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"将":{"docs":{},"c":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"的":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"修":{"docs":{},"改":{"docs":{},"为":{"2":{"0":{"4":{"8":{"docs":{},"并":{"docs":{},"不":{"docs":{},"会":{"docs":{},"影":{"docs":{},"响":{"docs":{},"h":{"docs":{},"d":{"docs":{},"中":{"docs":{},"的":{"docs":{},"宽":{"docs":{},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"k":{"docs":{},"y":{"docs":{},"s":{"docs":{},"l":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}}}},"o":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.045454545454545456},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"f":{"docs":{},"和":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"来":{"docs":{},"处":{"docs":{},"理":{"docs":{},"值":{"docs":{},"缺":{"docs":{},"失":{"docs":{},"的":{"docs":{},"情":{"docs":{},"况":{"docs":{},"。":{"docs":{},"有":{"docs":{},"些":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"值":{"docs":{},"可":{"docs":{},"能":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"具":{"docs":{},"体":{"docs":{},"的":{"docs":{},"值":{"docs":{},"或":{"docs":{},"者":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"来":{"docs":{},"进":{"docs":{},"行":{"docs":{},"条":{"docs":{},"件":{"docs":{},"操":{"docs":{},"作":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"、":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"、":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"和":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},",":{"docs":{},"条":{"docs":{},"件":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"—":{"docs":{},"—":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"像":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}},"条":{"docs":{},"件":{"docs":{},"的":{"docs":{},"值":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"i":{"docs":{},"c":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"判":{"docs":{},"断":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"是":{"docs":{},"否":{"docs":{},"包":{"docs":{},"含":{"docs":{},"值":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"有":{"docs":{},"值":{"docs":{},",":{"docs":{},"结":{"docs":{},"果":{"docs":{},"是":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},";":{"docs":{},"如":{"docs":{},"果":{"docs":{},"没":{"docs":{},"有":{"docs":{},"值":{"docs":{},",":{"docs":{},"结":{"docs":{},"果":{"docs":{},"是":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"分":{"docs":{},"支":{"docs":{},"中":{"docs":{},"操":{"docs":{},"作":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"改":{"docs":{},"成":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"允":{"docs":{},"许":{"docs":{},"二":{"docs":{},"选":{"docs":{},"一":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"当":{"docs":{},"条":{"docs":{},"件":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"通":{"docs":{},"常":{"docs":{},",":{"docs":{},"当":{"docs":{},"条":{"docs":{},"件":{"docs":{},"较":{"docs":{},"为":{"docs":{},"简":{"docs":{},"单":{"docs":{},"且":{"docs":{},"可":{"docs":{},"能":{"docs":{},"的":{"docs":{},"情":{"docs":{},"况":{"docs":{},"很":{"docs":{},"少":{"docs":{},"时":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"f":{"docs":{},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"而":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"更":{"docs":{},"适":{"docs":{},"用":{"docs":{},"于":{"docs":{},"条":{"docs":{},"件":{"docs":{},"较":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"、":{"docs":{},"可":{"docs":{},"能":{"docs":{},"情":{"docs":{},"况":{"docs":{},"较":{"docs":{},"多":{"docs":{},"且":{"docs":{},"需":{"docs":{},"要":{"docs":{},"用":{"docs":{},"到":{"docs":{},"模":{"docs":{},"式":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"(":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"-":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"最":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"形":{"docs":{},"式":{"docs":{},"就":{"docs":{},"是":{"docs":{},"只":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"条":{"docs":{},"件":{"docs":{},",":{"docs":{},"当":{"docs":{},"且":{"docs":{},"仅":{"docs":{},"当":{"docs":{},"该":{"docs":{},"条":{"docs":{},"件":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"于":{"docs":{},"判":{"docs":{},"断":{"docs":{},"是":{"docs":{},"不":{"docs":{},"是":{"docs":{},"特":{"docs":{},"别":{"docs":{},"热":{"docs":{},"。":{"docs":{},"而":{"docs":{},"最":{"docs":{},"后":{"docs":{},"的":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"似":{"docs":{},"。":{"docs":{},"与":{"docs":{},"之":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"是":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}},"或":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.9100423838768273},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"l":{"docs":{},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.008849557522123894},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"y":{"docs":{},"u":{"docs":{},"n":{"docs":{},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"d":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"<":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.009708737864077669}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.01},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}}},"a":{"docs":{},"g":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866}}}},"g":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.01694915254237288}},"(":{"7":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"docs":{}},"b":{"docs":{},"y":{"docs":{},"(":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809}},"和":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"b":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"e":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"该":{"docs":{},"变":{"docs":{},"量":{"docs":{},"和":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"b":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.020958083832335328}},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"该":{"docs":{},"常":{"docs":{},"量":{"docs":{},"指":{"docs":{},"向":{"docs":{},"一":{"docs":{},"个":{"docs":{},"每":{"docs":{},"次":{"docs":{},"调":{"docs":{},"用":{"docs":{},"会":{"docs":{},"加":{"1":{"0":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028}}}},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.014970059880239521}},"从":{"docs":{},"上":{"docs":{},"下":{"docs":{},"文":{"docs":{},"中":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"值":{"docs":{},",":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"和":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"获":{"docs":{},"取":{"docs":{},"任":{"docs":{},"何":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"在":{"docs":{},"函":{"docs":{},"数":{"docs":{},"体":{"docs":{},"内":{"docs":{},"访":{"docs":{},"问":{"docs":{},"了":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"和":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"变":{"docs":{},"量":{"docs":{},"。":{"docs":{},"这":{"docs":{},"是":{"docs":{},"因":{"docs":{},"为":{"docs":{},"其":{"docs":{},"通":{"docs":{},"过":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"在":{"docs":{},"包":{"docs":{},"含":{"docs":{},"它":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"体":{"docs":{},"内":{"docs":{},"已":{"docs":{},"经":{"docs":{},"存":{"docs":{},"在":{"docs":{},"的":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"和":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"时":{"docs":{},",":{"docs":{},"其":{"docs":{},"会":{"docs":{},"以":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"作":{"docs":{},"为":{"docs":{},"增":{"docs":{},"量":{"docs":{},"增":{"docs":{},"加":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"其":{"docs":{},"会":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"属":{"docs":{},"于":{"docs":{},"自":{"docs":{},"己":{"docs":{},"的":{"docs":{},"独":{"docs":{},"立":{"docs":{},"的":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}},"不":{"docs":{},"能":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"尝":{"docs":{},"试":{"docs":{},"使":{"docs":{},"用":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},"`":{"docs":{},"`":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}},"方":{"docs":{},"法":{"docs":{},"后":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"型":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"通":{"docs":{},"过":{"docs":{},"可":{"docs":{},"选":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"方":{"docs":{},"法":{"docs":{},"通":{"docs":{},"过":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},",":{"docs":{},"尝":{"docs":{},"试":{"docs":{},"从":{"docs":{},"两":{"docs":{},"种":{"docs":{},"可":{"docs":{},"选":{"docs":{},"成":{"docs":{},"员":{"docs":{},"中":{"docs":{},"获":{"docs":{},"取":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}},"d":{"docs":{},"i":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.01807802093244529},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.016216216216216217},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.01444043321299639},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"结":{"docs":{},"束":{"docs":{},"后":{"docs":{},"最":{"docs":{},"终":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"3":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"2":{"docs":{},"。":{"docs":{},"最":{"docs":{},"后":{"docs":{},"一":{"docs":{},"次":{"docs":{},"调":{"docs":{},"用":{"docs":{},"递":{"docs":{},"增":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"+":{"docs":{},"+":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"会":{"docs":{},"将":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"3":{"docs":{},",":{"docs":{},"从":{"docs":{},"而":{"docs":{},"导":{"docs":{},"致":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}},"docs":{}}}}}}}}}}}},"常":{"docs":{},"量":{"docs":{},"只":{"docs":{},"存":{"docs":{},"在":{"docs":{},"于":{"docs":{},"循":{"docs":{},"环":{"docs":{},"的":{"docs":{},"生":{"docs":{},"命":{"docs":{},"周":{"docs":{},"期":{"docs":{},"里":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"完":{"docs":{},"成":{"docs":{},"后":{"docs":{},"访":{"docs":{},"问":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"又":{"docs":{},"或":{"docs":{},"者":{"docs":{},"想":{"docs":{},"让":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"每":{"docs":{},"次":{"docs":{},"循":{"docs":{},"环":{"docs":{},"遍":{"docs":{},"历":{"docs":{},"开":{"docs":{},"始":{"docs":{},"时":{"docs":{},"被":{"docs":{},"自":{"docs":{},"动":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"在":{"docs":{},"使":{"docs":{},"用":{"docs":{},"前":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"声":{"docs":{},"明":{"docs":{},",":{"docs":{},"只":{"docs":{},"需":{"docs":{},"要":{"docs":{},"将":{"docs":{},"它":{"docs":{},"包":{"docs":{},"含":{"docs":{},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},"中":{"docs":{},",":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"对":{"docs":{},"其":{"docs":{},"进":{"docs":{},"行":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"声":{"docs":{},"明":{"docs":{},",":{"docs":{},"而":{"docs":{},"无":{"docs":{},"需":{"docs":{},"使":{"docs":{},"用":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"值":{"docs":{},"被":{"docs":{},"更":{"docs":{},"新":{"docs":{},"为":{"docs":{},"闭":{"docs":{},"区":{"docs":{},"间":{"docs":{},"中":{"docs":{},"的":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"数":{"docs":{},"字":{"docs":{},"(":{"2":{"docs":{},")":{"docs":{},",":{"docs":{},"之":{"docs":{},"后":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"n":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}},"i":{"docs":{},"s":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"(":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}}}}}}},"i":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.021897810218978103},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.015238095238095238},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714}}}}}},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}}}},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}},"a":{"docs":{},"d":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"为":{"docs":{},"新":{"docs":{},"食":{"docs":{},"物":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"占":{"docs":{},"位":{"docs":{},"名":{"docs":{},"字":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"代":{"docs":{},"理":{"docs":{},"调":{"docs":{},"用":{"docs":{},"同":{"docs":{},"一":{"docs":{},"类":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"指":{"docs":{},"定":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},":":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"e":{"docs":{},"r":{"docs":{},":":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},":":{"docs":{},")":{"docs":{},"可":{"docs":{},"以":{"docs":{},"自":{"docs":{},"己":{"docs":{},"将":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"和":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"的":{"docs":{},"新":{"docs":{},"值":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"到":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"中":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},"尽":{"docs":{},"量":{"docs":{},"利":{"docs":{},"用":{"docs":{},"现":{"docs":{},"有":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"和":{"docs":{},"它":{"docs":{},"所":{"docs":{},"提":{"docs":{},"供":{"docs":{},"的":{"docs":{},"功":{"docs":{},"能":{"docs":{},"来":{"docs":{},"实":{"docs":{},"现":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},":":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"f":{"docs":{},"a":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"l":{"docs":{},"v":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}}},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},":":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.28757302177376526},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.003805899143672693},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":2.5025641025641026},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.8370098039215685},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.007709251101321586},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.011428571428571429}},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"l":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"和":{"docs":{},"逐":{"docs":{},"一":{"docs":{},"成":{"docs":{},"员":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"对":{"docs":{},"于":{"docs":{},"来":{"docs":{},"自":{"docs":{},"你":{"docs":{},"的":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"中":{"docs":{},"的":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"调":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"用":{"docs":{},"来":{"docs":{},"给":{"docs":{},"某":{"docs":{},"个":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}}}}}}}}}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}},"s":{"docs":{},"操":{"docs":{},"作":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"i":{"docs":{},"n":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{},"s":{"docs":{},"这":{"docs":{},"个":{"docs":{},"新":{"docs":{},"常":{"docs":{},"量":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"新":{"docs":{},"常":{"docs":{},"量":{"docs":{},"的":{"docs":{},"值":{"docs":{},"等":{"docs":{},"于":{"docs":{},"所":{"docs":{},"有":{"docs":{},"位":{"docs":{},"都":{"docs":{},"取":{"docs":{},"反":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{},"s":{"docs":{},",":{"docs":{},"即":{"1":{"docs":{},"变":{"docs":{},"成":{"0":{"docs":{},",":{"0":{"docs":{},"变":{"docs":{},"成":{"1":{"docs":{},",":{"docs":{},"变":{"docs":{},"成":{"docs":{},"了":{"1":{"1":{"1":{"1":{"0":{"0":{"0":{"0":{"docs":{},",":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"值":{"docs":{},"为":{"2":{"4":{"0":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}},"docs":{}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}},"docs":{}}}},"docs":{}}},"docs":{}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"z":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.010169491525423728}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"、":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"之":{"docs":{},"前":{"docs":{},"放":{"docs":{},"置":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"i":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}},",":{"docs":{},"并":{"docs":{},"在":{"docs":{},"里":{"docs":{},"面":{"docs":{},"将":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"3":{"2":{"docs":{},".":{"0":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"来":{"docs":{},"代":{"docs":{},"替":{"docs":{},"之":{"docs":{},"前":{"docs":{},"版":{"docs":{},"本":{"docs":{},"中":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"操":{"docs":{},"作":{"docs":{},"。":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"中":{"docs":{},"含":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"的":{"docs":{},"形":{"docs":{},"参":{"docs":{},",":{"docs":{},"使":{"docs":{},"得":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"接":{"docs":{},"收":{"docs":{},"任":{"docs":{},"意":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"/":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}},"(":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}}},"t":{"1":{"6":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}},"整":{"docs":{},"型":{"docs":{},"能":{"docs":{},"承":{"docs":{},"载":{"docs":{},"的":{"docs":{},"整":{"docs":{},"数":{"docs":{},"范":{"docs":{},"围":{"docs":{},"是":{"docs":{},"-":{"3":{"2":{"7":{"6":{"8":{"docs":{},"到":{"3":{"2":{"7":{"6":{"7":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}},"docs":{}},"8":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}},"i":{"docs":{},"n":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"的":{"docs":{},"数":{"docs":{},"字":{"docs":{},"范":{"docs":{},"围":{"docs":{},"是":{"docs":{},"-":{"1":{"2":{"8":{"docs":{},"~":{"1":{"2":{"7":{"docs":{},",":{"docs":{},"而":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"能":{"docs":{},"存":{"docs":{},"储":{"docs":{},"的":{"docs":{},"数":{"docs":{},"字":{"docs":{},"范":{"docs":{},"围":{"docs":{},"是":{"0":{"docs":{},"~":{"2":{"5":{"5":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.02383654937570942},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0072992700729927005},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.02654867256637168},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.015184381778741865},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.017964071856287425},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.07636363636363637},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.021834061135371178},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.027989821882951654},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.10270270270270271},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.03870967741935484},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.009523809523809525},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.015238095238095238},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.01079913606911447},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.046875},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.014367816091954023},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.02045728038507822},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.04512635379061372},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.0744336569579288},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.00881057268722467},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.035398230088495575},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.015714285714285715},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.28757302177376526},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},"的":{"docs":{},"方":{"docs":{},"式":{"docs":{},"把":{"docs":{},"常":{"docs":{},"量":{"docs":{},"名":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"名":{"docs":{},"当":{"docs":{},"做":{"docs":{},"占":{"docs":{},"位":{"docs":{},"符":{"docs":{},"加":{"docs":{},"入":{"docs":{},"到":{"docs":{},"长":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"中":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618}}},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}},"f":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":5.029850746268656}}}}}},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.010619469026548672},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"e":{"docs":{},"r":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}},"t":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"属":{"docs":{},"于":{"docs":{},"列":{"docs":{},"表":{"docs":{},"中":{"docs":{},"的":{"docs":{},"任":{"docs":{},"何":{"docs":{},"质":{"docs":{},"数":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"它":{"docs":{},"不":{"docs":{},"会":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"分":{"docs":{},"支":{"docs":{},"。":{"docs":{},"而":{"docs":{},"这":{"docs":{},"里":{"docs":{},"没":{"docs":{},"有":{"docs":{},"其":{"docs":{},"他":{"docs":{},"特":{"docs":{},"别":{"docs":{},"的":{"docs":{},"分":{"docs":{},"支":{"docs":{},"情":{"docs":{},"况":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"包":{"docs":{},"含":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}},")":{"docs":{},"、":{"docs":{},"浮":{"docs":{},"点":{"docs":{},"数":{"docs":{},"(":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"-":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"、":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},"(":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},")":{"docs":{},"、":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"、":{"docs":{},"数":{"docs":{},"组":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},")":{"docs":{},"和":{"docs":{},"字":{"docs":{},"典":{"docs":{},"(":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}},"p":{"docs":{},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},".":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}},")":{"docs":{},"或":{"docs":{},"者":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"值":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"来":{"docs":{},"分":{"docs":{},"类":{"docs":{},"下":{"docs":{},"图":{"docs":{},"中":{"docs":{},"的":{"docs":{},"点":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}},"来":{"docs":{},"分":{"docs":{},"类":{"docs":{},"下":{"docs":{},"图":{"docs":{},"中":{"docs":{},"的":{"docs":{},"点":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"产":{"docs":{},"生":{"docs":{},"新":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"一":{"docs":{},"开":{"docs":{},"始":{"docs":{},"先":{"docs":{},"将":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"参":{"docs":{},"数":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"也":{"docs":{},"是":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"在":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"中":{"docs":{},"新":{"docs":{},"引":{"docs":{},"入":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"随":{"docs":{},"后":{"docs":{},",":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"将":{"docs":{},"任":{"docs":{},"务":{"docs":{},"向":{"docs":{},"上":{"docs":{},"代":{"docs":{},"理":{"docs":{},"给":{"docs":{},"父":{"docs":{},"类":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"只":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"两":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"都":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"这":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"仅":{"docs":{},"需":{"docs":{},"要":{"docs":{},"限":{"docs":{},"制":{"docs":{},"一":{"docs":{},"个":{"docs":{},"元":{"docs":{},"组":{"docs":{},"模":{"docs":{},"式":{"docs":{},"中":{"docs":{},"的":{"docs":{},"某":{"docs":{},"几":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"只":{"docs":{},"需":{"docs":{},"要":{"docs":{},"直":{"docs":{},"接":{"docs":{},"对":{"docs":{},"这":{"docs":{},"几":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"提":{"docs":{},"供":{"docs":{},"类":{"docs":{},"型":{"docs":{},"注":{"docs":{},"释":{"docs":{},"即":{"docs":{},"可":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"在":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}},")":{"docs":{},"包":{"docs":{},"含":{"docs":{},"两":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},":":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"是":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"复":{"docs":{},"合":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"—":{"docs":{},"—":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"传":{"docs":{},"入":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"然":{"docs":{},"后":{"docs":{},"输":{"docs":{},"出":{"docs":{},"作":{"docs":{},"为":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"输":{"docs":{},"入":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"又":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"如":{"docs":{},"下":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"重":{"docs":{},"写":{"docs":{},"柯":{"docs":{},"里":{"docs":{},"化":{"docs":{},"函":{"docs":{},"数":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"浮":{"docs":{},"点":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"安":{"docs":{},"全":{"docs":{},"和":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},"数":{"docs":{},"值":{"docs":{},"型":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"数":{"docs":{},"值":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"转":{"docs":{},"换":{"docs":{},"整":{"docs":{},"数":{"docs":{},"转":{"docs":{},"换":{"docs":{},"整":{"docs":{},"数":{"docs":{},"和":{"docs":{},"浮":{"docs":{},"点":{"docs":{},"数":{"docs":{},"转":{"docs":{},"换":{"docs":{},"类":{"docs":{},"型":{"docs":{},"别":{"docs":{},"名":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},"元":{"docs":{},"组":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":5}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"就":{"docs":{},"够":{"docs":{},"了":{"docs":{},"。":{"docs":{},"这":{"docs":{},"可":{"docs":{},"以":{"docs":{},"提":{"docs":{},"高":{"docs":{},"代":{"docs":{},"码":{"docs":{},"一":{"docs":{},"致":{"docs":{},"性":{"docs":{},"和":{"docs":{},"可":{"docs":{},"复":{"docs":{},"用":{"docs":{},"性":{"docs":{},"。":{"docs":{},"即":{"docs":{},"使":{"docs":{},"是":{"docs":{},"在":{"3":{"2":{"docs":{},"位":{"docs":{},"平":{"docs":{},"台":{"docs":{},"上":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"的":{"docs":{},"整":{"docs":{},"数":{"docs":{},"范":{"docs":{},"围":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"达":{"docs":{},"到":{"docs":{},"-":{"2":{"1":{"4":{"7":{"4":{"8":{"3":{"6":{"4":{"8":{"docs":{},"~":{"2":{"1":{"4":{"7":{"4":{"8":{"3":{"6":{"4":{"7":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"整":{"docs":{},"型":{"docs":{},";":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"和":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"是":{"docs":{},"浮":{"docs":{},"点":{"docs":{},"型":{"docs":{},";":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"是":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"型":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"是":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"更":{"docs":{},"大":{"docs":{},"或":{"docs":{},"者":{"docs":{},"更":{"docs":{},"小":{"docs":{},"的":{"docs":{},"数":{"docs":{},"字":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}},"的":{"docs":{},"合":{"docs":{},"理":{"docs":{},"值":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"如":{"docs":{},"上":{"docs":{},"所":{"docs":{},"述":{"docs":{},",":{"docs":{},"当":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},",":{"docs":{},"我":{"docs":{},"们":{"docs":{},"不":{"docs":{},"能":{"docs":{},"往":{"docs":{},"其":{"docs":{},"中":{"docs":{},"插":{"docs":{},"入":{"docs":{},"任":{"docs":{},"何":{"docs":{},"不":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"找":{"docs":{},"到":{"docs":{},"一":{"docs":{},"个":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"的":{"docs":{},"行":{"docs":{},"星":{"docs":{},"。":{"docs":{},"正":{"docs":{},"因":{"docs":{},"为":{"docs":{},"如":{"docs":{},"此":{"docs":{},",":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"方":{"docs":{},"法":{"docs":{},"可":{"docs":{},"以":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"成":{"docs":{},"员":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{},"是":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{},"?":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"或":{"docs":{},"“":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"不":{"docs":{},"论":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"多":{"docs":{},"少":{"docs":{},"层":{"docs":{},"链":{"docs":{},"接":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"总":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}},"没":{"docs":{},"有":{"docs":{},"足":{"docs":{},"够":{"docs":{},"的":{"docs":{},"位":{"docs":{},"数":{"docs":{},",":{"docs":{},"即":{"docs":{},"下":{"docs":{},"标":{"docs":{},"越":{"docs":{},"界":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"上":{"docs":{},"述":{"docs":{},"实":{"docs":{},"现":{"docs":{},"的":{"docs":{},"下":{"docs":{},"标":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"0":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"会":{"docs":{},"在":{"docs":{},"数":{"docs":{},"字":{"docs":{},"左":{"docs":{},"边":{"docs":{},"自":{"docs":{},"动":{"docs":{},"补":{"0":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}},"docs":{}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}},"[":{"docs":{},"]":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}},"数":{"docs":{},"组":{"docs":{},"来":{"docs":{},"表":{"docs":{},"达":{"docs":{},"。":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"长":{"docs":{},"度":{"docs":{},"由":{"docs":{},"一":{"docs":{},"个":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}},"或":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"的":{"docs":{},"实":{"docs":{},"际":{"docs":{},"值":{"docs":{},",":{"docs":{},"它":{"docs":{},"只":{"docs":{},"是":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},",":{"docs":{},"当":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"常":{"docs":{},"量":{"docs":{},"和":{"docs":{},"变":{"docs":{},"量":{"docs":{},"等":{"docs":{},"于":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},".":{"docs":{},"u":{"docs":{},"p":{"docs":{},"c":{"docs":{},"a":{"docs":{},"或":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},".":{"docs":{},"q":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"数":{"docs":{},"组":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"a":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"继":{"docs":{},"而":{"docs":{},"又":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"了":{"docs":{},"变":{"docs":{},"量":{"docs":{},"b":{"docs":{},"和":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114}},";":{"docs":{},"。":{"docs":{},"字":{"docs":{},"典":{"docs":{},"实":{"docs":{},"例":{"docs":{},"创":{"docs":{},"建":{"docs":{},"完":{"docs":{},"成":{"docs":{},"之":{"docs":{},"后":{"docs":{},"通":{"docs":{},"过":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"的":{"docs":{},"方":{"docs":{},"式":{"docs":{},"将":{"docs":{},"整":{"docs":{},"型":{"docs":{},"值":{"2":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"到":{"docs":{},"字":{"docs":{},"典":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"为":{"docs":{},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"引":{"docs":{},"用":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}},"就":{"docs":{},"是":{"docs":{},"用":{"docs":{},"具":{"docs":{},"体":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"和":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"替":{"docs":{},"代":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"?":{"docs":{},"值":{"docs":{},",":{"docs":{},"不":{"docs":{},"论":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"多":{"docs":{},"少":{"docs":{},"层":{"docs":{},"链":{"docs":{},"接":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"总":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"将":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}},",":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}},"将":{"docs":{},"抽":{"docs":{},"象":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"转":{"docs":{},"换":{"docs":{},"为":{"docs":{},"具":{"docs":{},"体":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646}},"指":{"docs":{},"定":{"docs":{},"了":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},",":{"docs":{},"适":{"docs":{},"用":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"被":{"docs":{},"用":{"docs":{},"作":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"这":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"只":{"docs":{},"能":{"docs":{},"用":{"docs":{},"于":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},",":{"docs":{},"不":{"docs":{},"过":{"docs":{},",":{"docs":{},"其":{"docs":{},"对":{"docs":{},"于":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"三":{"docs":{},"个":{"docs":{},"要":{"docs":{},"求":{"docs":{},",":{"docs":{},"在":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"非":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},",":{"docs":{},"适":{"docs":{},"用":{"docs":{},"于":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}},"索":{"docs":{},"引":{"docs":{},"值":{"docs":{},"下":{"docs":{},"标":{"docs":{},"可":{"docs":{},"以":{"docs":{},"检":{"docs":{},"索":{"docs":{},"到":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}},"这":{"docs":{},"一":{"docs":{},"行":{"docs":{},",":{"docs":{},"一":{"docs":{},"切":{"docs":{},"仍":{"docs":{},"旧":{"docs":{},"可":{"docs":{},"以":{"docs":{},"工":{"docs":{},"作":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"清":{"docs":{},"楚":{"docs":{},"的":{"docs":{},"知":{"docs":{},"道":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},".":{"docs":{},".":{"docs":{},"。":{"docs":{},"可":{"docs":{},"变":{"docs":{},"长":{"docs":{},"参":{"docs":{},"数":{"docs":{},"被":{"docs":{},"认":{"docs":{},"为":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"基":{"docs":{},"础":{"docs":{},"类":{"docs":{},"型":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"即":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"docs":{},".":{"docs":{},".":{"docs":{},"就":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"被":{"docs":{},"看":{"docs":{},"做":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"理":{"docs":{},"解":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}},"引":{"docs":{},"用":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"同":{"docs":{},"样":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}},"和":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"均":{"docs":{},"满":{"docs":{},"足":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},")":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"基":{"docs":{},"类":{"docs":{},"(":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":3.333333333333333}}}}}}}}}}}}}}}}},")":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},")":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},")":{"docs":{},"和":{"docs":{},"其":{"docs":{},"它":{"docs":{},"特":{"docs":{},"性":{"docs":{},"。":{"docs":{},"当":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"继":{"docs":{},"承":{"docs":{},"其":{"docs":{},"它":{"docs":{},"类":{"docs":{},"时":{"docs":{},",":{"docs":{},"继":{"docs":{},"承":{"docs":{},"类":{"docs":{},"叫":{"docs":{},"子":{"docs":{},"类":{"docs":{},"(":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},")":{"docs":{},",":{"docs":{},"被":{"docs":{},"继":{"docs":{},"承":{"docs":{},"类":{"docs":{},"叫":{"docs":{},"超":{"docs":{},"类":{"docs":{},"(":{"docs":{},"或":{"docs":{},"父":{"docs":{},"类":{"docs":{},",":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.4424161964819117},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":1.6695402298850572},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}}}}},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}}}}},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"调":{"docs":{},"用":{"docs":{},"把":{"docs":{},"值":{"docs":{},"为":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"d":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612}}}},"i":{"docs":{},"x":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.009689922480620155},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0048484848484848485},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.010830324909747292},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"。":{"docs":{},"如":{"docs":{},"何":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}},"-":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},")":{"docs":{},"参":{"docs":{},"数":{"docs":{},"来":{"docs":{},"交":{"docs":{},"换":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"参":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"前":{"docs":{},"加":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"前":{"docs":{},"缀":{"docs":{},"。":{"docs":{},"但":{"docs":{},"是":{"docs":{},"你":{"docs":{},"不":{"docs":{},"可":{"docs":{},"以":{"docs":{},"对":{"docs":{},"可":{"docs":{},"变":{"docs":{},"长":{"docs":{},"参":{"docs":{},"数":{"docs":{},"或":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"。":{"docs":{},"关":{"docs":{},"于":{"docs":{},"i":{"docs":{},"n":{"docs":{},"-":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"参":{"docs":{},"数":{"docs":{},"的":{"docs":{},"讨":{"docs":{},"论":{"docs":{},"见":{"docs":{},"章":{"docs":{},"节":{"docs":{},"i":{"docs":{},"n":{"docs":{},"-":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"讨":{"docs":{},"论":{"docs":{},",":{"docs":{},"参":{"docs":{},"见":{"docs":{},"i":{"docs":{},"n":{"docs":{},"-":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"-":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.2386187455954898}}}}},"中":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"出":{"docs":{},"了":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.021691973969631236},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.032397408207343416},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.018050541516245487},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.010169491525423728}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.010830324909747292}},"e":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"协":{"docs":{},"议":{"docs":{},"不":{"docs":{},"会":{"docs":{},"定":{"docs":{},"义":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"是":{"docs":{},"什":{"docs":{},"么":{"docs":{},"的":{"docs":{},"别":{"docs":{},"名":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"信":{"docs":{},"息":{"docs":{},"留":{"docs":{},"给":{"docs":{},"了":{"docs":{},"任":{"docs":{},"何":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"来":{"docs":{},"提":{"docs":{},"供":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"如":{"docs":{},"此":{"docs":{},",":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"别":{"docs":{},"名":{"docs":{},"支":{"docs":{},"持":{"docs":{},"一":{"docs":{},"种":{"docs":{},"方":{"docs":{},"法":{"docs":{},"识":{"docs":{},"别":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"里":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"种":{"docs":{},"使":{"docs":{},"用":{"docs":{},"在":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"中":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"以":{"docs":{},"便":{"docs":{},"保":{"docs":{},"证":{"docs":{},"任":{"docs":{},"何":{"docs":{},"期":{"docs":{},"望":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"s":{"docs":{},".":{"docs":{},"\"":{"docs":{},"(":{"docs":{},"这":{"docs":{},"个":{"docs":{},"数":{"docs":{},"组":{"docs":{},"有":{"2":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}},"docs":{}}}}}}}},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.007220216606498195}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.007220216606498195}}}}}}}}}}}}},"。":{"docs":{},"\"":{"docs":{},"(":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"是":{"0":{"docs":{},"数":{"docs":{},"据":{"docs":{},"项":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}},"docs":{}}}}}}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"空":{"docs":{},"的":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}},"需":{"docs":{},"要":{"docs":{},"真":{"docs":{},"正":{"docs":{},"作":{"docs":{},"为":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}},"是":{"docs":{},"如":{"docs":{},"何":{"docs":{},"存":{"docs":{},"储":{"docs":{},"的":{"docs":{},"或":{"docs":{},"何":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"允":{"docs":{},"许":{"docs":{},"的":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"协":{"docs":{},"议":{"docs":{},"只":{"docs":{},"指":{"docs":{},"定":{"docs":{},"三":{"docs":{},"个":{"docs":{},"任":{"docs":{},"何":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"p":{"docs":{},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"该":{"docs":{},"参":{"docs":{},"数":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}},"'":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}},"s":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"来":{"docs":{},"作":{"docs":{},"为":{"docs":{},"检":{"docs":{},"查":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}},"n":{"docs":{},"'":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}},"o":{"8":{"8":{"5":{"9":{"docs":{},"-":{"1":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"x":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.009191176470588236}}}}}}},"检":{"docs":{},"验":{"docs":{},"协":{"docs":{},"议":{"docs":{},"一":{"docs":{},"致":{"docs":{},"性":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"s":{"docs":{},"将":{"docs":{},"协":{"docs":{},"议":{"docs":{},"类":{"docs":{},"型":{"docs":{},"向":{"docs":{},"下":{"docs":{},"转":{"docs":{},"换":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"模":{"docs":{},"式":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"这":{"docs":{},"个":{"docs":{},"值":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"在":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"(":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},"和":{"docs":{},"i":{"docs":{},"s":{"docs":{},"模":{"docs":{},"式":{"docs":{},"右":{"docs":{},"边":{"docs":{},"的":{"docs":{},"指":{"docs":{},"定":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"或":{"docs":{},"者":{"docs":{},"那":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},")":{"docs":{},"是":{"docs":{},"一":{"docs":{},"致":{"docs":{},"的":{"docs":{},"。":{"docs":{},"i":{"docs":{},"s":{"docs":{},"模":{"docs":{},"式":{"docs":{},"和":{"docs":{},"i":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"a":{"docs":{},"s":{"docs":{},"模":{"docs":{},"式":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"种":{"docs":{},"模":{"docs":{},"式":{"docs":{},"均":{"docs":{},"只":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"标":{"docs":{},"签":{"docs":{},"中":{"docs":{},"。":{"docs":{},"i":{"docs":{},"s":{"docs":{},"模":{"docs":{},"式":{"docs":{},"和":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.013245033112582781},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.012698412698412698},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.006309148264984227}}}}}}}}},"+":{"docs":{},"+":{"docs":{},"的":{"docs":{},"特":{"docs":{},"性":{"docs":{},",":{"docs":{},"不":{"docs":{},"然":{"docs":{},"推":{"docs":{},"荐":{"docs":{},"你":{"docs":{},"使":{"docs":{},"用":{"docs":{},"+":{"docs":{},"+":{"docs":{},"i":{"docs":{},"和":{"docs":{},"-":{"docs":{},"-":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}},"后":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"只":{"docs":{},"想":{"docs":{},"修":{"docs":{},"改":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}},",":{"docs":{},"i":{"docs":{},"+":{"docs":{},"+":{"docs":{},",":{"docs":{},"-":{"docs":{},"-":{"docs":{},"i":{"docs":{},"和":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}},"的":{"docs":{},"值":{"docs":{},"就":{"docs":{},"会":{"docs":{},"加":{"1":{"docs":{},"。":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},",":{"docs":{},"+":{"docs":{},"+":{"docs":{},"i":{"docs":{},"是":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}},"docs":{}}}}}}}},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}},"b":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"和":{"docs":{},"i":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"用":{"docs":{},"于":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"声":{"docs":{},"明":{"docs":{},";":{"docs":{},"i":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"特":{"docs":{},"性":{"docs":{},"用":{"docs":{},"于":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"声":{"docs":{},"明":{"docs":{},";":{"docs":{},"i":{"docs":{},"b":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.005506607929515419}}}}}}},"j":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"b":{"docs":{},"r":{"docs":{},"o":{"docs":{},"k":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}},"y":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}},"c":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625}}}}},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0380952380952381},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}},"'":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.012698412698412698}}},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.012698412698412698}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"!":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"分":{"docs":{},"配":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"实":{"docs":{},"例":{"docs":{},"时":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"。":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"你":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"它":{"docs":{},"获":{"docs":{},"取":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"?":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"?":{"docs":{},".":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},")":{"docs":{},"?":{"docs":{},".":{"docs":{},"u":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.009523809523809525}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}},"[":{"0":{"docs":{},"]":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}}}}}}}},"docs":{}}},"不":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"时":{"docs":{},",":{"docs":{},"会":{"docs":{},"运":{"docs":{},"行":{"docs":{},"通":{"docs":{},"过":{"docs":{},",":{"docs":{},"且":{"docs":{},"会":{"docs":{},"将":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"值":{"docs":{},"现":{"docs":{},"在":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"然":{"docs":{},"而":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"现":{"docs":{},"在":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"?":{"docs":{},".":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"后":{"docs":{},"面":{"docs":{},",":{"docs":{},"在":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"括":{"docs":{},"号":{"docs":{},"的":{"docs":{},"前":{"docs":{},"面":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}},".":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}},"e":{"docs":{},".":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.012698412698412698}}}}}}}}},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"里":{"docs":{},"的":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"这":{"docs":{},"里":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"两":{"docs":{},"层":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"来":{"docs":{},"联":{"docs":{},"系":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"和":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"保":{"docs":{},"存":{"docs":{},"某":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"客":{"docs":{},"户":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"由":{"docs":{},"于":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"变":{"docs":{},"量":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"!":{"docs":{},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}}},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}},"变":{"docs":{},"量":{"docs":{},"被":{"docs":{},"设":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"后":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}},",":{"docs":{},"并":{"docs":{},"分":{"docs":{},"别":{"docs":{},"被":{"docs":{},"设":{"docs":{},"定":{"docs":{},"为":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"都":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"后":{"docs":{},",":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}},"docs":{}},"docs":{}}}}}}}},"现":{"docs":{},"在":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"向":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"而":{"docs":{},"变":{"docs":{},"量":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"向":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.012903225806451613}},"(":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}},"s":{"1":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}},"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061}}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.01818181818181818}}}},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}},"n":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}}}}}}}}}},"y":{"docs":{},"n":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}},"i":{"docs":{},"c":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415}}}}}},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"u":{"docs":{},"a":{"docs":{},"g":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":3.347222222222222}},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.005309734513274336}}}}}}}}}}},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.013559322033898305}}}}},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747}}}}}},"c":{"docs":{},"h":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.009523809523809525}}}}},"w":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"'":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}}}}}}},"d":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.009626955475330927}},"s":{"docs":{},")":{"docs":{},"的":{"docs":{},"小":{"docs":{},"游":{"docs":{},"戏":{"docs":{},",":{"docs":{},"也":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"滑":{"docs":{},"道":{"docs":{},"和":{"docs":{},"梯":{"docs":{},"子":{"docs":{},"(":{"docs":{},"c":{"docs":{},"h":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"译":{"docs":{},"者":{"docs":{},"注":{"docs":{},":":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"章":{"docs":{},"节":{"docs":{},"有":{"docs":{},"该":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"的":{"docs":{},"详":{"docs":{},"细":{"docs":{},"介":{"docs":{},"绍":{"docs":{},")":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"的":{"docs":{},"新":{"docs":{},"版":{"docs":{},"本":{"docs":{},"。":{"docs":{},"新":{"docs":{},"版":{"docs":{},"本":{"docs":{},"使":{"docs":{},"用":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"作":{"docs":{},"为":{"docs":{},"骰":{"docs":{},"子":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"b":{"docs":{},"d":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"z":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.007619047619047619},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.029850746268656716}}},"y":{"docs":{},",":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"属":{"docs":{},"性":{"docs":{},"只":{"docs":{},"有":{"docs":{},"在":{"docs":{},"第":{"docs":{},"一":{"docs":{},"次":{"docs":{},"被":{"docs":{},"访":{"docs":{},"问":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},"才":{"docs":{},"被":{"docs":{},"创":{"docs":{},"建":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},"访":{"docs":{},"问":{"docs":{},"它":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}}}}}},"s":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635}}}}}}}},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}}}},"i":{"docs":{},"f":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"m":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"说":{"docs":{},"他":{"docs":{},"平":{"docs":{},"时":{"1":{"2":{"docs":{},"点":{"docs":{},"就":{"docs":{},"会":{"docs":{},"睡":{"docs":{},",":{"1":{"docs":{},"点":{"4":{"7":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}},"docs":{}},"docs":{}}},"docs":{}}}}}}},"docs":{}},"docs":{}}}}}}}}}},"n":{"docs":{},"-":{"docs":{},"h":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}},"e":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"f":{"docs":{},"e":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.006016847172081829}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"作":{"docs":{},"为":{"docs":{},"随":{"docs":{},"机":{"docs":{},"数":{"docs":{},"生":{"docs":{},"成":{"docs":{},"器":{"docs":{},"传":{"docs":{},"入":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}},"类":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"并":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"线":{"docs":{},"性":{"docs":{},"同":{"docs":{},"余":{"docs":{},"生":{"docs":{},"成":{"docs":{},"器":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"'":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},",":{"docs":{},"包":{"docs":{},"含":{"docs":{},"两":{"docs":{},"个":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"三":{"docs":{},"个":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"l":{"docs":{},"i":{"docs":{},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"在":{"docs":{},"它":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"时":{"docs":{},"根":{"docs":{},"据":{"docs":{},"它":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"所":{"docs":{},"包":{"docs":{},"含":{"docs":{},"的":{"docs":{},"内":{"docs":{},"容":{"docs":{},"推":{"docs":{},"断":{"docs":{},"来":{"docs":{},"的":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.02159827213822894}}}}}}},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}},")":{"docs":{},"根":{"docs":{},"据":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"的":{"docs":{},"先":{"docs":{},"后":{"docs":{},"顺":{"docs":{},"序":{"docs":{},",":{"docs":{},"被":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612}}}}}}},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2894317578332448},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.01892744479495268}},"a":{"docs":{},"l":{"docs":{},")":{"docs":{},"即":{"docs":{},"可":{"docs":{},"触":{"docs":{},"发":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},"。":{"docs":{},"(":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"就":{"docs":{},"是":{"docs":{},"会":{"docs":{},"直":{"docs":{},"接":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"你":{"docs":{},"代":{"docs":{},"码":{"docs":{},"中":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"比":{"docs":{},"如":{"4":{"2":{"docs":{},"和":{"3":{"docs":{},".":{"1":{"4":{"1":{"5":{"9":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}}}},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}},"s":{"docs":{},"l":{"docs":{},"x":{"docs":{},"d":{"docs":{},"x":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"u":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"m":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}},"y":{"docs":{},"u":{"docs":{},"k":{"docs":{},"a":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}},"z":{"docs":{},"w":{"1":{"2":{"0":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}},"docs":{}},"docs":{}},"docs":{}}},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353}}}}}},"s":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}},"t":{"docs":{},"来":{"docs":{},"声":{"docs":{},"明":{"docs":{},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"用":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}},"(":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"前":{"docs":{},"缀":{"docs":{},")":{"docs":{},"或":{"docs":{},"者":{"docs":{},"作":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"(":{"docs":{},"用":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}},",":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"给":{"docs":{},"变":{"docs":{},"量":{"docs":{},"时":{"docs":{},",":{"docs":{},"用":{"docs":{},"关":{"docs":{},"键":{"docs":{},"之":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}},"将":{"docs":{},"元":{"docs":{},"组":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}},"(":{"docs":{},"或":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},")":{"docs":{},"语":{"docs":{},"句":{"docs":{},"来":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"常":{"docs":{},"量":{"docs":{},"(":{"docs":{},"或":{"docs":{},"变":{"docs":{},"量":{"docs":{},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"常":{"docs":{},"量":{"docs":{},"(":{"docs":{},"或":{"docs":{},"变":{"docs":{},"量":{"docs":{},")":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"其":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"起":{"docs":{},"保":{"docs":{},"护":{"docs":{},"作":{"docs":{},"用":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"和":{"docs":{},"其":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.003805899143672693},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}}}},"f":{"docs":{},"t":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.03870967741935484},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.01744186046511628},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},".":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"i":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093}}},"x":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093}}}},"和":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},",":{"docs":{},"代":{"docs":{},"表":{"docs":{},"+":{"docs":{},"左":{"docs":{},"边":{"docs":{},"和":{"docs":{},"右":{"docs":{},"边":{"docs":{},"的":{"docs":{},"两":{"docs":{},"个":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"2":{"docs":{},"d":{"docs":{},"对":{"docs":{},"象":{"docs":{},"。":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"2":{"docs":{},"d":{"docs":{},"的":{"docs":{},"对":{"docs":{},"象":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"对":{"docs":{},"象":{"docs":{},"的":{"docs":{},"x":{"docs":{},"和":{"docs":{},"y":{"docs":{},"分":{"docs":{},"别":{"docs":{},"等":{"docs":{},"于":{"docs":{},"两":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"对":{"docs":{},"象":{"docs":{},"的":{"docs":{},"x":{"docs":{},"和":{"docs":{},"i":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"优":{"docs":{},"先":{"docs":{},"级":{"docs":{},"为":{"1":{"4":{"0":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}},"docs":{}}}}}},"-":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.020356234096692113},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"i":{"docs":{},"s":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.007633587786259542}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"h":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}},"监":{"docs":{},"测":{"docs":{},"玩":{"docs":{},"家":{"docs":{},"的":{"docs":{},"已":{"docs":{},"解":{"docs":{},"锁":{"docs":{},"的":{"docs":{},"最":{"docs":{},"高":{"docs":{},"等":{"docs":{},"级":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"值":{"docs":{},"被":{"docs":{},"存":{"docs":{},"储":{"docs":{},"在":{"docs":{},"静":{"docs":{},"态":{"docs":{},"属":{"docs":{},"性":{"docs":{},"h":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"还":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},"与":{"docs":{},"h":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"配":{"docs":{},"合":{"docs":{},"工":{"docs":{},"作":{"docs":{},"。":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},"是":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},":":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"新":{"docs":{},"等":{"docs":{},"级":{"docs":{},"被":{"docs":{},"解":{"docs":{},"锁":{"docs":{},",":{"docs":{},"它":{"docs":{},"会":{"docs":{},"更":{"docs":{},"新":{"docs":{},"h":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},"是":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},":":{"docs":{},"如":{"docs":{},"果":{"docs":{},"某":{"docs":{},"个":{"docs":{},"给":{"docs":{},"定":{"docs":{},"的":{"docs":{},"等":{"docs":{},"级":{"docs":{},"已":{"docs":{},"经":{"docs":{},"被":{"docs":{},"解":{"docs":{},"锁":{"docs":{},",":{"docs":{},"它":{"docs":{},"将":{"docs":{},"返":{"docs":{},"回":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"。":{"docs":{},"(":{"docs":{},"注":{"docs":{},"意":{"docs":{},":":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"我":{"docs":{},"们":{"docs":{},"没":{"docs":{},"有":{"docs":{},"使":{"docs":{},"用":{"docs":{},"类":{"docs":{},"似":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"h":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"的":{"docs":{},"写":{"docs":{},"法":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},"还":{"docs":{},"是":{"docs":{},"能":{"docs":{},"够":{"docs":{},"访":{"docs":{},"问":{"docs":{},"静":{"docs":{},"态":{"docs":{},"属":{"docs":{},"性":{"docs":{},"h":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"监":{"docs":{},"测":{"docs":{},"每":{"docs":{},"个":{"docs":{},"玩":{"docs":{},"家":{"docs":{},"的":{"docs":{},"进":{"docs":{},"度":{"docs":{},"。":{"docs":{},"它":{"docs":{},"用":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"一":{"docs":{},"起":{"docs":{},"来":{"docs":{},"指":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"的":{"docs":{},"优":{"docs":{},"先":{"docs":{},"级":{"docs":{},"。":{"docs":{},"优":{"docs":{},"先":{"docs":{},"级":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"0":{"docs":{},"到":{"2":{"5":{"5":{"docs":{},"之":{"docs":{},"间":{"docs":{},"的":{"docs":{},"任":{"docs":{},"何":{"docs":{},"一":{"docs":{},"个":{"docs":{},"数":{"docs":{},"字":{"docs":{},"(":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"整":{"docs":{},"数":{"docs":{},")":{"docs":{},";":{"docs":{},"与":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"整":{"docs":{},"数":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"是":{"docs":{},",":{"docs":{},"它":{"docs":{},"不":{"docs":{},"可":{"docs":{},"以":{"docs":{},"包":{"docs":{},"含":{"docs":{},"任":{"docs":{},"何":{"docs":{},"下":{"docs":{},"划":{"docs":{},"线":{"docs":{},"字":{"docs":{},"符":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"优":{"docs":{},"先":{"docs":{},"级":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"数":{"docs":{},"字":{"docs":{},",":{"docs":{},"但":{"docs":{},"它":{"docs":{},"仅":{"docs":{},"用":{"docs":{},"作":{"docs":{},"与":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"比":{"docs":{},"较":{"docs":{},"(":{"docs":{},"大":{"docs":{},"小":{"docs":{},")":{"docs":{},"。":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"操":{"docs":{},"作":{"docs":{},"数":{"docs":{},"可":{"docs":{},"以":{"docs":{},"同":{"docs":{},"时":{"docs":{},"被":{"docs":{},"两":{"docs":{},"个":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"使":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"2":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}},"x":{"docs":{},"i":{"docs":{},"c":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.008676789587852495}}}},"o":{"docs":{},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"i":{"docs":{},"c":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.005506607929515419}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"可":{"docs":{},"以":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},"环":{"docs":{},"境":{"docs":{},"下":{"docs":{},"。":{"docs":{},"此":{"docs":{},"时":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},"?":{"docs":{},"实":{"docs":{},"例":{"docs":{},"包":{"docs":{},"含":{"docs":{},"有":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"t":{"docs":{},"的":{"docs":{},"值":{"docs":{},"(":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},"值":{"docs":{},"为":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},"t":{"docs":{},")":{"docs":{},")":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"此":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"就":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"否":{"docs":{},"则":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"同":{"docs":{},"时":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.006779661016949152}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"k":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}},"p":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}},"w":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.007633587786259542}},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.28757302177376526},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.013015184381778741}}}}},"g":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}}}}}}}}}},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.006309148264984227},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"右":{"docs":{},"移":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}},"g":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612}}}}},"、":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"、":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}},"#":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.030612244897959183}}}}}}},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}},"l":{"docs":{},"a":{"docs":{},"m":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.007220216606498195}}}}}}},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}},"a":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}},"s":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}}}}}},"i":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"k":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809}},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.008982035928143712}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"变":{"docs":{},"量":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"(":{"docs":{},"初":{"docs":{},"始":{"docs":{},"为":{"0":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}},"将":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"其":{"docs":{},"外":{"docs":{},"部":{"docs":{},"命":{"docs":{},"名":{"docs":{},"为":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"其":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}},"x":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.021897810218978103}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"和":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"子":{"docs":{},"类":{"docs":{},"中":{"docs":{},"定":{"docs":{},"制":{"docs":{},"这":{"docs":{},"些":{"docs":{},"特":{"docs":{},"性":{"docs":{},",":{"docs":{},"或":{"docs":{},"添":{"docs":{},"加":{"docs":{},"新":{"docs":{},"的":{"docs":{},"特":{"docs":{},"性":{"docs":{},"来":{"docs":{},"更":{"docs":{},"好":{"docs":{},"地":{"docs":{},"描":{"docs":{},"述":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"u":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}}}}}}}}}}}},"i":{"docs":{},"m":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},"s":{"docs":{},"或":{"docs":{},"者":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},")":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"定":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"(":{"docs":{},"比":{"docs":{},"如":{"docs":{},"数":{"docs":{},"字":{"1":{"0":{"docs":{},"或":{"docs":{},"者":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"新":{"docs":{},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"并":{"docs":{},"给":{"docs":{},"它":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"1":{"0":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},",":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"字":{"docs":{},"是":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"并":{"docs":{},"将":{"docs":{},"它":{"docs":{},"的":{"docs":{},"值":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"0":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},"s":{"docs":{},",":{"docs":{},"它":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"所":{"docs":{},"有":{"docs":{},"a":{"docs":{},"u":{"docs":{},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}}},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.016728624535315983}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}}}}}}}},"a":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}},"p":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.008982035928143712}},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}},"e":{"docs":{},"s":{"docs":{},"y":{"docs":{},"r":{"docs":{},"u":{"docs":{},"p":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}}}}}},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"尾":{"docs":{},"随":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"将":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"数":{"docs":{},"组":{"docs":{},"[":{"1":{"6":{"docs":{},",":{"5":{"8":{"docs":{},",":{"5":{"1":{"0":{"docs":{},"]":{"docs":{},"转":{"docs":{},"换":{"docs":{},"为":{"docs":{},"包":{"docs":{},"含":{"docs":{},"对":{"docs":{},"应":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"[":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.007220216606498195},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"元":{"docs":{},"组":{"docs":{},"(":{"docs":{},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},"值":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.9090909090909092}}}}}}}}}}}}}}}}}}},",":{"docs":{},"元":{"docs":{},"组":{"docs":{},"(":{"docs":{},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},"和":{"docs":{},"特":{"docs":{},"定":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"描":{"docs":{},"述":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"”":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"“":{"docs":{},"最":{"docs":{},"大":{"docs":{},"适":{"docs":{},"合":{"docs":{},"”":{"docs":{},"(":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"2":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}},"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.021621621621621623}},"(":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}},"[":{"0":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"1":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"2":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"docs":{}},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"中":{"docs":{},"同":{"docs":{},"时":{"docs":{},"调":{"docs":{},"用":{"docs":{},"了":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"入":{"docs":{},"参":{"docs":{},"的":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"是":{"docs":{},"否":{"docs":{},"有":{"docs":{},"效":{"docs":{},"的":{"docs":{},"判":{"docs":{},"断":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"方":{"docs":{},"便":{"docs":{},"进":{"docs":{},"行":{"docs":{},"断":{"docs":{},"言":{"docs":{},",":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"i":{"docs":{},"s":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"确":{"docs":{},"认":{"docs":{},"入":{"docs":{},"参":{"docs":{},"的":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"或":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"在":{"docs":{},"阅":{"docs":{},"读":{"docs":{},"顺":{"docs":{},"序":{"docs":{},"从":{"docs":{},"左":{"docs":{},"上":{"docs":{},"到":{"docs":{},"右":{"docs":{},"下":{"docs":{},"的":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{},"实":{"docs":{},"例":{"docs":{},"中":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"实":{"docs":{},"例":{"docs":{},"g":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"两":{"docs":{},"个":{"docs":{},"入":{"docs":{},"参":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"入":{"docs":{},"参":{"docs":{},"分":{"docs":{},"别":{"docs":{},"是":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"s":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"s":{"docs":{},",":{"docs":{},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"足":{"docs":{},"够":{"docs":{},"容":{"docs":{},"纳":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},",":{"docs":{},"将":{"docs":{},"呈":{"docs":{},"现":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"二":{"docs":{},"维":{"docs":{},"矩":{"docs":{},"阵":{"docs":{},"。":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}},"d":{"docs":{},"e":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}}},"e":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.4653169598406903},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}},")":{"docs":{},",":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}},"类":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}},",":{"docs":{},"类":{"docs":{},"似":{"docs":{},"于":{"docs":{},"在":{"docs":{},"参":{"docs":{},"数":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},",":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"用":{"docs":{},"来":{"docs":{},"移":{"docs":{},"动":{"docs":{},"点":{"docs":{},"。":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"方":{"docs":{},"法":{"docs":{},"在":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},"修":{"docs":{},"改":{"docs":{},"了":{"docs":{},"这":{"docs":{},"个":{"docs":{},"点":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"点":{"docs":{},"。":{"docs":{},"方":{"docs":{},"法":{"docs":{},"定":{"docs":{},"义":{"docs":{},"时":{"docs":{},"加":{"docs":{},"上":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},")":{"docs":{},",":{"docs":{},"用":{"docs":{},"于":{"docs":{},"提":{"docs":{},"供":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"所":{"docs":{},"代":{"docs":{},"表":{"docs":{},"的":{"docs":{},"值":{"docs":{},"相":{"docs":{},"关":{"docs":{},"联":{"docs":{},"的":{"docs":{},"功":{"docs":{},"能":{"docs":{},"。":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"定":{"docs":{},"义":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"来":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"成":{"docs":{},"员":{"docs":{},"值":{"docs":{},";":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"原":{"docs":{},"始":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"基":{"docs":{},"础":{"docs":{},"上":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"功":{"docs":{},"能":{"docs":{},";":{"docs":{},"可":{"docs":{},"以":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"协":{"docs":{},"议":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.43478260869565216}}}}}}}}}}},"下":{"docs":{},"标":{"docs":{},"(":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"s":{"docs":{},")":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":1.6666666666666665}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.43478260869565216}}}}}}}}}}},"修":{"docs":{},"改":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"(":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.43478260869565216}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"变":{"docs":{},"异":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"给":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"(":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.43478260869565216}}}}}}}}}}}}}}}}}}}}}},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"局":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"和":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"(":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.43478260869565216}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.43478260869565216}}}}}}}}}}},"中":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"等":{"docs":{},"同":{"docs":{},"于":{"docs":{},"当":{"docs":{},"前":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.017241379310344827}}}},"a":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"a":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"o":{"docs":{},"f":{"docs":{},"l":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}}}}}}}},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.010619469026548672},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}},"r":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}}},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.6995670666869209},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":2.5025641025641026},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}},")":{"docs":{},"中":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"这":{"docs":{},"个":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},",":{"docs":{},"在":{"docs":{},"某":{"docs":{},"个":{"docs":{},"文":{"docs":{},"件":{"docs":{},"的":{"docs":{},"顶":{"docs":{},"端":{"docs":{},"(":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.028077753779697623}},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"能":{"docs":{},"够":{"docs":{},"使":{"docs":{},"用":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}},"因":{"docs":{},"为":{"docs":{},"不":{"docs":{},"确":{"docs":{},"定":{"docs":{},",":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.45004978426817127},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.019855595667870037},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"方":{"docs":{},"法":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"从":{"docs":{},"方":{"docs":{},"法":{"docs":{},"内":{"docs":{},"部":{"docs":{},"改":{"docs":{},"变":{"docs":{},"它":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},";":{"docs":{},"并":{"docs":{},"且":{"docs":{},"它":{"docs":{},"做":{"docs":{},"的":{"docs":{},"任":{"docs":{},"何":{"docs":{},"改":{"docs":{},"变":{"docs":{},"在":{"docs":{},"方":{"docs":{},"法":{"docs":{},"结":{"docs":{},"束":{"docs":{},"时":{"docs":{},"还":{"docs":{},"会":{"docs":{},"保":{"docs":{},"留":{"docs":{},"在":{"docs":{},"原":{"docs":{},"始":{"docs":{},"结":{"docs":{},"构":{"docs":{},"中":{"docs":{},"。":{"docs":{},"方":{"docs":{},"法":{"docs":{},"还":{"docs":{},"可":{"docs":{},"以":{"docs":{},"给":{"docs":{},"它":{"docs":{},"隐":{"docs":{},"含":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"i":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},")":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"是":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2857142857142857}}}}}}}}}}}}}}}}}}},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23498238195912613}},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.007434944237918215},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},"e":{"docs":{},"r":{"docs":{},"作":{"docs":{},"为":{"docs":{},"\\":{"docs":{},"(":{"docs":{},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}},"y":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}},"s":{"docs":{},"(":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"u":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}},"s":{"docs":{},"b":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}},"n":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"类":{"docs":{},"型":{"docs":{},"m":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"。":{"docs":{},"除":{"docs":{},"了":{"docs":{},"用":{"docs":{},"户":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"数":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.00881057268722467}}}}}}}},"i":{"docs":{},"n":{"docs":{},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}},"和":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}},"d":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}},"u":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801}}}}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0072992700729927005}}}}}}}}},"l":{"docs":{},"k":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.008676789587852495}},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}},"l":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.003805899143672693}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}}},"d":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}},"p":{"docs":{},"h":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.014598540145985401}}}},"o":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"r":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}},"e":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"o":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.007272727272727273}},"(":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028}}}}}}}}},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.09287257019438445}},"e":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.01079913606911447}}}}}},".":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.008639308855291577}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.008639308855291577}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.008639308855291577}}}}}}},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"将":{"docs":{},"用":{"docs":{},"于":{"docs":{},"打":{"docs":{},"印":{"docs":{},"一":{"docs":{},"个":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"描":{"docs":{},"述":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"它":{"docs":{},"的":{"docs":{},"导":{"docs":{},"演":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"。":{"docs":{},"当":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"真":{"docs":{},"的":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"(":{"docs":{},"这":{"docs":{},"个":{"docs":{},"是":{"docs":{},"为":{"docs":{},"了":{"docs":{},"判":{"docs":{},"断":{"docs":{},"下":{"docs":{},"转":{"docs":{},"是":{"docs":{},"否":{"docs":{},"成":{"docs":{},"功":{"docs":{},"。":{"docs":{},")":{"docs":{},"可":{"docs":{},"选":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"是":{"docs":{},"这":{"docs":{},"样":{"docs":{},"写":{"docs":{},"的":{"docs":{},"“":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}},"d":{"docs":{},"e":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},")":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"予":{"docs":{},"了":{"docs":{},"h":{"docs":{},"d":{"docs":{},"分":{"docs":{},"辨":{"docs":{},"率":{"docs":{},"(":{"1":{"9":{"2":{"0":{"docs":{},"*":{"1":{"0":{"8":{"0":{"docs":{},")":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"(":{"docs":{},"h":{"docs":{},"d":{"docs":{},")":{"docs":{},"。":{"docs":{},"同":{"docs":{},"时":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"交":{"docs":{},"错":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},")":{"docs":{},",":{"docs":{},"命":{"docs":{},"名":{"docs":{},"为":{"docs":{},"“":{"1":{"0":{"8":{"0":{"docs":{},"i":{"docs":{},"”":{"docs":{},"。":{"docs":{},"最":{"docs":{},"后":{"docs":{},",":{"docs":{},"其":{"docs":{},"帧":{"docs":{},"率":{"docs":{},"是":{"2":{"5":{"docs":{},".":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028}}}}},"u":{"docs":{},"l":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"e":{"docs":{},"的":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"只":{"docs":{},"能":{"docs":{},"调":{"docs":{},"用":{"docs":{},"在":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"-":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"声":{"docs":{},"明":{"docs":{},"中":{"docs":{},"的":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"l":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}},"y":{"docs":{},"m":{"docs":{},"b":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}},"h":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}},"m":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"p":{"docs":{},"i":{"docs":{},"a":{"docs":{},"o":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":5.021238938053098},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.006507592190889371},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.02857142857142857},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.016181229773462782},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.007709251101321586}},",":{"docs":{},"?":{"docs":{},"后":{"docs":{},"面":{"docs":{},"的":{"docs":{},"东":{"docs":{},"西":{"docs":{},"都":{"docs":{},"会":{"docs":{},"被":{"docs":{},"忽":{"docs":{},"略":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"整":{"docs":{},"个":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}},"条":{"docs":{},"件":{"docs":{},"会":{"docs":{},"判":{"docs":{},"断":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"大":{"docs":{},"括":{"docs":{},"号":{"docs":{},"中":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"会":{"docs":{},"被":{"docs":{},"跳":{"docs":{},"过":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"不":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"会":{"docs":{},"将":{"docs":{},"值":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}},"但":{"docs":{},"是":{"docs":{},"后":{"docs":{},"面":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"运":{"docs":{},"行":{"docs":{},"需":{"docs":{},"要":{"docs":{},"一":{"docs":{},"个":{"docs":{},"非":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}},"因":{"docs":{},"为":{"docs":{},"非":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"不":{"docs":{},"允":{"docs":{},"许":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}},"不":{"docs":{},"是":{"docs":{},"指":{"docs":{},"针":{"docs":{},"—":{"docs":{},"—":{"docs":{},"它":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"确":{"docs":{},"定":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"值":{"docs":{},"缺":{"docs":{},"失":{"docs":{},"。":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"状":{"docs":{},"态":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"话":{"docs":{},"请":{"docs":{},"不":{"docs":{},"要":{"docs":{},"使":{"docs":{},"用":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"解":{"docs":{},"析":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"生":{"docs":{},"命":{"docs":{},"周":{"docs":{},"期":{"docs":{},"中":{"docs":{},"判":{"docs":{},"断":{"docs":{},"是":{"docs":{},"否":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"使":{"docs":{},"用":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},"的":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"后":{"docs":{},"再":{"docs":{},"也":{"docs":{},"不":{"docs":{},"会":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"方":{"docs":{},"式":{"docs":{},"断":{"docs":{},"开":{"docs":{},"两":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"(":{"docs":{},")":{"docs":{},"包":{"docs":{},"括":{"docs":{},"最":{"docs":{},"先":{"docs":{},"的":{"docs":{},"那":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},")":{"docs":{},",":{"docs":{},"只":{"docs":{},"留":{"docs":{},"下":{"docs":{},"一":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"选":{"docs":{},"项":{"docs":{},"会":{"docs":{},"导":{"docs":{},"致":{"docs":{},"运":{"docs":{},"行":{"docs":{},"错":{"docs":{},"误":{"docs":{},"(":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}},"了":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"使":{"docs":{},"用":{"docs":{},"和":{"docs":{},"前":{"docs":{},"面":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"来":{"docs":{},"获":{"docs":{},"得":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},",":{"docs":{},"不":{"docs":{},"论":{"docs":{},"你":{"docs":{},"调":{"docs":{},"用":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"、":{"docs":{},"方":{"docs":{},"法":{"docs":{},"、":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"等":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"docs":{},"不":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"结":{"docs":{},"果":{"docs":{},"都":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"利":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"来":{"docs":{},"检":{"docs":{},"测":{"docs":{},"你":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"是":{"docs":{},"否":{"docs":{},"调":{"docs":{},"用":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"有":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"即":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"时":{"docs":{},",":{"docs":{},"将":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"内":{"docs":{},"的":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"总":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"当":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"销":{"docs":{},"毁":{"docs":{},"后":{"docs":{},",":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"值":{"docs":{},"会":{"docs":{},"自":{"docs":{},"动":{"docs":{},"置":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"没":{"docs":{},"有":{"docs":{},"任":{"docs":{},"何":{"docs":{},"一":{"docs":{},"个":{"docs":{},"析":{"docs":{},"构":{"docs":{},"函":{"docs":{},"数":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"。":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"循":{"docs":{},"环":{"docs":{},"阻":{"docs":{},"止":{"docs":{},"了":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"和":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}},"u":{"docs":{},"m":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{},"b":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.03571428571428571},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}},"e":{"docs":{},"r":{"7":{"3":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.015238095238095238}},"!":{"docs":{},".":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}}}},"docs":{}},"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.018161180476730987},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.003805899143672693},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.02694610778443114},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.008484848484848486},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.031746031746031744},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.017142857142857144},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714}},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00681044267877412}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.01272264631043257}}}},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635}},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"0":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}},"docs":{}}}}}}}}}}}},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.01824817518248175}}}}}}},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}},"s":{"docs":{},"[":{"docs":{},"\"":{"docs":{},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"并":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"出":{"docs":{},"了":{"docs":{},"包":{"docs":{},"含":{"docs":{},"三":{"docs":{},"对":{"docs":{},"键":{"docs":{},"值":{"docs":{},"的":{"docs":{},"字":{"docs":{},"典":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"s":{"docs":{},"的":{"docs":{},"字":{"docs":{},"典":{"docs":{},"存":{"docs":{},"放":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},"为":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.025806451612903226}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.01904761904761905}},"s":{"docs":{},"是":{"docs":{},"非":{"docs":{},"可":{"docs":{},"选":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},")":{"docs":{},"时":{"docs":{},"这":{"docs":{},"一":{"docs":{},"点":{"docs":{},"也":{"docs":{},"成":{"docs":{},"立":{"docs":{},"。":{"docs":{},"只":{"docs":{},"要":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"的":{"docs":{},"请":{"docs":{},"求":{"docs":{},"就":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"最":{"docs":{},"后":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"总":{"docs":{},"是":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"操":{"docs":{},"作":{"docs":{},"有":{"docs":{},"可":{"docs":{},"能":{"docs":{},"失":{"docs":{},"败":{"docs":{},",":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"类":{"docs":{},"型":{"docs":{},"值":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"称":{"docs":{},"作":{"docs":{},"“":{"docs":{},"可":{"docs":{},"选":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"”":{"docs":{},"。":{"docs":{},"当":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"是":{"docs":{},"空":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},"(":{"docs":{},"上":{"docs":{},"例":{"docs":{},")":{"docs":{},",":{"docs":{},"选":{"docs":{},"择":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"将":{"docs":{},"会":{"docs":{},"为":{"docs":{},"空":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"会":{"docs":{},"出":{"docs":{},"先":{"docs":{},"无":{"docs":{},"法":{"docs":{},"访":{"docs":{},"问":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}},"y":{"docs":{},"m":{"docs":{},"b":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.003805899143672693}},"是":{"docs":{},"否":{"docs":{},"是":{"docs":{},"拉":{"docs":{},"丁":{"docs":{},",":{"docs":{},"阿":{"docs":{},"拉":{"docs":{},"伯":{"docs":{},",":{"docs":{},"中":{"docs":{},"文":{"docs":{},"或":{"docs":{},"者":{"docs":{},"泰":{"docs":{},"语":{"docs":{},"中":{"docs":{},"的":{"1":{"docs":{},"到":{"4":{"docs":{},"之":{"docs":{},"一":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"被":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},",":{"docs":{},"该":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"分":{"docs":{},"支":{"docs":{},"语":{"docs":{},"句":{"docs":{},"给":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"类":{"docs":{},"型":{"docs":{},"变":{"docs":{},"量":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087}}}}}}},"的":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}},"参":{"docs":{},"数":{"docs":{},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"具":{"docs":{},"体":{"docs":{},"描":{"docs":{},"述":{"docs":{},"请":{"docs":{},"参":{"docs":{},"看":{"docs":{},"常":{"docs":{},"量":{"docs":{},"参":{"docs":{},"数":{"docs":{},"和":{"docs":{},"变":{"docs":{},"量":{"docs":{},"参":{"docs":{},"数":{"docs":{},")":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"函":{"docs":{},"数":{"docs":{},"体":{"docs":{},"内":{"docs":{},"对":{"docs":{},"其":{"docs":{},"进":{"docs":{},"行":{"docs":{},"修":{"docs":{},"改":{"docs":{},"。":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"制":{"docs":{},"定":{"docs":{},"了":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},",":{"docs":{},"以":{"docs":{},"表":{"docs":{},"明":{"docs":{},"存":{"docs":{},"储":{"docs":{},"映":{"docs":{},"射":{"docs":{},"值":{"docs":{},"的":{"docs":{},"新":{"docs":{},"数":{"docs":{},"组":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"变":{"docs":{},"量":{"docs":{},"之":{"docs":{},"后":{"docs":{},"除":{"docs":{},"以":{"1":{"0":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}},"docs":{}},"docs":{}}}}}}},"值":{"docs":{},"和":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"例":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"方":{"docs":{},"式":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"这":{"docs":{},"样":{"docs":{},"可":{"docs":{},"以":{"docs":{},"确":{"docs":{},"保":{"docs":{},"当":{"docs":{},"创":{"docs":{},"建":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"时":{"docs":{},"总":{"docs":{},"是":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.021566401816118047},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.015184381778741865},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.2410429880197322},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.8771988051775639},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.012165450121654502},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.009191176470588236},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.03492063492063492},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.030476190476190476},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.012958963282937365},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.01444043321299639},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.007709251101321586},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.04},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.013559322033898305}},"=":{"docs":{},"\"":{"2":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}},"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"_":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"_":{"docs":{},"o":{"docs":{},"f":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"_":{"docs":{},"b":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"_":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"_":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},"_":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"s":{"docs":{},"_":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"o":{"docs":{},"o":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"b":{"docs":{},"e":{"docs":{},"t":{"docs":{},"w":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},"_":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"c":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"i":{"docs":{},"z":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}},"_":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}}}}}}}},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"-":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"_":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"b":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"l":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"_":{"docs":{},"t":{"docs":{},"o":{"docs":{},"_":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"u":{"docs":{},"n":{"docs":{},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"_":{"docs":{},"o":{"docs":{},"b":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"s":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"_":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"o":{"docs":{},"c":{"docs":{},"i":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}},"u":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}},"e":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}},"l":{"docs":{},"f":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"_":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"_":{"docs":{},"a":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"_":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"i":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"b":{"docs":{},"e":{"docs":{},"t":{"docs":{},"w":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"f":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"_":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"_":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"h":{"docs":{},"i":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"y":{"docs":{},"_":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}}},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"_":{"docs":{},"a":{"docs":{},"d":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}},"y":{"docs":{},"_":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"_":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}},"w":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"i":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"y":{"docs":{},"_":{"docs":{},"b":{"docs":{},"e":{"docs":{},"h":{"docs":{},"a":{"docs":{},"v":{"docs":{},"i":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"i":{"docs":{},"f":{"docs":{},"y":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"_":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"_":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}}}}}}},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"_":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"h":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"_":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},"a":{"docs":{},"_":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"s":{"docs":{},"_":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"_":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"e":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"y":{"docs":{},"_":{"docs":{},"u":{"docs":{},"n":{"docs":{},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"_":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"_":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"_":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"_":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}}},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}},"n":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}},"y":{"docs":{},"_":{"docs":{},"s":{"docs":{},"y":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"r":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}},"n":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"_":{"docs":{},"s":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"_":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"t":{"docs":{},"_":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"s":{"docs":{},"_":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"v":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{},"_":{"docs":{},"p":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"_":{"docs":{},"o":{"docs":{},"f":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"y":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"f":{"docs":{},"-":{"1":{"6":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}},"docs":{}},"8":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}},"docs":{}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}},"_":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"i":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"_":{"docs":{},"o":{"docs":{},"f":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"_":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"_":{"docs":{},"a":{"docs":{},"_":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"d":{"docs":{},"i":{"docs":{},"f":{"docs":{},"y":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},"_":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}},"z":{"docs":{},"y":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"_":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"_":{"docs":{},"o":{"docs":{},"f":{"docs":{},"_":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}},"e":{"docs":{},"x":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"_":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"_":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"l":{"docs":{},"y":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"v":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"_":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"docs":{},"b":{"docs":{},"e":{"docs":{},"t":{"docs":{},"w":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"t":{"docs":{},"o":{"docs":{},"_":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"_":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}},"-":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"o":{"docs":{},"w":{"docs":{},"_":{"docs":{},"d":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"_":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"_":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{},"_":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"_":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.03571428571428571}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{},"s":{"docs":{},"\"":{"docs":{},">":{"docs":{},"<":{"docs":{},"/":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}},"d":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}},"e":{"docs":{},"的":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"子":{"docs":{},"类":{"docs":{},"c":{"docs":{},"i":{"docs":{},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"接":{"docs":{},"收":{"docs":{},"两":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"半":{"docs":{},"径":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"实":{"docs":{},"现":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"和":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}}},"协":{"docs":{},"议":{"docs":{},"包":{"docs":{},"含":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},";":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"协":{"docs":{},"议":{"docs":{},"包":{"docs":{},"含":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"[":{"1":{"6":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}},"docs":{}},"docs":{}}}}}}}}}}}},")":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}}}}}}}},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}},"简":{"docs":{},"写":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"(":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}}}}}}},"默":{"docs":{},"认":{"docs":{},"参":{"docs":{},"数":{"docs":{},"值":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}}}},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}},"数":{"docs":{},"组":{"docs":{},"确":{"docs":{},"已":{"docs":{},"被":{"docs":{},"复":{"docs":{},"制":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"将":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{},"e":{"docs":{},"d":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"中":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"从":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"m":{"docs":{},"o":{"docs":{},"h":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"修":{"docs":{},"改":{"docs":{},"为":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"m":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"则":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"数":{"docs":{},"组":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"仍":{"docs":{},"是":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"发":{"docs":{},"生":{"docs":{},"前":{"docs":{},"的":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"m":{"docs":{},"o":{"docs":{},"h":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"其":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"七":{"docs":{},"个":{"docs":{},"人":{"docs":{},"名":{"docs":{},"。":{"docs":{},"还":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{},"e":{"docs":{},"d":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"用":{"docs":{},"以":{"docs":{},"储":{"docs":{},"存":{"docs":{},"在":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"上":{"docs":{},"调":{"docs":{},"用":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}},"(":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"(":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.008563273073263558}}}}}}}}}}}}},"e":{"docs":{},"w":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.012903225806451613},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}}}},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"相":{"docs":{},"同":{"docs":{},"。":{"docs":{},"与":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"是":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"的":{"docs":{},"入":{"docs":{},"参":{"docs":{},"声":{"docs":{},"明":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"就":{"docs":{},"算":{"docs":{},"不":{"docs":{},"写":{"docs":{},",":{"docs":{},"在":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"中":{"docs":{},"依":{"docs":{},"然":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"e":{"docs":{},"d":{"docs":{},"函":{"docs":{},"数":{"docs":{},"。":{"docs":{},"更":{"docs":{},"多":{"docs":{},"关":{"docs":{},"于":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"讨":{"docs":{},"论":{"docs":{},",":{"docs":{},"参":{"docs":{},"见":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"t":{"docs":{},"u":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"r":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}},"x":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"方":{"docs":{},"法":{"docs":{},"时":{"docs":{},",":{"docs":{},"开":{"docs":{},"关":{"docs":{},"在":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"电":{"docs":{},"源":{"docs":{},"状":{"docs":{},"态":{"docs":{},"(":{"docs":{},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{},",":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},",":{"docs":{},"h":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"其":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"不":{"docs":{},"是":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093}}},"a":{"docs":{},"r":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.017699115044247787}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"的":{"docs":{},"非":{"docs":{},"结":{"docs":{},"合":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"不":{"docs":{},"以":{"docs":{},"任":{"docs":{},"何":{"docs":{},"形":{"docs":{},"式":{"docs":{},"分":{"docs":{},"组":{"docs":{},"。":{"docs":{},"具":{"docs":{},"有":{"docs":{},"相":{"docs":{},"同":{"docs":{},"优":{"docs":{},"先":{"docs":{},"级":{"docs":{},"的":{"docs":{},"非":{"docs":{},"结":{"docs":{},"合":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},",":{"docs":{},"不":{"docs":{},"可":{"docs":{},"以":{"docs":{},"互":{"docs":{},"相":{"docs":{},"邻":{"docs":{},"接":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"1":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.007272727272727273},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.020512820512820513},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.015267175572519083},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.05161290322580645},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.016245487364620937},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"”":{"docs":{},"。":{"docs":{},"当":{"docs":{},"它":{"docs":{},"等":{"docs":{},"于":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"打":{"docs":{},"印":{"docs":{},"“":{"docs":{},"w":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"h":{"docs":{},",":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"和":{"docs":{},"w":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},")":{"docs":{},"是":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"值":{"docs":{},"(":{"docs":{},"或":{"docs":{},"者":{"docs":{},"成":{"docs":{},"员":{"docs":{},")":{"docs":{},"。":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.05970149253731343}},"特":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"或":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"将":{"docs":{},"它":{"docs":{},"重":{"docs":{},"写":{"docs":{},"(":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},")":{"docs":{},"为":{"docs":{},"用":{"docs":{},"该":{"docs":{},"特":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"已":{"docs":{},"经":{"docs":{},"用":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"特":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"或":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"你":{"docs":{},"则":{"docs":{},"不":{"docs":{},"可":{"docs":{},"以":{"docs":{},"将":{"docs":{},"它":{"docs":{},"重":{"docs":{},"写":{"docs":{},"为":{"docs":{},"没":{"docs":{},"使":{"docs":{},"用":{"docs":{},"该":{"docs":{},"特":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"的":{"docs":{},"。":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"规":{"docs":{},"则":{"docs":{},"试":{"docs":{},"用":{"docs":{},"于":{"docs":{},"当":{"docs":{},"你":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"似":{"docs":{},"的":{"docs":{},"是":{"docs":{},",":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},")":{"docs":{},"来":{"docs":{},"暗":{"docs":{},"示":{"docs":{},"值":{"docs":{},"缺":{"docs":{},"失":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"方":{"docs":{},"法":{"docs":{},"假":{"docs":{},"设":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"调":{"docs":{},"用":{"docs":{},"者":{"docs":{},"知":{"docs":{},"道":{"docs":{},"并":{"docs":{},"记":{"docs":{},"得":{"docs":{},"对":{"docs":{},"特":{"docs":{},"殊":{"docs":{},"值":{"docs":{},"进":{"docs":{},"行":{"docs":{},"判":{"docs":{},"断":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}},"和":{"docs":{},"n":{"docs":{},"s":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"来":{"docs":{},"指":{"docs":{},"定":{"docs":{},"该":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"是":{"docs":{},"否":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"修":{"docs":{},"改":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"将":{"docs":{},"其":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"/":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"一":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"您":{"docs":{},"传":{"docs":{},"递":{"docs":{},"或":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"的":{"docs":{},"是":{"docs":{},"该":{"docs":{},"n":{"docs":{},"s":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}},"y":{"docs":{},"和":{"docs":{},"n":{"docs":{},"s":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"的":{"docs":{},"行":{"docs":{},"为":{"docs":{},"描":{"docs":{},"述":{"docs":{},"在":{"docs":{},"本":{"docs":{},"质":{"docs":{},"上":{"docs":{},"不":{"docs":{},"同":{"docs":{},",":{"docs":{},"后":{"docs":{},"者":{"docs":{},"是":{"docs":{},"以":{"docs":{},"类":{"docs":{},"的":{"docs":{},"形":{"docs":{},"式":{"docs":{},"实":{"docs":{},"现":{"docs":{},",":{"docs":{},"前":{"docs":{},"者":{"docs":{},"是":{"docs":{},"以":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"形":{"docs":{},"式":{"docs":{},"实":{"docs":{},"现":{"docs":{},"。":{"docs":{},"n":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"和":{"docs":{},"n":{"docs":{},"s":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"和":{"docs":{},"n":{"docs":{},"s":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}},"e":{"docs":{},"d":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"子":{"docs":{},"类":{"docs":{},"中":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"变":{"docs":{},"量":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"表":{"docs":{},"明":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"和":{"docs":{},"实":{"docs":{},"现":{"docs":{},"由":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}},"y":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"特":{"docs":{},"性":{"docs":{},"的":{"docs":{},"行":{"docs":{},"为":{"docs":{},"与":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"中":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"c":{"1":{"7":{"0":{"1":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},".":{"docs":{},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}},"p":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.01892744479495268},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"e":{"docs":{},"i":{"docs":{},"y":{"docs":{},"u":{"docs":{},"c":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.015873015873015872},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.02857142857142857},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"'":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061}}}}},"和":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"模":{"docs":{},"型":{"docs":{},"通":{"docs":{},"过":{"docs":{},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"并":{"docs":{},"将":{"docs":{},"类":{"docs":{},"实":{"docs":{},"例":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},"和":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"一":{"docs":{},"致":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"重":{"docs":{},"要":{"docs":{},"的":{"docs":{},"区":{"docs":{},"别":{"docs":{},"。":{"docs":{},"这":{"docs":{},"一":{"docs":{},"次":{"docs":{},",":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"展":{"docs":{},"示":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"值":{"docs":{},"都":{"docs":{},"允":{"docs":{},"许":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}},"这":{"docs":{},"也":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"你":{"docs":{},"不":{"docs":{},"再":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}},"依":{"docs":{},"然":{"docs":{},"保":{"docs":{},"持":{"docs":{},"对":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"只":{"docs":{},"是":{"docs":{},"对":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"弱":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"当":{"docs":{},"你":{"docs":{},"断":{"docs":{},"开":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},"变":{"docs":{},"量":{"docs":{},"所":{"docs":{},"保":{"docs":{},"持":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"再":{"docs":{},"也":{"docs":{},"没":{"docs":{},"有":{"docs":{},"指":{"docs":{},"向":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},",":{"docs":{},"名":{"docs":{},"字":{"docs":{},"为":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"并":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"的":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"现":{"docs":{},"在":{"docs":{},"有":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"向":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"而":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"也":{"docs":{},"有":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"向":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"当":{"docs":{},"你":{"docs":{},"断":{"docs":{},"开":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},"和":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"数":{"docs":{},"量":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"会":{"docs":{},"在":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}},"?":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"按":{"docs":{},"照":{"docs":{},"代":{"docs":{},"码":{"docs":{},"片":{"docs":{},"段":{"docs":{},"中":{"docs":{},"的":{"docs":{},"顺":{"docs":{},"序":{"docs":{},",":{"docs":{},"为":{"docs":{},"新":{"docs":{},"的":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"建":{"docs":{},"立":{"docs":{},"多":{"docs":{},"个":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"由":{"docs":{},"于":{"docs":{},"这":{"docs":{},"些":{"docs":{},"变":{"docs":{},"量":{"docs":{},"是":{"docs":{},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"?":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"值":{"docs":{},"会":{"docs":{},"被":{"docs":{},"自":{"docs":{},"动":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"目":{"docs":{},"前":{"docs":{},"还":{"docs":{},"不":{"docs":{},"会":{"docs":{},"引":{"docs":{},"用":{"docs":{},"到":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"开":{"docs":{},"始":{"docs":{},",":{"docs":{},"并":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"此":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"为":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"并":{"docs":{},"打":{"docs":{},"印":{"docs":{},"出":{"docs":{},"信":{"docs":{},"息":{"docs":{},",":{"docs":{},"以":{"docs":{},"表":{"docs":{},"明":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"过":{"docs":{},"程":{"docs":{},"生":{"docs":{},"效":{"docs":{},"。":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"新":{"docs":{},"实":{"docs":{},"例":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"了":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"1":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"1":{"docs":{},"到":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"类":{"docs":{},"的":{"docs":{},"新":{"docs":{},"实":{"docs":{},"例":{"docs":{},"之":{"docs":{},"间":{"docs":{},"建":{"docs":{},"立":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"正":{"docs":{},"是":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"含":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}},"n":{"docs":{},"g":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087}}}}}}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}},"p":{"docs":{},"-":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"g":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"告":{"docs":{},"诉":{"docs":{},"我":{"docs":{},",":{"docs":{},"这":{"docs":{},"几":{"docs":{},"天":{"docs":{},"太":{"docs":{},"累":{"docs":{},"了":{"docs":{},",":{"docs":{},"校":{"docs":{},"对":{"docs":{},"到":{"docs":{},"一":{"docs":{},"半":{"docs":{},"睡":{"docs":{},"着":{"docs":{},"了":{"docs":{},",":{"docs":{},"醒":{"docs":{},"来":{"docs":{},"又":{"docs":{},"继":{"docs":{},"续":{"docs":{},"做":{"docs":{},"。":{"2":{"docs":{},"点":{"1":{"7":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":3.347222222222222}}}}}},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.031287605294825514},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.019417475728155338},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.018571428571428572},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.01002004008016032}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"变":{"docs":{},"量":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},",":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"会":{"docs":{},"把":{"docs":{},"它":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"当":{"docs":{},"做":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}},"<":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.010948905109489052},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":2.51528384279476},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.008571428571428572}},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},",":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},")":{"docs":{},",":{"docs":{},"构":{"docs":{},"造":{"docs":{},"过":{"docs":{},"程":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},",":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},")":{"docs":{},"和":{"docs":{},"协":{"docs":{},"议":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"s":{"docs":{},")":{"docs":{},"修":{"docs":{},"改":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":1.6666666666666665}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"y":{"docs":{},")":{"docs":{},"还":{"docs":{},"是":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}},",":{"docs":{},"或":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"(":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},")":{"docs":{},"提":{"docs":{},"供":{"docs":{},"自":{"docs":{},"己":{"docs":{},"定":{"docs":{},"制":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"(":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},"。":{"docs":{},"我":{"docs":{},"们":{"docs":{},"把":{"docs":{},"这":{"docs":{},"种":{"docs":{},"行":{"docs":{},"为":{"docs":{},"叫":{"docs":{},"重":{"docs":{},"写":{"docs":{},"(":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"后":{"docs":{},"者":{"docs":{},"则":{"docs":{},"把":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"写":{"docs":{},"为":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"在":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"修":{"docs":{},"改":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.43478260869565216}}}}}}}}}}}}}}}}}}}},"还":{"docs":{},"是":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{},"u":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}},",":{"docs":{},"也":{"docs":{},"能":{"docs":{},"够":{"docs":{},"要":{"docs":{},"求":{"docs":{},"属":{"docs":{},"性":{"docs":{},"具":{"docs":{},"有":{"docs":{},"(":{"docs":{},"设":{"docs":{},"置":{"docs":{},"权":{"docs":{},"限":{"docs":{},")":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}},"y":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.013245033112582781}},"e":{"docs":{},"的":{"docs":{},"新":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"它":{"docs":{},"一":{"docs":{},"个":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},".":{"docs":{},"u":{"docs":{},"p":{"docs":{},"c":{"docs":{},"a":{"docs":{},"的":{"docs":{},"相":{"docs":{},"关":{"docs":{},"元":{"docs":{},"组":{"docs":{},"值":{"docs":{},"(":{"8":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251}}}}}},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.01575757575757576},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.009523809523809525},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.017142857142857144},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.01327433628318584},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"l":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}},"(":{"docs":{},"\"":{"3":{"docs":{},"的":{"6":{"docs":{},"倍":{"docs":{},"是":{"docs":{},"\\":{"docs":{},"(":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"[":{"6":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}},"r":{"docs":{},"e":{"docs":{},"'":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"d":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"a":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}},"i":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}}}}},"n":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}},"b":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}},"d":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"c":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.012165450121654502}}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"l":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}},"b":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}},"t":{"docs":{},"h":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}},"n":{"docs":{},"g":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},".":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}},"h":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.01415929203539823},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.01735357917570499},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.01282051282051282},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.012903225806451613},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.009523809523809525},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.01327433628318584},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"e":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}},"s":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}},"r":{"docs":{},"e":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}},"\\":{"docs":{},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.007079646017699115}}}}}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}}}}}}}}}}},"a":{"docs":{},"i":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}},"n":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},"'":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},".":{"docs":{},"v":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.013333333333333334}}}}}}},"e":{"docs":{},"w":{"docs":{},"w":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}},"m":{"docs":{},"m":{"docs":{},"m":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}},"v":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}},"u":{"docs":{},"n":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.022222222222222223}},"u":{"docs":{},"s":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}},"p":{"docs":{},"c":{"docs":{},"-":{"docs":{},"a":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}}},"i":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}},"e":{"docs":{},"m":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}},"'":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.007611798287345386}}}},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}},"'":{"docs":{},"m":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}},"(":{"0":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894}}},"docs":{},"\\":{"docs":{},"(":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"0":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}},"docs":{}}}}}}}}}}},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},".":{"0":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894}}},"docs":{}}}}}}}}}},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"b":{"docs":{},"y":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364}}}}}}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}},"l":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}},"q":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}},"w":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.009732360097323601}}}}}}}},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.012903225806451613}}}}}}}}}},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},"'":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.022222222222222223}}}}}}},"'":{"docs":{},"\\":{"docs":{},"\\":{"docs":{},"(":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}}}}}}},"[":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}}},"docs":{}},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"[":{"docs":{},"\"":{"docs":{},"p":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}},"u":{"docs":{},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}},"[":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}}},"docs":{}},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}}}}}}}}},"d":{"1":{"2":{"docs":{},".":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}},"docs":{}},"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"y":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}},"u":{"docs":{},"z":{"docs":{},"z":{"docs":{},"l":{"docs":{},"e":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"!":{"docs":{},".":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}},"h":{"docs":{},"a":{"docs":{},"l":{"docs":{},"f":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{},"(":{"1":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}},"docs":{}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"y":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}},"b":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}},"a":{"docs":{},"g":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"[":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}}},"docs":{}},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},".":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"i":{"docs":{},"s":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"(":{"0":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}},"9":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"[":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}}}}}},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{},".":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{},".":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}},"h":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},".":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}},"“":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"s":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"输":{"docs":{},"出":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}},"(":{"docs":{},"\"":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}},"的":{"docs":{},"输":{"docs":{},"入":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"并":{"docs":{},"对":{"docs":{},"其":{"docs":{},"字":{"docs":{},"符":{"docs":{},"进":{"docs":{},"行":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"。":{"docs":{},"在":{"docs":{},"每":{"docs":{},"次":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"过":{"docs":{},"程":{"docs":{},"中":{"docs":{},",":{"docs":{},"考":{"docs":{},"虑":{"docs":{},"当":{"docs":{},"前":{"docs":{},"字":{"docs":{},"符":{"docs":{},"的":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"并":{"docs":{},"打":{"docs":{},"印":{"docs":{},"出":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"类":{"docs":{},"别":{"docs":{},"描":{"docs":{},"述":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"打":{"docs":{},"印":{"docs":{},"一":{"docs":{},"个":{"docs":{},"完":{"docs":{},"整":{"docs":{},"单":{"docs":{},"词":{"docs":{},"中":{"docs":{},"所":{"docs":{},"有":{"docs":{},"字":{"docs":{},"母":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"正":{"docs":{},"如":{"docs":{},"上":{"docs":{},"述":{"docs":{},"单":{"docs":{},"词":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"\"":{"docs":{},"\\":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},".":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}},"v":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}},"(":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0048484848484848485}},"(":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}}}}}}}}}}}}}},"s":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}}},"(":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"!":{"docs":{},".":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"!":{"docs":{},".":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}},".":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}},"e":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.28757302177376526},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.007220216606498195},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.011627906976744186},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"存":{"docs":{},"在":{"docs":{},"时":{"docs":{},",":{"docs":{},"将":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"插":{"docs":{},"入":{"docs":{},"到":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"之":{"docs":{},"前":{"docs":{},"来":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"p":{"docs":{},"构":{"docs":{},"建":{"docs":{},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},",":{"docs":{},"二":{"docs":{},"元":{"docs":{},"(":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},")":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},",":{"docs":{},"主":{"docs":{},"要":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},")":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"和":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},")":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"。":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"可":{"docs":{},"以":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"运":{"docs":{},"行":{"docs":{},"某":{"docs":{},"些":{"docs":{},"逻":{"docs":{},"辑":{"docs":{},"(":{"docs":{},"c":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"同":{"docs":{},"时":{"docs":{},",":{"docs":{},"也":{"docs":{},"需":{"docs":{},"要":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}},"继":{"docs":{},"承":{"docs":{},"了":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"、":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"、":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"、":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"、":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"、":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"(":{"docs":{},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{},"e":{"docs":{},")":{"docs":{},"、":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"(":{"docs":{},"u":{"docs":{},"n":{"docs":{},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{},"e":{"docs":{},")":{"docs":{},"、":{"docs":{},"w":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"、":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"并":{"docs":{},"优":{"docs":{},"先":{"docs":{},"级":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}},"y":{"docs":{},"a":{"docs":{},"n":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"s":{"docs":{},")":{"docs":{},"。":{"docs":{},"遍":{"docs":{},"历":{"docs":{},"字":{"docs":{},"典":{"docs":{},"时":{"docs":{},",":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"每":{"docs":{},"项":{"docs":{},"元":{"docs":{},"素":{"docs":{},"会":{"docs":{},"以":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.021897810218978103}}}},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.012165450121654502}}}}}}}}}}}}}}}},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364}},"d":{"docs":{},"e":{"docs":{},"d":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":1.6533615221987317},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.8746542759154774},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.022857142857142857},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.030612244897959183},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}},"s":{"docs":{},")":{"docs":{},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}},"常":{"docs":{},"量":{"docs":{},"参":{"docs":{},"数":{"docs":{},"和":{"docs":{},"变":{"docs":{},"量":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}}}}},"无":{"docs":{},"参":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}},"输":{"docs":{},"入":{"docs":{},"输":{"docs":{},"出":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"-":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}}}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},")":{"docs":{},"或":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}},"指":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"或":{"docs":{},"多":{"docs":{},"个":{"docs":{},"用":{"docs":{},"于":{"docs":{},"在":{"docs":{},"相":{"docs":{},"关":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"中":{"docs":{},"访":{"docs":{},"问":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"(":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"[":{"docs":{},"i":{"docs":{},"]":{"docs":{},"中":{"docs":{},"的":{"docs":{},"i":{"docs":{},")":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"用":{"docs":{},"于":{"docs":{},"元":{"docs":{},"素":{"docs":{},"访":{"docs":{},"问":{"docs":{},"的":{"docs":{},"索":{"docs":{},"引":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"任":{"docs":{},"意":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"每":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"必":{"docs":{},"须":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"用":{"docs":{},"于":{"docs":{},"指":{"docs":{},"定":{"docs":{},"每":{"docs":{},"种":{"docs":{},"索":{"docs":{},"引":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"标":{"docs":{},"注":{"docs":{},"。":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},",":{"docs":{},"不":{"docs":{},"支":{"docs":{},"持":{"docs":{},"默":{"docs":{},"认":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}}}}}}}}}}}}},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.007619047619047619}},"变":{"docs":{},"量":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"打":{"docs":{},"破":{"docs":{},"它":{"docs":{},"持":{"docs":{},"有":{"docs":{},"的":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"可":{"docs":{},"选":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"我":{"docs":{},"们":{"docs":{},"可":{"docs":{},"以":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"k":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.208456243854474},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.01694915254237288}},"s":{"docs":{},")":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.1111111111111112}}}}}}}}}}}}}}},"通":{"docs":{},"配":{"docs":{},"符":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.1111111111111112}}}}}}}}}}}}}}}}}},")":{"docs":{},"代":{"docs":{},"表":{"docs":{},"了":{"docs":{},"单":{"docs":{},"个":{"docs":{},"值":{"docs":{},"或":{"docs":{},"者":{"docs":{},"复":{"docs":{},"合":{"docs":{},"值":{"docs":{},"的":{"docs":{},"结":{"docs":{},"构":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"元":{"docs":{},"组":{"docs":{},"(":{"1":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"值":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"-":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.1111111111111112}}}}}}}}}}}}}}}}}},"元":{"docs":{},"组":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.1111111111111112}}}}}}}}}}},"和":{"docs":{},"元":{"docs":{},"组":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}},"枚":{"docs":{},"举":{"docs":{},"用":{"docs":{},"例":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.1111111111111112}}}}}}}}}}}}}}},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.1111111111111112}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"转":{"docs":{},"换":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":1.1111111111111112}}}}}}}}}}}}}}}}}},",":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894}}}}}}}}}}}}}}}}}},"-":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"d":{"docs":{},")":{"docs":{},"的":{"docs":{},",":{"docs":{},"和":{"docs":{},"其":{"docs":{},"相":{"docs":{},"反":{"docs":{},"的":{"docs":{},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"块":{"docs":{},"中":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"事":{"docs":{},"件":{"docs":{},"匹":{"docs":{},"配":{"docs":{},",":{"docs":{},"在":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"事":{"docs":{},"件":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.007079646017699115},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"e":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"x":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}}}}},"n":{"docs":{},"k":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.007751937984496124}}}}},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"o":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.009523809523809525}},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.005708848715509039}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},",":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}}}}}}}}},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.010917030567685589},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.017811704834605598},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.05752212389380531}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"x":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414}}}},"封":{"docs":{},"装":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"的":{"docs":{},"中":{"docs":{},"心":{"docs":{},"点":{"docs":{},"。":{"docs":{},"如":{"docs":{},"代":{"docs":{},"码":{"docs":{},"所":{"docs":{},"示":{"docs":{},",":{"docs":{},"它":{"docs":{},"正":{"docs":{},"确":{"docs":{},"返":{"docs":{},"回":{"docs":{},"了":{"docs":{},"中":{"docs":{},"心":{"docs":{},"点":{"docs":{},"(":{"5":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"引":{"docs":{},"用":{"docs":{},"元":{"docs":{},"组":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"变":{"docs":{},"异":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}},"(":{"docs":{},"x":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}},".":{"0":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894}}},"1":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.017699115044247787}}},"docs":{}}}}},"w":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.006507592190889371}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866}}}}},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.010830324909747292}},"并":{"docs":{},"移":{"docs":{},"除":{"docs":{},"值":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"c":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},",":{"docs":{},"该":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"将":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093}}}}}}}}}}}}}}}}}},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}},"z":{"docs":{},"z":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}}},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}}}}}}}},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588}}}}}}},"s":{"docs":{},"h":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.007220216606498195}}}}}}},")":{"docs":{},"/":{"docs":{},"出":{"docs":{},"栈":{"docs":{},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}},"n":{"docs":{},"e":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.029801324503311258}},".":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"(":{"7":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"9":{"docs":{},")":{"docs":{},"语":{"docs":{},"句":{"docs":{},"获":{"docs":{},"得":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"可":{"docs":{},"选":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"获":{"docs":{},"得":{"docs":{},",":{"docs":{},"把":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{},"设":{"docs":{},"置":{"docs":{},"成":{"docs":{},"该":{"docs":{},"可":{"docs":{},"选":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{},"的":{"docs":{},"内":{"docs":{},"容":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"范":{"docs":{},"例":{"docs":{},"中":{"docs":{},",":{"docs":{},"无":{"docs":{},"法":{"docs":{},"检":{"docs":{},"索":{"docs":{},"到":{"docs":{},"位":{"docs":{},"置":{"docs":{},"为":{"9":{"docs":{},"的":{"docs":{},"行":{"docs":{},"星":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"s":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"是":{"2":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"docs":{}}}}}}}}}}}}}}},"y":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.07741935483870968}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028}}}}},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"1":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"docs":{}}}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"6":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028}}}}},"类":{"docs":{},"使":{"docs":{},"用":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"例":{"docs":{},"来":{"docs":{},"监":{"docs":{},"测":{"docs":{},"这":{"docs":{},"个":{"docs":{},"用":{"docs":{},"户":{"docs":{},"的":{"docs":{},"发":{"docs":{},"展":{"docs":{},"进":{"docs":{},"度":{"docs":{},"。":{"docs":{},"它":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"方":{"docs":{},"法":{"docs":{},":":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"玩":{"docs":{},"家":{"docs":{},"完":{"docs":{},"成":{"docs":{},"某":{"docs":{},"个":{"docs":{},"指":{"docs":{},"定":{"docs":{},"等":{"docs":{},"级":{"docs":{},"就":{"docs":{},"调":{"docs":{},"用":{"docs":{},"它":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"为":{"docs":{},"所":{"docs":{},"有":{"docs":{},"玩":{"docs":{},"家":{"docs":{},"解":{"docs":{},"锁":{"docs":{},"下":{"docs":{},"一":{"docs":{},"等":{"docs":{},"级":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"将":{"docs":{},"当":{"docs":{},"前":{"docs":{},"玩":{"docs":{},"家":{"docs":{},"的":{"docs":{},"进":{"docs":{},"度":{"docs":{},"更":{"docs":{},"新":{"docs":{},"为":{"docs":{},"下":{"docs":{},"一":{"docs":{},"等":{"docs":{},"级":{"docs":{},"。":{"docs":{},"(":{"docs":{},"我":{"docs":{},"们":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"了":{"docs":{},"a":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"之":{"docs":{},"前":{"docs":{},"调":{"docs":{},"用":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"u":{"docs":{},"n":{"docs":{},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"w":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"该":{"docs":{},"方":{"docs":{},"法":{"docs":{},"从":{"docs":{},"银":{"docs":{},"行":{"docs":{},"获":{"docs":{},"取":{"docs":{},"一":{"docs":{},"定":{"docs":{},"数":{"docs":{},"量":{"docs":{},"的":{"docs":{},"硬":{"docs":{},"币":{"docs":{},",":{"docs":{},"并":{"docs":{},"把":{"docs":{},"它":{"docs":{},"们":{"docs":{},"添":{"docs":{},"加":{"docs":{},"到":{"docs":{},"玩":{"docs":{},"家":{"docs":{},"的":{"docs":{},"钱":{"docs":{},"包":{"docs":{},"。":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{},"e":{"docs":{},"r":{"docs":{},"类":{"docs":{},"还":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"析":{"docs":{},"构":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"析":{"docs":{},"构":{"docs":{},"函":{"docs":{},"数":{"docs":{},"在":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.025806451612903226}},"e":{"docs":{},"!":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"r":{"docs":{},"s":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.012903225806451613}}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"2":{"docs":{},"_":{"0":{"0":{"0":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}},"变":{"docs":{},"量":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"意":{"docs":{},"思":{"docs":{},"是":{"docs":{},"“":{"docs":{},"没":{"docs":{},"有":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"例":{"docs":{},"”":{"docs":{},"。":{"docs":{},"当":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},"发":{"docs":{},"生":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"变":{"docs":{},"量":{"docs":{},"对":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{},"e":{"docs":{},"r":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"被":{"docs":{},"破":{"docs":{},"坏":{"docs":{},"了":{"docs":{},"。":{"docs":{},"没":{"docs":{},"有":{"docs":{},"其":{"docs":{},"它":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"引":{"docs":{},"用":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"由":{"docs":{},"一":{"docs":{},"个":{"docs":{},"感":{"docs":{},"叹":{"docs":{},"号":{"docs":{},"(":{"docs":{},"!":{"docs":{},")":{"docs":{},"来":{"docs":{},"修":{"docs":{},"饰":{"docs":{},",":{"docs":{},"每":{"docs":{},"当":{"docs":{},"其":{"docs":{},"w":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"方":{"docs":{},"法":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"r":{"docs":{},"s":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"存":{"docs":{},"储":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"y":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}}},"u":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"s":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801}}}}}},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"s":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}}}}}}}}},">":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}},"<":{"docs":{},"/":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"表":{"docs":{},"示":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},"继":{"docs":{},"承":{"docs":{},"自":{"docs":{},"类":{"docs":{},"c":{"docs":{},"且":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"协":{"docs":{},"议":{"docs":{},"p":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"1":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.03592814371257485},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.008484848484848486}}},"2":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.03293413173652695},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.01090909090909091}},")":{"docs":{},",":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"在":{"docs":{},"新":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"s":{"1":{"docs":{},"应":{"docs":{},"该":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"s":{"2":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}},"docs":{}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}},"该":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"返":{"docs":{},"回":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"类":{"docs":{},"型":{"docs":{},"值":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"这":{"docs":{},"里":{"docs":{},"没":{"docs":{},"有":{"docs":{},"歧":{"docs":{},"义":{"docs":{},",":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}},"g":{"5":{"5":{"2":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"docs":{}},"docs":{}},"docs":{}},"h":{"docs":{},"i":{"docs":{},"n":{"docs":{},"y":{"docs":{},"z":{"docs":{},"h":{"docs":{},"u":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}},"f":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.011627906976744186}}}}}}}},"a":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00681044267877412}},".":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}},"类":{"docs":{},"缺":{"docs":{},"少":{"docs":{},"了":{"docs":{},"一":{"docs":{},"些":{"docs":{},"重":{"docs":{},"要":{"docs":{},"的":{"docs":{},"东":{"docs":{},"西":{"docs":{},":":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"类":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}}}}},"o":{"docs":{},"p":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618}},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.03036876355748373}},"[":{"0":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.006507592190889371}}},"1":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"4":{"docs":{},".":{"docs":{},".":{"docs":{},".":{"6":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}},"docs":{}}}}},"docs":{}},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"(":{"0":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}},"docs":{}}}}}}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}},"变":{"docs":{},"量":{"docs":{},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"“":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},"“":{"docs":{},",":{"docs":{},"记":{"docs":{},"作":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}},"数":{"docs":{},"组":{"docs":{},"由":{"docs":{},"两":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"(":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"e":{"docs":{},"g":{"docs":{},"g":{"docs":{},"s":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"变":{"docs":{},"量":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"创":{"docs":{},"建":{"docs":{},")":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"常":{"docs":{},"量":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"现":{"docs":{},"在":{"docs":{},"只":{"docs":{},"有":{"5":{"docs":{},"项":{"docs":{},",":{"docs":{},"不":{"docs":{},"包":{"docs":{},"括":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"s":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}},"docs":{}}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.011029411764705883}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}}},"没":{"docs":{},"有":{"docs":{},"定":{"docs":{},"义":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"来":{"docs":{},"为":{"docs":{},"p":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}},"类":{"docs":{},"中":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"属":{"docs":{},"性":{"docs":{},"都":{"docs":{},"有":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},",":{"docs":{},"且":{"docs":{},"它":{"docs":{},"是":{"docs":{},"没":{"docs":{},"有":{"docs":{},"父":{"docs":{},"类":{"docs":{},"的":{"docs":{},"基":{"docs":{},"类":{"docs":{},",":{"docs":{},"它":{"docs":{},"将":{"docs":{},"自":{"docs":{},"动":{"docs":{},"获":{"docs":{},"得":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"以":{"docs":{},"为":{"docs":{},"所":{"docs":{},"有":{"docs":{},"属":{"docs":{},"性":{"docs":{},"设":{"docs":{},"置":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"代":{"docs":{},"码":{"docs":{},"中":{"docs":{},"没":{"docs":{},"有":{"docs":{},"显":{"docs":{},"式":{"docs":{},"为":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"设":{"docs":{},"置":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},",":{"docs":{},"但":{"docs":{},"由":{"docs":{},"于":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"它":{"docs":{},"将":{"docs":{},"默":{"docs":{},"认":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},")":{"docs":{},"。":{"docs":{},"上":{"docs":{},"面":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"创":{"docs":{},"造":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"类":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"(":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"(":{"docs":{},")":{"docs":{},"形":{"docs":{},"式":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"语":{"docs":{},"法":{"docs":{},")":{"docs":{},",":{"docs":{},"并":{"docs":{},"将":{"docs":{},"其":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"变":{"docs":{},"量":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"封":{"docs":{},"装":{"docs":{},"了":{"docs":{},"购":{"docs":{},"物":{"docs":{},"清":{"docs":{},"单":{"docs":{},"中":{"docs":{},"的":{"docs":{},"某":{"docs":{},"一":{"docs":{},"项":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},":":{"docs":{},"名":{"docs":{},"字":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},"、":{"docs":{},"数":{"docs":{},"量":{"docs":{},"(":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}},"i":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"l":{"docs":{},"i":{"docs":{},"u":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}},"d":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.012485811577752554}}}}}}}},"s":{"docs":{},")":{"docs":{},"-":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.014755959137343927}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"e":{"docs":{},"时":{"docs":{},"候":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"用":{"docs":{},"来":{"docs":{},"标":{"docs":{},"记":{"docs":{},"一":{"docs":{},"个":{"docs":{},"会":{"docs":{},"修":{"docs":{},"改":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"(":{"1":{"7":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}},"docs":{}},"3":{"docs":{},".":{"1":{"4":{"1":{"5":{"9":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"<":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"h":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"s":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}},"x":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}}}},"t":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}},"e":{"docs":{},"g":{"docs":{},"g":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}},"z":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.013100436681222707},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.027573529411764705},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.02586206896551724}},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}}}}}},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}},"封":{"docs":{},"装":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"和":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"包":{"docs":{},"含":{"docs":{},"两":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"和":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"e":{"docs":{},"-":{"docs":{},"e":{"docs":{},"x":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5585495675316035}}}}}}}}}}}}}},"w":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"g":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.009689922480620155}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.006607929515418502},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.012024048096192385}},"u":{"docs":{},"r":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"z":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}},"d":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}},"r":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}},",":{"3":{"1":{"0":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}},"docs":{}},"docs":{}},"docs":{}},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"两":{"docs":{},"者":{"docs":{},"均":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"p":{"docs":{},"类":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"p":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"类":{"docs":{},"将":{"docs":{},"f":{"docs":{},"u":{"docs":{},"l":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"实":{"docs":{},"现":{"docs":{},"为":{"docs":{},"可":{"docs":{},"读":{"docs":{},"的":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"它":{"docs":{},"的":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"都":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"的":{"docs":{},"必":{"docs":{},"备":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.9205086065219272},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.022857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.022044088176352707},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.1016949152542373}},"s":{"docs":{},")":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.9090909090909092}}}}}}}}}}}}}}},"之":{"docs":{},"后":{"docs":{},",":{"docs":{},"执":{"docs":{},"行":{"docs":{},"递":{"docs":{},"增":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}},",":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}},"然":{"docs":{},"后":{"docs":{},"转":{"docs":{},"到":{"docs":{},"第":{"2":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}},"docs":{}}}}}}}}}}}}},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.02654867256637168}},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.005309734513274336}}}}},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}}}}}},"i":{"docs":{},"c":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.013100436681222707},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.007633587786259542},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.01935483870967742},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"来":{"docs":{},"定":{"docs":{},"义":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"来":{"docs":{},"为":{"docs":{},"类":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"静":{"docs":{},"态":{"docs":{},"属":{"docs":{},"性":{"docs":{},"在":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}},"声":{"docs":{},"明":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"使":{"docs":{},"用":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"在":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"类":{"docs":{},"时":{"docs":{},"使":{"docs":{},"用":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"结":{"docs":{},"构":{"docs":{},"以":{"docs":{},"或":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"内":{"docs":{},",":{"docs":{},"亦":{"docs":{},"或":{"docs":{},"是":{"docs":{},"以":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}},"<":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646}}}},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},".":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"c":{"docs":{},"u":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"d":{"docs":{},"o":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}}}}}},"如":{"docs":{},"何":{"docs":{},"p":{"docs":{},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}},"单":{"docs":{},"例":{"docs":{},"来":{"docs":{},"存":{"docs":{},"储":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"压":{"docs":{},"了":{"docs":{},"三":{"docs":{},"个":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"进":{"docs":{},"栈":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"也":{"docs":{},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"单":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"包":{"docs":{},"含":{"docs":{},"三":{"docs":{},"个":{"docs":{},"同":{"docs":{},"栈":{"docs":{},"里":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"。":{"docs":{},"即":{"docs":{},"便":{"docs":{},"栈":{"docs":{},"和":{"docs":{},"数":{"docs":{},"组":{"docs":{},"否":{"docs":{},"是":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"但":{"docs":{},"它":{"docs":{},"们":{"docs":{},"都":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"它":{"docs":{},"们":{"docs":{},"都":{"docs":{},"包":{"docs":{},"含":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"值":{"docs":{},"。":{"docs":{},"你":{"docs":{},"因":{"docs":{},"此":{"docs":{},"可":{"docs":{},"以":{"docs":{},"调":{"docs":{},"用":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"用":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"作":{"docs":{},"为":{"docs":{},"它":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"函":{"docs":{},"数":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},"显":{"docs":{},"示":{"docs":{},"了":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"同":{"docs":{},"创":{"docs":{},"建":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},"基":{"docs":{},"本":{"docs":{},"上":{"docs":{},"和":{"docs":{},"非":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},"相":{"docs":{},"同":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"版":{"docs":{},"本":{"docs":{},"的":{"docs":{},"占":{"docs":{},"位":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"为":{"docs":{},"t":{"docs":{},"代":{"docs":{},"替":{"docs":{},"了":{"docs":{},"实":{"docs":{},"际":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"包":{"docs":{},"含":{"docs":{},"在":{"docs":{},"一":{"docs":{},"对":{"docs":{},"尖":{"docs":{},"括":{"docs":{},"号":{"docs":{},"里":{"docs":{},"(":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"的":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"保":{"docs":{},"证":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"可":{"docs":{},"以":{"docs":{},"推":{"docs":{},"断":{"docs":{},"出":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"所":{"docs":{},"使":{"docs":{},"用":{"docs":{},"的":{"docs":{},"适":{"docs":{},"用":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"这":{"docs":{},"个":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"后":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"将":{"docs":{},"任":{"docs":{},"何":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"当":{"docs":{},"作":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"栈":{"docs":{},")":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"栈":{"docs":{},"是":{"docs":{},"一":{"docs":{},"系":{"docs":{},"列":{"docs":{},"值":{"docs":{},"域":{"docs":{},"的":{"docs":{},"集":{"docs":{},"合":{"docs":{},",":{"docs":{},"和":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"1":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.007434944237918215}}},"2":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}},"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.02724177071509648},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.010948905109489052},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.02831858407079646},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":2.0390334572490705},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.013015184381778741},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.04790419161676647},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.05818181818181818},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.02389705882352941},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.01904761904761905},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.05333333333333334},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.028077753779697623},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.019253910950661854},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.010830324909747292},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.009708737864077669},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.00881057268722467},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.01327433628318584},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.012618296529968454},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714}},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}},")":{"docs":{},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}}},"x":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}},"”":{"docs":{},"的":{"docs":{},"意":{"docs":{},"思":{"docs":{},"是":{"docs":{},"“":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"任":{"docs":{},"意":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"值":{"docs":{},"存":{"docs":{},"在":{"docs":{},",":{"docs":{},"则":{"docs":{},"这":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"值":{"docs":{},"等":{"docs":{},"于":{"docs":{},"被":{"docs":{},"替":{"docs":{},"换":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"否":{"docs":{},"则":{"docs":{},"将":{"docs":{},"会":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"解":{"docs":{},"析":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"t":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"作":{"docs":{},"用":{"docs":{},"是":{"docs":{},"将":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"并":{"docs":{},"不":{"docs":{},"是":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"数":{"docs":{},"。":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"1":{"2":{"3":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"数":{"docs":{},"字":{"1":{"2":{"3":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"除":{"docs":{},"此":{"docs":{},"之":{"docs":{},"外":{"docs":{},",":{"docs":{},"还":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"本":{"docs":{},"章":{"docs":{},"介":{"docs":{},"绍":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"特":{"docs":{},"性":{"docs":{},"。":{"docs":{},"您":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"任":{"docs":{},"意":{"docs":{},"要":{"docs":{},"求":{"docs":{},"传":{"docs":{},"入":{"docs":{},"n":{"docs":{},"s":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"空":{"docs":{},"字":{"docs":{},"典":{"docs":{},"来":{"docs":{},"储":{"docs":{},"存":{"docs":{},"英":{"docs":{},"语":{"docs":{},"对":{"docs":{},"整":{"docs":{},"数":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"。":{"docs":{},"它":{"docs":{},"的":{"docs":{},"键":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"型":{"docs":{},",":{"docs":{},"值":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"键":{"docs":{},"值":{"docs":{},"对":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"对":{"docs":{},"应":{"docs":{},"a":{"docs":{},"i":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"变":{"docs":{},"量":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"一":{"docs":{},"个":{"docs":{},"只":{"docs":{},"有":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"键":{"docs":{},"和":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"的":{"docs":{},"字":{"docs":{},"典":{"docs":{},")":{"docs":{},"所":{"docs":{},"以":{"docs":{},"这":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"是":{"docs":{},"构":{"docs":{},"造":{"docs":{},"两":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"数":{"docs":{},"据":{"docs":{},"项":{"docs":{},"的":{"docs":{},"a":{"docs":{},"i":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"变":{"docs":{},"量":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"并":{"docs":{},"且":{"docs":{},"给":{"docs":{},"它":{"docs":{},"设":{"docs":{},"置":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"。":{"docs":{},"函":{"docs":{},"数":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"逻":{"docs":{},"辑":{"docs":{},"来":{"docs":{},"判":{"docs":{},"断":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"当":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"属":{"docs":{},"于":{"docs":{},"列":{"docs":{},"表":{"docs":{},"中":{"docs":{},"的":{"docs":{},"质":{"docs":{},"数":{"docs":{},"之":{"docs":{},"一":{"docs":{},"时":{"docs":{},",":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"段":{"docs":{},"文":{"docs":{},"字":{"docs":{},"在":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"后":{"docs":{},",":{"docs":{},"来":{"docs":{},"表":{"docs":{},"明":{"docs":{},"这":{"docs":{},"个":{"docs":{},"是":{"docs":{},"数":{"docs":{},"字":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"质":{"docs":{},"数":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},"它":{"docs":{},"使":{"docs":{},"用":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"来":{"docs":{},"“":{"docs":{},"贯":{"docs":{},"穿":{"docs":{},"”":{"docs":{},"到":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"分":{"docs":{},"支":{"docs":{},"中":{"docs":{},"。":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"分":{"docs":{},"支":{"docs":{},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"段":{"docs":{},"额":{"docs":{},"外":{"docs":{},"的":{"docs":{},"文":{"docs":{},"字":{"docs":{},"在":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"最":{"docs":{},"后":{"docs":{},",":{"docs":{},"至":{"docs":{},"此":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"互":{"docs":{},"相":{"docs":{},"交":{"docs":{},"换":{"docs":{},"值":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"一":{"docs":{},"定":{"docs":{},"要":{"docs":{},"做":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"参":{"docs":{},"数":{"docs":{},"并":{"docs":{},"返":{"docs":{},"回":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}},"数":{"docs":{},"组":{"docs":{},"进":{"docs":{},"行":{"docs":{},"排":{"docs":{},"序":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"排":{"docs":{},"序":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"需":{"docs":{},"为":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}},"表":{"docs":{},"示":{"docs":{},"特":{"docs":{},"定":{"docs":{},"序":{"docs":{},"列":{"docs":{},"的":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"可":{"docs":{},"以":{"docs":{},"理":{"docs":{},"解":{"docs":{},"为":{"docs":{},"“":{"docs":{},"一":{"docs":{},"个":{"docs":{},"没":{"docs":{},"有":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"名":{"docs":{},"字":{"docs":{},"为":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"安":{"docs":{},"全":{"docs":{},"会":{"docs":{},"阻":{"docs":{},"止":{"docs":{},"你":{"docs":{},"不":{"docs":{},"小":{"docs":{},"心":{"docs":{},"传":{"docs":{},"入":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"和":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},")":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},"的":{"docs":{},",":{"docs":{},"请":{"docs":{},"使":{"docs":{},"用":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"这":{"docs":{},"种":{"docs":{},"方":{"docs":{},"式":{"docs":{},"为":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"方":{"docs":{},"法":{"docs":{},"命":{"docs":{},"名":{"docs":{},"(":{"docs":{},"如":{"docs":{},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"和":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"l":{"docs":{},"u":{"docs":{},"s":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}},"s":{"docs":{},")":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2857142857142857}}}}}}}}}}}}}},"t":{"docs":{},"f":{"docs":{},"-":{"8":{"docs":{},"u":{"docs":{},"t":{"docs":{},"f":{"docs":{},"-":{"1":{"6":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2857142857142857}}}}}}}}},"docs":{}},"docs":{}}}}}},"docs":{}}}}}}},"是":{"docs":{},"例":{"docs":{},"如":{"docs":{},"“":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}},"访":{"docs":{},"问":{"docs":{},"时":{"docs":{},"会":{"docs":{},"成":{"docs":{},"为":{"docs":{},"u":{"docs":{},"t":{"docs":{},"f":{"1":{"6":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}},"docs":{}},"docs":{}}}}}}}}}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"它":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"这":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"键":{"docs":{},"和":{"docs":{},"值":{"docs":{},"都":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"a":{"docs":{},"i":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}},"[":{"docs":{},"]":{"docs":{},"是":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}},"一":{"docs":{},"种":{"docs":{},"数":{"docs":{},"据":{"docs":{},"结":{"docs":{},"构":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"只":{"docs":{},"有":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}},"值":{"docs":{},"。":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"了":{"docs":{},"该":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"声":{"docs":{},"明":{"docs":{},"(":{"docs":{},"只":{"docs":{},"能":{"docs":{},"包":{"docs":{},"含":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},")":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"这":{"docs":{},"个":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"的":{"docs":{},"分":{"docs":{},"配":{"docs":{},"过":{"docs":{},"程":{"docs":{},"就":{"docs":{},"是":{"docs":{},"允":{"docs":{},"许":{"docs":{},"用":{"docs":{},"两":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"项":{"docs":{},"来":{"docs":{},"构":{"docs":{},"造":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"过":{"docs":{},"程":{"docs":{},"满":{"docs":{},"足":{"docs":{},"两":{"docs":{},"段":{"docs":{},"式":{"docs":{},"构":{"docs":{},"造":{"docs":{},"过":{"docs":{},"程":{"docs":{},"中":{"docs":{},"的":{"docs":{},"安":{"docs":{},"全":{"docs":{},"检":{"docs":{},"查":{"1":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}},"docs":{}}}}}}}}}}}}}}}}}}}}},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"跟":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"中":{"docs":{},"指":{"docs":{},"定":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}},"并":{"docs":{},"给":{"docs":{},"参":{"docs":{},"数":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"传":{"docs":{},"值":{"docs":{},"[":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"调":{"docs":{},"用":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"是":{"docs":{},"便":{"docs":{},"利":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},",":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"依":{"docs":{},"然":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"对":{"docs":{},"所":{"docs":{},"有":{"docs":{},"父":{"docs":{},"类":{"docs":{},"指":{"docs":{},"定":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"定":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"能":{"docs":{},"确":{"docs":{},"保":{"docs":{},"所":{"docs":{},"有":{"docs":{},"新":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"中":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"都":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"。":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"类":{"docs":{},"没":{"docs":{},"有":{"docs":{},"父":{"docs":{},"类":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"只":{"docs":{},"通":{"docs":{},"过":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"便":{"docs":{},"利":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"假":{"docs":{},"设":{"docs":{},"任":{"docs":{},"意":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},"为":{"1":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"显":{"docs":{},"示":{"docs":{},"指":{"docs":{},"明":{"docs":{},"数":{"docs":{},"量":{"docs":{},"即":{"docs":{},"可":{"docs":{},"创":{"docs":{},"建":{"docs":{},"出":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"便":{"docs":{},"利":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"可":{"docs":{},"以":{"docs":{},"让":{"docs":{},"创":{"docs":{},"建":{"docs":{},"实":{"docs":{},"例":{"docs":{},"更":{"docs":{},"加":{"docs":{},"方":{"docs":{},"便":{"docs":{},"和":{"docs":{},"快":{"docs":{},"捷":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"避":{"docs":{},"免":{"docs":{},"了":{"docs":{},"使":{"docs":{},"用":{"docs":{},"重":{"docs":{},"复":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"多":{"docs":{},"个":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"当":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"y":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"实":{"docs":{},"例":{"docs":{},"化":{"docs":{},"时":{"docs":{},",":{"docs":{},"它":{"docs":{},"将":{"docs":{},"自":{"docs":{},"动":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"空":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"?":{"docs":{},"。":{"docs":{},"如":{"docs":{},"上":{"docs":{},"所":{"docs":{},"述":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"在":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"调":{"docs":{},"用":{"docs":{},"后":{"docs":{},"最":{"docs":{},"终":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"依":{"docs":{},"然":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}}}},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.019650655021834062},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.016544117647058824},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.007220216606498195},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"u":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":2.505128205128205},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.007142857142857143},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.01904761904761905}},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"?":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"在":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"前":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"两":{"docs":{},"层":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},",":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"?":{"docs":{},".":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"也":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471}},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.007272727272727273}},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}},"。":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061}},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353}}}}}}}}}}}},"类":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"s":{"docs":{},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"包":{"docs":{},"含":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.01282051282051282},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}}}}}}}},"y":{"docs":{},"l":{"docs":{},"e":{"docs":{},")":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}}}}},"枚":{"docs":{},"举":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.007142857142857143},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.01002004008016032}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}},"r":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}}}},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}},"k":{"docs":{},"a":{"docs":{},"m":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.010948905109489052},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}},")":{"docs":{},",":{"docs":{},"以":{"docs":{},"此":{"docs":{},"确":{"docs":{},"保":{"docs":{},"在":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"试":{"docs":{},"图":{"docs":{},"修":{"docs":{},"改":{"docs":{},"那":{"docs":{},"些":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"前":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0072992700729927005}}}}}}}}}},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"来":{"docs":{},"访":{"docs":{},"问":{"docs":{},"超":{"docs":{},"类":{"docs":{},"版":{"docs":{},"本":{"docs":{},"的":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"正":{"docs":{},"如":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0072992700729927005}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"[":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},"e":{"docs":{},"最":{"docs":{},"接":{"docs":{},"近":{"docs":{},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}},"c":{"docs":{},"c":{"docs":{},"e":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}},"i":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0625}},".":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"r":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"对":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"和":{"docs":{},"c":{"docs":{},"l":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"返":{"docs":{},"回":{"docs":{},"“":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"”":{"docs":{},",":{"docs":{},"对":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"返":{"docs":{},"回":{"docs":{},"“":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"描":{"docs":{},"述":{"docs":{},"扑":{"docs":{},"克":{"docs":{},"牌":{"docs":{},"的":{"docs":{},"四":{"docs":{},"种":{"docs":{},"花":{"docs":{},"色":{"docs":{},",":{"docs":{},"并":{"docs":{},"分":{"docs":{},"别":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}},"o":{"docs":{},"f":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"(":{"4":{"2":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"docs":{}},"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.010948905109489052},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},")":{"docs":{},"变":{"docs":{},"成":{"docs":{},"父":{"docs":{},"类":{"docs":{},"(":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"超":{"docs":{},"类":{"docs":{},"(":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":10.005405405405405},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.006607929515418502},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.008571428571428572},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"s":{"docs":{},")":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"可":{"docs":{},"以":{"docs":{},"重":{"docs":{},"写":{"docs":{},"(":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},")":{"docs":{},"这":{"docs":{},"些":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"来":{"docs":{},"优":{"docs":{},"化":{"docs":{},"或":{"docs":{},"修":{"docs":{},"改":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"行":{"docs":{},"为":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"去":{"docs":{},"替":{"docs":{},"换":{"docs":{},"这":{"docs":{},"一":{"docs":{},"范":{"docs":{},"围":{"docs":{},"内":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"。":{"docs":{},"只":{"docs":{},"有":{"docs":{},"当":{"docs":{},"数":{"docs":{},"组":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"确":{"docs":{},"要":{"docs":{},"发":{"docs":{},"生":{"docs":{},"时":{"docs":{},",":{"docs":{},"数":{"docs":{},"组":{"docs":{},"内":{"docs":{},"容":{"docs":{},"的":{"docs":{},"行":{"docs":{},"为":{"docs":{},"规":{"docs":{},"则":{"docs":{},"与":{"docs":{},"字":{"docs":{},"典":{"docs":{},"中":{"docs":{},"键":{"docs":{},"值":{"docs":{},"的":{"docs":{},"相":{"docs":{},"同":{"docs":{},",":{"docs":{},"参":{"docs":{},"见":{"docs":{},"章":{"docs":{},"节":{"docs":{},"[":{"docs":{},"集":{"docs":{},"合":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"与":{"docs":{},"复":{"docs":{},"制":{"docs":{},"行":{"docs":{},"为":{"docs":{},"]":{"docs":{},"(":{"docs":{},"#":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"_":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"y":{"docs":{},"_":{"docs":{},"b":{"docs":{},"e":{"docs":{},"h":{"docs":{},"a":{"docs":{},"v":{"docs":{},"i":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646}},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.016216216216216217}}}}}}},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}},"d":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},",":{"docs":{},"显":{"docs":{},"式":{"docs":{},"声":{"docs":{},"明":{"docs":{},"入":{"docs":{},"参":{"docs":{},"(":{"docs":{},"一":{"docs":{},"个":{"docs":{},"或":{"docs":{},"多":{"docs":{},"个":{"docs":{},")":{"docs":{},"和":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"与":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"是":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"可":{"docs":{},"以":{"docs":{},"设":{"docs":{},"定":{"docs":{},"为":{"docs":{},"读":{"docs":{},"写":{"docs":{},"或":{"docs":{},"只":{"docs":{},"读":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"方":{"docs":{},"式":{"docs":{},"又":{"docs":{},"有":{"docs":{},"点":{"docs":{},"像":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.007692307692307693}}}}}}},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"y":{"docs":{},"a":{"docs":{},"n":{"docs":{},"s":{"docs":{},"w":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}}}},"示":{"docs":{},"例":{"docs":{},",":{"docs":{},"用":{"docs":{},"常":{"docs":{},"量":{"docs":{},"属":{"docs":{},"性":{"docs":{},"替":{"docs":{},"代":{"docs":{},"变":{"docs":{},"量":{"docs":{},"属":{"docs":{},"性":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},",":{"docs":{},"指":{"docs":{},"明":{"docs":{},"问":{"docs":{},"题":{"docs":{},"内":{"docs":{},"容":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"在":{"docs":{},"其":{"docs":{},"创":{"docs":{},"建":{"docs":{},"之":{"docs":{},"后":{"docs":{},"不":{"docs":{},"会":{"docs":{},"再":{"docs":{},"被":{"docs":{},"修":{"docs":{},"改":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"属":{"docs":{},"性":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.28757302177376526}}}}}},"e":{"docs":{},"d":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":3.3749999999999996},"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":10.363636363636363},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":10.005675368898979},"chapter1/chapter1.html#gitbook_742":{"ref":"chapter1/chapter1.html#gitbook_742","tf":10.75},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.01824817518248175},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.06548672566371681},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.026022304832713755},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.04772234273318872},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.012369172216936251},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.03592814371257485},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.01090909090909091},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.019867549668874173},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.035897435897435895},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.017811704834605598},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0413625304136253},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.02022058823529412},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.012903225806451613},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.009523809523809525},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.009523809523809525},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.02888086642599278},"chapter2/chapter2.html#gitbook_786":{"ref":"chapter2/chapter2.html#gitbook_786","tf":10.666666666666666},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.011627906976744186},"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.07142857142857142},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.019417475728155338},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.015772870662460567},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.023728813559322035}},"可":{"docs":{},"以":{"docs":{},"推":{"docs":{},"断":{"docs":{},"出":{"docs":{},"这":{"docs":{},"个":{"docs":{},"常":{"docs":{},"量":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"考":{"docs":{},"类":{"docs":{},"型":{"docs":{},"安":{"docs":{},"全":{"docs":{},"和":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"没":{"docs":{},"有":{"docs":{},"给":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"赋":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"变":{"docs":{},"量":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"内":{"docs":{},"建":{"docs":{},"类":{"docs":{},"型":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"下":{"docs":{},"标":{"docs":{},"。":{"docs":{},"该":{"docs":{},"下":{"docs":{},"标":{"docs":{},"[":{"docs":{},"n":{"docs":{},"]":{"docs":{},"返":{"docs":{},"回":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"数":{"docs":{},"字":{"docs":{},"从":{"docs":{},"右":{"docs":{},"向":{"docs":{},"左":{"docs":{},"数":{"docs":{},"的":{"docs":{},"第":{"docs":{},"n":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"名":{"docs":{},"为":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"已":{"docs":{},"经":{"docs":{},"提":{"docs":{},"供":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"通":{"docs":{},"过":{"docs":{},"下":{"docs":{},"标":{"docs":{},"来":{"docs":{},"查":{"docs":{},"找":{"docs":{},"一":{"docs":{},"个":{"docs":{},"自":{"docs":{},"己":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"。":{"docs":{},"这":{"docs":{},"三":{"docs":{},"个":{"docs":{},"功":{"docs":{},"能":{"docs":{},"都":{"docs":{},"达":{"docs":{},"到":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"要":{"docs":{},"求":{"docs":{},"。":{"docs":{},"也":{"docs":{},"就":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"扩":{"docs":{},"展":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"去":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"只":{"docs":{},"要":{"docs":{},"通":{"docs":{},"过":{"docs":{},"简":{"docs":{},"单":{"docs":{},"声":{"docs":{},"明":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"较":{"docs":{},"c":{"docs":{},"语":{"docs":{},"言":{"docs":{},"和":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"来":{"docs":{},"得":{"docs":{},"更":{"docs":{},"简":{"docs":{},"单":{"docs":{},"和":{"docs":{},"保":{"docs":{},"守":{"docs":{},",":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"跟":{"docs":{},"基":{"docs":{},"于":{"docs":{},"c":{"docs":{},"的":{"docs":{},"语":{"docs":{},"言":{"docs":{},"可":{"docs":{},"能":{"docs":{},"不":{"docs":{},"一":{"docs":{},"样":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},",":{"docs":{},"在":{"docs":{},"移":{"docs":{},"植":{"docs":{},"已":{"docs":{},"有":{"docs":{},"代":{"docs":{},"码":{"docs":{},"到":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"考":{"docs":{},",":{"docs":{},"你":{"docs":{},"不":{"docs":{},"用":{"docs":{},"在":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"定":{"docs":{},"义":{"docs":{},"部":{"docs":{},"分":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"具":{"docs":{},"体":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"。":{"docs":{},"由":{"docs":{},"于":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"要":{"docs":{},"求":{"docs":{},",":{"docs":{},"只":{"docs":{},"要":{"docs":{},"通":{"docs":{},"过":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"查":{"docs":{},"找":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"参":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"推":{"docs":{},"断":{"docs":{},"出":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"并":{"docs":{},"不":{"docs":{},"存":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"。":{"docs":{},"此":{"docs":{},"处":{"docs":{},"为":{"docs":{},"了":{"docs":{},"演":{"docs":{},"示":{"docs":{},",":{"docs":{},"我":{"docs":{},"们":{"docs":{},"让":{"docs":{},"+":{"docs":{},"+":{"docs":{},"+":{"docs":{},"对":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"2":{"docs":{},"d":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"支":{"docs":{},"持":{"docs":{},"如":{"docs":{},"下":{"docs":{},"所":{"docs":{},"有":{"docs":{},"c":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}},"还":{"docs":{},"有":{"docs":{},"许":{"docs":{},"多":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"的":{"docs":{},"高":{"docs":{},"级":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"了":{"docs":{},"c":{"docs":{},"语":{"docs":{},"和":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},"有":{"docs":{},"两":{"docs":{},"类":{"docs":{},"特":{"docs":{},"性":{"docs":{},",":{"docs":{},"用":{"docs":{},"于":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"以":{"docs":{},"及":{"docs":{},"用":{"docs":{},"于":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"特":{"docs":{},"性":{"docs":{},",":{"docs":{},"当":{"docs":{},"应":{"docs":{},"用":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"的":{"docs":{},"指":{"docs":{},"定":{"docs":{},"或":{"docs":{},"便":{"docs":{},"利":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"声":{"docs":{},"明":{"docs":{},"时":{"docs":{},",":{"docs":{},"表":{"docs":{},"明":{"docs":{},"它":{"docs":{},"的":{"docs":{},"每":{"docs":{},"个":{"docs":{},"子":{"docs":{},"类":{"docs":{},"都":{"docs":{},"必":{"docs":{},"须":{"docs":{},"实":{"docs":{},"现":{"docs":{},"那":{"docs":{},"个":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"。":{"docs":{},"再":{"docs":{},"比":{"docs":{},"如":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"信":{"docs":{},"息":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"反":{"docs":{},"方":{"docs":{},"向":{"docs":{},"流":{"docs":{},"动":{"docs":{},"—":{"docs":{},"—":{"docs":{},"从":{"docs":{},"根":{"docs":{},"节":{"docs":{},"点":{"docs":{},"传":{"docs":{},"向":{"docs":{},"叶":{"docs":{},"子":{"docs":{},"节":{"docs":{},"点":{"docs":{},"。":{"docs":{},"在":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"常":{"docs":{},"量":{"docs":{},"e":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"上":{"docs":{},"的":{"docs":{},"显":{"docs":{},"式":{"docs":{},"类":{"docs":{},"型":{"docs":{},"注":{"docs":{},"解":{"docs":{},"(":{"docs":{},":":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},")":{"docs":{},"导":{"docs":{},"致":{"docs":{},"数":{"docs":{},"字":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"2":{"docs":{},".":{"7":{"1":{"8":{"2":{"8":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"而":{"docs":{},"非":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"模":{"docs":{},"式":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"变":{"docs":{},"量":{"docs":{},"和":{"docs":{},"常":{"docs":{},"量":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},"(":{"docs":{},"在":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"左":{"docs":{},"侧":{"docs":{},")":{"docs":{},",":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"语":{"docs":{},"句":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"(":{"docs":{},"在":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"标":{"docs":{},"签":{"docs":{},")":{"docs":{},"中":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"任":{"docs":{},"何":{"docs":{},"模":{"docs":{},"式":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"标":{"docs":{},"签":{"docs":{},"中":{"docs":{},",":{"docs":{},"但":{"docs":{},"在":{"docs":{},"其":{"docs":{},"他":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"通":{"docs":{},"配":{"docs":{},"符":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"言":{"docs":{},"相":{"docs":{},"对":{"docs":{},"小":{"docs":{},"点":{"docs":{},",":{"docs":{},"这":{"docs":{},"是":{"docs":{},"由":{"docs":{},"于":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"代":{"docs":{},"码":{"docs":{},"中":{"docs":{},"几":{"docs":{},"乎":{"docs":{},"无":{"docs":{},"处":{"docs":{},"不":{"docs":{},"在":{"docs":{},"的":{"docs":{},"许":{"docs":{},"多":{"docs":{},"常":{"docs":{},"见":{"docs":{},"的":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"以":{"docs":{},"及":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"都":{"docs":{},"由":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"来":{"docs":{},"定":{"docs":{},"义":{"docs":{},"。":{"docs":{},"虽":{"docs":{},"然":{"docs":{},"这":{"docs":{},"些":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"和":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"不":{"docs":{},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.03571428571428571}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"使":{"docs":{},"用":{"docs":{},"类":{"docs":{},"型":{"docs":{},"名":{"docs":{},"紧":{"docs":{},"接":{"docs":{},"中":{"docs":{},"括":{"docs":{},"号":{"docs":{},"[":{"docs":{},"]":{"docs":{},"来":{"docs":{},"简":{"docs":{},"化":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"!":{"docs":{},"作":{"docs":{},"为":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"命":{"docs":{},"名":{"docs":{},"类":{"docs":{},"型":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{},"l":{"docs":{},"y":{"docs":{},"u":{"docs":{},"n":{"docs":{},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"d":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"?":{"docs":{},"来":{"docs":{},"作":{"docs":{},"为":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"广":{"docs":{},"泛":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},",":{"docs":{},"从":{"docs":{},"而":{"docs":{},"允":{"docs":{},"许":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"很":{"docs":{},"多":{"docs":{},"变":{"docs":{},"量":{"docs":{},"和":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"或":{"docs":{},"部":{"docs":{},"分":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"细":{"docs":{},"节":{"docs":{},"讨":{"docs":{},"论":{"docs":{},",":{"docs":{},"见":{"docs":{},"章":{"docs":{},"节":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"~":{"docs":{},"=":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"与":{"docs":{},"输":{"docs":{},"入":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"值":{"docs":{},"进":{"docs":{},"行":{"docs":{},"比":{"docs":{},"较":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"~":{"docs":{},"=":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"返":{"docs":{},"回":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"则":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"成":{"docs":{},"功":{"docs":{},"。":{"docs":{},"默":{"docs":{},"认":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"~":{"docs":{},"=":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"使":{"docs":{},"用":{"docs":{},"=":{"docs":{},"=":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"来":{"docs":{},"比":{"docs":{},"较":{"docs":{},"两":{"docs":{},"个":{"docs":{},"相":{"docs":{},"同":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"它":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"数":{"docs":{},"值":{"docs":{},"与":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.02759276879162702},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.03642384105960265},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.01327433628318584},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.01002004008016032},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":2.273069679849341}},"中":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"的":{"docs":{},"子":{"docs":{},"句":{"docs":{},"之":{"docs":{},"后":{"docs":{},",":{"docs":{},"程":{"docs":{},"序":{"docs":{},"会":{"docs":{},"退":{"docs":{},"出":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"并":{"docs":{},"不":{"docs":{},"会":{"docs":{},"继":{"docs":{},"续":{"docs":{},"向":{"docs":{},"下":{"docs":{},"运":{"docs":{},"行":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"每":{"docs":{},"个":{"docs":{},"子":{"docs":{},"句":{"docs":{},"结":{"docs":{},"尾":{"docs":{},"写":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"时":{"docs":{},",":{"docs":{},"会":{"docs":{},"立":{"docs":{},"即":{"docs":{},"中":{"docs":{},"断":{"docs":{},"该":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"的":{"docs":{},"执":{"docs":{},"行":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"跳":{"docs":{},"转":{"docs":{},"到":{"docs":{},"表":{"docs":{},"示":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"嵌":{"docs":{},"套":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"来":{"docs":{},"创":{"docs":{},"造":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"的":{"docs":{},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"结":{"docs":{},"构":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},"两":{"docs":{},"者":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"来":{"docs":{},"提":{"docs":{},"前":{"docs":{},"结":{"docs":{},"束":{"docs":{},"整":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"体":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"显":{"docs":{},"示":{"docs":{},"地":{"docs":{},"指":{"docs":{},"明":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"想":{"docs":{},"要":{"docs":{},"终":{"docs":{},"止":{"docs":{},"的":{"docs":{},"是":{"docs":{},"哪":{"docs":{},"个":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},"或":{"docs":{},"者":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},",":{"docs":{},"会":{"docs":{},"很":{"docs":{},"有":{"docs":{},"用":{"docs":{},"。":{"docs":{},"类":{"docs":{},"似":{"docs":{},"地":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"有":{"docs":{},"许":{"docs":{},"多":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"的":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},",":{"docs":{},"显":{"docs":{},"示":{"docs":{},"指":{"docs":{},"明":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"完":{"docs":{},"成":{"docs":{},"了":{"docs":{},"它":{"docs":{},"的":{"docs":{},"执":{"docs":{},"行":{"docs":{},"。":{"docs":{},"相":{"docs":{},"比":{"docs":{},"之":{"docs":{},"下":{"docs":{},",":{"docs":{},"c":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}},"执":{"docs":{},"行":{"docs":{},"完":{"docs":{},"后":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"n":{"docs":{},"函":{"docs":{},"数":{"docs":{},"打":{"docs":{},"印":{"docs":{},"该":{"docs":{},"数":{"docs":{},"字":{"docs":{},"的":{"docs":{},"描":{"docs":{},"述":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"数":{"docs":{},"字":{"5":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"接":{"docs":{},"下":{"docs":{},"来":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"通":{"docs":{},"过":{"docs":{},"使":{"docs":{},"用":{"docs":{},"可":{"docs":{},"选":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"来":{"docs":{},"判":{"docs":{},"断":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"是":{"docs":{},"否":{"docs":{},"曾":{"docs":{},"经":{"docs":{},"被":{"docs":{},"设":{"docs":{},"置":{"docs":{},"过":{"docs":{},"值":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"缘":{"docs":{},"故":{"docs":{},",":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"当":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"曾":{"docs":{},"被":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"当":{"docs":{},"使":{"docs":{},"用":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"或":{"docs":{},"者":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}},"分":{"docs":{},"支":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"包":{"docs":{},"含":{"docs":{},"注":{"docs":{},"释":{"docs":{},"时":{"docs":{},",":{"docs":{},"会":{"docs":{},"被":{"docs":{},"报":{"docs":{},"编":{"docs":{},"译":{"docs":{},"时":{"docs":{},"错":{"docs":{},"误":{"docs":{},"。":{"docs":{},"注":{"docs":{},"释":{"docs":{},"不":{"docs":{},"是":{"docs":{},"代":{"docs":{},"码":{"docs":{},"语":{"docs":{},"句":{"docs":{},"而":{"docs":{},"且":{"docs":{},"也":{"docs":{},"不":{"docs":{},"能":{"docs":{},"让":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"分":{"docs":{},"支":{"docs":{},"达":{"docs":{},"到":{"docs":{},"被":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"的":{"docs":{},"效":{"docs":{},"果":{"docs":{},"。":{"docs":{},"你":{"docs":{},"总":{"docs":{},"是":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"判":{"docs":{},"断":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"不":{"docs":{},"会":{"docs":{},"同":{"docs":{},"时":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"a":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"和":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"a":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},"的":{"docs":{},",":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"会":{"docs":{},"引":{"docs":{},"起":{"docs":{},"编":{"docs":{},"译":{"docs":{},"期":{"docs":{},"错":{"docs":{},"误":{"docs":{},":":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},"测":{"docs":{},"试":{"docs":{},"多":{"docs":{},"个":{"docs":{},"值":{"docs":{},"。":{"docs":{},"元":{"docs":{},"组":{"docs":{},"中":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"值":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"区":{"docs":{},"间":{"docs":{},"。":{"docs":{},"另":{"docs":{},"外":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"下":{"docs":{},"划":{"docs":{},"线":{"docs":{},"(":{"docs":{},"_":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894}}}}},"控":{"docs":{},"制":{"docs":{},"流":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"修":{"docs":{},"改":{"docs":{},",":{"docs":{},"详":{"docs":{},"情":{"docs":{},"请":{"docs":{},"见":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}},"使":{"docs":{},"用":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}},"会":{"docs":{},"判":{"docs":{},"断":{"docs":{},"某":{"docs":{},"个":{"docs":{},"点":{"docs":{},"是":{"docs":{},"否":{"docs":{},"在":{"docs":{},"红":{"docs":{},"色":{"docs":{},"的":{"docs":{},"x":{"docs":{},"轴":{"docs":{},"上":{"docs":{},",":{"docs":{},"是":{"docs":{},"否":{"docs":{},"在":{"docs":{},"黄":{"docs":{},"色":{"docs":{},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}},"绿":{"docs":{},"色":{"docs":{},"的":{"docs":{},"对":{"docs":{},"角":{"docs":{},"线":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}},"是":{"docs":{},"原":{"docs":{},"点":{"docs":{},"(":{"0":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}},"docs":{}}}}}}}}}}}},"尝":{"docs":{},"试":{"docs":{},"把":{"docs":{},"某":{"docs":{},"个":{"docs":{},"值":{"docs":{},"与":{"docs":{},"若":{"docs":{},"干":{"docs":{},"个":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},")":{"docs":{},"进":{"docs":{},"行":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"。":{"docs":{},"根":{"docs":{},"据":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"成":{"docs":{},"功":{"docs":{},"的":{"docs":{},"模":{"docs":{},"式":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"会":{"docs":{},"执":{"docs":{},"行":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"。":{"docs":{},"当":{"docs":{},"有":{"docs":{},"可":{"docs":{},"能":{"docs":{},"的":{"docs":{},"情":{"docs":{},"况":{"docs":{},"较":{"docs":{},"多":{"docs":{},"时":{"docs":{},",":{"docs":{},"通":{"docs":{},"常":{"docs":{},"用":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"替":{"docs":{},"换":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}},"i":{"docs":{},"s":{"docs":{},"模":{"docs":{},"式":{"docs":{},"和":{"docs":{},"a":{"docs":{},"s":{"docs":{},"模":{"docs":{},"式":{"docs":{},"值":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"阅":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}},"包":{"docs":{},"含":{"docs":{},"关":{"docs":{},"联":{"docs":{},"值":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"用":{"docs":{},"例":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"阅":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"o":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}},"检":{"docs":{},"验":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"事":{"docs":{},"件":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"正":{"docs":{},"如":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"值":{"docs":{},"(":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"强":{"docs":{},"制":{"docs":{},"形":{"docs":{},"式":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"转":{"docs":{},"换":{"docs":{},"操":{"docs":{},"作":{"docs":{},"符":{"docs":{},"(":{"docs":{},"a":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}},"控":{"docs":{},"制":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.006779661016949152}}}}}}}}}}}}}}}},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"包":{"docs":{},"含":{"docs":{},"默":{"docs":{},"认":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"a":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}},"前":{"docs":{},"面":{"docs":{},"加":{"docs":{},"上":{"docs":{},"标":{"docs":{},"签":{"docs":{},",":{"docs":{},"它":{"docs":{},"由":{"docs":{},"标":{"docs":{},"签":{"docs":{},"名":{"docs":{},"和":{"docs":{},"紧":{"docs":{},"随":{"docs":{},"其":{"docs":{},"后":{"docs":{},"的":{"docs":{},"冒":{"docs":{},"号":{"docs":{},"(":{"docs":{},":":{"docs":{},")":{"docs":{},"组":{"docs":{},"成":{"docs":{},"。":{"docs":{},"在":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"e":{"docs":{},"后":{"docs":{},"面":{"docs":{},"跟":{"docs":{},"上":{"docs":{},"标":{"docs":{},"签":{"docs":{},"名":{"docs":{},"可":{"docs":{},"以":{"docs":{},"显":{"docs":{},"式":{"docs":{},"地":{"docs":{},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"语":{"docs":{},"句":{"docs":{},"或":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"只":{"docs":{},"能":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"默":{"docs":{},"认":{"docs":{},"分":{"docs":{},"支":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"必":{"docs":{},"须":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}},"需":{"docs":{},"要":{"docs":{},"包":{"docs":{},"含":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"分":{"docs":{},"支":{"docs":{},"而":{"docs":{},"且":{"docs":{},"不":{"docs":{},"允":{"docs":{},"许":{"docs":{},"有":{"docs":{},"为":{"docs":{},"空":{"docs":{},"的":{"docs":{},"分":{"docs":{},"支":{"docs":{},",":{"docs":{},"有":{"docs":{},"时":{"docs":{},"为":{"docs":{},"了":{"docs":{},"使":{"docs":{},"你":{"docs":{},"的":{"docs":{},"意":{"docs":{},"图":{"docs":{},"更":{"docs":{},"明":{"docs":{},"显":{"docs":{},",":{"docs":{},"需":{"docs":{},"要":{"docs":{},"特":{"docs":{},"意":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"或":{"docs":{},"者":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"某":{"docs":{},"个":{"docs":{},"分":{"docs":{},"支":{"docs":{},"。":{"docs":{},"那":{"docs":{},"么":{"docs":{},"当":{"docs":{},"你":{"docs":{},"想":{"docs":{},"忽":{"docs":{},"略":{"docs":{},"某":{"docs":{},"个":{"docs":{},"分":{"docs":{},"支":{"docs":{},"时":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"该":{"docs":{},"分":{"docs":{},"支":{"docs":{},"内":{"docs":{},"写":{"docs":{},"上":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"。":{"docs":{},"当":{"docs":{},"那":{"docs":{},"个":{"docs":{},"分":{"docs":{},"支":{"docs":{},"被":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"时":{"docs":{},",":{"docs":{},"分":{"docs":{},"支":{"docs":{},"内":{"docs":{},"的":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"语":{"docs":{},"句":{"docs":{},"立":{"docs":{},"即":{"docs":{},"结":{"docs":{},"束":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.012024048096192385},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.020338983050847456}}}}}}},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"(":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}},"s":{"docs":{},"(":{"docs":{},"&":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}},"。":{"docs":{},"需":{"docs":{},"要":{"docs":{},"注":{"docs":{},"意":{"docs":{},"的":{"docs":{},"是":{"docs":{},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"交":{"docs":{},"换":{"docs":{},"两":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"可":{"docs":{},"以":{"docs":{},"交":{"docs":{},"换":{"docs":{},"b":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"到":{"docs":{},"a":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"交":{"docs":{},"换":{"docs":{},"a":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"到":{"docs":{},"b":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"调":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"交":{"docs":{},"换":{"docs":{},"两":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"非":{"docs":{},"常":{"docs":{},"有":{"docs":{},"用":{"docs":{},"的":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"它":{"docs":{},"只":{"docs":{},"能":{"docs":{},"交":{"docs":{},"换":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"想":{"docs":{},"要":{"docs":{},"交":{"docs":{},"换":{"docs":{},"两":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"或":{"docs":{},"者":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}},"函":{"docs":{},"数":{"docs":{},"功":{"docs":{},"能":{"docs":{},"都":{"docs":{},"是":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},",":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"不":{"docs":{},"同":{"docs":{},"之":{"docs":{},"处":{"docs":{},"就":{"docs":{},"在":{"docs":{},"于":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"类":{"docs":{},"型":{"docs":{},"不":{"docs":{},"同":{"docs":{},",":{"docs":{},"分":{"docs":{},"别":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"、":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"和":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"(":{"docs":{},"&":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}},"<":{"docs":{},"t":{"docs":{},">":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}}}}},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"占":{"docs":{},"位":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},"是":{"docs":{},"一":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"的":{"docs":{},"示":{"docs":{},"例":{"docs":{},"。":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"指":{"docs":{},"定":{"docs":{},"并":{"docs":{},"命":{"docs":{},"名":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"占":{"docs":{},"位":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"紧":{"docs":{},"随":{"docs":{},"在":{"docs":{},"函":{"docs":{},"数":{"docs":{},"名":{"docs":{},"后":{"docs":{},"面":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"一":{"docs":{},"对":{"docs":{},"尖":{"docs":{},"括":{"docs":{},"号":{"docs":{},"括":{"docs":{},"起":{"docs":{},"来":{"docs":{},"(":{"docs":{},"如":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"中":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{},")":{"docs":{},",":{"docs":{},"或":{"docs":{},"作":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"或":{"docs":{},"用":{"docs":{},"作":{"docs":{},"函":{"docs":{},"数":{"docs":{},"主":{"docs":{},"体":{"docs":{},"中":{"docs":{},"的":{"docs":{},"注":{"docs":{},"释":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"被":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"所":{"docs":{},"代":{"docs":{},"表":{"docs":{},"的":{"docs":{},"占":{"docs":{},"位":{"docs":{},"类":{"docs":{},"型":{"docs":{},"不":{"docs":{},"管":{"docs":{},"函":{"docs":{},"数":{"docs":{},"任":{"docs":{},"何":{"docs":{},"时":{"docs":{},"候":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"都":{"docs":{},"会":{"docs":{},"被":{"docs":{},"实":{"docs":{},"际":{"docs":{},"类":{"docs":{},"型":{"docs":{},"所":{"docs":{},"替":{"docs":{},"换":{"docs":{},"(":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"当":{"docs":{},"函":{"docs":{},"数":{"docs":{},"第":{"docs":{},"一":{"docs":{},"次":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"t":{"docs":{},"被":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"替":{"docs":{},"换":{"docs":{},",":{"docs":{},"第":{"docs":{},"二":{"docs":{},"次":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},",":{"docs":{},"被":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"主":{"docs":{},"体":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"是":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},",":{"docs":{},"它":{"docs":{},"只":{"docs":{},"在":{"docs":{},"第":{"docs":{},"一":{"docs":{},"行":{"docs":{},"稍":{"docs":{},"微":{"docs":{},"有":{"docs":{},"那":{"docs":{},"么":{"docs":{},"一":{"docs":{},"点":{"docs":{},"点":{"docs":{},"不":{"docs":{},"同":{"docs":{},"于":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"的":{"docs":{},"功":{"docs":{},"能":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"已":{"docs":{},"存":{"docs":{},"在":{"docs":{},"的":{"docs":{},"交":{"docs":{},"换":{"docs":{},"函":{"docs":{},"数":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}},"除":{"docs":{},"了":{"docs":{},"要":{"docs":{},"求":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"两":{"docs":{},"个":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},"值":{"docs":{},"是":{"docs":{},"同":{"docs":{},"一":{"docs":{},"类":{"docs":{},"型":{"docs":{},"外":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"作":{"docs":{},"为":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"。":{"docs":{},"每":{"docs":{},"次":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},",":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"受":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"函":{"docs":{},"数":{"docs":{},"启":{"docs":{},"发":{"docs":{},"而":{"docs":{},"实":{"docs":{},"现":{"docs":{},"的":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}},"泛":{"docs":{},"型":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"或":{"docs":{},"一":{"docs":{},"个":{"docs":{},"存":{"docs":{},"储":{"docs":{},"单":{"docs":{},"一":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"集":{"docs":{},",":{"docs":{},"如":{"docs":{},"数":{"docs":{},"组":{"docs":{},")":{"docs":{},",":{"docs":{},"通":{"docs":{},"常":{"docs":{},"用":{"docs":{},"一":{"docs":{},"单":{"docs":{},"个":{"docs":{},"字":{"docs":{},"母":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"t":{"docs":{},"为":{"docs":{},"整":{"docs":{},"型":{"docs":{},"计":{"docs":{},"算":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"5":{"docs":{},"个":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}},"docs":{}}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"w":{"docs":{},"i":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"k":{"docs":{},"e":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"s":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"e":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}},")":{"docs":{},"的":{"docs":{},"语":{"docs":{},"言":{"docs":{},"。":{"docs":{},"类":{"docs":{},"型":{"docs":{},"安":{"docs":{},"全":{"docs":{},"的":{"docs":{},"语":{"docs":{},"言":{"docs":{},"可":{"docs":{},"以":{"docs":{},"让":{"docs":{},"你":{"docs":{},"清":{"docs":{},"楚":{"docs":{},"地":{"docs":{},"知":{"docs":{},"道":{"docs":{},"代":{"docs":{},"码":{"docs":{},"要":{"docs":{},"处":{"docs":{},"理":{"docs":{},"的":{"docs":{},"值":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"需":{"docs":{},"要":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},",":{"docs":{},"你":{"docs":{},"绝":{"docs":{},"对":{"docs":{},"不":{"docs":{},"可":{"docs":{},"能":{"docs":{},"不":{"docs":{},"小":{"docs":{},"心":{"docs":{},"传":{"docs":{},"进":{"docs":{},"去":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.015384615384615385},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}}}},"p":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}},"y":{"docs":{},"g":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"b":{"docs":{},"y":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}},"e":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"d":{"docs":{},"a":{"docs":{},"v":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0048484848484848485}},"(":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}},"a":{"docs":{},"g":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"(":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}},"。":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"展":{"docs":{},"示":{"docs":{},"的":{"docs":{},"是":{"docs":{},"用":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"a":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"和":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"b":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}}},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}}}},"t":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2912904938927244},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}},"r":{"docs":{},"f":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866}}}}},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.03531598513011153}},".":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}},"s":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"c":{"docs":{},"a":{"docs":{},"p":{"docs":{},"u":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"'":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0546875},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286}},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}}}}}}}},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}},"l":{"docs":{},"f":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.892465980750083},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.009523809523809525},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.02586206896551724},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3701579826826675},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.028056112224448898}},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.01904761904761905},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}},"e":{"docs":{},")":{"docs":{},">":{"docs":{},"\\":{"docs":{},"(":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},")":{"docs":{},"<":{"docs":{},"/":{"docs":{},"\\":{"docs":{},"(":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714}}}}}},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}},"z":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"中":{"docs":{},"调":{"docs":{},"用":{"docs":{},"了":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"某":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"r":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"c":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}},"x":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}},"a":{"docs":{},"d":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"b":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}},"在":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"中":{"docs":{},"引":{"docs":{},"用":{"docs":{},"其":{"docs":{},"它":{"docs":{},"的":{"docs":{},"属":{"docs":{},"于":{"docs":{},"相":{"docs":{},"同":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"。":{"docs":{},"并":{"docs":{},"且":{"docs":{},"你":{"docs":{},"只":{"docs":{},"能":{"docs":{},"在":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"内":{"docs":{},"部":{"docs":{},"调":{"docs":{},"用":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.007619047619047619}}}}},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"n":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}}}},"a":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"被":{"docs":{},"用":{"docs":{},"来":{"docs":{},"区":{"docs":{},"别":{"docs":{},"实":{"docs":{},"例":{"docs":{},"变":{"docs":{},"量":{"docs":{},"。":{"docs":{},"当":{"docs":{},"你":{"docs":{},"创":{"docs":{},"建":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"像":{"docs":{},"传":{"docs":{},"入":{"docs":{},"函":{"docs":{},"数":{"docs":{},"参":{"docs":{},"数":{"docs":{},"一":{"docs":{},"样":{"docs":{},"给":{"docs":{},"类":{"docs":{},"传":{"docs":{},"入":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"。":{"docs":{},"每":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"都":{"docs":{},"需":{"docs":{},"要":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"—":{"docs":{},"—":{"docs":{},"无":{"docs":{},"论":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"声":{"docs":{},"明":{"docs":{},"(":{"docs":{},"就":{"docs":{},"像":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"还":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"就":{"docs":{},"像":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"不":{"docs":{},"论":{"docs":{},"何":{"docs":{},"时":{"docs":{},",":{"docs":{},"只":{"docs":{},"要":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"已":{"docs":{},"知":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"者":{"docs":{},"方":{"docs":{},"法":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"没":{"docs":{},"有":{"docs":{},"明":{"docs":{},"确":{"docs":{},"的":{"docs":{},"写":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"一":{"docs":{},"个":{"docs":{},"全":{"docs":{},"新":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"上":{"docs":{},"面":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}},"前":{"docs":{},"缀":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}},"消":{"docs":{},"除":{"docs":{},"方":{"docs":{},"法":{"docs":{},"参":{"docs":{},"数":{"docs":{},"x":{"docs":{},"和":{"docs":{},"实":{"docs":{},"例":{"docs":{},"属":{"docs":{},"性":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}},"赋":{"docs":{},"值":{"docs":{},"(":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"完":{"docs":{},"全":{"docs":{},"等":{"docs":{},"同":{"docs":{},"于":{"docs":{},"该":{"docs":{},"实":{"docs":{},"例":{"docs":{},"本":{"docs":{},"身":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"隐":{"docs":{},"含":{"docs":{},"的":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"它":{"docs":{},"只":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}},"并":{"docs":{},"不":{"docs":{},"会":{"docs":{},"持":{"docs":{},"有":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"将":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"]":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"“":{"docs":{},"用":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"来":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}},"后":{"docs":{},"是":{"docs":{},"如":{"docs":{},"何":{"docs":{},"产":{"docs":{},"生":{"docs":{},"一":{"docs":{},"个":{"docs":{},"循":{"docs":{},"环":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"。":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},",":{"docs":{},"就":{"docs":{},"要":{"docs":{},"用":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"或":{"docs":{},"者":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"(":{"docs":{},"而":{"docs":{},"不":{"docs":{},"只":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"或":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"提":{"docs":{},"醒":{"docs":{},"你":{"docs":{},"可":{"docs":{},"能":{"docs":{},"会":{"docs":{},"不":{"docs":{},"小":{"docs":{},"心":{"docs":{},"就":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"或":{"docs":{},"其":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"必":{"docs":{},"须":{"docs":{},"将":{"docs":{},"该":{"docs":{},"实":{"docs":{},"例":{"docs":{},"方":{"docs":{},"法":{"docs":{},"标":{"docs":{},"注":{"docs":{},"为":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},".":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"本":{"docs":{},"身":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"同":{"docs":{},"样":{"docs":{},",":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},".":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"返":{"docs":{},"回":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"本":{"docs":{},"身":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"适":{"docs":{},"配":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"的":{"docs":{},"某":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"还":{"docs":{},"可":{"docs":{},"以":{"docs":{},"对":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"使":{"docs":{},"用":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}},"[":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}},"等":{"docs":{},"同":{"docs":{},"于":{"docs":{},"当":{"docs":{},"前":{"docs":{},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}},"修":{"docs":{},"饰":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"或":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"方":{"docs":{},"法":{"docs":{},"必":{"docs":{},"须":{"docs":{},"以":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"些":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}},"r":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747}},"e":{"docs":{},".":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"r":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"(":{"docs":{},"\"":{"6":{"docs":{},":":{"0":{"0":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.007079646017699115}}}}}}}}}}}}}}}}},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.010917030567685589},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.025547445255474453},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":2.517467248908297},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.011428571428571429},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.014028056112224449}},"与":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"副":{"docs":{},"本":{"docs":{},"合":{"docs":{},"成":{"docs":{},",":{"docs":{},"由":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"y":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"z":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"返":{"docs":{},"回":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"属":{"docs":{},"性":{"docs":{},"本":{"docs":{},"身":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"该":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"需":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"n":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.07142857142857142}},"e":{"docs":{},"­":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.07142857142857142}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}}}}}}}}}}}}},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"名":{"docs":{},"为":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"正":{"docs":{},"如":{"docs":{},"在":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"声":{"docs":{},"明":{"docs":{},"速":{"docs":{},"记":{"docs":{},"(":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"名":{"docs":{},"字":{"docs":{},"和":{"docs":{},"圆":{"docs":{},"括":{"docs":{},"号":{"docs":{},"内":{"docs":{},"的":{"docs":{},"语":{"docs":{},"句":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"写":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"名":{"docs":{},",":{"docs":{},"它":{"docs":{},"就":{"docs":{},"会":{"docs":{},"作":{"docs":{},"为":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"被":{"docs":{},"使":{"docs":{},"用":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"不":{"docs":{},"写":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"封":{"docs":{},"闭":{"docs":{},"的":{"docs":{},"括":{"docs":{},"号":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"它":{"docs":{},"会":{"docs":{},"被":{"docs":{},"当":{"docs":{},"做":{"docs":{},"传":{"docs":{},"给":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"名":{"docs":{},"称":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"不":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"传":{"docs":{},"给":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"名":{"docs":{},"称":{"docs":{},"默":{"docs":{},"认":{"docs":{},"是":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"。":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"名":{"docs":{},"称":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"必":{"docs":{},"须":{"docs":{},"与":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"你":{"docs":{},"也":{"docs":{},"必":{"docs":{},"需":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}}}}},"u":{"docs":{},"p":{"docs":{},")":{"docs":{},"被":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"k":{"docs":{},"e":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"类":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},"实":{"docs":{},"现":{"docs":{},"。":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"逻":{"docs":{},"辑":{"docs":{},"被":{"docs":{},"转":{"docs":{},"移":{"docs":{},"到":{"docs":{},"了":{"docs":{},"p":{"docs":{},"l":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"1":{"0":{"0":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"docs":{}},"docs":{}},"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}}},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}}},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}},"和":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"e":{"docs":{},"r":{"docs":{},"。":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"参":{"docs":{},"数":{"docs":{},"是":{"docs":{},"类":{"docs":{},"型":{"docs":{},"c":{"1":{"docs":{},",":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"参":{"docs":{},"数":{"docs":{},"是":{"docs":{},"类":{"docs":{},"型":{"docs":{},"c":{"2":{"docs":{},"。":{"docs":{},"c":{"1":{"docs":{},"和":{"docs":{},"c":{"2":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}},"docs":{}}}},"docs":{}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"1":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}},"docs":{}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"的":{"docs":{},"重":{"docs":{},"写":{"docs":{},"实":{"docs":{},"现":{"docs":{},"中":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"(":{"docs":{},")":{"docs":{},"来":{"docs":{},"调":{"docs":{},"用":{"docs":{},"超":{"docs":{},"类":{"docs":{},"版":{"docs":{},"本":{"docs":{},"的":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635}},">":{"docs":{},"(":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028}},".":{"1":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}},"docs":{},"i":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"o":{"docs":{},"f":{"docs":{},"x":{"docs":{},"(":{"1":{"docs":{},".":{"0":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"b":{"docs":{},"y":{"docs":{},"x":{"docs":{},"(":{"2":{"docs":{},".":{"0":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"docs":{}}},"docs":{}}}}}}}}},"x":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.016556291390728478}}}}}}}},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}}}}}}}},"b":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.012944983818770227},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.005506607929515419}}}}}}}}},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"变":{"docs":{},"量":{"docs":{},"通":{"docs":{},"过":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"进":{"docs":{},"行":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"e":{"docs":{},"等":{"docs":{},")":{"docs":{},",":{"docs":{},"以":{"docs":{},"便":{"docs":{},"符":{"docs":{},"合":{"docs":{},"标":{"docs":{},"准":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.01282051282051282}},"e":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.007692307692307693}}}}}}}}}}}}}}}}}}},"中":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"这":{"docs":{},"个":{"docs":{},"子":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"以":{"docs":{},"上":{"docs":{},"操":{"docs":{},"作":{"docs":{},"并":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"重":{"docs":{},"新":{"docs":{},"设":{"docs":{},"置":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}},"e":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"模":{"docs":{},"式":{"docs":{},",":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"了":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"4":{"2":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{},"?":{"docs":{},"(":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"可":{"docs":{},"选":{"docs":{},"方":{"docs":{},"法":{"docs":{},"名":{"docs":{},"称":{"docs":{},"后":{"docs":{},"加":{"docs":{},"上":{"docs":{},"?":{"docs":{},"来":{"docs":{},"检":{"docs":{},"查":{"docs":{},"该":{"docs":{},"方":{"docs":{},"法":{"docs":{},"是":{"docs":{},"否":{"docs":{},"被":{"docs":{},"实":{"docs":{},"现":{"docs":{},"。":{"docs":{},"可":{"docs":{},"选":{"docs":{},"方":{"docs":{},"法":{"docs":{},"和":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},"都":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}},"s":{"docs":{},"数":{"docs":{},"组":{"docs":{},"为":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.008620689655172414},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.005506607929515419}},"e":{"docs":{},"(":{"docs":{},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}},"e":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"指":{"docs":{},"定":{"docs":{},"为":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.009025270758122744}},"s":{"docs":{},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"3":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}},"docs":{}}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}},"被":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"[":{"docs":{},"]":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"输":{"docs":{},"出":{"docs":{},"所":{"docs":{},"以":{"docs":{},"它":{"docs":{},"的":{"docs":{},"变":{"docs":{},"量":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}},"s":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.009708737864077669},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251}},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"a":{"docs":{},"k":{"docs":{},"e":{"docs":{},"s":{"docs":{},"a":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809}},"e":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}},"<":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}},"(":{"docs":{},"x":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.007692307692307693}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},".":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"引":{"docs":{},"用":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"[":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}},"都":{"docs":{},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"数":{"docs":{},"组":{"docs":{},"。":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"[":{"docs":{},"]":{"docs":{},"获":{"docs":{},"取":{"docs":{},"访":{"docs":{},"问":{"docs":{},":":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"[":{"0":{"docs":{},"]":{"docs":{},"是":{"docs":{},"指":{"docs":{},"第":{"0":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"“":{"docs":{},"a":{"docs":{},"l":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}},"docs":{}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114}}}}}}},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"[":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}}},"u":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}},"s":{"docs":{},"和":{"docs":{},"m":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{},"s":{"docs":{},"在":{"docs":{},"不":{"docs":{},"同":{"docs":{},"位":{"docs":{},"上":{"docs":{},"有":{"1":{"docs":{},"。":{"docs":{},"按":{"docs":{},"位":{"docs":{},"或":{"docs":{},"运":{"docs":{},"行":{"docs":{},"的":{"docs":{},"结":{"docs":{},"果":{"docs":{},"是":{"1":{"1":{"1":{"1":{"1":{"1":{"1":{"0":{"docs":{},",":{"docs":{},"即":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"的":{"2":{"5":{"4":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}},"docs":{}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.012944983818770227},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}}}}}}}}}}}}},"r":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5795076513639388}},"(":{"docs":{},"[":{"1":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"docs":{}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.023952095808383235}}}}}},"函":{"docs":{},"数":{"docs":{},"对":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}},"当":{"docs":{},"排":{"docs":{},"序":{"docs":{},"结":{"docs":{},"束":{"docs":{},"后":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"排":{"docs":{},"在":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"前":{"docs":{},"面":{"docs":{},"还":{"docs":{},"是":{"docs":{},"后":{"docs":{},"面":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"值":{"docs":{},"出":{"docs":{},"现":{"docs":{},"在":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"值":{"docs":{},"前":{"docs":{},"面":{"docs":{},",":{"docs":{},"排":{"docs":{},"序":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"函":{"docs":{},"数":{"docs":{},"需":{"docs":{},"要":{"docs":{},"返":{"docs":{},"回":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"反":{"docs":{},"之":{"docs":{},"返":{"docs":{},"回":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"进":{"docs":{},"行":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}},"整":{"docs":{},"体":{"docs":{},"调":{"docs":{},"用":{"docs":{},"保":{"docs":{},"持":{"docs":{},"不":{"docs":{},"变":{"docs":{},",":{"docs":{},"一":{"docs":{},"对":{"docs":{},"圆":{"docs":{},"括":{"docs":{},"号":{"docs":{},"仍":{"docs":{},"然":{"docs":{},"包":{"docs":{},"裹":{"docs":{},"住":{"docs":{},"了":{"docs":{},"函":{"docs":{},"数":{"docs":{},"中":{"docs":{},"整":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"集":{"docs":{},"合":{"docs":{},"。":{"docs":{},"而":{"docs":{},"其":{"docs":{},"中":{"docs":{},"一":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"现":{"docs":{},"在":{"docs":{},"变":{"docs":{},"成":{"docs":{},"了":{"docs":{},"内":{"docs":{},"联":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"(":{"docs":{},"相":{"docs":{},"比":{"docs":{},"于":{"docs":{},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"明":{"docs":{},"确":{"docs":{},"了":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"必":{"docs":{},"须":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"期":{"docs":{},"望":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"是":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}},"u":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"t":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}},"n":{"docs":{},"g":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.04103671706263499}},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}},".":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.008639308855291577}},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"计":{"docs":{},"算":{"docs":{},"数":{"docs":{},"组":{"docs":{},"l":{"docs":{},"i":{"docs":{},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}},"检":{"docs":{},"查":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"是":{"docs":{},"否":{"docs":{},"为":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"在":{"docs":{},"循":{"docs":{},"环":{"docs":{},"结":{"docs":{},"束":{"docs":{},"后":{"docs":{},",":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625}}}},"r":{"docs":{},"k":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}},")":{"docs":{},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"2":{"0":{"docs":{},")":{"docs":{},"、":{"docs":{},"换":{"docs":{},"行":{"docs":{},"符":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.014598540145985401}},"l":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.010948905109489052}},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"属":{"docs":{},"性":{"docs":{},"时":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"会":{"docs":{},"去":{"docs":{},"检":{"docs":{},"查":{"docs":{},"新":{"docs":{},"值":{"docs":{},"与":{"docs":{},"限":{"docs":{},"制":{"docs":{},"值":{"4":{"0":{"docs":{},"m":{"docs":{},"p":{"docs":{},"h":{"docs":{},"的":{"docs":{},"大":{"docs":{},"小":{"docs":{},",":{"docs":{},"它":{"docs":{},"会":{"docs":{},"将":{"docs":{},"超":{"docs":{},"类":{"docs":{},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"和":{"4":{"0":{"docs":{},".":{"0":{"docs":{},"中":{"docs":{},"较":{"docs":{},"小":{"docs":{},"的":{"docs":{},"那":{"docs":{},"个":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"值":{"docs":{},"哪":{"docs":{},"个":{"docs":{},"较":{"docs":{},"小":{"docs":{},"由":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"函":{"docs":{},"数":{"docs":{},"决":{"docs":{},"定":{"docs":{},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"标":{"docs":{},"准":{"docs":{},"库":{"docs":{},"中":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"全":{"docs":{},"局":{"docs":{},"函":{"docs":{},"数":{"docs":{},"。":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}},"设":{"docs":{},"置":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"大":{"docs":{},"于":{"4":{"0":{"docs":{},"m":{"docs":{},"p":{"docs":{},"h":{"docs":{},"的":{"docs":{},"数":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"打":{"docs":{},"印":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"输":{"docs":{},"出":{"docs":{},",":{"docs":{},"你":{"docs":{},"会":{"docs":{},"发":{"docs":{},"现":{"docs":{},"速":{"docs":{},"度":{"docs":{},"被":{"docs":{},"限":{"docs":{},"制":{"docs":{},"在":{"4":{"0":{"docs":{},"m":{"docs":{},"p":{"docs":{},"h":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},"。":{"docs":{},"类":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"l":{"docs":{},"i":{"docs":{},"m":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"表":{"docs":{},"示":{"docs":{},"安":{"docs":{},"装":{"docs":{},"了":{"docs":{},"限":{"docs":{},"速":{"docs":{},"装":{"docs":{},"置":{"docs":{},"的":{"docs":{},"车":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"最":{"docs":{},"高":{"docs":{},"速":{"docs":{},"度":{"docs":{},"只":{"docs":{},"能":{"docs":{},"达":{"docs":{},"到":{"4":{"0":{"docs":{},"m":{"docs":{},"p":{"docs":{},"h":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"重":{"docs":{},"写":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.01},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.014028056112224449}}}}}}},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"和":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"替":{"docs":{},"换":{"docs":{},"为":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"b":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"s":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.011350737797956867},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.016175071360608945},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.012033694344163659}},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},".":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}},"增":{"docs":{},"加":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"[":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"]":{"docs":{},"的":{"docs":{},"值":{"docs":{},"向":{"docs":{},"前":{"docs":{},"或":{"docs":{},"向":{"docs":{},"后":{"docs":{},"移":{"docs":{},"动":{"docs":{},"(":{"docs":{},"遇":{"docs":{},"到":{"docs":{},"了":{"docs":{},"梯":{"docs":{},"子":{"docs":{},"或":{"docs":{},"者":{"docs":{},"蛇":{"docs":{},")":{"docs":{},"之":{"docs":{},"前":{"docs":{},",":{"docs":{},"检":{"docs":{},"测":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"docs":{},"否":{"docs":{},"小":{"docs":{},"于":{"docs":{},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"属":{"docs":{},"性":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"点":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},".":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"原":{"docs":{},"点":{"docs":{},"是":{"docs":{},"(":{"0":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"docs":{}}}}}}}}}}}}}}}},"i":{"docs":{},"s":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"(":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}},"k":{"docs":{},"e":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.009626955475330927}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"l":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.006016847172081829}},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"是":{"docs":{},"s":{"docs":{},"n":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}},"遵":{"docs":{},"循":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"y":{"docs":{},"r":{"docs":{},"u":{"docs":{},"p":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.008676789587852495}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"的":{"docs":{},"新":{"docs":{},"数":{"docs":{},"据":{"docs":{},"项":{"docs":{},"插":{"docs":{},"入":{"docs":{},"列":{"docs":{},"表":{"docs":{},"的":{"docs":{},"最":{"docs":{},"开":{"docs":{},"始":{"docs":{},"位":{"docs":{},"置":{"docs":{},",":{"docs":{},"并":{"docs":{},"且":{"docs":{},"使":{"docs":{},"用":{"0":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},")":{"docs":{},"根":{"docs":{},"据":{"docs":{},"上":{"docs":{},"下":{"docs":{},"文":{"docs":{},"推":{"docs":{},"断":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"f":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}}}}}}}}}}},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":1.6666666666666665}}}}}}}}}}}}}}},")":{"docs":{},"和":{"docs":{},"显":{"docs":{},"式":{"docs":{},"成":{"docs":{},"员":{"docs":{},"表":{"docs":{},"达":{"docs":{},"(":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}},"k":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}},"r":{"docs":{},"c":{"docs":{},"=":{"docs":{},"\"":{"docs":{},"h":{"docs":{},"t":{"docs":{},"t":{"docs":{},"p":{"docs":{},"s":{"docs":{},":":{"docs":{},"/":{"docs":{},"/":{"docs":{},"d":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"/":{"docs":{},"l":{"docs":{},"i":{"docs":{},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"/":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"/":{"docs":{},"i":{"docs":{},"o":{"docs":{},"s":{"docs":{},"/":{"docs":{},"d":{"docs":{},"o":{"docs":{},"c":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"/":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"/":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"p":{"docs":{},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"/":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"_":{"docs":{},"l":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"u":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"/":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{},"/":{"docs":{},"b":{"docs":{},"a":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"_":{"docs":{},"q":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}},"docs":{}}}},"u":{"docs":{},"p":{"docs":{},"c":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}},"docs":{}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"e":{"docs":{},"s":{"docs":{},"v":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.03429602888086643},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.029850746268656716},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.09183673469387756},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"a":{"docs":{},"k":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}},"e":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}},"k":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.01824817518248175}},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}},"类":{"docs":{},"也":{"docs":{},"继":{"docs":{},"承":{"docs":{},"了":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}},"b":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"(":{"docs":{},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"z":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}},")":{"docs":{},"\\":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"9":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}},"docs":{},"b":{"docs":{},")":{"docs":{},"、":{"docs":{},"换":{"docs":{},"页":{"docs":{},"符":{"docs":{},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}},"i":{"docs":{},"m":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"y":{"docs":{},"y":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.007611798287345386},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}},"s":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"(":{"docs":{},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}},"例":{"docs":{},"子":{"docs":{},"是":{"docs":{},"基":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"固":{"docs":{},"定":{"docs":{},"的":{"docs":{},"数":{"docs":{},"学":{"docs":{},"公":{"docs":{},"式":{"docs":{},"。":{"docs":{},"它":{"docs":{},"并":{"docs":{},"不":{"docs":{},"适":{"docs":{},"合":{"docs":{},"开":{"docs":{},"放":{"docs":{},"写":{"docs":{},"权":{"docs":{},"限":{"docs":{},"来":{"docs":{},"对":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"[":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"只":{"docs":{},"读":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"的":{"docs":{},"用":{"docs":{},"法":{"docs":{},",":{"docs":{},"该":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"用":{"docs":{},"来":{"docs":{},"展":{"docs":{},"示":{"docs":{},"传":{"docs":{},"入":{"docs":{},"整":{"docs":{},"数":{"docs":{},"的":{"docs":{},"n":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"创":{"docs":{},"建":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"索":{"docs":{},"引":{"docs":{},"值":{"docs":{},"三":{"docs":{},"倍":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"数":{"docs":{},"值":{"3":{"docs":{},"作":{"docs":{},"为":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},"入":{"docs":{},"参":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"实":{"docs":{},"例":{"docs":{},"成":{"docs":{},"员":{"docs":{},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}}}},"e":{"docs":{},"s":{"docs":{},"d":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"l":{"docs":{},"i":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}},"p":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.006607929515418502},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894}}}},"r":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"i":{"docs":{},"p":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.005309734513274336}},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}}}}}}}}}}}}}},"w":{"docs":{},"l":{"docs":{},"k":{"docs":{},"y":{"docs":{},"a":{"docs":{},"o":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}},"o":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"是":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"然":{"docs":{},"而":{"docs":{},"常":{"docs":{},"量":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"是":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"不":{"docs":{},"能":{"docs":{},"直":{"docs":{},"接":{"docs":{},"相":{"docs":{},"加":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"们":{"docs":{},"类":{"docs":{},"型":{"docs":{},"不":{"docs":{},"同":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},"要":{"docs":{},"调":{"docs":{},"用":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"(":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},")":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"数":{"docs":{},"字":{"docs":{},"并":{"docs":{},"用":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}},"b":{"docs":{},"y":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}},"d":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}},"和":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"方":{"docs":{},"法":{"docs":{},"可":{"docs":{},"能":{"docs":{},"会":{"docs":{},"失":{"docs":{},"败":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"它":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},")":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"被":{"docs":{},"写":{"docs":{},"作":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"?":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"。":{"docs":{},"问":{"docs":{},"号":{"docs":{},"暗":{"docs":{},"示":{"docs":{},"包":{"docs":{},"含":{"docs":{},"的":{"docs":{},"值":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},"可":{"docs":{},"能":{"docs":{},"包":{"docs":{},"含":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"值":{"docs":{},"也":{"docs":{},"可":{"docs":{},"能":{"docs":{},"不":{"docs":{},"包":{"docs":{},"含":{"docs":{},"值":{"docs":{},"。":{"docs":{},"(":{"docs":{},"不":{"docs":{},"能":{"docs":{},"包":{"docs":{},"含":{"docs":{},"其":{"docs":{},"他":{"docs":{},"任":{"docs":{},"何":{"docs":{},"值":{"docs":{},"比":{"docs":{},"如":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"值":{"docs":{},"或":{"docs":{},"者":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"。":{"docs":{},"只":{"docs":{},"能":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"尝":{"docs":{},"试":{"docs":{},"将":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"i":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}},"k":{"docs":{},"y":{"docs":{},"o":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},":":{"docs":{},"\"":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0048484848484848485}},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.015283842794759825}},"s":{"docs":{},"设":{"docs":{},"置":{"docs":{},"新":{"docs":{},"值":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"含":{"docs":{},"有":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{},"e":{"docs":{},"函":{"docs":{},"数":{"docs":{},"。":{"docs":{},"根":{"docs":{},"据":{"docs":{},"函":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"推":{"docs":{},"测":{"docs":{},",":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{},"e":{"docs":{},"可":{"docs":{},"能":{"docs":{},"用":{"docs":{},"于":{"docs":{},"切":{"docs":{},"换":{"docs":{},"或":{"docs":{},"恢":{"docs":{},"复":{"docs":{},"某":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"状":{"docs":{},"态":{"docs":{},"。":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"协":{"docs":{},"议":{"docs":{},"时":{"docs":{},",":{"docs":{},"必":{"docs":{},"须":{"docs":{},"在":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"前":{"docs":{},"加":{"docs":{},"上":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"s":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"e":{"docs":{},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"e":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093}}}}}}}}},"那":{"docs":{},"些":{"docs":{},"包":{"docs":{},"含":{"docs":{},"可":{"docs":{},"选":{"docs":{},"成":{"docs":{},"员":{"docs":{},"需":{"docs":{},"求":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"。":{"docs":{},"更":{"docs":{},"多":{"docs":{},"关":{"docs":{},"于":{"docs":{},"如":{"docs":{},"何":{"docs":{},"使":{"docs":{},"用":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"特":{"docs":{},"性":{"docs":{},"以":{"docs":{},"及":{"docs":{},"如":{"docs":{},"何":{"docs":{},"访":{"docs":{},"问":{"docs":{},"可":{"docs":{},"选":{"docs":{},"协":{"docs":{},"议":{"docs":{},"成":{"docs":{},"员":{"docs":{},"的":{"docs":{},"指":{"docs":{},"导":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"当":{"docs":{},"你":{"docs":{},"不":{"docs":{},"确":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"-":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}},".":{"0":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"1":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},".":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}}}}}}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612}}}}}}}}}},"e":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"m":{"docs":{},"s":{"docs":{},"c":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747}}}}}}}},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.015384615384615385}}},"y":{"docs":{},".":{"docs":{},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}},"和":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"o":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"y":{"docs":{},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"常":{"docs":{},"量":{"docs":{},"(":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},")":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"变":{"docs":{},"量":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},"你":{"docs":{},"依":{"docs":{},"然":{"docs":{},"可":{"docs":{},"以":{"docs":{},"改":{"docs":{},"变":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"和":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"o":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"常":{"docs":{},"量":{"docs":{},"本":{"docs":{},"身":{"docs":{},"不":{"docs":{},"会":{"docs":{},"改":{"docs":{},"变":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"并":{"docs":{},"不":{"docs":{},"存":{"docs":{},"储":{"docs":{},"这":{"docs":{},"个":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"在":{"docs":{},"后":{"docs":{},"台":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"是":{"docs":{},"对":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},",":{"docs":{},"改":{"docs":{},"变":{"docs":{},"的":{"docs":{},"是":{"docs":{},"被":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"基":{"docs":{},"础":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"的":{"docs":{},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"我":{"docs":{},"们":{"docs":{},"会":{"docs":{},"发":{"docs":{},"现":{"docs":{},"它":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},"显":{"docs":{},"示":{"docs":{},"了":{"docs":{},"基":{"docs":{},"本":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"新":{"docs":{},"帧":{"docs":{},"率":{"docs":{},",":{"docs":{},"其":{"docs":{},"值":{"docs":{},"为":{"3":{"0":{"docs":{},".":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"其":{"docs":{},"引":{"docs":{},"用":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"类":{"docs":{},"的":{"docs":{},"新":{"docs":{},"实":{"docs":{},"例":{"docs":{},"。":{"docs":{},"在":{"docs":{},"之":{"docs":{},"前":{"docs":{},"的":{"docs":{},"示":{"docs":{},"例":{"docs":{},"中":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"视":{"docs":{},"频":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"o":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"是":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},".":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.009708737864077669}}}}}}}},"r":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"g":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.28757302177376526}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.005506607929515419}}}}}},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"m":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.009191176470588236}},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"f":{"docs":{},"a":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.009514747859181731}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415}}}}}}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0048484848484848485},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.01444043321299639}}},"b":{"docs":{},"o":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"docs":{},"i":{"docs":{},"s":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"x":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.01904761904761905}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"/":{"docs":{},"p":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"或":{"docs":{},"者":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"p":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"还":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"p":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"值":{"docs":{},"存":{"docs":{},"在":{"docs":{},",":{"docs":{},"该":{"docs":{},"标":{"docs":{},"签":{"docs":{},"就":{"docs":{},"包":{"docs":{},"含":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},";":{"docs":{},"如":{"docs":{},"果":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"不":{"docs":{},"存":{"docs":{},"在":{"docs":{},",":{"docs":{},"该":{"docs":{},"标":{"docs":{},"签":{"docs":{},"就":{"docs":{},"不":{"docs":{},"包":{"docs":{},"含":{"docs":{},"文":{"docs":{},"本":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"段":{"docs":{},"落":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"根":{"docs":{},"据":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"是":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.006016847172081829}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},"含":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.006507592190889371}}}}}}},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}},"的":{"docs":{},"值":{"docs":{},"被":{"docs":{},"用":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"[":{"6":{"docs":{},"]":{"docs":{},"。":{"docs":{},"这":{"docs":{},"条":{"docs":{},"语":{"docs":{},"句":{"docs":{},"访":{"docs":{},"问":{"docs":{},"了":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"第":{"docs":{},"六":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"6":{"docs":{},"的":{"3":{"docs":{},"倍":{"docs":{},"即":{"1":{"8":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"docs":{}},"docs":{}}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}},"f":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}}}},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"e":{"docs":{},"作":{"docs":{},"为":{"docs":{},"数":{"docs":{},"据":{"docs":{},"源":{"docs":{},"开":{"docs":{},"实":{"docs":{},"例":{"docs":{},"化":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}},"实":{"docs":{},"现":{"docs":{},"了":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"g":{"docs":{},"h":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.00946372239747634},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}},")":{"docs":{},"控":{"docs":{},"制":{"docs":{},"传":{"docs":{},"递":{"docs":{},"语":{"docs":{},"句":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":1.1111111111111112}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"k":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}},"g":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.012958963282937365},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976}},"s":{"docs":{},".":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"0":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}},".":{"0":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}},"docs":{}}},"3":{"docs":{},".":{"1":{"4":{"1":{"5":{"9":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}},"4":{"2":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}},"docs":{}},"docs":{},"\"":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}},"(":{"3":{"docs":{},".":{"0":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}},"docs":{}}},"docs":{}},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"的":{"docs":{},"每":{"docs":{},"一":{"docs":{},"项":{"docs":{},"的":{"docs":{},"并":{"docs":{},"用":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"查":{"docs":{},"找":{"docs":{},"每":{"docs":{},"一":{"docs":{},"项":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"这":{"docs":{},"几":{"docs":{},"种":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"直":{"docs":{},"接":{"docs":{},"遍":{"docs":{},"历":{"docs":{},",":{"docs":{},"并":{"docs":{},"调":{"docs":{},"用":{"docs":{},"其":{"docs":{},"中":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}},"被":{"docs":{},"当":{"docs":{},"做":{"docs":{},"是":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"e":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},",":{"docs":{},"h":{"docs":{},"a":{"docs":{},"m":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"等":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},"能":{"docs":{},"且":{"docs":{},"仅":{"docs":{},"能":{"docs":{},"调":{"docs":{},"用":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}},"e":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625}},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747}},"e":{"docs":{},".":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"e":{"docs":{},"(":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},".":{"docs":{},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},".":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}},"u":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.021897810218978103},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.010169491525423728}},"。":{"docs":{},"从":{"docs":{},"字":{"docs":{},"面":{"docs":{},"意":{"docs":{},"思":{"docs":{},"来":{"docs":{},"说":{"docs":{},",":{"docs":{},"断":{"docs":{},"言":{"docs":{},"“":{"docs":{},"断":{"docs":{},"言":{"docs":{},"”":{"docs":{},"一":{"docs":{},"个":{"docs":{},"条":{"docs":{},"件":{"docs":{},"是":{"docs":{},"否":{"docs":{},"为":{"docs":{},"真":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"断":{"docs":{},"言":{"docs":{},"来":{"docs":{},"保":{"docs":{},"证":{"docs":{},"在":{"docs":{},"运":{"docs":{},"行":{"docs":{},"其":{"docs":{},"他":{"docs":{},"代":{"docs":{},"码":{"docs":{},"之":{"docs":{},"前":{"docs":{},",":{"docs":{},"某":{"docs":{},"些":{"docs":{},"重":{"docs":{},"要":{"docs":{},"的":{"docs":{},"条":{"docs":{},"件":{"docs":{},"已":{"docs":{},"经":{"docs":{},"被":{"docs":{},"满":{"docs":{},"足":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"条":{"docs":{},"件":{"docs":{},"判":{"docs":{},"断":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"代":{"docs":{},"码":{"docs":{},"运":{"docs":{},"行":{"docs":{},"会":{"docs":{},"继":{"docs":{},"续":{"docs":{},"进":{"docs":{},"行":{"docs":{},";":{"docs":{},"如":{"docs":{},"果":{"docs":{},"条":{"docs":{},"件":{"docs":{},"判":{"docs":{},"断":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},",":{"docs":{},"则":{"docs":{},"会":{"docs":{},"执":{"docs":{},"行":{"docs":{},"大":{"docs":{},"括":{"docs":{},"号":{"docs":{},"内":{"docs":{},"部":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}},"即":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"y":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}},"转":{"docs":{},"到":{"docs":{},"第":{"1":{"docs":{},"步":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}},"2":{"docs":{},"步":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}},"docs":{}}}}},"表":{"docs":{},"示":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"黑":{"docs":{},"格":{"docs":{},",":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.014598540145985401}}}}},"n":{"docs":{},"s":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.9109938586627455},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":10.004285714285714}}}}}}},"i":{"docs":{},"l":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.008982035928143712},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}},"c":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"e":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},")":{"docs":{},"的":{"docs":{},"叶":{"docs":{},"子":{"docs":{},"节":{"docs":{},"点":{"docs":{},"传":{"docs":{},"向":{"docs":{},"根":{"docs":{},"节":{"docs":{},"点":{"docs":{},"。":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.008849557522123894},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":5.006507592190889},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":1.1200931470392548},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.47481324876673714},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.007692307692307693},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.4449607257439982},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":3.3419726421886247},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":1.6695402298850572},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":10.067961165048544},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.37896855536989216},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.041428571428571426},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.009025270758122744},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.007142857142857143},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}}},"s":{"docs":{},")":{"docs":{},"使":{"docs":{},"用":{"docs":{},"字":{"docs":{},"符":{"docs":{},"(":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2857142857142857}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"作":{"docs":{},"为":{"docs":{},"参":{"docs":{},"数":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}}}}}},"嵌":{"docs":{},"套":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}},"—":{"docs":{},"—":{"docs":{},"比":{"docs":{},"如":{"docs":{},"表":{"docs":{},"示":{"docs":{},"数":{"docs":{},"字":{"docs":{},"、":{"docs":{},"字":{"docs":{},"符":{"docs":{},"和":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"—":{"docs":{},"—":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"就":{"docs":{},"是":{"docs":{},"命":{"docs":{},"名":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"是":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"类":{"docs":{},"是":{"docs":{},"引":{"docs":{},"用":{"docs":{},"类":{"docs":{},"型":{"docs":{},"恒":{"docs":{},"等":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"指":{"docs":{},"针":{"docs":{},"类":{"docs":{},"和":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"选":{"docs":{},"择":{"docs":{},"集":{"docs":{},"合":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":2.5}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},"知":{"docs":{},"道":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"有":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"构":{"docs":{},"造":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"去":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"新":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"如":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"、":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},"外":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"浮":{"docs":{},"点":{"docs":{},"数":{"docs":{},"、":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"、":{"docs":{},"元":{"docs":{},"组":{"docs":{},"、":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"类":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},"和":{"docs":{},"可":{"docs":{},"选":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"甚":{"docs":{},"至":{"docs":{},"是":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"类":{"docs":{},"型":{"docs":{},"中":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"值":{"docs":{},"和":{"docs":{},"指":{"docs":{},"定":{"docs":{},"的":{"docs":{},"范":{"docs":{},"围":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},")":{"docs":{},"等":{"docs":{},"。":{"docs":{},"关":{"docs":{},"于":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"-":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"p":{"docs":{},"a":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"将":{"docs":{},"自":{"docs":{},"动":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"空":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}},"协":{"docs":{},"议":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"元":{"docs":{},"类":{"docs":{},"型":{"docs":{},"—":{"docs":{},"—":{"docs":{},"并":{"docs":{},"不":{"docs":{},"是":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"适":{"docs":{},"配":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"具":{"docs":{},"体":{"docs":{},"类":{"docs":{},"型":{"docs":{},"—":{"docs":{},"—":{"docs":{},"是":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},"名":{"docs":{},"字":{"docs":{},"紧":{"docs":{},"跟":{"docs":{},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"类":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"元":{"docs":{},"类":{"docs":{},"型":{"docs":{},"就":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},".":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},",":{"docs":{},"协":{"docs":{},"议":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"的":{"docs":{},"元":{"docs":{},"类":{"docs":{},"型":{"docs":{},"就":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"。":{"docs":{},"即":{"docs":{},"使":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"本":{"docs":{},"身":{"docs":{},"没":{"docs":{},"有":{"docs":{},"定":{"docs":{},"义":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},",":{"docs":{},"你":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"f":{"docs":{},"语":{"docs":{},"句":{"docs":{},"来":{"docs":{},"检":{"docs":{},"查":{"docs":{},"是":{"docs":{},"否":{"docs":{},"能":{"docs":{},"成":{"docs":{},"功":{"docs":{},"调":{"docs":{},"用":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"方":{"docs":{},"法":{"docs":{},":":{"docs":{},"如":{"docs":{},"果":{"docs":{},"方":{"docs":{},"法":{"docs":{},"通":{"docs":{},"过":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"调":{"docs":{},"用":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"的":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"将":{"docs":{},"会":{"docs":{},"是":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"没":{"docs":{},"有":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"将":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"声":{"docs":{},"明":{"docs":{},"属":{"docs":{},"性":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"时":{"docs":{},",":{"docs":{},"在":{"docs":{},"前":{"docs":{},"面":{"docs":{},"加":{"docs":{},"上":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"向":{"docs":{},"下":{"docs":{},"转":{"docs":{},"型":{"docs":{},"(":{"docs":{},"d":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"和":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"转":{"docs":{},"换":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":3.333333333333333}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"上":{"docs":{},"下":{"docs":{},"文":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},")":{"docs":{},"中":{"docs":{},",":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"成":{"docs":{},"员":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"是":{"docs":{},"访":{"docs":{},"问":{"docs":{},"某":{"docs":{},"个":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"的":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"常":{"docs":{},"量":{"docs":{},"声":{"docs":{},"明":{"docs":{},"中":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"项":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"描":{"docs":{},"述":{"docs":{},"在":{"docs":{},"类":{"docs":{},"型":{"docs":{},"推":{"docs":{},"断":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"(":{"docs":{},"译":{"docs":{},"者":{"docs":{},"注":{"docs":{},":":{"docs":{},"特":{"docs":{},"指":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},")":{"docs":{},"中":{"docs":{},"的":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"前":{"docs":{},"缀":{"docs":{},"加":{"docs":{},"上":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"修":{"docs":{},"改":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"值":{"docs":{},"就":{"docs":{},"相":{"docs":{},"当":{"docs":{},"于":{"docs":{},"修":{"docs":{},"改":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"而":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"默":{"docs":{},"认":{"docs":{},"不":{"docs":{},"允":{"docs":{},"许":{"docs":{},"修":{"docs":{},"改":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"需":{"docs":{},"要":{"docs":{},"前":{"docs":{},"置":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"方":{"docs":{},"便":{"docs":{},"的":{"docs":{},"修":{"docs":{},"改":{"docs":{},"实":{"docs":{},"例":{"docs":{},"及":{"docs":{},"其":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"值":{"docs":{},"而":{"docs":{},"无":{"docs":{},"需":{"docs":{},"改":{"docs":{},"变":{"docs":{},"类":{"docs":{},"型":{"docs":{},";":{"docs":{},"而":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"中":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"均":{"docs":{},"为":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"与":{"docs":{},"先":{"docs":{},"前":{"docs":{},"的":{"docs":{},"不":{"docs":{},"同":{"docs":{},"即":{"docs":{},"可":{"docs":{},"。":{"docs":{},"此":{"docs":{},"时":{"docs":{},",":{"docs":{},"必":{"docs":{},"须":{"docs":{},"使":{"docs":{},"用":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"在":{"docs":{},"声":{"docs":{},"明":{"docs":{},"时":{"docs":{},"候":{"docs":{},"所":{"docs":{},"定":{"docs":{},"义":{"docs":{},"(":{"docs":{},"d":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"(":{"docs":{},"当":{"docs":{},"然":{"docs":{},"了":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"我":{"docs":{},"都":{"docs":{},"知":{"docs":{},"道":{"docs":{},"它":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"了":{"docs":{},"还":{"docs":{},"需":{"docs":{},"要":{"docs":{},"动":{"docs":{},"态":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"它":{"docs":{},"吗":{"docs":{},")":{"docs":{},"。":{"docs":{},"动":{"docs":{},"态":{"docs":{},"类":{"docs":{},"型":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"某":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"o":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618}}}},"-":{"docs":{},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}}}}}},"分":{"docs":{},"别":{"docs":{},"代":{"docs":{},"表":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}},"和":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"u":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"同":{"docs":{},"时":{"docs":{},"要":{"docs":{},"求":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"等":{"docs":{},"同":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"这":{"docs":{},"样":{"docs":{},"来":{"docs":{},"表":{"docs":{},"达":{"docs":{},":":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"“":{"docs":{},"某":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},"”":{"docs":{},"的":{"docs":{},"节":{"docs":{},"点":{"docs":{},"提":{"docs":{},"供":{"docs":{},"给":{"docs":{},"后":{"docs":{},"来":{"docs":{},"用":{"docs":{},"。":{"docs":{},"这":{"docs":{},"种":{"docs":{},"将":{"docs":{},"来":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"里":{"docs":{},"任":{"docs":{},"何":{"docs":{},"地":{"docs":{},"方":{"docs":{},"表":{"docs":{},"示":{"docs":{},"为":{"docs":{},"“":{"docs":{},"t":{"docs":{},"”":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"所":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"t":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"占":{"docs":{},"位":{"docs":{},"命":{"docs":{},"名":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},")":{"docs":{},"来":{"docs":{},"代":{"docs":{},"替":{"docs":{},"实":{"docs":{},"际":{"docs":{},"类":{"docs":{},"型":{"docs":{},"名":{"docs":{},"(":{"docs":{},"如":{"docs":{},"i":{"docs":{},"n":{"docs":{},"、":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"或":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},")":{"docs":{},"。":{"docs":{},"占":{"docs":{},"位":{"docs":{},"类":{"docs":{},"型":{"docs":{},"名":{"docs":{},"没":{"docs":{},"有":{"docs":{},"提":{"docs":{},"示":{"docs":{},"t":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"什":{"docs":{},"么":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"它":{"docs":{},"提":{"docs":{},"示":{"docs":{},"了":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"同":{"docs":{},"一":{"docs":{},"类":{"docs":{},"型":{"docs":{},"t":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"管":{"docs":{},"t":{"docs":{},"表":{"docs":{},"示":{"docs":{},"什":{"docs":{},"么":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"只":{"docs":{},"有":{"docs":{},"s":{"docs":{},"w":{"docs":{},"a":{"docs":{},"p":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"函":{"docs":{},"数":{"docs":{},"在":{"docs":{},"每":{"docs":{},"次":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},"所":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"实":{"docs":{},"际":{"docs":{},"类":{"docs":{},"型":{"docs":{},"才":{"docs":{},"能":{"docs":{},"决":{"docs":{},"定":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"被":{"docs":{},"用":{"docs":{},"作":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"参":{"docs":{},"数":{"docs":{},"和":{"docs":{},"下":{"docs":{},"标":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"是":{"docs":{},"用":{"docs":{},"尖":{"docs":{},"括":{"docs":{},"号":{"docs":{},"括":{"docs":{},"起":{"docs":{},"来":{"docs":{},"的":{"docs":{},"(":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"需":{"docs":{},"要":{"docs":{},"t":{"docs":{},"必":{"docs":{},"须":{"docs":{},"是":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"子":{"docs":{},"类":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"约":{"docs":{},"束":{"docs":{},";":{"docs":{},"第":{"docs":{},"二":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"u":{"docs":{},",":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"需":{"docs":{},"要":{"docs":{},"u":{"docs":{},"必":{"docs":{},"须":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"@":{"docs":{},"n":{"docs":{},"o":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.029850746268656716}}}}}}}}}}}},"u":{"docs":{},",":{"docs":{},"v":{"docs":{},",":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},",":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}},"则":{"docs":{},"是":{"docs":{},"跟":{"docs":{},"这":{"docs":{},"些":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"的":{"docs":{},"公":{"docs":{},"共":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"最":{"docs":{},"接":{"docs":{},"近":{"docs":{},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},".":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"就":{"docs":{},"是":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}},"u":{"0":{"0":{"0":{"1":{"docs":{},"f":{"4":{"9":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}},"2":{"6":{"6":{"5":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}},"docs":{}},"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.012618296529968454},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"m":{"docs":{},"c":{"docs":{},"s":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}}},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter1/chapter1.html#gitbook_742":{"ref":"chapter1/chapter1.html#gitbook_742","tf":0.25},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488},"chapter2/chapter2.html#gitbook_786":{"ref":"chapter2/chapter2.html#gitbook_786","tf":0.3333333333333333},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.03571428571428571},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":1.2116303770578862},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.00946372239747634}},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}},"是":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}},"拥":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"返":{"docs":{},"回":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"2":{"1":{"docs":{},"位":{"docs":{},"数":{"docs":{},"值":{"docs":{},",":{"docs":{},"用":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"3":{"2":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}},"是":{"2":{"1":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.011428571428571429},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.01603206412825651}},"s":{"docs":{},")":{"docs":{},"和":{"docs":{},"变":{"docs":{},"体":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"体":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}},"标":{"docs":{},"签":{"docs":{},"联":{"docs":{},"合":{"docs":{},"(":{"docs":{},"t":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}},"-":{"docs":{},"s":{"docs":{},"t":{"docs":{},"y":{"docs":{},"l":{"docs":{},"e":{"docs":{},"-":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"-":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.007142857142857143},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.01002004008016032}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.010619469026548672},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"p":{"docs":{},"e":{"docs":{},"d":{"docs":{},"c":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}},"u":{"docs":{},"s":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}}}}}}}}}}}},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"确":{"docs":{},"定":{"docs":{},"数":{"docs":{},"组":{"docs":{},"引":{"docs":{},"用":{"docs":{},"的":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"性":{"docs":{},"。":{"docs":{},"(":{"docs":{},"当":{"docs":{},"数":{"docs":{},"组":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"常":{"docs":{},"量":{"docs":{},"时":{"docs":{},",":{"docs":{},"不":{"docs":{},"能":{"docs":{},"调":{"docs":{},"用":{"docs":{},"u":{"docs":{},"n":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"调":{"docs":{},"用":{"docs":{},"后":{"docs":{},"再":{"docs":{},"修":{"docs":{},"改":{"docs":{},"b":{"docs":{},"中":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"这":{"docs":{},"三":{"docs":{},"个":{"docs":{},"数":{"docs":{},"组":{"docs":{},"(":{"docs":{},"a":{"docs":{},",":{"docs":{},"b":{"docs":{},",":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"y":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"u":{"docs":{},"n":{"docs":{},"s":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"方":{"docs":{},"法":{"docs":{},"仅":{"docs":{},"会":{"docs":{},"在":{"docs":{},"确":{"docs":{},"有":{"docs":{},"必":{"docs":{},"要":{"docs":{},"时":{"docs":{},"才":{"docs":{},"会":{"docs":{},"创":{"docs":{},"建":{"docs":{},"数":{"docs":{},"组":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"。":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.007633587786259542}},"e":{"docs":{},"d":{"docs":{},"\"":{"docs":{},"(":{"docs":{},"等":{"docs":{},"级":{"6":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"docs":{}}}}}}},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}},"p":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"d":{"docs":{},"未":{"docs":{},"购":{"docs":{},"买":{"docs":{},"状":{"docs":{},"态":{"docs":{},"开":{"docs":{},"始":{"docs":{},"的":{"docs":{},"。":{"docs":{},"为":{"docs":{},"了":{"docs":{},"展":{"docs":{},"现":{"docs":{},"这":{"docs":{},"一":{"docs":{},"事":{"docs":{},"实":{"docs":{},",":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"引":{"docs":{},"入":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"p":{"docs":{},"u":{"docs":{},"r":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"d":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"是":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"。":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"还":{"docs":{},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"计":{"docs":{},"算":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},",":{"docs":{},"它":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"关":{"docs":{},"于":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.012698412698412698}}}},"r":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}},"o":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}},"w":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.009523809523809525},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"e":{"docs":{},"d":{"docs":{},"(":{"docs":{},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}},"u":{"docs":{},"n":{"docs":{},"s":{"docs":{},"a":{"docs":{},"f":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}}}}}}}}}}},".":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},".":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}},"p":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.021897810218978103},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"和":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"e":{"docs":{},"l":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},":":{"docs":{},")":{"docs":{},"函":{"docs":{},"数":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"包":{"docs":{},"含":{"docs":{},"一":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"。":{"docs":{},"举":{"docs":{},"例":{"docs":{},"来":{"docs":{},"说":{"docs":{},":":{"docs":{},"对":{"docs":{},"于":{"docs":{},"存":{"docs":{},"储":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"值":{"docs":{},"的":{"docs":{},"字":{"docs":{},"典":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"函":{"docs":{},"数":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"方":{"docs":{},"法":{"docs":{},"可":{"docs":{},"以":{"docs":{},"设":{"docs":{},"置":{"docs":{},"或":{"docs":{},"者":{"docs":{},"更":{"docs":{},"新":{"docs":{},"特":{"docs":{},"定":{"docs":{},"键":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"就":{"docs":{},"像":{"docs":{},"上":{"docs":{},"面":{"docs":{},"所":{"docs":{},"示":{"docs":{},"的":{"docs":{},"示":{"docs":{},"例":{"docs":{},",":{"docs":{},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"(":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"-":{"docs":{},"a":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}},"a":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"y":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}},"(":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"接":{"docs":{},"受":{"docs":{},"一":{"docs":{},"个":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"现":{"docs":{},"有":{"docs":{},"的":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"。":{"docs":{},"注":{"docs":{},"意":{"docs":{},",":{"docs":{},"你":{"docs":{},"并":{"docs":{},"不":{"docs":{},"能":{"docs":{},"传":{"docs":{},"入":{"docs":{},"任":{"docs":{},"意":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"只":{"docs":{},"能":{"docs":{},"传":{"docs":{},"入":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"进":{"docs":{},"行":{"docs":{},"相":{"docs":{},"加":{"docs":{},"。":{"docs":{},"目":{"docs":{},"标":{"docs":{},"常":{"docs":{},"量":{"docs":{},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"推":{"docs":{},"断":{"docs":{},"为":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"是":{"docs":{},"两":{"docs":{},"个":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}},"docs":{}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"3":{"2":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}},"的":{"docs":{},"命":{"docs":{},"名":{"docs":{},"为":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"k":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"来":{"docs":{},"存":{"docs":{},"储":{"docs":{},"层":{"docs":{},"叠":{"docs":{},"样":{"docs":{},"式":{"docs":{},"表":{"docs":{},"c":{"docs":{},"s":{"docs":{},"s":{"docs":{},"中":{"docs":{},"粉":{"docs":{},"色":{"docs":{},"的":{"docs":{},"颜":{"docs":{},"色":{"docs":{},"值":{"docs":{},",":{"docs":{},"c":{"docs":{},"s":{"docs":{},"s":{"docs":{},"颜":{"docs":{},"色":{"docs":{},"#":{"docs":{},"c":{"docs":{},"c":{"6":{"6":{"9":{"9":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"用":{"docs":{},"十":{"docs":{},"六":{"docs":{},"进":{"docs":{},"制":{"0":{"docs":{},"x":{"docs":{},"c":{"docs":{},"c":{"6":{"6":{"9":{"9":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},"使":{"docs":{},"用":{"docs":{},"按":{"docs":{},"位":{"docs":{},"与":{"docs":{},"(":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},";":{"docs":{},")":{"docs":{},"和":{"docs":{},"按":{"docs":{},"位":{"docs":{},"右":{"docs":{},"移":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"从":{"docs":{},"这":{"docs":{},"个":{"docs":{},"颜":{"docs":{},"色":{"docs":{},"值":{"docs":{},"中":{"docs":{},"解":{"docs":{},"析":{"docs":{},"出":{"docs":{},"红":{"docs":{},"(":{"docs":{},"c":{"docs":{},"c":{"docs":{},")":{"docs":{},",":{"docs":{},"绿":{"docs":{},"(":{"6":{"6":{"docs":{},")":{"docs":{},",":{"docs":{},"蓝":{"docs":{},"(":{"9":{"9":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"8":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.008849557522123894},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.01744186046511628}},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}},"i":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}},"是":{"8":{"docs":{},"位":{"docs":{},"无":{"docs":{},"符":{"docs":{},"整":{"docs":{},"型":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"0":{"docs":{},"~":{"2":{"5":{"5":{"docs":{},"之":{"docs":{},"间":{"docs":{},"的":{"docs":{},"任":{"docs":{},"意":{"docs":{},"数":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"为":{"docs":{},"二":{"docs":{},"进":{"docs":{},"制":{"docs":{},"值":{"0":{"0":{"0":{"0":{"1":{"1":{"1":{"1":{"docs":{},"(":{"docs":{},"前":{"4":{"docs":{},"位":{"docs":{},"为":{"0":{"docs":{},",":{"docs":{},"后":{"4":{"docs":{},"位":{"docs":{},"为":{"1":{"docs":{},")":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"值":{"docs":{},"为":{"1":{"5":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}}}}}}}}}}},"docs":{}}}},"docs":{}}}},"docs":{}}}},"docs":{}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}},"docs":{}},"的":{"docs":{},"最":{"docs":{},"小":{"docs":{},"值":{"0":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{},"是":{"0":{"docs":{},"(":{"docs":{},"二":{"docs":{},"进":{"docs":{},"制":{"docs":{},"为":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{"docs":{},")":{"docs":{},"。":{"docs":{},"使":{"docs":{},"用":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},";":{"docs":{},"-":{"docs":{},"进":{"docs":{},"行":{"docs":{},"溢":{"docs":{},"出":{"docs":{},"减":{"1":{"docs":{},",":{"docs":{},"就":{"docs":{},"会":{"docs":{},"得":{"docs":{},"到":{"docs":{},"二":{"docs":{},"进":{"docs":{},"制":{"docs":{},"的":{"1":{"1":{"1":{"1":{"1":{"1":{"1":{"1":{"docs":{},"即":{"docs":{},"十":{"docs":{},"进":{"docs":{},"制":{"docs":{},"的":{"2":{"5":{"5":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}},"docs":{}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}},"docs":{}}}}}}},"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}},",":{"docs":{},"除":{"docs":{},"非":{"docs":{},"你":{"docs":{},"真":{"docs":{},"的":{"docs":{},"需":{"docs":{},"要":{"docs":{},"存":{"docs":{},"储":{"docs":{},"一":{"docs":{},"个":{"docs":{},"和":{"docs":{},"当":{"docs":{},"前":{"docs":{},"平":{"docs":{},"台":{"docs":{},"原":{"docs":{},"生":{"docs":{},"字":{"docs":{},"长":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"无":{"docs":{},"符":{"docs":{},"号":{"docs":{},"整":{"docs":{},"数":{"docs":{},"。":{"docs":{},"除":{"docs":{},"了":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},",":{"docs":{},"最":{"docs":{},"好":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"即":{"docs":{},"使":{"docs":{},"你":{"docs":{},"要":{"docs":{},"存":{"docs":{},"储":{"docs":{},"的":{"docs":{},"值":{"docs":{},"已":{"docs":{},"知":{"docs":{},"是":{"docs":{},"非":{"docs":{},"负":{"docs":{},"的":{"docs":{},"。":{"docs":{},"统":{"docs":{},"一":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"v":{"docs":{},"i":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"r":{"docs":{},"类":{"docs":{},"使":{"docs":{},"用":{"docs":{},"来":{"docs":{},"模":{"docs":{},"拟":{"docs":{},"试":{"docs":{},"图":{"docs":{},"控":{"docs":{},"制":{"docs":{},"器":{"docs":{},"的":{"docs":{},"导":{"docs":{},"航":{"docs":{},"结":{"docs":{},"构":{"docs":{},"。":{"docs":{},"你":{"docs":{},"通":{"docs":{},"过":{"docs":{},"调":{"docs":{},"用":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"v":{"docs":{},"i":{"docs":{},"g":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"p":{"docs":{},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"r":{"docs":{},":":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},":":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"为":{"docs":{},"导":{"docs":{},"航":{"docs":{},"栈":{"docs":{},"添":{"docs":{},"加":{"docs":{},"(":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},")":{"docs":{},"新":{"docs":{},"的":{"docs":{},"试":{"docs":{},"图":{"docs":{},"控":{"docs":{},"制":{"docs":{},"器":{"docs":{},";":{"docs":{},"而":{"docs":{},"通":{"docs":{},"过":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"l":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},":":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"从":{"docs":{},"导":{"docs":{},"航":{"docs":{},"栈":{"docs":{},"中":{"docs":{},"移":{"docs":{},"除":{"docs":{},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"+":{"0":{"0":{"0":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"d":{"docs":{},"的":{"docs":{},"所":{"docs":{},"有":{"docs":{},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}}},"2":{"4":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{},"a":{"8":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"b":{"2":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"b":{"5":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}}},"docs":{}},"docs":{}}}}},"7":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"b":{"docs":{},"a":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"docs":{}},"docs":{}}}}},"docs":{},"c":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"b":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}}}}}},"c":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"d":{"6":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}}},"docs":{}},"docs":{}}}}},"docs":{}},"d":{"8":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"f":{"6":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}}},"docs":{}},"docs":{}}}}},"docs":{}},"f":{"8":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"docs":{}},"docs":{}}}}},"docs":{}}},"1":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"2":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"3":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"0":{"3":{"6":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"7":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"6":{"7":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"1":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"6":{"8":{"1":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"8":{"0":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"8":{"0":{"docs":{},"f":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"d":{"docs":{},"b":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}},"docs":{}}}}}},"docs":{}},"docs":{},"f":{"4":{"3":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}},"docs":{}},"9":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}},"docs":{}},"d":{"docs":{},"c":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"d":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}},"docs":{}}}}},"docs":{}}},"e":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}},"docs":{}}}}},"docs":{}},"docs":{}}},"2":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"docs":{},"b":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"0":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}},"docs":{}}}}}},"2":{"docs":{},"a":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"2":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}},"docs":{}},"docs":{}}}}}},"3":{"docs":{},"f":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"4":{"0":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}},"5":{"4":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}},"6":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"6":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"7":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"docs":{},"c":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{},"d":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"0":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"docs":{}},"docs":{}}}}},"docs":{}}},"1":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"1":{"8":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"4":{"6":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"4":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"6":{"6":{"5":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}},"7":{"7":{"6":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"7":{"9":{"3":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{},"c":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"docs":{},"d":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"e":{"8":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"2":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}},"docs":{}}}}},"docs":{}},"docs":{}}},"3":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"3":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"4":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"3":{"0":{"0":{"7":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"2":{"1":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"3":{"0":{"2":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"3":{"1":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"3":{"0":{"3":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"4":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"d":{"7":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}},"docs":{}}}}}},"docs":{}},"docs":{}},"docs":{}},"4":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"4":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"5":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"5":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"6":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"6":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"7":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"7":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"8":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"8":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"9":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"9":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{},"d":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"d":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"8":{"3":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}},"docs":{}},"docs":{}},"a":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"a":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"b":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"b":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"c":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"c":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"e":{"0":{"0":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"e":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"f":{"9":{"0":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"d":{"3":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}}}}}}},"docs":{}},"docs":{}},"docs":{},"d":{"4":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"d":{"docs":{},"c":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}},"docs":{}},"docs":{},"f":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"e":{"1":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}}}}}}},"docs":{}}},"e":{"2":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"e":{"2":{"docs":{},"f":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}},"docs":{}}}}}}},"docs":{}},"3":{"0":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"e":{"4":{"4":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}},"docs":{}},"docs":{}}}}}}},"docs":{}},"4":{"7":{"docs":{},"–":{"docs":{},"u":{"docs":{},"+":{"docs":{},"f":{"docs":{},"f":{"docs":{},"f":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}},"docs":{}},"docs":{}}}},"s":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"s":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}},"t":{"docs":{},"f":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"u":{"docs":{},"t":{"docs":{},"f":{"1":{"6":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{},"是":{"docs":{},"无":{"docs":{},"符":{"docs":{},"号":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"来":{"docs":{},"访":{"docs":{},"问":{"docs":{},"它":{"docs":{},"的":{"docs":{},"u":{"docs":{},"t":{"docs":{},"f":{"docs":{},"-":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}}}}}}}}}}}}},"docs":{}},"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"u":{"docs":{},"t":{"docs":{},"f":{"8":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"w":{"docs":{},"是":{"docs":{},"无":{"docs":{},"符":{"docs":{},"号":{"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}}}}}}}}}},"docs":{}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"来":{"docs":{},"访":{"docs":{},"问":{"docs":{},"它":{"docs":{},"的":{"docs":{},"u":{"docs":{},"t":{"docs":{},"f":{"docs":{},"-":{"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}}}}}}}}}}}}},"docs":{},"-":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.00929368029739777}},"(":{"docs":{},"以":{"1":{"6":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}}}},"docs":{}},"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.011152416356877323}},"(":{"docs":{},"以":{"8":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}}}},"docs":{}}}},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}}},"v":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"c":{"docs":{},"l":{"docs":{},"w":{"docs":{},"e":{"docs":{},"i":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}},"i":{"docs":{},"z":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}},"e":{"docs":{},"中":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"类":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"描":{"docs":{},"述":{"docs":{},"一":{"docs":{},"个":{"docs":{},"视":{"docs":{},"频":{"docs":{},"显":{"docs":{},"示":{"docs":{},"器":{"docs":{},"的":{"docs":{},"特":{"docs":{},"定":{"docs":{},"模":{"docs":{},"式":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"类":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"四":{"docs":{},"个":{"docs":{},"储":{"docs":{},"存":{"docs":{},"属":{"docs":{},"性":{"docs":{},"变":{"docs":{},"量":{"docs":{},"。":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"是":{"docs":{},"分":{"docs":{},"辨":{"docs":{},"率":{"docs":{},",":{"docs":{},"它":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"具":{"docs":{},"有":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"新":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},"同":{"docs":{},"时":{"docs":{},"还":{"docs":{},"会":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"其":{"docs":{},"它":{"docs":{},"三":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"分":{"docs":{},"别":{"docs":{},"是":{"docs":{},",":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"(":{"docs":{},"意":{"docs":{},"为":{"docs":{},"“":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"”":{"docs":{},")":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},",":{"docs":{},"回":{"docs":{},"放":{"docs":{},"帧":{"docs":{},"率":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"为":{"0":{"docs":{},".":{"0":{"docs":{},"的":{"docs":{},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"和":{"docs":{},"值":{"docs":{},"为":{"docs":{},"可":{"docs":{},"选":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"的":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"。":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"会":{"docs":{},"被":{"docs":{},"自":{"docs":{},"动":{"docs":{},"赋":{"docs":{},"予":{"docs":{},"一":{"docs":{},"个":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"意":{"docs":{},"为":{"docs":{},"“":{"docs":{},"没":{"docs":{},"有":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.012389380530973451},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2894317578332448},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.026030368763557483},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.016175071360608945},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.008982035928143712},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.012121212121212121},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":3.3730684326710816},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.010917030567685589},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.4398716672198252},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.019438444924406047},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.046875},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.016245487364620937},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.019823788546255508},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.017699115044247787},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.017142857142857144},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}},"e":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"定":{"docs":{},"义":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"是":{"docs":{},"字":{"docs":{},"典":{"docs":{},"中":{"docs":{},"键":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"f":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.01263537906137184}}}}}}}},")":{"docs":{},"都":{"docs":{},"关":{"docs":{},"联":{"docs":{},"唯":{"docs":{},"一":{"docs":{},"的":{"docs":{},"键":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"些":{"docs":{},"量":{"docs":{},"是":{"docs":{},"不":{"docs":{},"能":{"docs":{},"被":{"docs":{},"修":{"docs":{},"改":{"docs":{},"的":{"docs":{},"。":{"docs":{},"当":{"docs":{},"传":{"docs":{},"入":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"作":{"docs":{},"为":{"docs":{},"输":{"docs":{},"入":{"docs":{},"输":{"docs":{},"出":{"docs":{},"参":{"docs":{},"数":{"docs":{},"时":{"docs":{},",":{"docs":{},"需":{"docs":{},"要":{"docs":{},"在":{"docs":{},"参":{"docs":{},"数":{"docs":{},"前":{"docs":{},"加":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"检":{"docs":{},"查":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"字":{"docs":{},"典":{"docs":{},"中":{"docs":{},"所":{"docs":{},"对":{"docs":{},"应":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"来":{"docs":{},"证":{"docs":{},"明":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"字":{"docs":{},"典":{"docs":{},"确":{"docs":{},"实":{"docs":{},"是":{"docs":{},"被":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"了":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"在":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{},"e":{"docs":{},"d":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"字":{"docs":{},"典":{"docs":{},"中":{"docs":{},"将":{"docs":{},"p":{"docs":{},"e":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"值":{"docs":{},"设":{"docs":{},"为":{"2":{"4":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"字":{"docs":{},"典":{"docs":{},"仍":{"docs":{},"然":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"修":{"docs":{},"改":{"docs":{},"前":{"docs":{},"的":{"docs":{},"值":{"2":{"3":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"元":{"docs":{},"组":{"docs":{},"。":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"键":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},")":{"docs":{},"解":{"docs":{},"读":{"docs":{},"为":{"docs":{},"常":{"docs":{},"量":{"docs":{},"a":{"docs":{},"n":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},",":{"docs":{},"字":{"docs":{},"典":{"docs":{},"的":{"docs":{},"值":{"docs":{},"会":{"docs":{},"被":{"docs":{},"解":{"docs":{},"读":{"docs":{},"为":{"docs":{},"常":{"docs":{},"量":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"形":{"docs":{},"式":{"docs":{},"返":{"docs":{},"回":{"docs":{},",":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"-":{"docs":{},"i":{"docs":{},"n":{"docs":{},"循":{"docs":{},"环":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"显":{"docs":{},"式":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"名":{"docs":{},"称":{"docs":{},"来":{"docs":{},"解":{"docs":{},"读":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"当":{"docs":{},"其":{"docs":{},"不":{"docs":{},"可":{"docs":{},"访":{"docs":{},"问":{"docs":{},"时":{"docs":{},",":{"docs":{},"?":{"docs":{},"之":{"docs":{},"后":{"docs":{},"语":{"docs":{},"句":{"docs":{},"不":{"docs":{},"会":{"docs":{},"执":{"docs":{},"行":{"docs":{},",":{"docs":{},"并":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"值":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"在":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},")":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"是":{"docs":{},"引":{"docs":{},"用":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5555555555555556}}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"称":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}},"可":{"docs":{},"变":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}},"多":{"docs":{},"重":{"docs":{},"输":{"docs":{},"入":{"docs":{},"参":{"docs":{},"数":{"docs":{},"(":{"docs":{},"m":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{},"i":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"函":{"docs":{},"数":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}}},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"参":{"docs":{},"数":{"docs":{},"的":{"docs":{},"外":{"docs":{},"部":{"docs":{},"参":{"docs":{},"数":{"docs":{},"名":{"docs":{},"(":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23255813953488372}}}}}}}}}}}}}}}}}}}},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":3.333333333333333}}}}}}}}}},"(":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0234375}}}}}}}}},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"-":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.01327433628318584}}}}}}}}},"i":{"docs":{},"d":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.04767309875141884},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.025547445255474453},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.01415929203539823},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.01486988847583643},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.021691973969631236},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.017126546146527116},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.011976047904191617},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.01090909090909091},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.038461538461538464},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.05895196506550218},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.027989821882951654},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.016216216216216217},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.012165450121654502},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.04411764705882353},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.01935483870967742},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.02857142857142857},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0380952380952381},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.012958963282937365},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0234375},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.034482758620689655},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.039711191335740074},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.02888086642599278},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.015503875968992248},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.022653721682847898},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.012857142857142857},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"i":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.23377026074700494},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.005714285714285714}},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}}}}}},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}},"或":{"docs":{},"者":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"定":{"docs":{},"义":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"包":{"docs":{},"括":{"docs":{},"只":{"docs":{},"读":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"他":{"docs":{},"们":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"是":{"docs":{},"固":{"docs":{},"定":{"docs":{},"的":{"docs":{},"。":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":2.502183406113537}}}}}}}}}}}}}}},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"是":{"docs":{},"固":{"docs":{},"定":{"docs":{},"的":{"docs":{},"。":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},")":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"常":{"docs":{},"量":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"用":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.004757373929590866}}},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}},"y":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.021897810218978103}},"e":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},",":{"docs":{},"叫":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},",":{"docs":{},"它":{"docs":{},"重":{"docs":{},"写":{"docs":{},"了":{"docs":{},"从":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"类":{"docs":{},"继":{"docs":{},"承":{"docs":{},"来":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"基":{"docs":{},"类":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"基":{"docs":{},"类":{"docs":{},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"对":{"docs":{},"所":{"docs":{},"有":{"docs":{},"车":{"docs":{},"辆":{"docs":{},"都":{"docs":{},"通":{"docs":{},"用":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"和":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"属":{"docs":{},"性":{"docs":{},"在":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"方":{"docs":{},"法":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"中":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"对":{"docs":{},"自":{"docs":{},"行":{"docs":{},"车":{"docs":{},"来":{"docs":{},"说":{"docs":{},"已":{"docs":{},"经":{"docs":{},"是":{"docs":{},"正":{"docs":{},"确":{"docs":{},"的":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"在":{"docs":{},"b":{"docs":{},"i":{"docs":{},"c":{"docs":{},"y":{"docs":{},"c":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"中":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"改":{"docs":{},"变":{"docs":{},"它":{"docs":{},"。":{"docs":{},"而":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}},"的":{"docs":{},"基":{"docs":{},"础":{"docs":{},"上":{"docs":{},"创":{"docs":{},"建":{"docs":{},"起":{"docs":{},"来":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},"你":{"docs":{},"需":{"docs":{},"要":{"docs":{},"将":{"docs":{},"v":{"docs":{},"e":{"docs":{},"h":{"docs":{},"i":{"docs":{},"c":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"为":{"docs":{},"任":{"docs":{},"意":{"docs":{},"的":{"docs":{},"一":{"docs":{},"辆":{"docs":{},"车":{"docs":{},"设":{"docs":{},"置":{"docs":{},"一":{"docs":{},"些":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}},"d":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}},"s":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"2":{"docs":{},"d":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.04844961240310078}},"(":{"docs":{},"x":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.029069767441860465}}}},"对":{"docs":{},"象":{"docs":{},"是":{"docs":{},"否":{"docs":{},"有":{"docs":{},"相":{"docs":{},"等":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"相":{"docs":{},"等":{"docs":{},"的":{"docs":{},"概":{"docs":{},"念":{"docs":{},"就":{"docs":{},"是":{"docs":{},"它":{"docs":{},"们":{"docs":{},"有":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"x":{"docs":{},"值":{"docs":{},"和":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"i":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"单":{"docs":{},"目":{"docs":{},"减":{"docs":{},"运":{"docs":{},"算":{"docs":{},"-":{"docs":{},"a":{"docs":{},",":{"docs":{},"@":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"也":{"docs":{},"是":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"2":{"docs":{},"d":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"需":{"docs":{},"要":{"docs":{},"定":{"docs":{},"义":{"docs":{},"和":{"docs":{},"实":{"docs":{},"现":{"docs":{},"一":{"docs":{},"个":{"docs":{},"中":{"docs":{},"置":{"docs":{},"运":{"docs":{},"算":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"在":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"任":{"docs":{},"意":{"docs":{},"两":{"docs":{},"个":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"2":{"docs":{},"d":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}},"docs":{}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"单":{"docs":{},"目":{"docs":{},"减":{"docs":{},"运":{"docs":{},"算":{"docs":{},"将":{"docs":{},"其":{"docs":{},"x":{"docs":{},"和":{"docs":{},"i":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}},"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.01937984496124031}},".":{"docs":{},"i":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"x":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}},"t":{"docs":{},"o":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}}}}},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.007272727272727273},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.014367816091954023}},"代":{"docs":{},"替":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"k":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},".":{"docs":{},"v":{"docs":{},"o":{"docs":{},"w":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}},"。":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"中":{"docs":{},",":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}},"它":{"docs":{},"其":{"docs":{},"实":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"空":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},"(":{"docs":{},"t":{"docs":{},"u":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}},"?":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"当":{"docs":{},"通":{"docs":{},"过":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"调":{"docs":{},"用":{"docs":{},"方":{"docs":{},"法":{"docs":{},"时":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"总":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"参":{"docs":{},"见":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}},"是":{"docs":{},"空":{"docs":{},"元":{"docs":{},"组":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},")":{"docs":{},"的":{"docs":{},"别":{"docs":{},"名":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"括":{"docs":{},"号":{"docs":{},"内":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"该":{"docs":{},"类":{"docs":{},"型":{"docs":{},"就":{"docs":{},"是":{"docs":{},"括":{"docs":{},"号":{"docs":{},"内":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353}}}}}},"g":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}},"w":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"h":{"1":{"1":{"0":{"0":{"7":{"1":{"7":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},",":{"docs":{},"只":{"docs":{},"在":{"docs":{},"冒":{"docs":{},"号":{"docs":{},"后":{"docs":{},"面":{"docs":{},"写":{"docs":{},"协":{"docs":{},"议":{"docs":{},"或":{"docs":{},"者":{"docs":{},"类":{"docs":{},"名":{"docs":{},"。":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"作":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"队":{"docs":{},"列":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"使":{"docs":{},"你":{"docs":{},"能":{"docs":{},"够":{"docs":{},"要":{"docs":{},"求":{"docs":{},"一":{"docs":{},"个":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"一":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"(":{"docs":{},"或":{"docs":{},")":{"docs":{},"那":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"参":{"docs":{},"数":{"docs":{},"和":{"docs":{},"关":{"docs":{},"联":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"是":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"写":{"docs":{},"一":{"docs":{},"个":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"通":{"docs":{},"过":{"docs":{},"紧":{"docs":{},"随":{"docs":{},"放":{"docs":{},"置":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},",":{"docs":{},"写":{"docs":{},"在":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}},"子":{"docs":{},"句":{"docs":{},"。":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"子":{"docs":{},"句":{"docs":{},"由":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}},"中":{"docs":{},"的":{"docs":{},"要":{"docs":{},"求":{"docs":{},"用":{"docs":{},"于":{"docs":{},"指":{"docs":{},"明":{"docs":{},"该":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"继":{"docs":{},"承":{"docs":{},"自":{"docs":{},"某":{"docs":{},"个":{"docs":{},"类":{"docs":{},"或":{"docs":{},"遵":{"docs":{},"守":{"docs":{},"某":{"docs":{},"个":{"docs":{},"协":{"docs":{},"议":{"docs":{},"或":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},"。":{"docs":{},"尽":{"docs":{},"管":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"子":{"docs":{},"句":{"docs":{},"有":{"docs":{},"助":{"docs":{},"于":{"docs":{},"表":{"docs":{},"达":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"上":{"docs":{},"的":{"docs":{},"简":{"docs":{},"单":{"docs":{},"约":{"docs":{},"束":{"docs":{},"(":{"docs":{},"如":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"l":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.021897810218978103}}}}},"i":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}}},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"条":{"docs":{},"件":{"docs":{},"语":{"docs":{},"句":{"docs":{},"i":{"docs":{},"f":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"不":{"docs":{},"存":{"docs":{},"在":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"的":{"docs":{},"贯":{"docs":{},"穿":{"docs":{},"(":{"docs":{},"n":{"docs":{},"o":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.9090909090909092}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"循":{"docs":{},"环":{"docs":{},"从":{"docs":{},"计":{"docs":{},"算":{"docs":{},"单":{"docs":{},"一":{"docs":{},"条":{"docs":{},"件":{"docs":{},"开":{"docs":{},"始":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"条":{"docs":{},"件":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"会":{"docs":{},"重":{"docs":{},"复":{"docs":{},"运":{"docs":{},"行":{"docs":{},"一":{"docs":{},"系":{"docs":{},"列":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"直":{"docs":{},"到":{"docs":{},"条":{"docs":{},"件":{"docs":{},"变":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"体":{"docs":{},"中":{"docs":{},"调":{"docs":{},"用":{"docs":{},"b":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"k":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"方":{"docs":{},"法":{"docs":{},"块":{"docs":{},"来":{"docs":{},"实":{"docs":{},"现":{"docs":{},"游":{"docs":{},"戏":{"docs":{},"的":{"docs":{},"逻":{"docs":{},"辑":{"docs":{},"。":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"标":{"docs":{},"签":{"docs":{},"名":{"docs":{},"g":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"l":{"docs":{},"o":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"条":{"docs":{},"件":{"docs":{},"判":{"docs":{},"断":{"docs":{},"语":{"docs":{},"句":{"docs":{},"是":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}},"语":{"docs":{},"法":{"docs":{},",":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},"规":{"docs":{},"则":{"docs":{},"适":{"docs":{},"用":{"docs":{},"于":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"循":{"docs":{},"环":{"docs":{},"体":{"docs":{},"和":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"另":{"docs":{},"外":{"docs":{},"一":{"docs":{},"种":{"docs":{},"形":{"docs":{},"式":{"docs":{},"是":{"docs":{},"d":{"docs":{},"o":{"docs":{},"-":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},",":{"docs":{},"它":{"docs":{},"和":{"docs":{},"w":{"docs":{},"h":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"的":{"docs":{},"区":{"docs":{},"别":{"docs":{},"是":{"docs":{},"在":{"docs":{},"判":{"docs":{},"断":{"docs":{},"循":{"docs":{},"环":{"docs":{},"条":{"docs":{},"件":{"docs":{},"之":{"docs":{},"前":{"docs":{},",":{"docs":{},"先":{"docs":{},"执":{"docs":{},"行":{"docs":{},"一":{"docs":{},"次":{"docs":{},"循":{"docs":{},"环":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"块":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"重":{"docs":{},"复":{"docs":{},"循":{"docs":{},"环":{"docs":{},"直":{"docs":{},"到":{"docs":{},"条":{"docs":{},"件":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"运":{"docs":{},"行":{"docs":{},"一":{"docs":{},"系":{"docs":{},"列":{"docs":{},"语":{"docs":{},"句":{"docs":{},"直":{"docs":{},"到":{"docs":{},"条":{"docs":{},"件":{"docs":{},"变":{"docs":{},"成":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"。":{"docs":{},"这":{"docs":{},"类":{"docs":{},"循":{"docs":{},"环":{"docs":{},"适":{"docs":{},"合":{"docs":{},"使":{"docs":{},"用":{"docs":{},"在":{"docs":{},"第":{"docs":{},"一":{"docs":{},"次":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"前":{"docs":{},"迭":{"docs":{},"代":{"docs":{},"次":{"docs":{},"数":{"docs":{},"未":{"docs":{},"知":{"docs":{},"的":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"s":{"docs":{},"p":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.006309148264984227}}}}}}}}},"o":{"docs":{},"s":{"docs":{},"e":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"o":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.012903225806451613}},"g":{"docs":{},"z":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"i":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}}}},"r":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.01696969696969697},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0170316301703163},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}},"<":{"docs":{},"/":{"docs":{},"p":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}},"k":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"d":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}},"x":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"r":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}},"c":{"docs":{},"h":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}},"r":{"docs":{},"m":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}},"v":{"docs":{},"e":{"docs":{},"g":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"b":{"docs":{},"y":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}},"n":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.017948717948717947},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"=":{"docs":{},"\"":{"1":{"6":{"9":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"docs":{}},"docs":{}},"2":{"4":{"3":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"docs":{}},"5":{"2":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}},"docs":{}},"docs":{}},"3":{"8":{"8":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}},"docs":{}},"docs":{}},"docs":{}}},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"两":{"docs":{},"者":{"docs":{},"均":{"docs":{},"为":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}}}},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.007142857142857143},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":2.504366812227074},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"的":{"docs":{},"实":{"docs":{},"际":{"docs":{},"例":{"docs":{},"子":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"名":{"docs":{},"和":{"docs":{},"圆":{"docs":{},"括":{"docs":{},"号":{"docs":{},"的":{"docs":{},"语":{"docs":{},"句":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"写":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"名":{"docs":{},",":{"docs":{},"它":{"docs":{},"就":{"docs":{},"会":{"docs":{},"作":{"docs":{},"为":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"被":{"docs":{},"使":{"docs":{},"用":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"不":{"docs":{},"写":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"或":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}},"(":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"会":{"docs":{},"将":{"docs":{},"新":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"作":{"docs":{},"为":{"docs":{},"固":{"docs":{},"定":{"docs":{},"参":{"docs":{},"数":{"docs":{},"传":{"docs":{},"入":{"docs":{},",":{"docs":{},"在":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"的":{"docs":{},"实":{"docs":{},"现":{"docs":{},"代":{"docs":{},"码":{"docs":{},"中":{"docs":{},"可":{"docs":{},"以":{"docs":{},"为":{"docs":{},"这":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"指":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"不":{"docs":{},"指":{"docs":{},"定":{"docs":{},"则":{"docs":{},"参":{"docs":{},"数":{"docs":{},"仍":{"docs":{},"然":{"docs":{},"可":{"docs":{},"用":{"docs":{},",":{"docs":{},"这":{"docs":{},"时":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"名":{"docs":{},"称":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"将":{"docs":{},"表":{"docs":{},"示":{"docs":{},"新":{"docs":{},"值":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"p":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}},"初":{"docs":{},"始":{"docs":{},"名":{"docs":{},"为":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"初":{"docs":{},"始":{"docs":{},"名":{"docs":{},"为":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"只":{"docs":{},"有":{"docs":{},"在":{"docs":{},"变":{"docs":{},"量":{"docs":{},"或":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"被":{"docs":{},"改":{"docs":{},"变":{"docs":{},"之":{"docs":{},"前":{"docs":{},"运":{"docs":{},"行":{"docs":{},"。":{"docs":{},"新":{"docs":{},"的":{"docs":{},"值":{"docs":{},"作":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"常":{"docs":{},"量":{"docs":{},"经":{"docs":{},"过":{"docs":{},"过":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"-":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.006012024048096192}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"改":{"docs":{},"变":{"docs":{},"它":{"docs":{},"。":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"监":{"docs":{},"视":{"docs":{},"器":{"docs":{},"在":{"docs":{},"变":{"docs":{},"量":{"docs":{},"或":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"被":{"docs":{},"改":{"docs":{},"变":{"docs":{},"后":{"docs":{},"立":{"docs":{},"即":{"docs":{},"运":{"docs":{},"行":{"docs":{},"。":{"docs":{},"和":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"时":{"docs":{},",":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"语":{"docs":{},"句":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"。":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},",":{"docs":{},"在":{"docs":{},"你":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"语":{"docs":{},"句":{"docs":{},"时":{"docs":{},",":{"docs":{},"w":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.009689922480620155}},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"所":{"docs":{},"能":{"docs":{},"承":{"docs":{},"载":{"docs":{},"的":{"docs":{},"最":{"docs":{},"大":{"docs":{},"值":{"2":{"5":{"5":{"docs":{},"(":{"docs":{},"二":{"docs":{},"进":{"docs":{},"制":{"1":{"1":{"1":{"1":{"1":{"1":{"1":{"1":{"docs":{},")":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"用":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},";":{"docs":{},"+":{"docs":{},"加":{"1":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"就":{"docs":{},"无":{"docs":{},"法":{"docs":{},"表":{"docs":{},"达":{"docs":{},"这":{"docs":{},"个":{"docs":{},"新":{"docs":{},"值":{"docs":{},"的":{"docs":{},"二":{"docs":{},"进":{"docs":{},"制":{"docs":{},"了":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"导":{"docs":{},"致":{"docs":{},"了":{"docs":{},"这":{"docs":{},"个":{"docs":{},"新":{"docs":{},"值":{"docs":{},"上":{"docs":{},"溢":{"docs":{},"出":{"docs":{},"了":{"docs":{},",":{"docs":{},"大":{"docs":{},"家":{"docs":{},"可":{"docs":{},"以":{"docs":{},"看":{"docs":{},"下":{"docs":{},"图":{"docs":{},"。":{"docs":{},"溢":{"docs":{},"出":{"docs":{},"后":{"docs":{},",":{"docs":{},"新":{"docs":{},"值":{"docs":{},"在":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"8":{"docs":{},"的":{"docs":{},"承":{"docs":{},"载":{"docs":{},"范":{"docs":{},"围":{"docs":{},"内":{"docs":{},"的":{"docs":{},"那":{"docs":{},"部":{"docs":{},"分":{"docs":{},"是":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{"docs":{},",":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"0":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}},"docs":{}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}},"docs":{}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}},"docs":{}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.009689922480620155}}}}}}}}}}}},"d":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.01327433628318584}}}}}}}},"s":{"docs":{},"e":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}}}}},"h":{"docs":{},"h":{"docs":{},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"y":{"docs":{},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"a":{"docs":{},"y":{"docs":{},"(":{"docs":{},"b":{"docs":{},"i":{"docs":{},"r":{"docs":{},"t":{"docs":{},"h":{"docs":{},"d":{"docs":{},"a":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"b":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"的":{"docs":{},"形":{"docs":{},"参":{"docs":{},"c":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"b":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},",":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"d":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"j":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.006060606060606061}}}}}},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.4675405214940099},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}},"i":{"docs":{},"n":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.8746542759154774}}}},",":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},",":{"docs":{},"b":{"docs":{},"y":{"docs":{},"等":{"docs":{},"等":{"docs":{},"。":{"docs":{},"前":{"docs":{},"面":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"类":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"b":{"docs":{},"y":{"docs":{},"方":{"docs":{},"法":{"docs":{},"就":{"docs":{},"是":{"docs":{},"这":{"docs":{},"样":{"docs":{},"的":{"docs":{},"。":{"docs":{},"介":{"docs":{},"词":{"docs":{},"的":{"docs":{},"使":{"docs":{},"用":{"docs":{},"让":{"docs":{},"方":{"docs":{},"法":{"docs":{},"在":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},"能":{"docs":{},"像":{"docs":{},"一":{"docs":{},"个":{"docs":{},"句":{"docs":{},"子":{"docs":{},"一":{"docs":{},"样":{"docs":{},"被":{"docs":{},"解":{"docs":{},"读":{"docs":{},"。":{"docs":{},"和":{"docs":{},"函":{"docs":{},"数":{"docs":{},"参":{"docs":{},"数":{"docs":{},"不":{"docs":{},"同":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}},"e":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"l":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0072992700729927005}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.005309734513274336}},"e":{"docs":{},"变":{"docs":{},"量":{"docs":{},"添":{"docs":{},"加":{"docs":{},"了":{"docs":{},"类":{"docs":{},"型":{"docs":{},"标":{"docs":{},"注":{"docs":{},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"这":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},"可":{"docs":{},"以":{"docs":{},"存":{"docs":{},"储":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}},"a":{"docs":{},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.010466222645099905}}},"k":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.005506607929515419},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"或":{"docs":{},"者":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"和":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},"(":{"docs":{},"如":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"或":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256}}}},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}},"x":{"2":{"4":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.045454545454545456},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.007079646017699115},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.016175071360608945},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.022900763358778626},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.012165450121654502},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.009191176470588236},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.008639308855291577},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.009689922480620155},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.012944983818770227},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.01762114537444934},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.035398230088495575},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.015772870662460567},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.006779661016949152}},"i":{"docs":{},"e":{"docs":{},"h":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"a":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"w":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}}}}}}}}}}}},".":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"u":{"docs":{},"f":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"p":{"docs":{},"e":{"docs":{},"p":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},",":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"n":{"docs":{},"将":{"docs":{},"会":{"docs":{},"输":{"docs":{},"出":{"docs":{},"内":{"docs":{},"容":{"docs":{},"到":{"docs":{},"“":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"”":{"docs":{},"面":{"docs":{},"板":{"docs":{},"上":{"docs":{},"。":{"docs":{},"(":{"docs":{},"另":{"docs":{},"一":{"docs":{},"种":{"docs":{},"函":{"docs":{},"数":{"docs":{},"叫":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"n":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"n":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}},"-":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}}}},"和":{"docs":{},"y":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}},"的":{"docs":{},"占":{"docs":{},"位":{"docs":{},"符":{"docs":{},",":{"docs":{},"用":{"docs":{},"于":{"docs":{},"临":{"docs":{},"时":{"docs":{},"获":{"docs":{},"取":{"docs":{},"元":{"docs":{},"组":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}},"y":{"docs":{},"e":{"docs":{},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"两":{"docs":{},"个":{"docs":{},"值":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"常":{"docs":{},"量":{"docs":{},"被":{"docs":{},"用":{"docs":{},"作":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"一":{"docs":{},"部":{"docs":{},"分":{"docs":{},",":{"docs":{},"从":{"docs":{},"而":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"动":{"docs":{},"态":{"docs":{},"的":{"docs":{},"过":{"docs":{},"滤":{"docs":{},"器":{"docs":{},"(":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},"。":{"docs":{},"当":{"docs":{},"且":{"docs":{},"仅":{"docs":{},"当":{"docs":{},"w":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"条":{"docs":{},"件":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"y":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}},"和":{"docs":{},"z":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"三":{"docs":{},"者":{"docs":{},"均":{"docs":{},"为":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}},"都":{"docs":{},"指":{"docs":{},"的":{"docs":{},"是":{"docs":{},"名":{"docs":{},"称":{"docs":{},"为":{"docs":{},"x":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}},"相":{"docs":{},"加":{"docs":{},",":{"docs":{},"把":{"docs":{},"向":{"docs":{},"量":{"docs":{},"的":{"docs":{},"y":{"docs":{},"相":{"docs":{},"减":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"他":{"docs":{},"实":{"docs":{},"际":{"docs":{},"是":{"docs":{},"属":{"docs":{},"于":{"docs":{},"加":{"docs":{},"减":{"docs":{},"运":{"docs":{},"算":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"让":{"docs":{},"它":{"docs":{},"保":{"docs":{},"持":{"docs":{},"了":{"docs":{},"和":{"docs":{},"加":{"docs":{},"法":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"结":{"docs":{},"合":{"docs":{},"性":{"docs":{},"和":{"docs":{},"优":{"docs":{},"先":{"docs":{},"级":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"t":{"docs":{},"和":{"1":{"4":{"0":{"docs":{},")":{"docs":{},"。":{"docs":{},"查":{"docs":{},"阅":{"docs":{},"完":{"docs":{},"整":{"docs":{},"的":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}},"没":{"docs":{},"有":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"y":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}},"y":{"1":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"2":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.019980970504281638},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.013100436681222707},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.035623409669211195},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.009732360097323601},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.009191176470588236},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.008639308855291577},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.014367816091954023},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.03682170542635659},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.012114537444933921},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.02654867256637168},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.008571428571428572},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.030612244897959183},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.006779661016949152}},"a":{"docs":{},"n":{"docs":{},"k":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}},"e":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}},"a":{"docs":{},"h":{"docs":{},"d":{"docs":{},"o":{"docs":{},"n":{"docs":{},"g":{"docs":{},"c":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728}}}}}}}}}},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}},"t":{"docs":{},"a":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}}}}}}}}}}}},"o":{"docs":{},"u":{"docs":{},"k":{"docs":{},"u":{"docs":{},"g":{"docs":{},"e":{"docs":{},"m":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}},"'":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}},"u":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"i":{"docs":{},"a":{"docs":{},"n":{"docs":{},"x":{"docs":{},"i":{"docs":{},"a":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}}}}}}}}}}}},")":{"docs":{},"声":{"docs":{},"明":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"以":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"余":{"docs":{},"下":{"docs":{},"所":{"docs":{},"有":{"docs":{},"值":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},"。":{"docs":{},"这":{"docs":{},"使":{"docs":{},"得":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"将":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"一":{"docs":{},"个":{"docs":{},"横":{"docs":{},"坐":{"docs":{},"标":{"docs":{},"为":{"0":{"docs":{},"的":{"docs":{},"点":{"docs":{},",":{"docs":{},"并":{"docs":{},"把":{"docs":{},"这":{"docs":{},"个":{"docs":{},"点":{"docs":{},"的":{"docs":{},"纵":{"docs":{},"坐":{"docs":{},"标":{"docs":{},"赋":{"docs":{},"给":{"docs":{},"临":{"docs":{},"时":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"y":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}},":":{"docs":{},"和":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}},"中":{"docs":{},"的":{"docs":{},"元":{"docs":{},"组":{"docs":{},"模":{"docs":{},"式":{"docs":{},",":{"docs":{},"只":{"docs":{},"要":{"docs":{},"某":{"docs":{},"个":{"docs":{},"元":{"docs":{},"组":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"包":{"docs":{},"含":{"docs":{},"两":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"且":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"元":{"docs":{},"素":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"分":{"docs":{},"配":{"docs":{},"到":{"docs":{},"各":{"docs":{},"个":{"docs":{},"标":{"docs":{},"识":{"docs":{},"符":{"docs":{},"模":{"docs":{},"式":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"种":{"docs":{},"行":{"docs":{},"为":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"语":{"docs":{},"句":{"docs":{},"中":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"元":{"docs":{},"组":{"docs":{},"(":{"1":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}},"docs":{}}}}}}}}},"-":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}},"上":{"docs":{},",":{"docs":{},"是":{"docs":{},"否":{"docs":{},"在":{"docs":{},"紫":{"docs":{},"色":{"docs":{},"的":{"docs":{},"对":{"docs":{},"角":{"docs":{},"线":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}}}}}}}}}}},"是":{"docs":{},"错":{"docs":{},"误":{"docs":{},"代":{"docs":{},"码":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}},"z":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.006309148264984227},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"a":{"docs":{},"c":{"1":{"docs":{},"s":{"docs":{},"t":{"1":{"docs":{},"k":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888}}}},"docs":{}}}},"docs":{}}},"q":{"5":{"4":{"docs":{},"z":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"n":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}},"docs":{}},"docs":{},"p":{"docs":{"index.html#gitbook_737":{"ref":"index.html#gitbook_737","tf":0.013888888888888888},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0048484848484848485},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}},"a":{"5":{"1":{"6":{"docs":{},"a":{"docs":{},"f":{"6":{"docs":{},"a":{"5":{"3":{"1":{"docs":{},"a":{"1":{"0":{"4":{"docs":{},"e":{"docs":{},"c":{"8":{"8":{"docs":{},"d":{"docs":{},"a":{"0":{"docs":{},"d":{"2":{"3":{"6":{"docs":{},"e":{"docs":{},"c":{"docs":{},"f":{"3":{"8":{"9":{"docs":{},"a":{"5":{"docs":{},"e":{"docs":{},"c":{"7":{"2":{"docs":{},"a":{"docs":{},"f":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}},"docs":{}},"docs":{}}}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}}}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}},"docs":{}},"docs":{}}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}},"docs":{}},"docs":{}},"docs":{},"r":{"docs":{},"c":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.02666666666666667}},")":{"docs":{},"这":{"docs":{},"一":{"docs":{},"机":{"docs":{},"制":{"docs":{},"来":{"docs":{},"跟":{"docs":{},"踪":{"docs":{},"和":{"docs":{},"管":{"docs":{},"理":{"docs":{},"你":{"docs":{},"的":{"docs":{},"应":{"docs":{},"用":{"docs":{},"程":{"docs":{},"序":{"docs":{},"的":{"docs":{},"内":{"docs":{},"存":{"docs":{},"。":{"docs":{},"通":{"docs":{},"常":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"a":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.00842358604091456},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}},":":{"docs":{},"≈":{"docs":{},"r":{"docs":{},"a":{"docs":{},"d":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"y":{"3":{"docs":{},"d":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}},"[":{"0":{"docs":{},"]":{"docs":{},"是":{"docs":{},"指":{"docs":{},"[":{"docs":{},"[":{"1":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}},"docs":{}}}}}}},"docs":{}}}},"docs":{},"和":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}}}}}}}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"这":{"docs":{},"样":{"docs":{},"的":{"docs":{},"形":{"docs":{},"式":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}},"替":{"docs":{},"代":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"类":{"docs":{},"型":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"形":{"docs":{},"参":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"a":{"docs":{},"i":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"s":{"docs":{},".":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}},"类":{"docs":{},"型":{"docs":{},"还":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"以":{"docs":{},"创":{"docs":{},"建":{"docs":{},"特":{"docs":{},"定":{"docs":{},"大":{"docs":{},"小":{"docs":{},"并":{"docs":{},"且":{"docs":{},"所":{"docs":{},"有":{"docs":{},"数":{"docs":{},"据":{"docs":{},"都":{"docs":{},"被":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"方":{"docs":{},"法":{"docs":{},"。":{"docs":{},"我":{"docs":{},"们":{"docs":{},"可":{"docs":{},"以":{"docs":{},"把":{"docs":{},"准":{"docs":{},"备":{"docs":{},"加":{"docs":{},"入":{"docs":{},"新":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"项":{"docs":{},"数":{"docs":{},"量":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"和":{"docs":{},"适":{"docs":{},"当":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"p":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"m":{"docs":{},"a":{"docs":{},"p":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}},"更":{"docs":{},"多":{"docs":{},"限":{"docs":{},"制":{"docs":{},"的":{"docs":{},"集":{"docs":{},"合":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"数":{"docs":{},"组":{"docs":{},"可":{"docs":{},"以":{"docs":{},"允":{"docs":{},"许":{"docs":{},"其":{"docs":{},"里":{"docs":{},"面":{"docs":{},"任":{"docs":{},"何":{"docs":{},"位":{"docs":{},"置":{"docs":{},"的":{"docs":{},"插":{"docs":{},"入":{"docs":{},"/":{"docs":{},"删":{"docs":{},"除":{"docs":{},"操":{"docs":{},"作":{"docs":{},",":{"docs":{},"而":{"docs":{},"栈":{"docs":{},",":{"docs":{},"只":{"docs":{},"允":{"docs":{},"许":{"docs":{},"在":{"docs":{},"集":{"docs":{},"合":{"docs":{},"的":{"docs":{},"末":{"docs":{},"端":{"docs":{},"添":{"docs":{},"加":{"docs":{},"新":{"docs":{},"的":{"docs":{},"项":{"docs":{},"(":{"docs":{},"如":{"docs":{},"同":{"docs":{},"p":{"docs":{},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"值":{"docs":{},"进":{"docs":{},"栈":{"docs":{},")":{"docs":{},"。":{"docs":{},"同":{"docs":{},"样":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"栈":{"docs":{},"也":{"docs":{},"只":{"docs":{},"能":{"docs":{},"从":{"docs":{},"末":{"docs":{},"端":{"docs":{},"移":{"docs":{},"除":{"docs":{},"项":{"docs":{},"(":{"docs":{},"如":{"docs":{},"同":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"和":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"行":{"docs":{},"为":{"docs":{},"要":{"docs":{},"比":{"docs":{},"字":{"docs":{},"典":{"docs":{},"(":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"的":{"docs":{},"多":{"docs":{},"。":{"docs":{},"当":{"docs":{},"操":{"docs":{},"作":{"docs":{},"数":{"docs":{},"组":{"docs":{},"内":{"docs":{},"容":{"docs":{},"时":{"docs":{},",":{"docs":{},"数":{"docs":{},"组":{"docs":{},"(":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},")":{"docs":{},"能":{"docs":{},"提":{"docs":{},"供":{"docs":{},"接":{"docs":{},"近":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"和":{"docs":{},"字":{"docs":{},"典":{"docs":{},"(":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"i":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}},"性":{"docs":{},"质":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"存":{"docs":{},"储":{"docs":{},"值":{"docs":{},"。":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"提":{"docs":{},"供":{"docs":{},"两":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},":":{"docs":{},"p":{"docs":{},"u":{"docs":{},"s":{"docs":{},"h":{"docs":{},"和":{"docs":{},"p":{"docs":{},"o":{"docs":{},"p":{"docs":{},",":{"docs":{},"从":{"docs":{},"栈":{"docs":{},"中":{"docs":{},"压":{"docs":{},"进":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"和":{"docs":{},"移":{"docs":{},"除":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"方":{"docs":{},"法":{"docs":{},"标":{"docs":{},"记":{"docs":{},"为":{"docs":{},"可":{"docs":{},"变":{"docs":{},"的":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"们":{"docs":{},"需":{"docs":{},"要":{"docs":{},"修":{"docs":{},"改":{"docs":{},"(":{"docs":{},"或":{"docs":{},"转":{"docs":{},"换":{"docs":{},")":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"<":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"a":{"docs":{},"y":{"docs":{},"<":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}}},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}},"g":{"docs":{},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5585495675316035},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.013215859030837005},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}}}}}}},"y":{"docs":{},"r":{"docs":{},"i":{"docs":{},"o":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"m":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}},"i":{"docs":{},"c":{"docs":{},"m":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"(":{"1":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}},"3":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}},"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"/":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"t":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801}}}}}}}},"docs":{}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{},"e":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{},"s":{"docs":{},"h":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}}}}}},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"s":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}},"o":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}},"x":{"docs":{},"o":{"docs":{},"r":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}}}}}}}},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"s":{"docs":{},"i":{"docs":{},"g":{"docs":{},"n":{"docs":{},"e":{"docs":{},"d":{"docs":{},"s":{"docs":{},"u":{"docs":{},"b":{"docs":{},"t":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"2":{"docs":{},"x":{"docs":{},".":{"docs":{},"p":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"docs":{}}}}}}}}}}}}}}}}},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.017278617710583154}}}}}}},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}},"i":{"docs":{},"c":{"docs":{},".":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.010948905109489052}},"的":{"docs":{},"s":{"docs":{},"p":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},"就":{"docs":{},"会":{"docs":{},"自":{"docs":{},"动":{"docs":{},"地":{"docs":{},"设":{"docs":{},"置":{"docs":{},"g":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"为":{"docs":{},"新":{"docs":{},"的":{"docs":{},"速":{"docs":{},"度":{"docs":{},"选":{"docs":{},"择":{"docs":{},"一":{"docs":{},"个":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"挡":{"docs":{},"位":{"docs":{},"。":{"docs":{},"具":{"docs":{},"体":{"docs":{},"来":{"docs":{},"说":{"docs":{},"就":{"docs":{},"是":{"docs":{},",":{"docs":{},"属":{"docs":{},"性":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},"将":{"docs":{},"新":{"docs":{},"的":{"docs":{},"速":{"docs":{},"度":{"docs":{},"值":{"docs":{},"除":{"docs":{},"以":{"1":{"0":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"向":{"docs":{},"下":{"docs":{},"取":{"docs":{},"得":{"docs":{},"最":{"docs":{},"接":{"docs":{},"近":{"docs":{},"的":{"docs":{},"整":{"docs":{},"数":{"docs":{},"值":{"docs":{},",":{"docs":{},"最":{"docs":{},"后":{"docs":{},"加":{"1":{"docs":{},"来":{"docs":{},"得":{"docs":{},"到":{"docs":{},"档":{"docs":{},"位":{"docs":{},"g":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"速":{"docs":{},"度":{"docs":{},"为":{"1":{"0":{"docs":{},".":{"0":{"docs":{},"时":{"docs":{},",":{"docs":{},"挡":{"docs":{},"位":{"docs":{},"为":{"1":{"docs":{},";":{"docs":{},"速":{"docs":{},"度":{"docs":{},"为":{"3":{"5":{"docs":{},".":{"0":{"docs":{},"时":{"docs":{},",":{"docs":{},"挡":{"docs":{},"位":{"docs":{},"为":{"4":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}},"docs":{}}}}}}},"docs":{}}},"docs":{}},"docs":{}}}}}},"docs":{}}}}}}},"docs":{}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"是":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},"。":{"docs":{},"a":{"docs":{},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"表":{"docs":{},"示":{"docs":{},"自":{"docs":{},"动":{"docs":{},"挡":{"docs":{},"汽":{"docs":{},"车":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"根":{"docs":{},"据":{"docs":{},"当":{"docs":{},"前":{"docs":{},"的":{"docs":{},"速":{"docs":{},"度":{"docs":{},"自":{"docs":{},"动":{"docs":{},"选":{"docs":{},"择":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"挡":{"docs":{},"位":{"docs":{},"。":{"docs":{},"a":{"docs":{},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"c":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"也":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"定":{"docs":{},"制":{"docs":{},"的":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.029850746268656716},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"见":{"docs":{},"类":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"章":{"docs":{},"节":{"docs":{},")":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"自":{"docs":{},"动":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"函":{"docs":{},"数":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"特":{"docs":{},"定":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"上":{"docs":{},"的":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"而":{"docs":{},"非":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"本":{"docs":{},"身":{"docs":{},"。":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"u":{"docs":{},"t":{"docs":{},"o":{"docs":{},"_":{"docs":{},"c":{"docs":{},"l":{"docs":{},"o":{"docs":{},"s":{"docs":{},"u":{"docs":{},"r":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"来":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"很":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{},"s":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},"e":{"docs":{},".":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"别":{"docs":{},"名":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"是":{"docs":{},"别":{"docs":{},"名":{"docs":{},",":{"docs":{},"a":{"docs":{},"u":{"docs":{},"d":{"docs":{},"i":{"docs":{},"o":{"docs":{},"s":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},".":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"是":{"docs":{},"u":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"1":{"6":{"docs":{},".":{"docs":{},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"会":{"docs":{},"给":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"i":{"docs":{},"t":{"docs":{},"u":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"d":{"docs":{},"赋":{"docs":{},"一":{"docs":{},"个":{"docs":{},"初":{"docs":{},"值":{"0":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.010917030567685589}},".":{"docs":{},"m":{"docs":{},"a":{"docs":{},"x":{"docs":{},"i":{"docs":{},"n":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"l":{"docs":{},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}}}}}}}}}}},"也":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"表":{"docs":{},"示":{"docs":{},"立":{"docs":{},"体":{"docs":{},"声":{"docs":{},"系":{"docs":{},"统":{"docs":{},"的":{"docs":{},"两":{"docs":{},"个":{"docs":{},"声":{"docs":{},"道":{"docs":{},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{},"和":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"j":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"(":{"4":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}},".":{"docs":{},".":{"docs":{},"b":{"docs":{},")":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"包":{"docs":{},"含":{"docs":{},"从":{"docs":{},"a":{"docs":{},"到":{"docs":{},"b":{"docs":{},"(":{"docs":{},"包":{"docs":{},"括":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}},"b":{"docs":{},"和":{"docs":{},"a":{"docs":{},".":{"docs":{},".":{"docs":{},".":{"docs":{},"b":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}},")":{"docs":{},"定":{"docs":{},"义":{"docs":{},"一":{"docs":{},"个":{"docs":{},"从":{"docs":{},"a":{"docs":{},"到":{"docs":{},"b":{"docs":{},"但":{"docs":{},"不":{"docs":{},"包":{"docs":{},"括":{"docs":{},"b":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0234375}},"e":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}},"t":{"1":{"docs":{},"s":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}}}}}}}}}}},"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.024163568773234202}},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.005309734513274336}},"e":{"docs":{},"r":{"docs":{},"常":{"docs":{},"量":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"i":{"docs":{},"f":{"docs":{},"语":{"docs":{},"句":{"docs":{},"的":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"分":{"docs":{},"支":{"docs":{},"中":{"docs":{},"使":{"docs":{},"用":{"docs":{},"。":{"docs":{},"它":{"docs":{},"已":{"docs":{},"经":{"docs":{},"被":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"包":{"docs":{},"含":{"docs":{},"的":{"docs":{},"值":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"过":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"再":{"docs":{},"使":{"docs":{},"用":{"docs":{},"!":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"它":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},",":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"u":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"才":{"docs":{},"会":{"docs":{},"被":{"docs":{},"执":{"docs":{},"行":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}}}}},"d":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},"o":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"e":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}},"t":{"docs":{},"w":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.007272727272727273}},"s":{"docs":{},"(":{"docs":{},"a":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}},",":{"docs":{},"并":{"docs":{},"输":{"docs":{},"出":{"docs":{},"结":{"docs":{},"果":{"docs":{},":":{"8":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}},"docs":{}}}}}}}}}}}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"(":{"4":{"docs":{},")":{"docs":{},"(":{"5":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}}}},"docs":{},"a":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}},"e":{"docs":{},"r":{"docs":{},"(":{"docs":{},"b":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.022222222222222223}},"。":{"docs":{},"它":{"docs":{},"有":{"docs":{},"三":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"?":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"前":{"docs":{},"面":{"docs":{},"两":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"中":{"docs":{},"的":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}},"还":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"?":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"检":{"docs":{},"查":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"有":{"docs":{},"值":{"docs":{},"则":{"docs":{},"将":{"docs":{},"其":{"docs":{},"返":{"docs":{},"回":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"如":{"docs":{},"果":{"docs":{},"b":{"docs":{},"u":{"docs":{},"i":{"docs":{},"l":{"docs":{},"d":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"设":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"实":{"docs":{},"例":{"docs":{},"来":{"docs":{},"作":{"docs":{},"为":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},".":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"并":{"docs":{},"为":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"的":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}},"j":{"docs":{},"u":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00681044267877412}}}}}},"v":{"docs":{},"a":{"docs":{},"n":{"docs":{},"c":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251}},"e":{"docs":{},"t":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286}}}}}},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.008982035928143712},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.007633587786259542},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.006016847172081829}},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"并":{"docs":{},"存":{"docs":{},"储":{"docs":{},"了":{"docs":{},"该":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"副":{"docs":{},"本":{"docs":{},",":{"docs":{},"而":{"docs":{},"该":{"docs":{},"副":{"docs":{},"本":{"docs":{},"随":{"docs":{},"着":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"或":{"docs":{},"者":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"来":{"docs":{},"声":{"docs":{},"明":{"docs":{},"在":{"docs":{},"嵌":{"docs":{},"入":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"表":{"docs":{},"示":{"docs":{},"每":{"docs":{},"次":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"被":{"docs":{},"调":{"docs":{},"用":{"docs":{},"时":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"o":{"docs":{},"p":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364}}}}}}},"和":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},"s":{"docs":{},"。":{"docs":{},"默":{"docs":{},"认":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}},"当":{"docs":{},"作":{"docs":{},"一":{"docs":{},"个":{"docs":{},"局":{"docs":{},"部":{"docs":{},"名":{"docs":{},"称":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"把":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"p":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.011627906976744186},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.00881057268722467},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.006309148264984227},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},";":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0072992700729927005},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}},";":{"docs":{},"和":{"docs":{},"|":{"docs":{},"|":{"docs":{},"的":{"docs":{},"复":{"docs":{},"合":{"docs":{},"逻":{"docs":{},"辑":{"docs":{},"。":{"docs":{},"但":{"docs":{},"无":{"docs":{},"论":{"docs":{},"怎":{"docs":{},"样":{"docs":{},",":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},";":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"/":{"docs":{},"和":{"docs":{},"&":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},";":{"docs":{},"%":{"docs":{},"进":{"docs":{},"行":{"docs":{},"除":{"0":{"docs":{},"操":{"docs":{},"作":{"docs":{},"时":{"docs":{},"就":{"docs":{},"会":{"docs":{},"得":{"docs":{},"到":{"0":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}}}}}}}}},"docs":{}}}}}}}}}}}}}},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"e":{"docs":{},"r":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635}},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"这":{"docs":{},"样":{"docs":{},"的":{"docs":{},"格":{"docs":{},"式":{"docs":{},"进":{"docs":{},"行":{"docs":{},"组":{"docs":{},"合":{"docs":{},",":{"docs":{},"称":{"docs":{},"为":{"docs":{},"协":{"docs":{},"议":{"docs":{},"合":{"docs":{},"成":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}}},"e":{"docs":{},"m":{"docs":{},"p":{"docs":{},"t":{"docs":{},"y":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.006507592190889371}}}}}}}}}}},"w":{"docs":{},"o":{"docs":{},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}}}}}}},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}},"e":{"docs":{},"r":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"c":{"2":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}},"docs":{}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.009696969696969697},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.01444043321299639}}}}},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"h":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646}}}}},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}},"n":{"docs":{},"y":{"docs":{},"m":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"y":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"m":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"(":{"docs":{},"[":{"1":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"docs":{}}}}}}}}}}}}}}}}},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.01079913606911447},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}},"可":{"docs":{},"以":{"docs":{},"代":{"docs":{},"表":{"docs":{},"任":{"docs":{},"何":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}},"可":{"docs":{},"以":{"docs":{},"表":{"docs":{},"示":{"docs":{},"任":{"docs":{},"何":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"除":{"docs":{},"了":{"docs":{},"方":{"docs":{},"法":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}}}}}}}}},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}},"a":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801}}}},"i":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}},"s":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}},"s":{"docs":{},"w":{"docs":{},"e":{"docs":{},"r":{"1":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}},"2":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}},"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}}}},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976}}}}}}},"p":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.004540295119182747},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.013015184381778741}},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.017142857142857144},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}},"u":{"docs":{},"m":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},",":{"docs":{},"插":{"docs":{},"入":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},",":{"docs":{},"删":{"docs":{},"除":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"或":{"docs":{},"者":{"docs":{},"使":{"docs":{},"用":{"docs":{},"范":{"docs":{},"围":{"docs":{},"下":{"docs":{},"标":{"docs":{},"(":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646}}}}}}},"方":{"docs":{},"法":{"docs":{},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}},"s":{"docs":{},",":{"docs":{},"它":{"docs":{},"一":{"docs":{},"般":{"docs":{},"接":{"docs":{},"收":{"docs":{},"一":{"docs":{},"个":{"docs":{},"a":{"docs":{},"n":{"docs":{},"y":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.02095238095238095}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}}},"实":{"docs":{},"例":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"叫":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"并":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"的":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"来":{"docs":{},"自":{"docs":{},"于":{"docs":{},"变":{"docs":{},"量":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"7":{"3":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"断":{"docs":{},"开":{"docs":{},"这":{"docs":{},"个":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"再":{"docs":{},"也":{"docs":{},"没":{"docs":{},"有":{"docs":{},"指":{"docs":{},"向":{"docs":{},"a":{"docs":{},"p":{"docs":{},"a":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.007079646017699115},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.007692307692307693},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.007220216606498195}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}},"e":{"docs":{},"s":{"docs":{},"的":{"docs":{},"字":{"docs":{},"典":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"储":{"docs":{},"存":{"docs":{},"了":{"docs":{},"四":{"docs":{},"个":{"docs":{},"人":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"和":{"docs":{},"年":{"docs":{},"龄":{"docs":{},"。":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"字":{"docs":{},"典":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"予":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{},"e":{"docs":{},"d":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"的":{"docs":{},"新":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"同":{"docs":{},"时":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"在":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"的":{"docs":{},"过":{"docs":{},"程":{"docs":{},"中":{"docs":{},"被":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"。":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"结":{"docs":{},"束":{"docs":{},"后":{"docs":{},",":{"docs":{},"a":{"docs":{},"g":{"docs":{},"e":{"docs":{},"s":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"p":{"docs":{},"i":{"docs":{},"e":{"docs":{},"d":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"a":{"docs":{},"s":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"就":{"docs":{},"是":{"docs":{},"给":{"docs":{},"现":{"docs":{},"有":{"docs":{},"类":{"docs":{},"型":{"docs":{},"定":{"docs":{},"义":{"docs":{},"另":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"字":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"a":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"k":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}},"g":{"docs":{},"n":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}},"e":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}},"e":{"docs":{},"x":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.006472491909385114}}}},"s":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"b":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809}}}}}}}}}}}}}}}},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.007692307692307693}}},"y":{"docs":{},".":{"docs":{},"f":{"docs":{},"r":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}},"的":{"docs":{},"新":{"docs":{},"常":{"docs":{},"量":{"docs":{},",":{"docs":{},"同":{"docs":{},"时":{"docs":{},"对":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"o":{"docs":{},"t":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}},"m":{"docs":{},"i":{"docs":{},"n":{"docs":{},"u":{"docs":{},"s":{"docs":{},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}},"=":{"docs":{},"\"":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0072992700729927005}}}}}}}}}}},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.005415162454873646}},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"o":{"docs":{},"f":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}},"的":{"docs":{},"泛":{"docs":{},"型":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"检":{"docs":{},"查":{"docs":{},"是":{"docs":{},"否":{"docs":{},"两":{"docs":{},"个":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"单":{"docs":{},"例":{"docs":{},"包":{"docs":{},"含":{"docs":{},"具":{"docs":{},"有":{"docs":{},"相":{"docs":{},"同":{"docs":{},"顺":{"docs":{},"序":{"docs":{},"的":{"docs":{},"相":{"docs":{},"同":{"docs":{},"元":{"docs":{},"素":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"到":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"的":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},"e":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"首":{"docs":{},"先":{"docs":{},"检":{"docs":{},"查":{"docs":{},"两":{"docs":{},"个":{"docs":{},"容":{"docs":{},"器":{"docs":{},"是":{"docs":{},"否":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"同":{"docs":{},"样":{"docs":{},"数":{"docs":{},"目":{"docs":{},"的":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"s":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"数":{"docs":{},"目":{"docs":{},"不":{"docs":{},"同":{"docs":{},",":{"docs":{},"没":{"docs":{},"有":{"docs":{},"办":{"docs":{},"法":{"docs":{},"进":{"docs":{},"行":{"docs":{},"匹":{"docs":{},"配":{"docs":{},",":{"docs":{},"函":{"docs":{},"数":{"docs":{},"就":{"docs":{},"会":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"w":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},"(":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"i":{"docs":{},"s":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"d":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{},"(":{"docs":{},"r":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811}}}}}}}}}}}}}}}}}}}}}}}}},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"写":{"docs":{},"一":{"docs":{},"个":{"docs":{},"断":{"docs":{},"言":{"docs":{},"。":{"docs":{},"向":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"函":{"docs":{},"数":{"docs":{},"传":{"docs":{},"入":{"docs":{},"一":{"docs":{},"个":{"docs":{},"结":{"docs":{},"果":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"或":{"docs":{},"者":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"以":{"docs":{},"及":{"docs":{},"一":{"docs":{},"条":{"docs":{},"信":{"docs":{},"息":{"docs":{},",":{"docs":{},"当":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"为":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"m":{"docs":{},"e":{"docs":{},"d":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.005309734513274336}}}}}}}}},"o":{"docs":{},"c":{"docs":{},"i":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.007142857142857143},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},")":{"docs":{},"的":{"docs":{},"值":{"docs":{},"可":{"docs":{},"取":{"docs":{},"的":{"docs":{},"值":{"docs":{},"有":{"docs":{},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"t":{"docs":{},",":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"和":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}},"默":{"docs":{},"认":{"docs":{},"为":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},",":{"docs":{},"优":{"docs":{},"先":{"docs":{},"级":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},")":{"docs":{},"默":{"docs":{},"认":{"docs":{},"为":{"1":{"0":{"0":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}},"docs":{}},"docs":{}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"、":{"docs":{},"d":{"docs":{},"i":{"docs":{},"d":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"、":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"、":{"docs":{},"i":{"docs":{},"n":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"、":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{},"、":{"docs":{},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"t":{"docs":{},"、":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"、":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"、":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"m":{"docs":{},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"、":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"、":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"、":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"并":{"docs":{},"结":{"docs":{},"合":{"docs":{},"性":{"docs":{},"(":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"o":{"docs":{},"c":{"docs":{},"i":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"i":{"docs":{},"t":{"docs":{},"y":{"docs":{},")":{"docs":{},"一":{"docs":{},"起":{"docs":{},"来":{"docs":{},"指":{"docs":{},"定":{"docs":{},"一":{"docs":{},"个":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"的":{"docs":{},"结":{"docs":{},"合":{"docs":{},"性":{"docs":{},",":{"docs":{},"其":{"docs":{},"中":{"docs":{},"结":{"docs":{},"合":{"docs":{},"性":{"docs":{},"可":{"docs":{},"以":{"docs":{},"说":{"docs":{},"是":{"docs":{},"上":{"docs":{},"下":{"docs":{},"文":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"l":{"docs":{},"e":{"docs":{},"f":{"docs":{},"t":{"docs":{},",":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"或":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"中":{"docs":{},"的":{"docs":{},"任":{"docs":{},"何":{"docs":{},"一":{"docs":{},"个":{"docs":{},"。":{"docs":{},"左":{"docs":{},"结":{"docs":{},"合":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"以":{"docs":{},"从":{"docs":{},"左":{"docs":{},"到":{"docs":{},"右":{"docs":{},"的":{"docs":{},"形":{"docs":{},"式":{"docs":{},"分":{"docs":{},"组":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"减":{"docs":{},"法":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"-":{"docs":{},")":{"docs":{},"具":{"docs":{},"有":{"docs":{},"左":{"docs":{},"结":{"docs":{},"合":{"docs":{},"性":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"4":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"g":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}},"n":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":2.004866180048662},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.007751937984496124},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.01762114537444934}},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"还":{"docs":{},"需":{"docs":{},"要":{"docs":{},"把":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"的":{"docs":{},"左":{"docs":{},"参":{"docs":{},"数":{"docs":{},"设":{"docs":{},"置":{"docs":{},"成":{"docs":{},"i":{"docs":{},"n":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"i":{"docs":{},"i":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087}},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"t":{"docs":{},"r":{"docs":{},"o":{"docs":{},"l":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"字":{"docs":{},"符":{"docs":{},"型":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"k":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714}},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"l":{"docs":{},"a":{"docs":{},"z":{"docs":{},"y":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"只":{"docs":{},"有":{"docs":{},"当":{"docs":{},"元":{"docs":{},"素":{"docs":{},"确":{"docs":{},"实":{"docs":{},"需":{"docs":{},"要":{"docs":{},"处":{"docs":{},"理":{"docs":{},"为":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"输":{"docs":{},"出":{"docs":{},"的":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"时":{"docs":{},",":{"docs":{},"才":{"docs":{},"需":{"docs":{},"要":{"docs":{},"使":{"docs":{},"用":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"。":{"docs":{},"也":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"在":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"中":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"只":{"docs":{},"有":{"docs":{},"当":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"完":{"docs":{},"成":{"docs":{},"以":{"docs":{},"及":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"确":{"docs":{},"实":{"docs":{},"存":{"docs":{},"在":{"docs":{},"后":{"docs":{},",":{"docs":{},"才":{"docs":{},"能":{"docs":{},"访":{"docs":{},"问":{"docs":{},"l":{"docs":{},"a":{"docs":{},"z":{"docs":{},"i":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"然":{"docs":{},"而":{"docs":{},",":{"docs":{},"由":{"docs":{},"于":{"docs":{},"a":{"docs":{},"s":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}},"持":{"docs":{},"有":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"的":{"docs":{},"强":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"但":{"docs":{},"是":{"docs":{},",":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"在":{"docs":{},"其":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"体":{"docs":{},"内":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"(":{"docs":{},"引":{"docs":{},"用":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},".":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{},")":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"了":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},",":{"docs":{},"这":{"docs":{},"意":{"docs":{},"味":{"docs":{},"着":{"docs":{},"闭":{"docs":{},"包":{"docs":{},"又":{"docs":{},"反":{"docs":{},"过":{"docs":{},"来":{"docs":{},"持":{"docs":{},"有":{"docs":{},"了":{"docs":{},"h":{"docs":{},"t":{"docs":{},"m":{"docs":{},"l":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},")":{"docs":{},"下":{"docs":{},"转":{"docs":{},"并":{"docs":{},"解":{"docs":{},"包":{"docs":{},"到":{"docs":{},"不":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"i":{"docs":{},"e":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"p":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}},"?":{"docs":{},")":{"docs":{},"。":{"docs":{},"可":{"docs":{},"选":{"docs":{},"形":{"docs":{},"式":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"转":{"docs":{},"换":{"docs":{},"总":{"docs":{},"是":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},"(":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943}}}}}}}}}}}}}}}}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"值":{"docs":{},",":{"docs":{},"当":{"docs":{},"实":{"docs":{},"例":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"协":{"docs":{},"议":{"docs":{},"时":{"docs":{},",":{"docs":{},"返":{"docs":{},"回":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},"类":{"docs":{},"型":{"docs":{},";":{"docs":{},"否":{"docs":{},"则":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.006016847172081829}}}}}},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"y":{"docs":{},"t":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}}}}}}}},"模":{"docs":{},"式":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"这":{"docs":{},"个":{"docs":{},"值":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"在":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"(":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"e":{"docs":{},")":{"docs":{},"和":{"docs":{},"a":{"docs":{},"s":{"docs":{},"模":{"docs":{},"式":{"docs":{},"右":{"docs":{},"边":{"docs":{},"的":{"docs":{},"指":{"docs":{},"定":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"或":{"docs":{},"者":{"docs":{},"那":{"docs":{},"个":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},")":{"docs":{},"是":{"docs":{},"一":{"docs":{},"致":{"docs":{},"的":{"docs":{},"。":{"docs":{},"一":{"docs":{},"旦":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"成":{"docs":{},"功":{"docs":{},",":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"的":{"docs":{},"值":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"被":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"a":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"、":{"docs":{},"d":{"docs":{},"y":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"、":{"docs":{},"i":{"docs":{},"s":{"docs":{},"、":{"docs":{},"n":{"docs":{},"e":{"docs":{},"w":{"docs":{},"、":{"docs":{},"s":{"docs":{},"u":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"、":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"、":{"docs":{},"s":{"docs":{},"e":{"docs":{},"l":{"docs":{},"f":{"docs":{},"、":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"、":{"docs":{},"_":{"docs":{},"_":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"_":{"docs":{},"_":{"docs":{},"、":{"docs":{},"_":{"docs":{},"_":{"docs":{},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"_":{"docs":{},"_":{"docs":{},"、":{"docs":{},"_":{"docs":{},"_":{"docs":{},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{},"_":{"docs":{},"、":{"docs":{},"_":{"docs":{},"_":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"_":{"docs":{},"_":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"r":{"docs":{},"p":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.03470715835140998}},"'":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.010845986984815618}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.01735357917570499}}}}},"s":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"d":{"docs":{},"u":{"docs":{},"b":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"p":{"docs":{},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"e":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"d":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}},"[":{"docs":{},"\"":{"docs":{},"a":{"docs":{},"p":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}},"d":{"docs":{},"u":{"docs":{},"b":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}},"l":{"docs":{},"h":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}}}},"字":{"docs":{},"典":{"docs":{},"使":{"docs":{},"用":{"docs":{},"字":{"docs":{},"典":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},",":{"docs":{},"包":{"docs":{},"含":{"docs":{},"两":{"docs":{},"个":{"docs":{},"键":{"docs":{},"值":{"docs":{},"对":{"docs":{},"。":{"docs":{},"第":{"docs":{},"一":{"docs":{},"对":{"docs":{},"的":{"docs":{},"键":{"docs":{},"是":{"docs":{},"t":{"docs":{},"y":{"docs":{},"o":{"docs":{},",":{"docs":{},"值":{"docs":{},"是":{"docs":{},"t":{"docs":{},"o":{"docs":{},"k":{"docs":{},"y":{"docs":{},"o":{"docs":{},"。":{"docs":{},"第":{"docs":{},"二":{"docs":{},"对":{"docs":{},"的":{"docs":{},"键":{"docs":{},"是":{"docs":{},"d":{"docs":{},"u":{"docs":{},"b":{"docs":{},",":{"docs":{},"值":{"docs":{},"是":{"docs":{},"d":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"被":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"变":{"docs":{},"量":{"docs":{},"(":{"docs":{},"用":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},")":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"常":{"docs":{},"量":{"docs":{},"(":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"一":{"docs":{},"种":{"docs":{},"d":{"docs":{},"i":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"b":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.05970149253731343},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.009708737864077669},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.032857142857142856},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.056112224448897796}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"r":{"docs":{},"k":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}}}},"b":{"docs":{},"c":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"g":{"docs":{},"h":{"docs":{},"i":{"docs":{},"j":{"docs":{},"k":{"docs":{},"l":{"docs":{},"m":{"docs":{},"n":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391}}}}}}}}}}}}}}}}},",":{"docs":{},"b":{"docs":{},",":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}}}}},"[":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}}},"docs":{}},"中":{"docs":{},"元":{"docs":{},"素":{"docs":{},"值":{"docs":{},"的":{"docs":{},"话":{"docs":{},",":{"docs":{},"a":{"docs":{},"将":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"与":{"docs":{},"b":{"docs":{},",":{"docs":{},"c":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}},"+":{"docs":{},"+":{"docs":{},",":{"docs":{},"是":{"docs":{},"先":{"docs":{},"返":{"docs":{},"回":{"docs":{},"了":{"docs":{},"a":{"docs":{},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"a":{"docs":{},"才":{"docs":{},"加":{"1":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},"c":{"docs":{},"得":{"docs":{},"到":{"docs":{},"了":{"docs":{},"a":{"docs":{},"的":{"docs":{},"旧":{"docs":{},"值":{"1":{"docs":{},",":{"docs":{},"而":{"docs":{},"a":{"docs":{},"加":{"1":{"docs":{},"后":{"docs":{},"变":{"docs":{},"成":{"2":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}},"docs":{}}}}},"docs":{}}}}}},"docs":{}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}},".":{"docs":{},"b":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}},"b":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}},"先":{"docs":{},"把":{"docs":{},"a":{"docs":{},"加":{"1":{"docs":{},"了":{"docs":{},"再":{"docs":{},"返":{"docs":{},"回":{"docs":{},"a":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"所":{"docs":{},"以":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{},"都":{"docs":{},"是":{"docs":{},"新":{"docs":{},"值":{"1":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}},"docs":{}}}}}}}}}}}}}}}}}}},"docs":{}}}}},")":{"docs":{},"。":{"docs":{},"一":{"docs":{},"元":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"分":{"docs":{},"前":{"docs":{},"置":{"docs":{},"符":{"docs":{},"和":{"docs":{},"后":{"docs":{},"置":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},",":{"docs":{},"前":{"docs":{},"置":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"需":{"docs":{},"紧":{"docs":{},"排":{"docs":{},"操":{"docs":{},"作":{"docs":{},"对":{"docs":{},"象":{"docs":{},"之":{"docs":{},"前":{"docs":{},"(":{"docs":{},"如":{"docs":{},"!":{"docs":{},"b":{"docs":{},")":{"docs":{},",":{"docs":{},"后":{"docs":{},"置":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"需":{"docs":{},"紧":{"docs":{},"跟":{"docs":{},"操":{"docs":{},"作":{"docs":{},"对":{"docs":{},"象":{"docs":{},"之":{"docs":{},"后":{"docs":{},"(":{"docs":{},"如":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"对":{"docs":{},"一":{"docs":{},"个":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"值":{"docs":{},"取":{"docs":{},"反":{"docs":{},",":{"docs":{},"使":{"docs":{},"得":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"变":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"变":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"b":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"是":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"a":{"docs":{},"和":{"docs":{},"b":{"docs":{},"不":{"docs":{},"是":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"那":{"docs":{},"它":{"docs":{},"们":{"docs":{},"俩":{"docs":{},"就":{"docs":{},"不":{"docs":{},"能":{"docs":{},"互":{"docs":{},"换":{"docs":{},"值":{"docs":{},"。":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0018050541516245488}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}}},"?":{"docs":{},"b":{"docs":{},":":{"docs":{},"c":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}},",":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}},"o":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.00929368029739777},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635}},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.11363636363636363},"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.019469026548672566},"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.020356234096692113},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0021598272138228943},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}},"中":{"docs":{},"表":{"docs":{},"示":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},",":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"非":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"类":{"docs":{},",":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"类":{"docs":{},"和":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"方":{"docs":{},"法":{"docs":{},"(":{"docs":{},"包":{"docs":{},"含":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},",":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},",":{"docs":{},"析":{"docs":{},"构":{"docs":{},"器":{"docs":{},",":{"docs":{},"以":{"docs":{},"下":{"docs":{},"下":{"docs":{},"标":{"docs":{},"。":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"告":{"docs":{},"诉":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"该":{"docs":{},"声":{"docs":{},"明":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"-":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}},"s":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"元":{"docs":{},"素":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"并":{"docs":{},"不":{"docs":{},"会":{"docs":{},"因":{"docs":{},"为":{"docs":{},"向":{"docs":{},"下":{"docs":{},"转":{"docs":{},"型":{"docs":{},"而":{"docs":{},"改":{"docs":{},"变":{"docs":{},",":{"docs":{},"当":{"docs":{},"它":{"docs":{},"们":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"时":{"docs":{},"只":{"docs":{},"被":{"docs":{},"视":{"docs":{},"为":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"只":{"docs":{},"有":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},".":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"元":{"docs":{},"素":{"docs":{},"是":{"docs":{},"否":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"h":{"docs":{},"a":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"a":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"了":{"docs":{},",":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"属":{"docs":{},"性":{"docs":{},"就":{"docs":{},"隐":{"docs":{},"性":{"docs":{},"地":{"docs":{},"应":{"docs":{},"用":{"docs":{},"于":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},";":{"docs":{},"没":{"docs":{},"有":{"docs":{},"必":{"docs":{},"要":{"docs":{},"再":{"docs":{},"明":{"docs":{},"确":{"docs":{},"地":{"docs":{},"使":{"docs":{},"用":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.029850746268656716}},"前":{"docs":{},"缀":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"中":{"docs":{},"生":{"docs":{},"效":{"docs":{},"。":{"docs":{},"且":{"docs":{},"@":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"协":{"docs":{},"议":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"表":{"docs":{},"示":{"docs":{},"暴":{"docs":{},"露":{"docs":{},"给":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},",":{"docs":{},"此":{"docs":{},"外":{"docs":{},",":{"docs":{},"@":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"型":{"docs":{},"协":{"docs":{},"议":{"docs":{},"只":{"docs":{},"对":{"docs":{},"类":{"docs":{},"有":{"docs":{},"效":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"只":{"docs":{},"能":{"docs":{},"在":{"docs":{},"类":{"docs":{},"中":{"docs":{},"检":{"docs":{},"查":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"一":{"docs":{},"致":{"docs":{},"性":{"docs":{},"。":{"docs":{},"详":{"docs":{},"情":{"docs":{},"查":{"docs":{},"看":{"docs":{},"u":{"docs":{},"s":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}},"特":{"docs":{},"性":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"一":{"docs":{},"个":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"特":{"docs":{},"性":{"docs":{},"就":{"docs":{},"会":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"地":{"docs":{},"应":{"docs":{},"用":{"docs":{},"到":{"docs":{},"该":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"因":{"docs":{},"此":{"docs":{},"无":{"docs":{},"需":{"docs":{},"显":{"docs":{},"式":{"docs":{},"地":{"docs":{},"用":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"_":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"t":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"应":{"docs":{},"用":{"docs":{},"于":{"docs":{},"一":{"docs":{},"个":{"docs":{},"类":{"docs":{},"或":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"它":{"docs":{},"也":{"docs":{},"会":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"地":{"docs":{},"应":{"docs":{},"用":{"docs":{},"于":{"docs":{},"那":{"docs":{},"个":{"docs":{},"类":{"docs":{},"或":{"docs":{},"协":{"docs":{},"议":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"标":{"docs":{},"记":{"docs":{},"了":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"的":{"docs":{},"类":{"docs":{},",":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"会":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"地":{"docs":{},"为":{"docs":{},"它":{"docs":{},"的":{"docs":{},"子":{"docs":{},"类":{"docs":{},"添":{"docs":{},"加":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"。":{"docs":{},"标":{"docs":{},"记":{"docs":{},"了":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"不":{"docs":{},"能":{"docs":{},"继":{"docs":{},"承":{"docs":{},"自":{"docs":{},"没":{"docs":{},"有":{"docs":{},"标":{"docs":{},"记":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"参":{"docs":{},"数":{"docs":{},",":{"docs":{},"由":{"docs":{},"标":{"docs":{},"记":{"docs":{},"符":{"docs":{},"组":{"docs":{},"成":{"docs":{},"。":{"docs":{},"当":{"docs":{},"你":{"docs":{},"想":{"docs":{},"把":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"所":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"的":{"docs":{},"实":{"docs":{},"体":{"docs":{},"以":{"docs":{},"一":{"docs":{},"个":{"docs":{},"不":{"docs":{},"同":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"暴":{"docs":{},"露":{"docs":{},"给":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},",":{"docs":{},"你":{"docs":{},"就":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"特":{"docs":{},"性":{"docs":{},"参":{"docs":{},"数":{"docs":{},"。":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"参":{"docs":{},"数":{"docs":{},"来":{"docs":{},"命":{"docs":{},"名":{"docs":{},"类":{"docs":{},",":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},",":{"docs":{},"s":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"器":{"docs":{},"。":{"docs":{},"下":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"把":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"中":{"docs":{},"e":{"docs":{},"n":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"暴":{"docs":{},"露":{"docs":{},"给":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},",":{"docs":{},"名":{"docs":{},"字":{"docs":{},"是":{"docs":{},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},"v":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":3.3369829683698295},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}},"e":{"docs":{},"r":{"docs":{},")":{"docs":{},",":{"docs":{},"这":{"docs":{},"样":{"docs":{},"一":{"docs":{},"来":{"docs":{},",":{"docs":{},"当":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"改":{"docs":{},"变":{"docs":{},"时":{"docs":{},",":{"docs":{},"类":{"docs":{},"就":{"docs":{},"会":{"docs":{},"被":{"docs":{},"通":{"docs":{},"知":{"docs":{},"到":{"docs":{},"。":{"docs":{},"可":{"docs":{},"以":{"docs":{},"为":{"docs":{},"任":{"docs":{},"何":{"docs":{},"属":{"docs":{},"性":{"docs":{},"添":{"docs":{},"加":{"docs":{},"属":{"docs":{},"性":{"docs":{},"观":{"docs":{},"察":{"docs":{},"器":{"docs":{},",":{"docs":{},"无":{"docs":{},"论":{"docs":{},"它":{"docs":{},"原":{"docs":{},"本":{"docs":{},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"为":{"docs":{},"存":{"docs":{},"储":{"docs":{},"型":{"docs":{},"属":{"docs":{},"性":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.045454545454545456},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}},"c":{"docs":{},"c":{"docs":{},"u":{"docs":{},"p":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"[":{"docs":{},"\"":{"docs":{},"j":{"docs":{},"a":{"docs":{},"y":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}},"p":{"docs":{},"t":{"docs":{"chapter3/01_About_the_Language_Reference.html#gitbook_791":{"ref":"chapter3/01_About_the_Language_Reference.html#gitbook_791","tf":0.03571428571428571}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.017699115044247787},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":5.0095238095238095},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.01079913606911447},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.009708737864077669},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.007709251101321586},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.004008016032064128}},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"e":{"docs":{},"改":{"docs":{},"成":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},",":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"会":{"docs":{},"是":{"docs":{},"什":{"docs":{},"么":{"docs":{},"?":{"docs":{},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{},"e":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"当":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{},"时":{"docs":{},"给":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"s":{"docs":{},"q":{"docs":{},"u":{"docs":{},"a":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}},"e":{"docs":{},"?":{"docs":{},".":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}},")":{"docs":{},"。":{"docs":{},"把":{"docs":{},"想":{"docs":{},"要":{"docs":{},"用":{"docs":{},"作":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"后":{"docs":{},"面":{"docs":{},"的":{"docs":{},"问":{"docs":{},"号":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"?":{"docs":{},")":{"docs":{},"改":{"docs":{},"成":{"docs":{},"感":{"docs":{},"叹":{"docs":{},"号":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"<":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}},"特":{"docs":{},"性":{"docs":{},"修":{"docs":{},"饰":{"docs":{},"那":{"docs":{},"些":{"docs":{},"标":{"docs":{},"记":{"docs":{},"了":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"特":{"docs":{},"性":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"。":{"docs":{},"因":{"docs":{},"此":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"类":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"a":{"docs":{},"d":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"&":{"docs":{},"l":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{},";":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"枚":{"docs":{},"举":{"docs":{},",":{"docs":{},"有":{"docs":{},"两":{"docs":{},"种":{"docs":{},"形":{"docs":{},"式":{"docs":{},",":{"docs":{},"n":{"docs":{},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"和":{"docs":{},"s":{"docs":{},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},"t":{"docs":{},")":{"docs":{},",":{"docs":{},"又":{"docs":{},"来":{"docs":{},"代":{"docs":{},"表":{"docs":{},"可":{"docs":{},"能":{"docs":{},"出":{"docs":{},"现":{"docs":{},"或":{"docs":{},"可":{"docs":{},"能":{"docs":{},"不":{"docs":{},"出":{"docs":{},"现":{"docs":{},"的":{"docs":{},"值":{"docs":{},"。":{"docs":{},"任":{"docs":{},"意":{"docs":{},"类":{"docs":{},"型":{"docs":{},"都":{"docs":{},"可":{"docs":{},"以":{"docs":{},"被":{"docs":{},"显":{"docs":{},"式":{"docs":{},"的":{"docs":{},"声":{"docs":{},"明":{"docs":{},"(":{"docs":{},"或":{"docs":{},"隐":{"docs":{},"式":{"docs":{},"的":{"docs":{},"转":{"docs":{},"换":{"docs":{},")":{"docs":{},"为":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"当":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"类":{"docs":{},"型":{"docs":{},"时":{"docs":{},",":{"docs":{},"确":{"docs":{},"保":{"docs":{},"使":{"docs":{},"用":{"docs":{},"括":{"docs":{},"号":{"docs":{},"给":{"docs":{},"?":{"docs":{},"提":{"docs":{},"供":{"docs":{},"合":{"docs":{},"适":{"docs":{},"的":{"docs":{},"作":{"docs":{},"用":{"docs":{},"范":{"docs":{},"围":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},"说":{"docs":{},",":{"docs":{},"声":{"docs":{},"明":{"docs":{},"一":{"docs":{},"个":{"docs":{},"整":{"docs":{},"型":{"docs":{},"的":{"docs":{},"可":{"docs":{},"选":{"docs":{},"数":{"docs":{},"组":{"docs":{},",":{"docs":{},"应":{"docs":{},"写":{"docs":{},"作":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"[":{"docs":{},"]":{"docs":{},")":{"docs":{},"?":{"docs":{},",":{"docs":{},"写":{"docs":{},"成":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"<":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}}}}}},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"g":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.016181229773462782}}}}}}},"-":{"docs":{},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}},"属":{"docs":{},"性":{"docs":{},"标":{"docs":{},"注":{"docs":{},"这":{"docs":{},"些":{"docs":{},"协":{"docs":{},"议":{"docs":{},"成":{"docs":{},"员":{"docs":{},"声":{"docs":{},"明":{"docs":{},"以":{"docs":{},"指":{"docs":{},"定":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"一":{"docs":{},"致":{"docs":{},"性":{"docs":{},"类":{"docs":{},"型":{"docs":{},"实":{"docs":{},"现":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"的":{"docs":{},"。":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"a":{"docs":{},"l":{"docs":{},"属":{"docs":{},"性":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"于":{"docs":{},"使":{"docs":{},"用":{"docs":{},"o":{"docs":{},"b":{"docs":{},"j":{"docs":{},"c":{"docs":{},"属":{"docs":{},"性":{"docs":{},"标":{"docs":{},"记":{"docs":{},"过":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"。":{"docs":{},"这":{"docs":{},"样":{"docs":{},"的":{"docs":{},"结":{"docs":{},"果":{"docs":{},"就":{"docs":{},"是":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"类":{"docs":{},"类":{"docs":{},"型":{"docs":{},"可":{"docs":{},"以":{"docs":{},"采":{"docs":{},"用":{"docs":{},"并":{"docs":{},"符":{"docs":{},"合":{"docs":{},"包":{"docs":{},"含":{"docs":{},"可":{"docs":{},"选":{"docs":{},"成":{"docs":{},"员":{"docs":{},"要":{"docs":{},"求":{"docs":{},"的":{"docs":{},"协":{"docs":{},"议":{"docs":{},"。":{"docs":{},"更":{"docs":{},"多":{"docs":{},"关":{"docs":{},"于":{"docs":{},"如":{"docs":{},"何":{"docs":{},"使":{"docs":{},"用":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":2.0097323600973236},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.007751937984496124},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.01762114537444934},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.006309148264984227},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.011428571428571429}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"s":{"docs":{},")":{"docs":{},"比":{"docs":{},"较":{"docs":{},"运":{"docs":{},"算":{"docs":{},"三":{"docs":{},"元":{"docs":{},"条":{"docs":{},"件":{"docs":{},"运":{"docs":{},"算":{"docs":{},"(":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":2}}}}}}}}}}}}}}}}}}}},"主":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"(":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"m":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}},"的":{"docs":{},"更":{"docs":{},"多":{"docs":{},"信":{"docs":{},"息":{"docs":{},",":{"docs":{},"请":{"docs":{},"参":{"docs":{},"见":{"docs":{},":":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}},")":{"docs":{},"三":{"docs":{},"元":{"docs":{},"条":{"docs":{},"件":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}},"类":{"docs":{},"型":{"docs":{},"转":{"docs":{},"换":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"-":{"docs":{},"c":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.3448275862068966}}}}}}}}}}}}}}}}}}},"、":{"docs":{},"后":{"docs":{},"缀":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}},"或":{"docs":{},"二":{"docs":{},"元":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"(":{"docs":{},"b":{"docs":{},"i":{"docs":{},"n":{"docs":{},"a":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}},")":{"docs":{},"是":{"docs":{},"一":{"docs":{},"元":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},",":{"docs":{},"例":{"docs":{},"如":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"+":{"docs":{},"+":{"docs":{},"i":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}},"i":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}},"和":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"之":{"docs":{},"间":{"docs":{},"添":{"docs":{},"加":{"docs":{},"上":{"docs":{},"下":{"docs":{},"文":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"i":{"docs":{},"n":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},",":{"docs":{},"p":{"docs":{},"r":{"docs":{},"e":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"或":{"docs":{},"p":{"docs":{},"o":{"docs":{},"s":{"docs":{},"t":{"docs":{},"f":{"docs":{},"i":{"docs":{},"x":{"docs":{},"来":{"docs":{},"指":{"docs":{},"定":{"docs":{},"。":{"docs":{},"每":{"docs":{},"种":{"docs":{},"形":{"docs":{},"式":{"docs":{},"中":{"docs":{},",":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"只":{"docs":{},"能":{"docs":{},"包":{"docs":{},"含":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}},"e":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"g":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}},"e":{"docs":{},"和":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"i":{"docs":{},"p":{"docs":{},"s":{"docs":{},"a":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"l":{"docs":{},"i":{"docs":{},"c":{"docs":{},"i":{"docs":{},"o":{"docs":{},"u":{"docs":{},"s":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"会":{"docs":{},"被":{"docs":{},"推":{"docs":{},"断":{"docs":{},"为":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{},"初":{"docs":{},"值":{"docs":{},"是":{"docs":{},"布":{"docs":{},"尔":{"docs":{},"字":{"docs":{},"面":{"docs":{},"量":{"docs":{},"。":{"docs":{},"就":{"docs":{},"像":{"docs":{},"之":{"docs":{},"前":{"docs":{},"提":{"docs":{},"到":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"和":{"docs":{},"d":{"docs":{},"o":{"docs":{},"u":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"一":{"docs":{},"样":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"你":{"docs":{},"创":{"docs":{},"建":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},"给":{"docs":{},"它":{"docs":{},"们":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{},"e":{"docs":{},"或":{"docs":{},"者":{"docs":{},"f":{"docs":{},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"e":{"docs":{},",":{"docs":{},"那":{"docs":{},"你":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"将":{"docs":{},"常":{"docs":{},"量":{"docs":{},"或":{"docs":{},"者":{"docs":{},"变":{"docs":{},"量":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"b":{"docs":{},"o":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.0036101083032490976},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.02654867256637168}},"a":{"docs":{},"l":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242}}}}}}},".":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471}}},"x":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.008733624454148471}}}},"的":{"docs":{},"x":{"docs":{},"和":{"docs":{},"i":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}},"i":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}}},"x":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}}}}},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.025547445255474453},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.004285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"e":{"docs":{},"标":{"docs":{},"记":{"docs":{},"—":{"docs":{},"—":{"docs":{},"如":{"docs":{},"果":{"docs":{},"没":{"docs":{},"有":{"docs":{},"添":{"docs":{},"加":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"就":{"docs":{},"重":{"docs":{},"写":{"docs":{},"父":{"docs":{},"类":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"话":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"会":{"docs":{},"报":{"docs":{},"错":{"docs":{},"。":{"docs":{},"编":{"docs":{},"译":{"docs":{},"器":{"docs":{},"同":{"docs":{},"样":{"docs":{},"会":{"docs":{},"检":{"docs":{},"测":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"。":{"docs":{},"这":{"docs":{},"么":{"docs":{},"做":{"docs":{},",":{"docs":{},"你":{"docs":{},"就":{"docs":{},"表":{"docs":{},"明":{"docs":{},"了":{"docs":{},"你":{"docs":{},"是":{"docs":{},"想":{"docs":{},"提":{"docs":{},"供":{"docs":{},"一":{"docs":{},"个":{"docs":{},"重":{"docs":{},"写":{"docs":{},"版":{"docs":{},"本":{"docs":{},",":{"docs":{},"而":{"docs":{},"非":{"docs":{},"错":{"docs":{},"误":{"docs":{},"地":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"相":{"docs":{},"同":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"。":{"docs":{},"意":{"docs":{},"外":{"docs":{},"的":{"docs":{},"重":{"docs":{},"写":{"docs":{},"行":{"docs":{},"为":{"docs":{},"可":{"docs":{},"能":{"docs":{},"会":{"docs":{},"导":{"docs":{},"致":{"docs":{},"不":{"docs":{},"可":{"docs":{},"预":{"docs":{},"知":{"docs":{},"的":{"docs":{},"错":{"docs":{},"误":{"docs":{},",":{"docs":{},"任":{"docs":{},"何":{"docs":{},"缺":{"docs":{},"少":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.0036496350364963502}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"作":{"docs":{},"为":{"docs":{},"函":{"docs":{},"数":{"docs":{},"声":{"docs":{},"明":{"docs":{},"头":{"docs":{},"。":{"docs":{},"不":{"docs":{},"用":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},"重":{"docs":{},"写":{"docs":{},"的":{"docs":{},"方":{"docs":{},"法":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"了":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}},"f":{"docs":{},"l":{"docs":{},"o":{"docs":{},"w":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.005506607929515419}}}}}},"l":{"docs":{},"o":{"docs":{},"a":{"docs":{},"d":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}}}}}},"n":{"docs":{},"l":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.007633587786259542}},".":{"docs":{},"n":{"docs":{},"e":{"docs":{},"x":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028}}}}}}}}}}}}}}},"k":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044},"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}},"e":{"docs":{},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0017699115044247787}}}}}}}},"y":{"docs":{},"s":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"y":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}},"b":{"docs":{},"a":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}}}}}}},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},".":{"docs":{},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}},"枚":{"docs":{},"举":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"了":{"docs":{},"t":{"docs":{},"o":{"docs":{},"g":{"docs":{},"g":{"docs":{},"l":{"docs":{},"a":{"docs":{},"b":{"docs":{},"l":{"docs":{},"e":{"docs":{},"协":{"docs":{},"议":{"docs":{},",":{"docs":{},"o":{"docs":{},"n":{"docs":{},",":{"docs":{},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.009933774834437087},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811}},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}},"p":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.011976047904191617},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.0055147058823529415},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.03125},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.006016847172081829}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}},"l":{"docs":{},"d":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.004366812227074236}}}}}}}},"t":{"docs":{},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0048484848484848485}},"w":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732}}}}},"b":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}},"t":{"docs":{},"a":{"docs":{},"w":{"docs":{},"a":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0038095238095238095}}}}}}},"d":{"docs":{},"y":{"docs":{},"s":{"docs":{},"s":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}}}}},"r":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"e":{"docs":{},"f":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter1/01_swift.html#gitbook_738":{"ref":"chapter1/01_swift.html#gitbook_738","tf":0.022727272727272728},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5615435795076514},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0048484848484848485},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.010256410256410256},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"1":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.007619047619047619}}},"2":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.005714285714285714}}},"3":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.007619047619047619}}},"docs":{},")":{"docs":{},"和":{"docs":{},"无":{"docs":{},"主":{"docs":{},"引":{"docs":{},"用":{"docs":{},"(":{"docs":{},"u":{"docs":{},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"n":{"docs":{"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.003875968992248062}}}}}}}}},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}},"t":{"docs":{},"m":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}}},"l":{"docs":{},"a":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}},"p":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"k":{"docs":{},"n":{"docs":{},"o":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}},"<":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},">":{"docs":{},"(":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}}},"e":{"docs":{},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}},"e":{"docs":{},":":{"0":{"docs":{},".":{"0":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}},"docs":{}}},"docs":{}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.005747126436781609}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},"(":{"docs":{},"t":{"docs":{},"a":{"docs":{},"s":{"docs":{},"k":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.2894317578332448}}}}}}}},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}}}}},"s":{"docs":{},"u":{"docs":{},"l":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0036363636363636364},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.007142857142857143},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.01002004008016032}},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"u":{"docs":{},"n":{"docs":{},"r":{"docs":{},"i":{"docs":{},"s":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}},"p":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464}}},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}},"e":{"docs":{},"声":{"docs":{},"明":{"docs":{},"为":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"?":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"或":{"docs":{},"者":{"docs":{},"说":{"docs":{},"是":{"docs":{},"可":{"docs":{},"选":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"类":{"docs":{},"型":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.020512820512820513}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{},"或":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},":":{"6":{"4":{"0":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"docs":{}},"docs":{}},"docs":{}}}}}}}},"的":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"描":{"docs":{},"述":{"docs":{},"一":{"docs":{},"个":{"docs":{},"显":{"docs":{},"示":{"docs":{},"器":{"docs":{},"的":{"docs":{},"像":{"docs":{},"素":{"docs":{},"分":{"docs":{},"辨":{"docs":{},"率":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"w":{"docs":{},"i":{"docs":{},"d":{"docs":{},"t":{"docs":{},"h":{"docs":{},"和":{"docs":{},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"存":{"docs":{},"储":{"docs":{},"属":{"docs":{},"性":{"docs":{},"是":{"docs":{},"捆":{"docs":{},"绑":{"docs":{},"和":{"docs":{},"存":{"docs":{},"储":{"docs":{},"在":{"docs":{},"类":{"docs":{},"或":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"中":{"docs":{},"的":{"docs":{},"常":{"docs":{},"量":{"docs":{},"或":{"docs":{},"变":{"docs":{},"量":{"docs":{},"。":{"docs":{},"当":{"docs":{},"这":{"docs":{},"两":{"docs":{},"个":{"docs":{},"属":{"docs":{},"性":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"整":{"docs":{},"数":{"0":{"docs":{},"的":{"docs":{},"时":{"docs":{},"候":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"会":{"docs":{},"被":{"docs":{},"推":{"docs":{},"断":{"docs":{},"为":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"和":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"类":{"docs":{},"的":{"docs":{},"定":{"docs":{},"义":{"docs":{},"仅":{"docs":{},"描":{"docs":{},"述":{"docs":{},"了":{"docs":{},"什":{"docs":{},"么":{"docs":{},"是":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"和":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{},"m":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"。":{"docs":{},"它":{"docs":{},"们":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"描":{"docs":{},"述":{"docs":{},"一":{"docs":{},"个":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"分":{"docs":{},"辨":{"docs":{},"率":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},")":{"docs":{},"或":{"docs":{},"者":{"docs":{},"视":{"docs":{},"频":{"docs":{},"模":{"docs":{},"式":{"docs":{},"(":{"docs":{},"v":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"o":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}},"将":{"docs":{},"计":{"docs":{},"数":{"docs":{},"器":{"docs":{},"重":{"docs":{},"置":{"docs":{},"为":{"0":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514}}},"docs":{}}}}}}}}},"r":{"docs":{},"v":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.04126984126984127}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"?":{"docs":{},"属":{"docs":{},"性":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"存":{"docs":{},"在":{"docs":{},"则":{"docs":{},"取":{"docs":{},"回":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"中":{"docs":{},"也":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}},"具":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}},"存":{"docs":{},"储":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"实":{"docs":{},"例":{"docs":{},"的":{"docs":{},"数":{"docs":{},"组":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"不":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"固":{"docs":{},"定":{"docs":{},"的":{"docs":{},"存":{"docs":{},"储":{"docs":{},"值":{"docs":{},",":{"docs":{},"而":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"计":{"docs":{},"算":{"docs":{},"而":{"docs":{},"来":{"docs":{},"的":{"docs":{},"。":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},"是":{"docs":{},"由":{"docs":{},"返":{"docs":{},"回":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"可":{"docs":{},"选":{"docs":{},"属":{"docs":{},"性":{"docs":{},"叫":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"(":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{},"?":{"docs":{},")":{"docs":{},"。":{"docs":{},"a":{"docs":{},"d":{"docs":{},"d":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"s":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"实":{"docs":{},"例":{"docs":{},"给":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{},"且":{"docs":{},"在":{"docs":{},"他":{"docs":{},"的":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"或":{"docs":{},"多":{"docs":{},"个":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"通":{"docs":{},"过":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"在":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"属":{"docs":{},"性":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"属":{"docs":{},"性":{"docs":{},"值":{"docs":{},",":{"docs":{},"将":{"docs":{},"会":{"docs":{},"引":{"docs":{},"发":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"错":{"docs":{},"误":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"这":{"docs":{},"时":{"docs":{},"没":{"docs":{},"有":{"docs":{},"可":{"docs":{},"以":{"docs":{},"供":{"docs":{},"解":{"docs":{},"析":{"docs":{},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"p":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"s":{"docs":{},"方":{"docs":{},"法":{"docs":{},"会":{"docs":{},"打":{"docs":{},"印":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"中":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"子":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"数":{"docs":{},"组":{"docs":{},"中":{"docs":{},"第":{"docs":{},"一":{"docs":{},"个":{"docs":{},"房":{"docs":{},"间":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"。":{"docs":{},"因":{"docs":{},"为":{"docs":{},"j":{"docs":{},"o":{"docs":{},"h":{"docs":{},"n":{"docs":{},".":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"n":{"docs":{},"c":{"docs":{},"e":{"docs":{},"现":{"docs":{},"在":{"docs":{},"是":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0340522133938706},"chapter2/13_Inheritance.html#gitbook_743":{"ref":"chapter2/13_Inheritance.html#gitbook_743","tf":0.014598540145985401},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.5884896872920825},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.9762931642001409},"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.010178117048346057},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.021621621621621623},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.007352941176470588},"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.01904761904761905},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.007619047619047619},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.03125},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.040229885057471264},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.012033694344163659},"chapter2/22_Generics.html#gitbook_784":{"ref":"chapter2/22_Generics.html#gitbook_784","tf":0.032490974729241874},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.013565891472868217},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.019417475728155338},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.014285714285714285},"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.02040816326530612},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256},"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":1.1382297551789078}},"f":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}},")":{"docs":{},"\\":{"docs":{},"r":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}},"或":{"docs":{},"换":{"docs":{},"行":{"docs":{},"符":{"docs":{},"(":{"docs":{},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}},"(":{"docs":{},"u":{"docs":{},"+":{"0":{"0":{"0":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}},"docs":{}},"docs":{}},"docs":{}}}}},"时":{"docs":{},",":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"是":{"docs":{},"将":{"docs":{},"控":{"docs":{},"制":{"docs":{},"权":{"docs":{},"从":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"或":{"docs":{},"方":{"docs":{},"法":{"docs":{},"传":{"docs":{},"递":{"docs":{},"给":{"docs":{},"调":{"docs":{},"用":{"docs":{},"者":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"值":{"docs":{},"。":{"docs":{},"(":{"docs":{},"这":{"docs":{},"就":{"docs":{},"是":{"docs":{},"说":{"docs":{},",":{"docs":{},"该":{"docs":{},"函":{"docs":{},"数":{"docs":{},"或":{"docs":{},"方":{"docs":{},"法":{"docs":{},"的":{"docs":{},"返":{"docs":{},"回":{"docs":{},"类":{"docs":{},"型":{"docs":{},"为":{"docs":{},"v":{"docs":{},"o":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"语":{"docs":{},"句":{"docs":{},"后":{"docs":{},"面":{"docs":{},"带":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"时":{"docs":{},",":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"的":{"docs":{},"值":{"docs":{},"将":{"docs":{},"会":{"docs":{},"返":{"docs":{},"回":{"docs":{},"给":{"docs":{},"调":{"docs":{},"用":{"docs":{},"者":{"docs":{},"。":{"docs":{},"如":{"docs":{},"果":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"值":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"与":{"docs":{},"调":{"docs":{},"用":{"docs":{},"者":{"docs":{},"期":{"docs":{},"望":{"docs":{},"的":{"docs":{},"类":{"docs":{},"型":{"docs":{},"不":{"docs":{},"匹":{"docs":{},"配":{"docs":{},",":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"时":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"只":{"docs":{},"写":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{},"这":{"docs":{},"个":{"docs":{},"关":{"docs":{},"键":{"docs":{},"词":{"docs":{},",":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"在":{"docs":{},"r":{"docs":{},"e":{"docs":{},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"chapter3/10_Statements.html#gitbook_807":{"ref":"chapter3/10_Statements.html#gitbook_807","tf":0.003389830508474576}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"v":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.03492063492063492}}}}}}},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}},"d":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}}}},"l":{"docs":{},"a":{"docs":{},"s":{"docs":{},"t":{"docs":{},"方":{"docs":{},"法":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{},"e":{"docs":{},"x":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"避":{"docs":{},"免":{"docs":{},"我":{"docs":{},"们":{"docs":{},"需":{"docs":{},"要":{"docs":{},"获":{"docs":{},"取":{"docs":{},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"方":{"docs":{},"法":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"来":{"docs":{},"在":{"docs":{},"字":{"docs":{},"典":{"docs":{},"中":{"docs":{},"移":{"docs":{},"除":{"docs":{},"键":{"docs":{},"值":{"docs":{},"对":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"方":{"docs":{},"法":{"docs":{},"在":{"docs":{},"键":{"docs":{},"值":{"docs":{},"对":{"docs":{},"存":{"docs":{},"在":{"docs":{},"的":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},"会":{"docs":{},"移":{"docs":{},"除":{"docs":{},"该":{"docs":{},"键":{"docs":{},"值":{"docs":{},"对":{"docs":{},"并":{"docs":{},"且":{"docs":{},"返":{"docs":{},"回":{"docs":{},"被":{"docs":{},"移":{"docs":{},"除":{"docs":{},"的":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"或":{"docs":{},"者":{"docs":{},"在":{"docs":{},"没":{"docs":{},"有":{"docs":{},"值":{"docs":{},"的":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},"返":{"docs":{},"回":{"docs":{},"n":{"docs":{},"i":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128}},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}},"e":{"docs":{},"d":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"予":{"docs":{},"了":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"值":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{},",":{"docs":{},"实":{"docs":{},"际":{"docs":{},"上":{"docs":{},"它":{"docs":{},"被":{"docs":{},"赋":{"docs":{},"予":{"docs":{},"的":{"docs":{},"是":{"docs":{},"值":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},")":{"docs":{},"的":{"docs":{},"一":{"docs":{},"个":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"。":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"过":{"docs":{},"程":{"docs":{},"结":{"docs":{},"束":{"docs":{},"后":{"docs":{},"再":{"docs":{},"修":{"docs":{},"改":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"的":{"docs":{},"值":{"docs":{},"并":{"docs":{},"不":{"docs":{},"影":{"docs":{},"响":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"d":{"docs":{},"i":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"所":{"docs":{},"储":{"docs":{},"存":{"docs":{},"的":{"docs":{},"原":{"docs":{},"始":{"docs":{},"值":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}}}},"a":{"docs":{},"l":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0028544243577545195}}}}},"d":{"docs":{},"-":{"docs":{},"o":{"docs":{},"n":{"docs":{},"l":{"docs":{},"i":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.02694610778443114}}}}}},"c":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.006550218340611353},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.011494252873563218}},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}},"也":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"的":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"矩":{"docs":{},"形":{"docs":{},"的":{"docs":{},"中":{"docs":{},"心":{"docs":{},"点":{"docs":{},"可":{"docs":{},"以":{"docs":{},"从":{"docs":{},"原":{"docs":{},"点":{"docs":{},"和":{"docs":{},"尺":{"docs":{},"寸":{"docs":{},"来":{"docs":{},"算":{"docs":{},"出":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"不":{"docs":{},"需":{"docs":{},"要":{"docs":{},"将":{"docs":{},"它":{"docs":{},"以":{"docs":{},"显":{"docs":{},"式":{"docs":{},"声":{"docs":{},"明":{"docs":{},"的":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"来":{"docs":{},"保":{"docs":{},"存":{"docs":{},"。":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"的":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"创":{"docs":{},"建":{"docs":{},"实":{"docs":{},"例":{"docs":{},"-":{"docs":{},"-":{"docs":{},"使":{"docs":{},"用":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"0":{"docs":{},"值":{"docs":{},"来":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"和":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},";":{"docs":{},"使":{"docs":{},"用":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"和":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"实":{"docs":{},"例":{"docs":{},"来":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},";":{"docs":{},"使":{"docs":{},"用":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"来":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"。":{"docs":{},"在":{"docs":{},"下":{"docs":{},"面":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}}}}}}}}}}}},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{},",":{"docs":{},"在":{"docs":{},"功":{"docs":{},"能":{"docs":{},"上":{"docs":{},"跟":{"docs":{},"没":{"docs":{},"有":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"时":{"docs":{},"自":{"docs":{},"动":{"docs":{},"获":{"docs":{},"得":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"是":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"空":{"docs":{},"函":{"docs":{},"数":{"docs":{},",":{"docs":{},"使":{"docs":{},"用":{"docs":{},"一":{"docs":{},"对":{"docs":{},"大":{"docs":{},"括":{"docs":{},"号":{"docs":{},"{":{"docs":{},"}":{"docs":{},"来":{"docs":{},"描":{"docs":{},"述":{"docs":{},",":{"docs":{},"它":{"docs":{},"没":{"docs":{},"有":{"docs":{},"执":{"docs":{},"行":{"docs":{},"任":{"docs":{},"何":{"docs":{},"定":{"docs":{},"制":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"过":{"docs":{},"程":{"docs":{},"。":{"docs":{},"调":{"docs":{},"用":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"将":{"docs":{},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"它":{"docs":{},"的":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"和":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"都":{"docs":{},"使":{"docs":{},"用":{"docs":{},"定":{"docs":{},"义":{"docs":{},"时":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"x":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},":":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},":":{"docs":{},")":{"docs":{},"稍":{"docs":{},"微":{"docs":{},"复":{"docs":{},"杂":{"docs":{},"一":{"docs":{},"点":{"docs":{},"。":{"docs":{},"它":{"docs":{},"先":{"docs":{},"通":{"docs":{},"过":{"docs":{},"c":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"和":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"的":{"docs":{},"值":{"docs":{},"计":{"docs":{},"算":{"docs":{},"出":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"的":{"docs":{},"坐":{"docs":{},"标":{"docs":{},"。":{"docs":{},"然":{"docs":{},"后":{"docs":{},"再":{"docs":{},"调":{"docs":{},"用":{"docs":{},"(":{"docs":{},"或":{"docs":{},"代":{"docs":{},"理":{"docs":{},"给":{"docs":{},")":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},":":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},":":{"docs":{},")":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"来":{"docs":{},"将":{"docs":{},"新":{"docs":{},"的":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"和":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},":":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},":":{"docs":{},")":{"docs":{},",":{"docs":{},"在":{"docs":{},"功":{"docs":{},"能":{"docs":{},"上":{"docs":{},"跟":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"在":{"docs":{},"没":{"docs":{},"有":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"时":{"docs":{},"获":{"docs":{},"得":{"docs":{},"的":{"docs":{},"逐":{"docs":{},"一":{"docs":{},"成":{"docs":{},"员":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"是":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"只":{"docs":{},"是":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"将":{"docs":{},"o":{"docs":{},"r":{"docs":{},"i":{"docs":{},"g":{"docs":{},"i":{"docs":{},"n":{"docs":{},"和":{"docs":{},"s":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"用":{"docs":{},"来":{"docs":{},"展":{"docs":{},"现":{"docs":{},"几":{"docs":{},"何":{"docs":{},"矩":{"docs":{},"形":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"需":{"docs":{},"要":{"docs":{},"两":{"docs":{},"个":{"docs":{},"辅":{"docs":{},"助":{"docs":{},"的":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"和":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"各":{"docs":{},"自":{"docs":{},"为":{"docs":{},"其":{"docs":{},"所":{"docs":{},"有":{"docs":{},"的":{"docs":{},"属":{"docs":{},"性":{"docs":{},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"0":{"docs":{},".":{"0":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"同":{"docs":{},"时":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"两":{"docs":{},"个":{"docs":{},"辅":{"docs":{},"助":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"s":{"docs":{},"i":{"docs":{},"z":{"docs":{},"e":{"docs":{},"和":{"docs":{},"p":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"都":{"docs":{},"把":{"0":{"docs":{},".":{"0":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"提":{"docs":{},"供":{"docs":{},"了":{"docs":{},"其":{"docs":{},"所":{"docs":{},"有":{"docs":{},"属":{"docs":{},"性":{"docs":{},"的":{"docs":{},"默":{"docs":{},"认":{"docs":{},"值":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"正":{"docs":{},"如":{"docs":{},"默":{"docs":{},"认":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"中":{"docs":{},"描":{"docs":{},"述":{"docs":{},"的":{"docs":{},",":{"docs":{},"它":{"docs":{},"可":{"docs":{},"以":{"docs":{},"自":{"docs":{},"动":{"docs":{},"接":{"docs":{},"受":{"docs":{},"一":{"docs":{},"个":{"docs":{},"默":{"docs":{},"认":{"docs":{},"的":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"成":{"docs":{},"员":{"docs":{},"级":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"。":{"docs":{},"这":{"docs":{},"些":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"可":{"docs":{},"以":{"docs":{},"用":{"docs":{},"于":{"docs":{},"构":{"docs":{},"造":{"docs":{},"新":{"docs":{},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"g":{"docs":{},"n":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.012867647058823529}},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}}},"也":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"便":{"docs":{},"利":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{},"便":{"docs":{},"利":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}},"子":{"docs":{},"类":{"docs":{},",":{"docs":{},"叫":{"docs":{},"做":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"p":{"docs":{},"p":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"l":{"docs":{},"i":{"docs":{},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}},"父":{"docs":{},"类":{"docs":{},"是":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},",":{"docs":{},"它":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"便":{"docs":{},"利":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"因":{"docs":{},"此":{"docs":{},"也":{"docs":{},"被":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"继":{"docs":{},"承":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"继":{"docs":{},"承":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},")":{"docs":{},"函":{"docs":{},"数":{"docs":{},"版":{"docs":{},"本":{"docs":{},"跟":{"docs":{},"f":{"docs":{},"o":{"docs":{},"o":{"docs":{},"d":{"docs":{},"提":{"docs":{},"供":{"docs":{},"的":{"docs":{},"版":{"docs":{},"本":{"docs":{},"是":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},",":{"docs":{},"除":{"docs":{},"了":{"docs":{},"它":{"docs":{},"是":{"docs":{},"将":{"docs":{},"任":{"docs":{},"务":{"docs":{},"代":{"docs":{},"理":{"docs":{},"给":{"docs":{},"r":{"docs":{},"e":{"docs":{},"c":{"docs":{},"i":{"docs":{},"p":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"d":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"版":{"docs":{},"本":{"docs":{},"的":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"类":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"指":{"docs":{},"定":{"docs":{},"构":{"docs":{},"造":{"docs":{},"器":{"docs":{},"i":{"docs":{},"n":{"docs":{},"i":{"docs":{},"t":{"docs":{},"(":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"e":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}},"s":{"docs":{},"(":{"docs":{},"c":{"docs":{},"o":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/15_Deinitialization.html#gitbook_770":{"ref":"chapter2/15_Deinitialization.html#gitbook_770","tf":0.0064516129032258064}}}}}}}}}}}}}}}}},"q":{"docs":{},"u":{"docs":{},"i":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635},"chapter3/06_Attributes.html#gitbook_789":{"ref":"chapter3/06_Attributes.html#gitbook_789","tf":0.014925373134328358}},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"&":{"docs":{},"g":{"docs":{},"t":{"docs":{"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803":{"ref":"chapter3/08_Generic_Parameters_and_Arguments.html#gitbook_803","tf":0.01020408163265306}}}}}}}}}}}},"e":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.002857142857142857}}}}}}}}},"a":{"docs":{},"i":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}},"n":{"docs":{},"k":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0056753688989784334},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.046875}},".":{"docs":{},"a":{"docs":{},"c":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"(":{"3":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}},"docs":{}}}}}}}}},"s":{"docs":{},"i":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}}}}}}}}}}}}},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}},"s":{"docs":{},"e":{"docs":{},"c":{"docs":{},"o":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}},"和":{"docs":{},"s":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"在":{"docs":{},"b":{"docs":{},"l":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"j":{"docs":{},"a":{"docs":{},"c":{"docs":{},"k":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"d":{"docs":{},"中":{"docs":{},",":{"docs":{},"但":{"docs":{},"仍":{"docs":{},"可":{"docs":{},"被":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"所":{"docs":{},"以":{"docs":{},"在":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"实":{"docs":{},"例":{"docs":{},"时":{"docs":{},"能":{"docs":{},"够":{"docs":{},"通":{"docs":{},"过":{"docs":{},"枚":{"docs":{},"举":{"docs":{},"类":{"docs":{},"型":{"docs":{},"中":{"docs":{},"的":{"docs":{},"成":{"docs":{},"员":{"docs":{},"名":{"docs":{},"称":{"docs":{},"单":{"docs":{},"独":{"docs":{},"引":{"docs":{},"用":{"docs":{},"。":{"docs":{},"在":{"docs":{},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"d":{"docs":{},"e":{"docs":{},"s":{"docs":{},"c":{"docs":{},"r":{"docs":{},"i":{"docs":{},"p":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"属":{"docs":{},"性":{"docs":{},"能":{"docs":{},"正":{"docs":{},"确":{"docs":{},"得":{"docs":{},"输":{"docs":{},"出":{"docs":{},"对":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"牌":{"docs":{},"有":{"1":{"docs":{},"和":{"1":{"1":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"在":{"docs":{},"自":{"docs":{},"己":{"docs":{},"内":{"docs":{},"部":{"docs":{},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"嵌":{"docs":{},"套":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"。":{"docs":{},"这":{"docs":{},"个":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"包":{"docs":{},"含":{"docs":{},"两":{"docs":{},"个":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"只":{"docs":{},"有":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"有":{"docs":{},"两":{"docs":{},"个":{"docs":{},"数":{"docs":{},"值":{"docs":{},",":{"docs":{},"其":{"docs":{},"余":{"docs":{},"牌":{"docs":{},"都":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"数":{"docs":{},"值":{"docs":{},"。":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"定":{"docs":{},"义":{"docs":{},"了":{"docs":{},"一":{"docs":{},"个":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},",":{"docs":{},"这":{"docs":{},"个":{"docs":{},"计":{"docs":{},"算":{"docs":{},"属":{"docs":{},"性":{"docs":{},"会":{"docs":{},"根":{"docs":{},"据":{"docs":{},"牌":{"docs":{},"的":{"docs":{},"面":{"docs":{},"值":{"docs":{},",":{"docs":{},"用":{"docs":{},"适":{"docs":{},"当":{"docs":{},"的":{"docs":{},"数":{"docs":{},"值":{"docs":{},"去":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"实":{"docs":{},"例":{"docs":{},",":{"docs":{},"并":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"给":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"j":{"docs":{},",":{"docs":{},"q":{"docs":{},",":{"docs":{},"k":{"docs":{},",":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"会":{"docs":{},"使":{"docs":{},"用":{"docs":{},"特":{"docs":{},"殊":{"docs":{},"数":{"docs":{},"值":{"docs":{},",":{"docs":{},"对":{"docs":{},"于":{"docs":{},"数":{"docs":{},"字":{"docs":{},"面":{"docs":{},"值":{"docs":{},"的":{"docs":{},"牌":{"docs":{},"使":{"docs":{},"用":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"用":{"docs":{},"来":{"docs":{},"描":{"docs":{},"述":{"docs":{},"扑":{"docs":{},"克":{"docs":{},"牌":{"docs":{},"从":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},"~":{"1":{"0":{"docs":{},",":{"docs":{},"j":{"docs":{},",":{"docs":{},"q":{"docs":{},",":{"docs":{},"k":{"docs":{},",":{"1":{"3":{"docs":{},"张":{"docs":{},"牌":{"docs":{},",":{"docs":{},"并":{"docs":{},"分":{"docs":{},"别":{"docs":{},"用":{"docs":{},"一":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"表":{"docs":{},"示":{"docs":{},"牌":{"docs":{},"的":{"docs":{},"面":{"docs":{},"值":{"docs":{},"。":{"docs":{},"(":{"docs":{},"这":{"docs":{},"个":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"类":{"docs":{},"型":{"docs":{},"的":{"docs":{},"值":{"docs":{},"不":{"docs":{},"适":{"docs":{},"用":{"docs":{},"于":{"docs":{},"a":{"docs":{},"c":{"docs":{},"e":{"docs":{},",":{"docs":{},"j":{"docs":{},",":{"docs":{},"q":{"docs":{},",":{"docs":{},"k":{"docs":{"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.0078125}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"docs":{}},"docs":{}}}}}}}}},"docs":{}},"docs":{}}}}}}}}}}}}}},"g":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0019029495718363464},"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.010810810810810811},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251}},"e":{"docs":{},"o":{"docs":{},"f":{"docs":{},"f":{"docs":{},"o":{"docs":{},"u":{"docs":{},"r":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}},"声":{"docs":{},"明":{"docs":{},"成":{"docs":{},"了":{"docs":{},"常":{"docs":{},"量":{"docs":{},"(":{"docs":{},"用":{"docs":{},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{},"关":{"docs":{},"键":{"docs":{},"字":{"docs":{},")":{"docs":{},",":{"docs":{},"即":{"docs":{},"使":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"h":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},"s":{"docs":{},".":{"docs":{},"f":{"docs":{},"i":{"docs":{},"r":{"docs":{},"s":{"docs":{},"t":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}}}}}},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.010830324909747292}},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},"b":{"docs":{},"e":{"docs":{},"r":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0048134777376654635}},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"协":{"docs":{},"议":{"docs":{},"要":{"docs":{},"求":{"docs":{},"其":{"docs":{},"遵":{"docs":{},"循":{"docs":{},"者":{"docs":{},"必":{"docs":{},"须":{"docs":{},"拥":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"名":{"docs":{},"为":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"w":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.006622516556291391},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.007142857142857143}}},"d":{"docs":{},"i":{"docs":{},"u":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0024067388688327317}}}}}},"h":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}},"s":{"docs":{},"i":{"docs":{},"t":{"docs":{},"e":{"docs":{},"m":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0022701475595913734}}}}}}}},"o":{"docs":{},"m":{"docs":{},"e":{"docs":{},"o":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"j":{"docs":{},"u":{"docs":{},"l":{"docs":{},"i":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0055762081784386614}}}}}}}}}}}}}},"o":{"docs":{},"m":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.06984126984126984}},"(":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.012698412698412698}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.006349206349206349}}}}}},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.022222222222222223}}}}}}},"s":{"docs":{},".":{"docs":{},"c":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}},"[":{"docs":{},"i":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}},"数":{"docs":{},"组":{"docs":{},"的":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{},"类":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"很":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"类":{"docs":{},",":{"docs":{},"它":{"docs":{},"只":{"docs":{},"有":{"docs":{},"一":{"docs":{},"个":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"属":{"docs":{},"性":{"docs":{},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"设":{"docs":{},"定":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},",":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"i":{"docs":{},"d":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}},",":{"docs":{},"它":{"docs":{},"被":{"docs":{},"初":{"docs":{},"始":{"docs":{},"化":{"docs":{},"为":{"docs":{},"一":{"docs":{},"个":{"docs":{},"r":{"docs":{},"o":{"docs":{},"o":{"docs":{},"m":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}}}}}}}}}}}},"w":{"0":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"1":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}},"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.04864864864864865}},"和":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"下":{"docs":{},"标":{"docs":{},"脚":{"docs":{},"本":{"docs":{},"的":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}},"的":{"docs":{},"数":{"docs":{},"量":{"docs":{},"来":{"docs":{},"构":{"docs":{},"造":{"docs":{},"一":{"docs":{},"个":{"docs":{},"新":{"docs":{},"的":{"docs":{},"m":{"docs":{},"a":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"x":{"docs":{"chapter2/12_Subscripts.html#gitbook_764":{"ref":"chapter2/12_Subscripts.html#gitbook_764","tf":0.005405405405405406}}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.019464720194647202}},"定":{"docs":{},"义":{"docs":{},"成":{"docs":{},"变":{"docs":{},"量":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"它":{"docs":{},"的":{"docs":{},"值":{"docs":{},"无":{"docs":{},"需":{"docs":{},"在":{"docs":{},"i":{"docs":{},"f":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"l":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.013237063778580024}},"方":{"docs":{},"法":{"docs":{},"用":{"docs":{},"来":{"docs":{},"模":{"docs":{},"拟":{"docs":{},"骰":{"docs":{},"子":{"docs":{},"的":{"docs":{},"面":{"docs":{},"值":{"docs":{},"。":{"docs":{},"它":{"docs":{},"先":{"docs":{},"使":{"docs":{},"用":{"docs":{},"g":{"docs":{},"e":{"docs":{},"n":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"的":{"docs":{},"r":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{},"o":{"docs":{},"m":{"docs":{},"方":{"docs":{},"法":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{},"[":{"0":{"docs":{},"-":{"1":{"docs":{"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0012033694344163659}}},"docs":{}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"获":{"docs":{},"得":{"docs":{},",":{"docs":{},"如":{"docs":{},"e":{"docs":{},"x":{"docs":{},"a":{"docs":{},"m":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{},"u":{"docs":{},"m":{"docs":{},".":{"docs":{},"b":{"docs":{},".":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{},"(":{"docs":{},")":{"docs":{},"。":{"docs":{},"你":{"docs":{},"也":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"调":{"docs":{},"用":{"docs":{},"f":{"docs":{},"r":{"docs":{},"o":{"docs":{},"m":{"docs":{},"r":{"docs":{},"a":{"docs":{},"w":{"docs":{"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"u":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"内":{"docs":{},"存":{"docs":{},"管":{"docs":{},"理":{"docs":{},"操":{"docs":{},"作":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"不":{"docs":{},"再":{"docs":{},"被":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.014970059880239521}},"a":{"docs":{},"l":{"docs":{},"增":{"docs":{},"加":{"docs":{},"a":{"docs":{},"m":{"docs":{},"o":{"docs":{},"u":{"docs":{},"n":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}},"的":{"docs":{},"值":{"docs":{},",":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"了":{"docs":{},"当":{"docs":{},"前":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{},"a":{"docs":{},"l":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"引":{"docs":{},"用":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"仅":{"docs":{},"仅":{"docs":{},"复":{"docs":{},"制":{"docs":{},"该":{"docs":{},"变":{"docs":{},"量":{"docs":{},"的":{"docs":{},"初":{"docs":{},"始":{"docs":{},"值":{"docs":{},"。":{"docs":{},"捕":{"docs":{},"获":{"docs":{},"一":{"docs":{},"个":{"docs":{},"引":{"docs":{},"用":{"docs":{},"保":{"docs":{},"证":{"docs":{},"了":{"docs":{},"当":{"docs":{},"m":{"docs":{},"a":{"docs":{},"k":{"docs":{},"e":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"结":{"docs":{},"束":{"docs":{},"时":{"docs":{},"候":{"docs":{},"并":{"docs":{},"不":{"docs":{},"会":{"docs":{},"消":{"docs":{},"失":{"docs":{},",":{"docs":{},"也":{"docs":{},"保":{"docs":{},"证":{"docs":{},"了":{"docs":{},"当":{"docs":{},"下":{"docs":{},"一":{"docs":{},"次":{"docs":{},"执":{"docs":{},"行":{"docs":{},"i":{"docs":{},"n":{"docs":{},"c":{"docs":{},"r":{"docs":{},"e":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"o":{"docs":{},"r":{"docs":{},"函":{"docs":{},"数":{"docs":{},"时":{"docs":{},",":{"docs":{},"r":{"docs":{},"u":{"docs":{},"n":{"docs":{},"n":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"t":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.004405286343612335}}}}}}},"i":{"docs":{},"s":{"docs":{},"e":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}},"c":{"docs":{},"h":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.005089058524173028},"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.013565891472868217},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.002004008016032064}},"c":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"n":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}},".":{"docs":{},"c":{"docs":{},"u":{"docs":{},"r":{"docs":{},"r":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"l":{"docs":{},"e":{"docs":{},"v":{"docs":{},"e":{"docs":{},"l":{"docs":{"chapter2/10_Properties.html#gitbook_760":{"ref":"chapter2/10_Properties.html#gitbook_760","tf":0.002183406113537118}}}}}}}}}}}}}}}}}}}}}},".":{"docs":{},"i":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093}}},"x":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.005813953488372093}}}},"-":{"docs":{},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}},"d":{"docs":{},"l":{"docs":{},"e":{"docs":{},"i":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}}}},"k":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"a":{"docs":{},"y":{"docs":{},"l":{"docs":{},"e":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867}}}}},"t":{"docs":{},"y":{"docs":{},"a":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}},"n":{"docs":{},"e":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.004319654427645789}}}}},"e":{"docs":{},"i":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.008676789587852495},"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.005988023952095809},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}},"y":{"docs":{},"s":{"docs":{},"或":{"docs":{},"者":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.004338394793926247}}}}}}}},")":{"docs":{},"和":{"docs":{},"/":{"docs":{},"或":{"docs":{},"值":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"是":{"docs":{},"值":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"结":{"docs":{},"构":{"docs":{},"体":{"docs":{},"或":{"docs":{},"枚":{"docs":{},"举":{"docs":{},")":{"docs":{},",":{"docs":{},"当":{"docs":{},"赋":{"docs":{},"值":{"docs":{},"或":{"docs":{},"调":{"docs":{},"用":{"docs":{},"发":{"docs":{},"生":{"docs":{},"时":{"docs":{},",":{"docs":{},"它":{"docs":{},"们":{"docs":{},"都":{"docs":{},"会":{"docs":{},"被":{"docs":{},"拷":{"docs":{},"贝":{"docs":{},"。":{"docs":{},"相":{"docs":{},"反":{"docs":{},",":{"docs":{},"如":{"docs":{},"果":{"docs":{},"键":{"docs":{},"(":{"docs":{},"k":{"docs":{},"e":{"docs":{},"y":{"docs":{},"s":{"docs":{},")":{"docs":{},"和":{"docs":{},"/":{"docs":{},"或":{"docs":{},"值":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"是":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"(":{"docs":{},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"值":{"docs":{},"(":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},")":{"docs":{},"是":{"docs":{},"整":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},")":{"docs":{},"类":{"docs":{},"型":{"docs":{},"。":{"docs":{},"这":{"docs":{},"两":{"docs":{},"种":{"docs":{},"类":{"docs":{},"型":{"docs":{},"在":{"docs":{},"s":{"docs":{},"w":{"docs":{},"i":{"docs":{},"f":{"docs":{},"t":{"docs":{"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.002564102564102564}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0022026431718061676}}}}},"和":{"docs":{},"一":{"docs":{},"个":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}},"-":{"docs":{},"v":{"docs":{},"a":{"docs":{},"l":{"docs":{},"u":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.006309148264984227}}}}}}},"l":{"docs":{},"v":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.003676470588235294}}}}}}},"i":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.0011350737797956867},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.014367816091954023},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.0014285714285714286}}},"g":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625}}}},"t":{"docs":{},"c":{"docs":{},"h":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter2/17_Optional_Chaining.html#gitbook_772":{"ref":"chapter2/17_Optional_Chaining.html#gitbook_772","tf":0.0031746031746031746}}}}}}}},"o":{"docs":{},"a":{"docs":{},"l":{"docs":{},"a":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}},"n":{"docs":{},"o":{"docs":{},"w":{"docs":{},"s":{"docs":{},"o":{"docs":{},"v":{"docs":{},"e":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"d":{"docs":{},"e":{"docs":{},"p":{"docs":{},"a":{"docs":{},"s":{"docs":{},"s":{"docs":{},"w":{"docs":{},"o":{"docs":{},"r":{"docs":{},"d":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.009732360097323601}}}}}}}}}}}}}}}}}}},"n":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251}}}}}},"u":{"docs":{},"b":{"docs":{},"r":{"docs":{},"i":{"docs":{},"c":{"docs":{},"k":{"docs":{"chapter2/18_Type_Casting.html#gitbook_776":{"ref":"chapter2/18_Type_Casting.html#gitbook_776","tf":0.0064794816414686825}}}}}}}},"m":{"docs":{"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}}}},"q":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046}},"u":{"docs":{},"e":{"docs":{},"e":{"docs":{},"n":{"docs":{"chapter1/02_a_swift_tour.html#gitbook_740":{"ref":"chapter1/02_a_swift_tour.html#gitbook_740","tf":0.00340522133938706},"chapter2/19_Nested_Types.html#gitbook_778":{"ref":"chapter2/19_Nested_Types.html#gitbook_778","tf":0.015625}}}},"s":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/09_Classes_and_Structures.html#gitbook_759":{"ref":"chapter2/09_Classes_and_Structures.html#gitbook_759","tf":0.005128205128205128},"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.004866180048661801},"chapter2/16_Automatic_Reference_Counting.html#gitbook_774":{"ref":"chapter2/16_Automatic_Reference_Counting.html#gitbook_774","tf":0.0019047619047619048},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.015772870662460567},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.008016032064128256}},";":{"docs":{},"n":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575}}}}},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}},"a":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.0009514747859181732},"chapter3/03_Types.html#gitbook_793":{"ref":"chapter3/03_Types.html#gitbook_793","tf":0.003236245954692557}},";":{"docs":{},")":{"docs":{},",":{"docs":{},"u":{"docs":{},"+":{"1":{"docs":{},"f":{"4":{"2":{"5":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}},"docs":{}},"docs":{}},"docs":{}}},"docs":{}}}}}}}}}}},"p":{"docs":{},"p":{"docs":{},"l":{"docs":{},"e":{"docs":{},"s":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}}}},"":{"docs":{},"":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0018587360594795538}}}}}}}}},"c":{"docs":{},"h":{"docs":{},"o":{"docs":{},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}},"?":{"docs":{},".":{"docs":{},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"t":{"docs":{},"y":{"docs":{},".":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"m":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"(":{"docs":{},")":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"m":{"docs":{},"i":{"docs":{},"l":{"docs":{},"k":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/04_Collection_Types.html#gitbook_749":{"ref":"chapter2/04_Collection_Types.html#gitbook_749","tf":0.0021691973969631237}}}}}}}}}}},"b":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"大":{"docs":{},"于":{"docs":{},"字":{"docs":{},"母":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"a":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"o":{"docs":{},"m":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"大":{"docs":{},"于":{"docs":{},"字":{"docs":{},"符":{"docs":{},"串":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"t":{"docs":{},"i":{"docs":{},"m":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"y":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"将":{"docs":{},"会":{"docs":{},"排":{"docs":{},"在":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"a":{"docs":{},"l":{"docs":{},"e":{"docs":{},"x":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},"e":{"docs":{},"i":{"docs":{},"g":{"docs":{},"h":{"docs":{},"t":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}},"o":{"docs":{},"n":{"docs":{},"e":{"docs":{},"z":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/07_Closures.html#gitbook_753":{"ref":"chapter2/07_Closures.html#gitbook_753","tf":0.0029940119760479044}}}}}}}}}}}}}}}}}},"g":{"docs":{},"r":{"docs":{},"e":{"docs":{},"e":{"docs":{},"t":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{},"f":{"docs":{},"o":{"docs":{},"r":{"docs":{},"p":{"docs":{},"e":{"docs":{},"r":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"被":{"docs":{},"转":{"docs":{},"换":{"docs":{},"成":{"docs":{},"了":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"-":{"docs":{},"-":{"docs":{},"-":{"docs":{},"-":{"docs":{},"-":{"docs":{},"h":{"docs":{},"e":{"docs":{},"l":{"docs":{},"l":{"docs":{},"o":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0012121212121212121}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"求":{"docs":{},"余":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"比":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"取":{"docs":{},"模":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}}}}},"短":{"docs":{},"路":{"docs":{},"计":{"docs":{},"算":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"的":{"docs":{},",":{"docs":{},"当":{"docs":{},"左":{"docs":{},"端":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"为":{"docs":{},"t":{"docs":{},"r":{"docs":{},"u":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}}},"(":{"docs":{},"s":{"docs":{},"h":{"docs":{},"o":{"docs":{},"r":{"docs":{},"t":{"docs":{},"-":{"docs":{},"c":{"docs":{},"i":{"docs":{},"r":{"docs":{},"c":{"docs":{},"u":{"docs":{},"i":{"docs":{},"t":{"docs":{"chapter2/02_Basic_Operators.html#gitbook_766":{"ref":"chapter2/02_Basic_Operators.html#gitbook_766","tf":0.0024330900243309003}}}}}}}}}}}}}}}}}}}},"按":{"docs":{},"位":{"docs":{},"左":{"docs":{},"移":{"docs":{},"/":{"docs":{},"右":{"docs":{},"移":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter2/23_Advanced_Operators.html#gitbook_787":{"ref":"chapter2/23_Advanced_Operators.html#gitbook_787","tf":0.001937984496124031}}}}}}}}}}}}}}}}},"i":{"docs":{},"n":{"docs":{},"-":{"docs":{},"o":{"docs":{},"u":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}},"二":{"docs":{},"元":{"docs":{},"运":{"docs":{},"算":{"docs":{},"符":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}},"右":{"docs":{},"边":{"docs":{},"参":{"docs":{},"数":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}},"后":{"docs":{},"缀":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"的":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"子":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"中":{"docs":{},"包":{"docs":{},"含":{"docs":{},"了":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},"可":{"docs":{},"选":{"docs":{},"链":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{},";":{"docs":{},",":{"docs":{},"那":{"docs":{},"么":{"docs":{},"只":{"docs":{},"有":{"docs":{},"最":{"docs":{},"外":{"docs":{},"层":{"docs":{},"的":{"docs":{},"表":{"docs":{},"达":{"docs":{},"式":{"docs":{},"返":{"docs":{},"回":{"docs":{},"的":{"docs":{},"才":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"o":{"docs":{},"p":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"左":{"docs":{},"边":{"docs":{},"参":{"docs":{},"数":{"docs":{},"&":{"docs":{},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}},"、":{"docs":{},"未":{"docs":{},"转":{"docs":{},"义":{"docs":{},"的":{"docs":{},"反":{"docs":{},"斜":{"docs":{},"线":{"docs":{},"\\":{"docs":{},"、":{"docs":{},"回":{"docs":{},"车":{"docs":{},"符":{"docs":{},"(":{"docs":{},"c":{"docs":{},"a":{"docs":{},"r":{"docs":{},"r":{"docs":{},"i":{"docs":{},"a":{"docs":{},"g":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}}}}}}}}},"a":{"docs":{},"t":{"docs":{"chapter2/03_Strings_and_Characters.html#gitbook_747":{"ref":"chapter2/03_Strings_and_Characters.html#gitbook_747","tf":0.0037174721189591076}}}},"e":{"docs":{},")":{"docs":{},"\\":{"docs":{},"&":{"docs":{},"#":{"3":{"9":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}},"docs":{}},"docs":{}},"q":{"docs":{},"u":{"docs":{},"o":{"docs":{},"t":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}},"a":{"docs":{},"n":{"docs":{},"t":{"docs":{},"i":{"docs":{},"t":{"docs":{},"i":{"docs":{"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.016544117647058824}}}}}}}}},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.013245033112582781}},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{},"e":{"docs":{},"(":{"docs":{},"\"":{"docs":{},"a":{"docs":{},"b":{"docs":{},"c":{"docs":{},"d":{"docs":{},"e":{"docs":{},"f":{"docs":{},"g":{"docs":{},"h":{"docs":{},"i":{"docs":{},"j":{"docs":{},"k":{"docs":{},"l":{"docs":{},"m":{"docs":{},"n":{"docs":{},"o":{"docs":{},"p":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}}}}}}}}},"l":{"docs":{},"e":{"docs":{},"t":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}},"p":{"docs":{},"r":{"docs":{},"o":{"docs":{},"d":{"docs":{},"u":{"docs":{},"c":{"docs":{},"t":{"docs":{},"c":{"docs":{},"o":{"docs":{},"d":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}},"s":{"docs":{},"t":{"docs":{},"r":{"docs":{"chapter2/08_Enumerations.html#gitbook_757":{"ref":"chapter2/08_Enumerations.html#gitbook_757","tf":0.0033112582781456954}}}}}}}}}}}},"_":{"docs":{"chapter2/01_The_Basics.html#gitbook_745":{"ref":"chapter2/01_The_Basics.html#gitbook_745","tf":0.0035398230088495575},"chapter2/05_Control_Flow.html#gitbook_751":{"ref":"chapter2/05_Control_Flow.html#gitbook_751","tf":0.003805899143672693},"chapter2/06_Functions.html#gitbook_755":{"ref":"chapter2/06_Functions.html#gitbook_755","tf":0.0024242424242424242},"chapter2/11_Methods.html#gitbook_762":{"ref":"chapter2/11_Methods.html#gitbook_762","tf":0.002544529262086514},"chapter2/14_Initialization.html#gitbook_768":{"ref":"chapter2/14_Initialization.html#gitbook_768","tf":0.001838235294117647},"chapter2/20_Extensions.html#gitbook_780":{"ref":"chapter2/20_Extensions.html#gitbook_780","tf":0.0028735632183908046},"chapter2/21_Protocols.html#gitbook_782":{"ref":"chapter2/21_Protocols.html#gitbook_782","tf":0.0036101083032490976},"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.003303964757709251},"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.008849557522123894},"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.01892744479495268},"chapter3/05_Declarations.html#gitbook_801":{"ref":"chapter3/05_Declarations.html#gitbook_801","tf":0.008571428571428572},"chapter3/09_Summary_of_the_Grammar.html#gitbook_805":{"ref":"chapter3/09_Summary_of_the_Grammar.html#gitbook_805","tf":0.01603206412825651}},"c":{"docs":{},"o":{"docs":{},"l":{"docs":{},"u":{"docs":{},"m":{"docs":{},"n":{"docs":{},"_":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}},"f":{"docs":{},"i":{"docs":{},"l":{"docs":{},"e":{"docs":{},"_":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"_":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}}}}}},"l":{"docs":{},"i":{"docs":{},"n":{"docs":{},"e":{"docs":{},"_":{"docs":{"chapter3/04_Expressions.html#gitbook_795":{"ref":"chapter3/04_Expressions.html#gitbook_795","tf":0.0011013215859030838}}}}}}},")":{"docs":{},"。":{"docs":{},"当":{"docs":{},"你":{"docs":{},"不":{"docs":{},"关":{"docs":{},"心":{"docs":{},"被":{"docs":{},"匹":{"docs":{},"配":{"docs":{},"的":{"docs":{},"值":{"docs":{},"时":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"使":{"docs":{},"用":{"docs":{},"此":{"docs":{},"模":{"docs":{},"式":{"docs":{},"。":{"docs":{},"例":{"docs":{},"如":{"docs":{},",":{"docs":{},"下":{"docs":{},"面":{"docs":{},"这":{"docs":{},"段":{"docs":{},"代":{"docs":{},"码":{"docs":{},"进":{"docs":{},"行":{"docs":{},"了":{"1":{"docs":{},".":{"docs":{},".":{"docs":{},".":{"3":{"docs":{"chapter3/07_Patterns.html#gitbook_797":{"ref":"chapter3/07_Patterns.html#gitbook_797","tf":0.004424778761061947}}},"docs":{}}}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"、":{"docs":{},"基":{"docs":{},"本":{"docs":{},"多":{"docs":{},"语":{"docs":{},"言":{"docs":{},"面":{"docs":{},"(":{"docs":{},"b":{"docs":{},"a":{"docs":{},"s":{"docs":{},"i":{"docs":{},"c":{"docs":{"chapter3/02_Lexical_Structure.html#gitbook_799":{"ref":"chapter3/02_Lexical_Structure.html#gitbook_799","tf":0.0031545741324921135}}}}}}}}}}}}}}}}},"length":6381},"corpusTokens":["0","0(空字符)、\\\\(反斜线)、\\t(水平制表符)、\\n(换行符)、\\r(回车符)、\\"(双引号)、\\'","0)。vendcoins方法声明numberofcoinstovend为一个变量参数,这样就可以在方法体的内部修改数字,而不需要定义一个新的变量。vendcoin","0)中的元素0","0)会首先匹配case","0)将匹配一个纵坐标为0的点,并把这个点的横坐标赋给临时的常量x","0),因此剩下的能够匹配(0","0),宽度高度都是10","0),是否在红色的x轴上,是否在黄色y轴上,是否在一个以原点为中心的4x4","0,$1,$2","0,1,2等。每一个没有被赋值的int","0..3","0..count","0..self","0..somecontainer.count","0..time","0.0","0.0)和size(width","0.0125","0.0254","0.0自动推导出它们的类型doubl","0.1","0.14159","0.25","0.37464991998171","0.5","0.729023776863283","0.914399970739201","00000000","00000001","00000100","00001000","00010000","00010001","000123.456","00111100","005","005000.76","02","0746381295[9","08","088haizi","09","0b","0b00000101","0b00001111","0b00010100","0b00111111","0b01011110","0b10001","0b10110010","0b11110000","0b11111100","0o","0o21","0x","0x0000ff","0x00ff00","0x11","0x66","0x99","0xc.3p0","0xcc","0xcc6699","0xcc6699和0x0000ff进行按位与运算,得到0x000099,无需向右移位了,所以结果就是0x99,即十进制的153","0xcc6699和0x00ff00的按位操作得到0x006600。然后向右移动8們,得到0x66,即十进制的102","0xcc6699和0xff0000进行按位与&操作就可以得到红色部分。0xff0000中的0了遮盖了oxcc6699的第二和第三个字节,这样6699被忽略了,只留下0xcc0000","0xff0000","0xfp-2","0xfp2","0x)。小数点两边必须有至少一个十进制数字(或者是十六进制的数字)。浮点字面量还有一个可选的指数(exponent),在十进制浮点数中通过大写或者小写的e来指定,在十六进制浮点数中通过大写或者小写的p","0——编译器会正确的推断出x的类型int。类似的,当完整的类型可以从上下文推断出来时,你也可以忽略类型的一部分。比如,如果你写了let","0。移位过程中保持符号会不变,负数在接近0","0中x的类型首先根据0的类型进行推断,然后将该类型信息传递到根节点(变量x","0为fals","0为true的时候代码运行才会继续,也就是说,当age的值非负的时候。如果age的值是负数,就像代码中那样,ag","0到25","0和$1表示闭包中第一个和第二个string","0和maxpasseng","0始的列表(如数组)时,非常方便地从0","0或nil","0或空值(比如说0或nil)。swift","0是需要向正数走还是向负数走。currentvalu","0的数据项的值再次等于"six","0而不是1","0)只在for循环的生命周期里有效。如果想在循环结束后访问index的值,你必须要在循环生命周期开始前声明index","0,1,2","0,1,2,3","0,代表正数,另外7比特位二进制表示的实际值就刚好是4","0,你可以完全忽略类型而简写成var","0,或者对0","0,负数为1","1","1(11111111向右移1位)。蓝色的是被移位的,灰色是被抛弃的,橙色的0","1(11111111向左移1","1...10","1...3","1...4","1...5","1...amounttopad","1...digitindex","1...finalsquar","1...power","1.0","1.0\"(这个点在x等于1.0","1.0,1.0","1.21875e1","1.25","1.25e-2","1.25e2","1.5","1.8","10","10,000","10...99","10.0","100","100...999","100.0","1000...999_999","10000","10000.56","1000000","10000000","1000_000","100,结合性被初始化为none","102","103","105","107","1080","1080i","10^-2","10^2","10^-2","10_000","10_000.56","10x10","10中,如果number为16,则返回6,58返回8,510返回0","10为0,这时闭包会将字符串输出,而map","10可以总是作为一个digitnam","10次,使用1到10的闭区间循环。这个计算并不需要知道每一次循环中计数器具体的值,只需要执行了正确的循环次数即可。下划线符号_","10被传递给x","10,同时maxinputlevelforallchannel","11","110","111","11111110","11111111","11,则会将右声道的currentlevel","12","12,gener","12-side","12.1875","12.5663708","120","123","1234567890123456","123456789[0]返回9","123456789[1]返回8","1234_5678_9012_3456","125.0","125.0;同样,1.25e-2","127","128","1280","128054","128054,是一个十六进制1f436","12880","128,即二进制的10000000。用溢出减法减去去1后,变成了01111111,即uint8所能承载的最大整数127","13","130","132","135","139968.0","140","144","15","15),表示向右上方移动正方形到如图所示橙色正方形的位置。设置属性center","15.0","150","153","159","16","160","16。十六进制中每两个字符是8比特位,所以移动16位的结果是把0xcc0000变成0x0000cc。这和0xcc是相等的,都是十进制的204","16变成了1,58变成了5,510变成了51","17","182","19","1920","195.m","1],编译提也能推断出dict的类型是dictionary<str","1_000.0","1_000_000","1_000_000.000_000_1","1。person具有一个可选residence属性,它的类型是resid","1个比特位(称为符号位)来表达这个整数是正数还是负数。0代表正数,1","1位时乘于2,右移1位时除于2","1到5的数字。index被赋值为闭区间中的第一个数字(1),然后循环中的语句被执行一次。在本例中,这个循环只包含一个语句,用来输出当前index","1千米等于1,000米,所以km计算型属性要把值乘以1_000.00来转化成单位米下的数值。类似地,1米有3.28024英尺,所以ft计算型属性要把对应的double值除以3.28024","1或减1","1时才为1","1的便捷自增运算符++i","1的条件是两个输入数的同一位不同,如果相同就设为0","1的条件是两个输入数的同一位都不为0(即任意一个为1,或都为1","1的比较结果是bool类型,所以第二个例子可以通过类型检查。类似i","1的简写,而--i是i","1)都被锁定。每次有玩家完成一个等级,这个等级就对这个设备上的所有玩家解锁。leveltrack","1,objective-c","1,代表负数,7个数值位要表达的二进制值是124,即128","2","2\"(最高等级现在是2","2(associ","2)中的元组模式(x","2)的结构是逗号分隔的,包含两个元素的列表。因为模式代表一种值的结构,而不是特定的某个值,你可以把模式和各种同类型的值匹配起来。比如,(x","2,000","2,100","2,953","2...2","2.0","2.0,4.0","2.5","2.71828","20","200","2000","2001","204","2048","21","2100","212.0","21位数字(和名称),例如u+0061表示小写的拉丁字母a","22","23","24","240","243610.0","243_610","25","25.0","25.4.mm","255","26","273.15","29573.0","2^-2","2^2","2_000","2。它简洁地表达根据问题成立与否作出二选一的操作。如果问题成立,返回答案1","2中,加号+是二元运算符,它的两个操作数是值1和2","2倍,非常好,那余数是1","2和3。而两个指定构造器必须调用父类中唯一的指定构造器,这满足了规则1","2和3。这个父类没有自己的父类,所以规则1","2是a","2的n次方减去它的绝对值,n为数值位的位数。一个8比特的数有7个数值位,所以是2的7次方,即128","2的整数。向左移动一个整型的比特位相当于把这个数乘于2,向右移一位就是除于2","2)。复杂些的运算例如逻辑与运算符&&(如if","2:返回对应的type。我们可以用它来动态的获取某个instance的typ","3","3.0","3.0,1.0","3.1","3.14159","3.1415927","3.14159,0.1和-273.15","3.2","3.28084","3.59","3.69","3.75","3.79","3.ft","3.repetit","30","30.0","305014012,307017261","32","32.0","32767","32位平台上,int和int32","32位平台上,uint和uint32","33","35","35.0","35;paramet","360","3877.0","39","39;&'","39;,'","39;,'分隔。一旦使用了参数列表,就必须使用'in'关键字(在任何情况下都得这样做,包括忽略参数的名字,typ","39;.dynamictype'","39;.self'","39;?'","39;as'","39;in'","39;is'","39;type","39;unowned'","39;weak'","3_000_000_000_000","3可以直接和字面量0.14159","3和5。它用传入3和5","3条件为fals","3步。如果为false,stat","3没有显式声明类型,而表达式中出现了一个浮点字面量,所以表达式会被推断为doubl","3的10次幂),从1(3的0次幂)开始做3","3的6倍是18","4","4...9","4.0","4.75会变成4,-3.9会变成-3","40","40.0","404","42","42.0","42.km","42495.0","42和-23","42并且没有标明类型,swift","42被绑定(赋值)给常量somevalu","43","480","4]],array3d[0][1]是指[3","4],array3d[0][1][1]则是指值4","4个string","4个元素,但0..count只数到3","4而不是0。优先级高的运算符要先计算,在swift和c","4,你先计算出4的多少倍会刚好可以容入9","5","5.0","5.0,5.0","5.2","50","5000.76","510","536","55357","55357),第二个值为u+dc36","56374","58","59049","597","6","6,gener","6-side","6.0","60.0","60;同样,0xfp-2","64位平台上,int和int64","64位平台上,uint和uint64","65","68","69105","6月12日凌晨4:38,我用了整整一晚上的时间来进行最后的校对,终于可以在12","6的形式分组,其结果为-7","6被以(4","6项,而且不包括mapl","6,7,8","7","7,900","7.5","7.simpledescript","70","70.0","72","73","746381295[0","746381295[1","746381295[2","746381295[8","746381295[9","75","77","777","7900","7,类型属性maxinputlevelforallchannel","8","8.0","8590951226","85909_51226","86","87","896","8:09","8位无符号整数类型是uint8,32位有符号整数类型是int32","8除于2.5等于3余0.5,所以结果是一个double值0.5","8,16,32和64","9","9.3","9.45","9.9","90","94","95;_column__","95;_file__","95;_function__","95;_line__","9900","9和4代入等式中,我们得1","9和4代入等式,-2","9天就完成整本书的翻译。我不知道大家付出了多少,牺牲了多少,但是我知道,他们的付出必将被这些文字记录下来,即使再过10年,20","9天时间,1317","9的行星,通过fromraw返回的可选planet值将是nil","_","_column_","_file_","_function_","_line_","_、基本多语言面(basic","_)。当你不关心被匹配的值时,可以使用此模式。例如,下面这段代码进行了1...3","a++.b","a++,是先返回了a的值,然后a才加1。所以c得到了a的旧值1,而a加1后变成2","a+b","a,b,c","a...b)定义一个包含从a到b(包括a和b","a..b和a...b","a..b)定义一个从a到b但不包括b","a.adjust","a.append(4","a.simpledescript","a516af6a531a104ec88da0d236ecf389a5ec72af","a[0","aardvark","abcdefghijklmnop","ac","access","ace.toraw","acerawvalu","act","act1scenecount","actualnumb","actualnumber常量可以在if语句的第一个分支中使用。它已经被可选类型包含的值初始化过,所以不需要再使用!后缀来获取它的值。在这个例子中,actualnumb","actual)拷贝才会被执行。swift","ad","add","addon","addone(numb","address","address。它有三个类型是string?的可选属性。前面两个可选属性buildingnam","address类中的buildingidentifi","address类还提供了一个buildingidentifier的方法,它的返回值类型为string?。这个方法检查buildingname和buildingnumber的属性,如果buildingname有值则将其返回,或者如果buildingnumb","address设定一个实例来作为john.residence.address的值,并为address的street","addthesecondnumb","addthesecondnumber(b","addtwoint","addtwoints(a","addtwoints,并输出结果:8","addtwonumbers(4)(5","addtwonumbers(a","adescript","adjust","adopt","advanc","advancetolevel(level","afterdoubl","afterincr","ag","again","ages的字典,其中储存了四个人的名字和年龄。ages字典被赋予了一个名为copiedages的新变量,同时ages在赋值的过程中被拷贝。赋值结束后,ages和copiedag","airport","airport'","airportcod","airportnam","airports.count","airports.kei","airports.removevalueforkey(\"dub","airports.updatevalue(\"dublin","airports.valu","airports[\"apl","airports[\"dub","airports[\"lhr","airports字典使用字典字面量初始化,包含两个键值对。第一对的键是tyo,值是tokyo。第二对的键是dub,值是dublin","airports字典被声明为变量(用var关键字)而不是常量(let","airports字典被定义为一种dictionary<str","alex","aliases)就是给现有类型定义另一个名字。你可以使用typealia","alien","alignright","alignright(originalstr","alignright(var","alik","allitemsmatch","allitemsmatch(stackofstr","allitemsmatch的泛型函数,用来检查是否两个container单例包含具有相同顺序的相同元素。如果匹配到所有的元素,那么返回一个为true的boolean","allitemsmatch首先检查两个容器是否拥有同样数目的items,如果它们的元素数目不同,没有办法进行匹配,函数就会fals","allow","allowedentri","alow","alsoincrementbyten","alsominussix","alsoposit","alsoteneighti","alsoteneighty.framer","alsoteneighty的新常量,同时对alsoteneighti","alsotentighti","alt","alt=\"comput","alt=\"stat","alternativerect","amarathon","ami","amount","amounttopad","amount变量,incrementor实际上捕获并存储了该变量的一个副本,而该副本随着incrementor","amount和numberoftimes。默认情况下,swift","amount当作一个局部名称,但是把numberoftim","amount或者runningtotal来声明在嵌入的incrementor","amount,表示每次incrementor被调用时runningtot","amp","amp;&","amp;&和||的复合逻辑。但无论怎样,&&","amp;/和&%进行除0操作时就会得到0","andrea","anim","animal(leg","animalnam","anish","anna","annot","anonym","anoth","anothercharact","anothercontain","anothercontainer.count","anothercontainer[i","anothercontainer是一个c2","anotheremptystr","anotherint","anothermathfunct","anotherpi","anotherpoint","anotherproctocol","anotherproperti","anotherprotocol","anotherprotocol>这样的格式进行组合,称为协议合成(protocol","anotherstr","anotherthreedoubl","anothertwothre","anothervalu","anothervector","answer","answer1","answer2","ant","anycommonel","anycommonelements([1","anyobject","anyobject可以代表任何class","any可以表示任何类型,除了方法类型(funct","any和anyobject","apart","apartment(numb","apartment实例有一个叫number,类型为int的属性,并有一个可选的初始化为nil的tenant属性。ten","apartment实例的强引用来自于变量number73。如果你断开这个强引用,再也没有指向apart","api","apis,它一般接收一个anyobject","apl","append","append(item","appending),插入(inserting),删除(removing)或者使用范围下标(rang","append方法添加一个新item","appl","applese","applesummari","appropri","arbitrari","arc","arc)这一机制来跟踪和管理你的应用程序的内存。通常情况下,swift","area","area:≈radiu","argument","argyrio","arithmet","arithmeticmean(1","arithmeticmean(3","arithmeticmean(numb","arrai","array<int>>","array<int>替代泛型类型array<t>的类型形参t","array<sometype>这样的形式,其中sometyp","array(airports.kei","array(airports.valu","array(count","array3d","array3d[0]是指[[1","array$0$1$2`。例如,class`class`。反引号不属于标识符的一部分,`x`(x","comparable等同于t","comparable表示任何用于替代类型形参t的类型实参必须满足compar","comparable,等等),但是依然可以用来对类型形参及其关联约束提供更复杂的约束。如,<t","compasspoint","compasspoint.west","compasspoints例子中,north,south,east和west不是隐式的等于0,1,2和3。相反的,这些不同的枚举成员在compasspoint","compasspoint和planet","compil","compile-tim","completedlevel(level","composit","compound","comput","computedtypeproperti","concaten","condit","condition(item","conform","congruenti","conjunct","consid","conson","constant","constantnam","constantstr","constrain","contain","container协议声明了一个itemtype的关联类型,写作typealia","container协议的例子,定义了一个itemtyp","container协议的泛型stack","container协议的类型必须指定存储在其里面的值类型,必须保证只有正确类型的items可以加进容器里,必须明确可以通过其下标返回item","container协议需要一个方法指定容器里的元素将会保留,而不需要知道特定容器的类型。container协议需要指定任何通过append","containsave","containscharact","containscharacter(#str","containscharacter(str","contentheight","context","context)单表达式闭包隐式返回(implicit","continu","continue、break和fallthrough语句。return","continue语句用于终止循环中当前迭代的执行,但不会终止该循环的执行。使用continue语句时,可以只写continue这个关键词,也可以在continue后面跟上标签名(label","continue语句,使本次循环迭代结束,从新开始下次循环迭代。这种行为使switch","control","conveni","convert","convertednumb","convertedrank","convertedrank.simpledescript","copi","copiedag","copiedages[\"pet","copiednam","copiedname[0","copy方法进行强制显式复制。这个方法对数组进行了浅拷贝(shallow","count","count(\"som","count(str","countedth","countel","countelements(str","countelements(stringtoprint","countelements(unusualmenageri","countelements返回的字符数量并不总是与包含相同字符的nsstring的length属性相同。nsstring的length","counter","counter.count","counter.datasourc","counter.incr","counter.incrementby(2","counter.incrementby(5","counter.reset","counterdatasourc","counterdatasource含有incrementforcount的可选方法和fiexdincr","counter中已经示范了:counter中的三个实例方法中都使用的是count(而不是self.count","counter的另一个版本(它定义了一个更复杂的incrementbi","counter类使用counterdatasource类型的外部数据源来提供增量值(incr","counter类含有counterdatasource?类型的可选属性datasourc","counter这个类还声明了一个可变属性count","counter,count","countri","country(area","country(nam","country.capitalcity.nam","country和city的实例,而不产生循环强引用,并且capitalc","country和city,每个类将另外一个类的实例保存为属性。在这个模型中,每个国家必须有首都,而每一个城市必须属于一个国家。为了实现这种关系,country类拥有一个capitalcity属性,而city类有一个countri","country的构造函数调用了city的构造函数。然而,只有country的实例完全初始化完后,country的构造函数才能把self传给c","count属性用于存储当前的值,increment方法用来为count","count属性获取容器里items的数量,并返回一个int","count属性进行比较来在使用某个索引之前先检验是否有效。除了当count","coverxit","cow","creditcard","creditcard(numb","cuatro","cuboid","cuboid(width","cuboid的结构体,表示三维空间的立方体,包含width、height和depth属性,还有一个名为volume的只读计算属性用来返回立方体的体积。设置volume的值毫无意义,因为通过width、height和depth就能算出volume。然而,cuboid","cucumb","cun","current","currentdirect","currentlevel","currentlevel值大于任何之前任意audiochannel实例中的值,属性监视器将新值保存在静态属性maxinputlevelforallchannel","currentlevel包含didset","currentlevel属性,leveltracker定义了实例方法advancetolevel。这个方法会在更新currentlevel之前检查所请求的新等级是否已经解锁。advancetolevel方法返回布尔值以指示是否能够设置currentlevel","currentlevel的新值大于允许的阈值thresholdlevel,属性监视器将currentlevel的值限定为阈值thresholdlevel","currentloginattempt","currentvalu","curri","curtiz","custom","customer(nam","customer和creditcard","customer和creditcard之间的关系与前面弱引用例子中apartment和person的关系截然不同。在这个数据模型中,一个客户可能有或者没有信用卡,但是一张信用卡总是关联着一个客户。为了表示这种关系,customer类有一个可选类型的card属性,但是creditcard类有一个非可选类型的custom","customer和creditcard的例子展示了一个属性的值允许为nil,而另一个属性的值不允许为nil","customer实例持有对creditcard实例的强引用,而creditcard实例持有对custom","customer实例的强引用,该实例被销毁了。其后,再也没有指向creditcard","customer的无主引用,当你断开john变量持有的强引用时,再也没有指向custom","customer类的实例,用它初始化creditcard实例,并将新创建的creditcard实例赋值为客户的card","c继承而来的新协议protocol","c语言中的数值计算,swift的数值计算默认是不可溢出的。溢出行为会被捕获并报告为错误。你是故意的?好吧,你可以使用swift为你准备的另一套默认允许溢出的数值运算符,如可溢出加&+。所有允许溢出的运算符都是以&","c,c","d","d12","d6","d6.roll","d``o``g``!和🐶(dog","dabing1022","dai","daniella","data","data.txt","dataimport","dataimporter和datamanag","datamanag","datamanager也可能不从文件中导入数据。所以当datamanager的实例被创建时,没必要创建一个dataimporter的实例,更明智的是当用到dataimport","datamanager的一个功能是从文件导入数据,该功能由dataimporter类提供,dataimport","datamanager类包含一个名为data的存储属性,初始值是一个空的字符串(string)数组。虽然没有写出全部代码,datamanag","datasourc","datasource?.fixedincr","datasource?.incrementforcount?(count","datasource可能为nil,因此在datasource后边加上了?标记来表明只在datasource非空时才去调用incrementforcount","datasource存在,但是也无法保证其是否实现了incrementforcount方法,因此在incrementforcount","dave","dc","decim","decimalbas","decimaldoubl","decimalinteg","declar","decompos","decrement","default","defaultrect","default)分支满足该要求,这个默认分支必须在switch","defin","definit","definitestr","deinit","deiniti","deinit来标示析构函数,类似于初始化函数用init","deleg","delegate?.game(self,didstartnewturnwithdicerol","delegate?.gamedidend(self","delegate?.gamedidstart(self","delegate不为nil","delegate属性为nil","delegate并不是该游戏的必备条件,delegate被定义为遵循dicegamedeleg","delegate是一个遵循dicegamedelegate的可选属性,因此在plai","deltai","deltax","deni","depth","descript","design","diamond","dic","dice","dice(sid","dice.rol","dicegam","dicegamedeleg","dicegamedelegate协议提供了三个方法用来追踪游戏过程。被放置于游戏的逻辑中,即plai","dicegametrack","dicegametracker实现了dicegamedeleg","dicegametracker遵循了dicegamedeleg","dicegame协议可以在任意含有骰子的游戏中实现,dicegamedelegate协议可以用来追踪dicegam","dicerol","diceroll:int","diceroll的值并不是一个随机数,而是以0为初始值,之后每一次while循环,diceroll的值使用前置自增操作符(++i","diceroll调用完成后,返回值等于diceroll自增后的值。任何时候如果diceroll的值等于7时,就超过了骰子的最大值,会被重置为1。所以diceroll的取值顺序会一直是1,2,3,4,5,6,1,2","dice含有sides和generator两个属性,前者用来表示骰子有几个面,后者为骰子提供一个随机数生成器。由于后者为randomnumbergener","dice的类,用来代表桌游中的n","dice类型的实例可被当作textrepresent","dice类遵循textrepresent","dict","dictionari","dictionary<keytyp","dictionary<str","dictionary(arrai","equatable类型都可以安全的使用在findindex函数中,因为其保证支持等式操作。为了说明这个事实,当你定义一个函数时,你可以写一个equat","equatable,也就意味着“任何t类型都遵循equat","equilater","equilateraltriangl","equilateraltriangle(sidelength","equival","ericzyh","error","error(error","error(str","evaluation)"","even","everyth","evilcom","ewa","eww","exampleclass","exampleenum","exampleenum.a的值是0,exampleenum.b的值是。因为exampleenum.c的值被显式的设定为5","exampleenum.d的值会自动增长为6","examplemodule.mytyp","exampleprotocol","execut","exist","explicit","explicitdoubl","exponentdoubl","export","express","expression)。起保护作用的表达式是这样构成的:关键字where后面跟着一个作为额外测试条件的表达式。因此,当且仅当控制表达式匹配一个cas","expression.dynamictyp","expression.init(initi","expression.memb","expression.self","expression[index","expressions)sort","expressions)二元表达式(binari","expressions)函数调用表达式(funct","expressions)前缀表达式(prefix","expressions)字符型表达式(liter","expressions)赋值表达式(assign","expression)dynamic表达式(dynam","expression)self表达式(self","expression)。通常会增加或减少计数器的值,或者根据语句(stat","expression)下标脚本表达式(subscript","expression)初始化函数表达式(initi","expression)可选链表达式(optional-chain","expression)后缀self表达式(postfix","expression)后缀表达式(postfix","expression)圆括号表达式(parenthes","expression)强制取值表达式(forced-valu","expression)显式成员表达式(explicit","expression)被调用,如果表达式调用结果为false,循环结束,继续执行for","expression)超类表达式(superclass","expression)通配符表达式(wildcard","expression)闭包表达式(closur","expression)隐式成员表达式(implicit","expression),switch","exp,那这个数相当于基数和10^exp","exp,那这个数相当于基数和2^exp","extens","extension-bodi","extensions)扩展语法(extens","extern","f","f()和f(x:7)都是只有一个变量x的函数的有效调用,但是f(7","f(7","f(x","f.temperatur","face字符的utf-16","face的4","face的unicod","face,unicod","fahrenheit","fahrenheit时为属性temperatur","fahrenheit,它拥有一个double类型的存储型属性temperatur","fail","failur","fall","fallthrough","fallthrough关键字。下面的例子使用fallthrough","fallthrough语句。关于fallthrough","fallthrough语句可出现在switch","fallthrough语句用于在switch语句中传递控制权。fallthrough语句会把控制权从switch","fallthrough语句,详情请参考贯穿(fallthrough","fallthrough)区间匹配(rang","fals","false。同样的,item","false,但是我们是知道紧急情况下重置的密码的,所以整个复杂表达式的值还是tru","false,整个表达式的值就为false。事实上,如果第一个值为fals","fd5788","feed","feed)\\n","feed)(u+000a)、回车符(carriag","feed)(u+000c)以及空(null)(u+0000","feet","few","fibonacci","filenam","file),它返回的是当前modul","final","finalsquar","finalsquare、board、square和dicerol","finalsquare)和while方式相同,但是只会在循环结束后进行计算。在这个游戏中,do-while表现得比while循环更好。do-while方式会在条件判断square没有超出后直接运行squar","finalsquare,这表明你必须刚好落在方格25","final来防止它们被重写,只需要在声明关键字前加上@final特性即可。(例如:@fin","findindex([\"mik","findindex([3.14159","findindex(arrai","findindex中这个单个类型参数写做:t","findindex函数现在则可以成功的编译过,并且作用于任何遵循equatable的类型,如double或str","findindex,用某个类型t","findstringindex","findstringindex(arrai","findstringindex(str","findstringindex的泛型版本findindex。请注意这个函数仍然返回int","findstringindex的非泛型函数,该函数功能是去查找包含一给定string值的数组。若查找到匹配的字符串,findstringindex函数返回该字符串在数组中的索引值(int),反之则返回nil","first","first-class)类型。它们采用了很多传统上只被类(class)所支持的特征,例如计算型属性(comput","firstbit","firstbits和otherbits都有一个1跟另一个数不同的。所以按位异或的结果是把它这些位置为1,其他都置为0","firstforloop","firstitem","firstnumb","firstnumber是一个值为10的常量,secnodename是一个值为42","firstprotocol","firstroomnam","firstsixbit","firstsixbits和lastsixbits中间4个位都为1。对它俩进行按位与运算后,就得到了00111100,即十进制的60","firstvalu","firstvector","five","fiveeight","fiveonezero","fixedincr","fixedlengthrang","fixedlengthrange(firstvalu","fixedlengthrange的实例包含一个名为firstvalue的变量存储属性和一个名为length的常量存储属性。在上面的例子中,length","fixedpoint","fixedpoint.movebyx(2.0","flat","float","floating-point","float并指定初始值为4","float表示32","flour","flow","flow)中介绍,当考虑一个枚举的成员们时,一个switch语句必须全面。如果忽略了.west这种情况,上面那段代码将无法通过编译,因为它没有考虑到compasspoint","follow","food","food(nam","food、recipeingredient以及shoppinglistitem","food的子类recipeingredient。recipeingredient类构建了食谱中的一味调味剂。它引入了int类型的数量属性quantity(以及从food继承过来的name属性),并且定义了两个构造器来创建recipeingredi","food类中的构造器init(nam","food类提供了一个接受单一参数name的指定构造器。这个构造器可以使用一个特定的名字来创建新的food","food,它是一个简单的用来封装食物名字的类。food类引入了一个叫做name的string类型属性,并且提供了两个构造器来创建food","for-condition-increment)循环,swift","for-in","for-infor条件递增(for-condition-increment)whil","for-in循环和半闭区间操作(..)来迭代somecontainer中的所有元素。对于每个元素,函数检查是否somecontainer中的元素不等于对应的anothercontainer中的元素,如果这两个元素不等,则这两个容器不匹配,返回fals","for-in循环来遍历字符串中的字符(charact","for-in循环来遍历某个字典中的键值对。每一个字典中的数据项都由(kei","for-in循环的介绍请参见for","for-in循环请参见for","for-in循环,swift","for-in循环,用来更简单地遍历数组(array),字典(dictionary),区间(range),字符串(str","for-in用来遍历一个区间(range),序列(sequence),集合(collection),系列(progress","for-in语句允许在重复执行代码块的同时,迭代集合(或遵循sequ","for-in语句或者变量或常量申明时,它可以包含通配符模式,标识符模式或者其他包含这两种模式的模式。例如,下面这段代码是不正确的,因为(x","forc","force-unwrap","forced-valu","forget","forkei","fork,超过30人参与翻译和校对工作,项目最高排名github总榜第4","form","for和while循环,基于特定条件选择执行不同代码分支的if和switch语句,还有控制流程跳转到其他代码的break和continu","for循环用来按照指定的次数多次执行一系列语句。swift","for条件递增(for-condition-incr","for条件递增(for-condition-increment)循环体中,在调用continu","for语句、for-in语句、while语句和do-whil","for语句中,continue语句执行后,incr","for语句的作用域以内有效。condit","found","found"","found")元组把一个int值和一个str","foundat","foundindex","four","fourbyfivebytwo","fourbyfivebytwo.volum","framer","freezingpointofwat","freezingpointofwater.temperatureincelsiu","friar","friendlywelcom","friendlywelcome的值从"hello!"改为了"bonjour!"","fromfahrenheit,内部名字为fahrenheit;第二个构造器也拥有一个构造参数,其外部名字为fromkelvin,内部名字为kelvin。这两个构造器都将唯一的参数值转换成摄氏温度值,并保存在属性temperatureincelsiu","fromraw方法来试图找到具有特定原始值的枚举成员。这个例子通过原始值7识别uranu","fromthetop","fruit","fruitsummari","ft","fullnam","fullynam","fullynamed协议含有fullname属性。因此其遵循者必须含有一个名为fullname,类型为str","func","function","functions)函数参数与返回值(funct","functions)函数的定义与调用(defin","functions)尾随闭包(trail","functions),它们定义在全局域中。你也可以把函数定义在别的函数体中,称作嵌套函数(nest","function)中,__function__","function)的类型相当于一个嵌套函数类型。例如,下面的柯里化函数addtwonumber()()的类型是int","function)闭包表达式语法(closur","func关键字之前加上关键字class;声明结构体和枚举的类型方法,在方法的func关键字之前加上关键字stat","func来声明一个函数,使用名字和参数来调用函数。使用->","g","game","game(gam","game,d12,simothehamst","game.deleg","game.dice.sides)-sid","game.plai","gamedidend(gam","gamedidstart(gam","gamedidstart方法从game参数获取游戏信息并输出。game在方法中被当做dicegame类型而不是snakeandladders类型,所以方法中只能访问dicegam","gameloop","gameloop去跳转到下一次循环迭代时,这里使用gameloop标签并不是严格必须的。因为在这个游戏中,只有一个循环体,所以continue语句会影响到哪个循环体是没有歧义的。然而,continue语句使用gameloop标签也是没有危害的。这样做符合标签的使用规则,同时参照旁边的break","gameloop语句结束本次whil","gameloop语句跳转控制去执行whil","gear","geek5nan","gener","generate方法来获取一个生成器类型(这是一个遵循gener","generator.random","getgaspric","gettable,但它不要求属性是存储型属性(stor","getter","getter-claus","getter-sett","getter-setter-block","getter-setter关键字(keyword","getter-setter方法​​块可以由一个getter子句后跟一个可选的setter子句构成,用大括号括起来,或者由一个setter子句后跟一个gett","getter/sett","getters和sett","getters和setters。(译者注:getters和sett","getter关键字(keyword","getter和sett","getter和setter。如果下标脚本申明包含get和set","getter和setter要求。结果就是你不需要在协议里它被声明的地方实现getter和sett","getter和setter要求可以通过一致性类型以各种方式满足。如果属性声明包含get和set关键词,一致性类型就可以用可读写(实现了getter和setter)的存储型变量属性或计算型属性,但是属性不能以常量属性或只读计算型属性实现。如果属性声明仅仅包含get","getter和setter语句。如果下标脚本声明值包含get","getter用于读取值,setter用于写入值。setter子句是可选的,当仅需要一个getter子句时,可以将二者都忽略且直接返回请求的值即可。也就是说,如果使用了setter子句,就必须使用gett","getter用来读取变量值,setter用来写入变量值。setter子句是可选择的,只有gett","getter获取某个值,或者通过sett","getter语句,可以选择是否包含sett","get代码块中的代码写在subscript","get关键字表示。它们的返回值是double型,而且可以用于所有接受doubl","get部分返回值是int?,上例中的numberoflegs字典通过附属脚本返回的是一个int?或者说“可选的int”,不是每个字典的索引都能得到一个整型值,对于没有设过值的索引的访问返回的结果就是nil;同样想要从字典实例中删除某个索引下的值也只需要给这个索引赋值为nil","ghostbust","give","given","global","goe","gonna","good","goodby","graham","grammar","great","green","greencompon","greet","greet(\"bob","greet(nam","grid","grid[(row","grtmndsthnklk","gt","gt;>","gt;"","gt;!&","guard","guard-claus","guard-express","h","half-clos","halfopenrangelength(start","hall","hamster","hamster(nam","hamster的实例可以作为textrepresent","haolloyin","happi","happym","harmless","hasanymatches(list","hasanymatches(numb","hasarea","hasarea协议时,通过as?操作符将其可选绑定(opt","hasdoorkei","hasdoorkey)为false,但第二个值(knowsoverridepassword)为true,所以整个表达是tru","hashabl","hashable和valuetype产生的。每一个类型实参必须满足它所替代的泛型形参的所有约束,包括任何where子句所指定的额外的要求。上面的例子中,类型形参keytype要求满足hashable协议,因此string也必须满足hash","hashead","hasprefix","hasprefix/hassuffix","hassuffix","hawk","hawstein","hd","hd.width","hd实例中width属性还是1920","hd的常量,其值为一个初始化为全高清视频分辨率(1920","hd赋予给cinema的时候,实际上是将hd中所存储的值(values)进行拷贝,然后将拷贝的数据存储到新的cinema实例中。结果就是两个完全独立的实例碰巧包含有相同的数值。由于两者相互独立,因此将cinema的width修改为2048并不会影响hd中的宽(width","head","heart","hearts.simpledescript","heartsdescript","heartssymbol","hearts成员:给hearts常量赋值时,枚举成员suit.hearts需要用全名来引用,因为常量没有显式指定类型。在switch里,枚举成员使用缩写.hearts来引用,因为self的值已经知道是一个suit","heathrow","height","height=\"120","height=\"169","height=\"357","height=\"387","heigth","hello","hello-world","help","here","here'","hexadecim","hexadecimaldoubl","hexadecimalinteg","high","highest","highestunlockedlevel","highland","hilari","honghaoz","horizont","horribl","hors","href=\"https://github.com/numbbbbb/the-swift-programming-language-in-chinese/raw/gh-pages/source/chapter1/guidedtour.playground.zip\">打开playgroundhello","pad","paddeddoubl","paddedstr","paint","pair","pairs)。遍历字典时,字典的每项元素会以(kei","paragraph","paragraph变量为nil,打破它持有的htmlelement实例的强引用,htmlel","paragraph变量定义为可选htmlelement,因此我们可以赋值nil","parakeet","paramet","parameter),不支持默认参数(default","parameter-claus","parameternam","parameters"","parameters)或返回类型(return","parameters)指定一个或多个用于在相关类型的下标脚本中访问元素的索引(例如,表达式object[i]中的i)。尽管用于元素访问的索引可以是任意类型的,但是每个变量必须包含一个用于指定每种索引类型的类型标注。返回类型(return","parameters)函数类型(funct","parameters)常量参数和变量参数(const","parameters)无参函数(funct","parameters)无返回值函数(funct","parameters)输入输出参数(in-out","parent","parenthes","passedretinascan","passeng","pattern","pattern-matched)的,和其相反的是switch语句case块中枚举事件匹配,在枚举事件类型(enumer","patterns)表达式模式(express","patterns)通配符模式(wildcard","pattern)代表了单个值或者复合值的结构。例如,元组(1","pattern)值绑定模式(value-bind","pattern)元组模式(tupl","pattern)和元组模式(tupl","pattern)枚举用例模式(enumer","pattern)标识符模式(identifi","pattern)类型转换模式(type-cast","pattern),标识符模式(identifi","peiyucn","penguin","pepper","performact","perimet","person","person'","person(fullnam","person(nam","person?的变量,用来按照代码片段中的顺序,为新的person实例建立多个引用。由于这些变量是被定义为可选类型(person?,而不是person),它们的值会被自动初始化为nil,目前还不会引用到person","personnam","person和apart","person和apartment实例并将类实例赋值给john和number73","person和apartment的例子一致,但是有一个重要的区别。这一次,apartment的ten","person和apartment的例子展示了两个属性的值都允许为nil","person和resid","person和residence模型通过添加一个room和一个address","person实例依然保持对apartment实例的强引用,但是apartment实例只是对person实例的弱引用。这意味着当你断开john变量所保持的强引用时,再也没有指向person","person实例有一个类型为string,名字为name的属性,并有一个可选的初始化为nil的apartment属性。apart","person实例现在有了一个指向apartment实例的强引用,而apartment实例也有了一个指向person实例的强引用。因此,当你断开john和number73","person实例的引用数量,并且会在person","person实例,它的resid","person实例,这也意味着你不再使用这个person","person类开始,并定义了一个叫nam","person类有一个构造函数,此构造函数为实例的name属性赋值并打印出信息,以表明初始化过程生效。person","person类的新实例被赋值给了reference1变量,所以reference1到person类的新实例之间建立了一个强引用。正是因为这个强引用,arc","person类的构造函数的时候,"john","person结构体含有一个名为fullnam","peter","pi","piec","pink","pixel","place","plai","plane","planet","planet.earth","planet.earth.toraw","planet.fromraw(7","planet.fromraw(9)语句获得一个可选planet,如果可选planet可以被获得,把someplanet设置成该可选planet的内容。在这个范例中,无法检索到位置为9的行星,所以els","planet.fromraw(positiontofind","planet.uranu","planet.venus的原始值是2","player","player(coin","player(nam","player.completedlevel(1","player.tracker.advancetolevel(6","playernam","playeron","playerone!.coinsinpurs","playerone!.wincoins(2_000","playerone变量设置为nil,意思是“没有player实例”。当这种情况发生的时候,playerone变量对player实例的引用被破坏了。没有其它属性或者变量引用play","playerone是可选的,所以由一个感叹号(!)来修饰,每当其wincoins方法被调用时,coinsinpurs","player实例存储在一个名为playerone的可选play","player类使用leveltrack","player类创建一个新的leveltracker实例来监测这个用户的发展进度。它提供了completedlevel方法:一旦玩家完成某个指定等级就调用它。这个方法为所有玩家解锁下一等级,并且将当前玩家的进度更新为下一等级。(我们忽略了advancetolevel返回的布尔值,因为之前调用leveltracker.unlocklevel","player类定义了一个wincoins方法,该方法从银行获取一定数量的硬币,并把它们添加到玩家的钱包。player类还实现了一个析构函数,这个析构函数在play","pleas","plu","plusminusvector","plusthre","pm","point","point(x","point.0","point.1","pointonefouronefivenin","point封装了一个(x","point来引用元组(int","point来表示square的中心点。如代码所示,它正确返回了中心点(5","point结构体定义了一个变异方法(mut","point(x","pop","pop并移除值"cuatro"","pop方法的返回值,该返回值将是一个t","posit","positiontofind","possibl","possibleinteg","possibleintegervalu","possiblenumb","possiblenumber.toint","possiblenumber.toint返回的可选int包含一个值,创建一个叫做actualnumb","possibleplanet","possiblestr","postfix","potentialoverflow","powder","power","pp-prog","pp-prog告诉我,这几天太累了,校对到一半睡着了,醒来又继续做。2点17","preced","precedence、prefix、right、set、unowned、unowned(safe)、unowned(unsafe)、weak、willset","precedence并优先级(preced","prefix","prefix存在时,将prefix插入到name之前来为starship构建fullnam","prefix)表达式,二元(binary)表达式,主要(primary)表达式和后缀(postfix)表达式。表达式可以返回一个值,以及运行某些逻辑(caus","preslei","prettytextrepresent","prettytextrepresentable协议的同时,也需要遵循textrepresent","prettytextrepresentable协议继承了textrepresent","preview","previewpreced","primari","prime","print","print(\"\\(codeunit","print(\"\\(scalar.valu","print(\"\\n","print(\"conson","print(\"oth","print(\"vowel","printandcount","printandcount(\"hello","printandcount(stringtoprint","printclassnam","printhelloworld","printletterkinds(\"hello","printletterkinds(word","printletterkinds的输入是一个string值并对其字符进行迭代。在每次迭代过程中,考虑当前字符的kind计算属性,并打印出合适的类别描述。所以printletterkinds就可以用来打印一个完整单词中所有字母的类型,正如上述单词"hello"","println","println(\"'\\\\(word","println(\"(0","println(\"(\\(point.0","println(\"(\\(somepoint.0","println(\"(\\(x","println(\"3的6倍是\\(threetimestable[6","println(\"\\(airportcod","println(\"\\(animalname)","println(\"\\(bas","println(\"\\(country.name)'","println(\"\\(currentvalu","println(\"\\(index","println(\"\\(mansioncount","println(\"\\(nam","println(\"\\(possiblenumb","println(\"\\(scalar","println(\"\\(somecharact","println(\"\\(total.vowel","println(\"a","println(\"about","println(\"access","println(\"ad","println(\"airport","println(\"al","println(\"an","println(\"and","println(\"apart","println(\"area","println(\"automaticcar","println(\"b","println(\"bicycl","println(\"car","println(\"card","println(\"cinema","println(\"count","println(\"eww","println(\"gam","println(\"goodby","println(\"happi","println(\"hd","println(\"hello","println(\"here'","println(\"highest","println(\"i'm","println(\"index","println(\"it","println(\"it'","println(\"item","println(\"john'","println(\"level","println(\"lot","println(\"media","println(\"mmm","println(\"mostli","println(\"movi","println(\"not","println(\"on","println(\"play","println(\"playeron","println(\"qr","println(\"random","println(\"result","println(\"rol","println(\"som","println(\"somebaseclass","println(\"someint","println(\"somesubclass","println(\"someth","println(\"somewher","println(\"song","println(\"speedlimitedcar","println(\"square.origin","println(\"start","println(\"tandem","println(\"tentighti","println(\"th","println(\"that","println(\"theaceofspad","println(\"ther","println(\"thes","println(\"thi","println(\"thre","println(\"un","println(\"unusualmenageri","println(\"upc-a","println(\"watch","println(\"welcom","println(\"wher","println(\"zero","println(a[0","println(ages[\"pet","println(assumedstr","println(audiochannel.maxinputlevelforallchannel","println(b[0","println(board.squareisblackatrow(0","println(board.squareisblackatrow(9","println(c[0","println(cat","println(charact","println(counter.count","println(d12.astext","println(definitestr","println(descript","println(friendlywelcom","println(game.asprettytext","println(game.astext","println(halfopenrangelength(1","println(item","println(item.descript","println(leftchannel.currentlevel","println(manager.importer.filenam","println(messag","println(name[0","println(paragraph!.ashtml","println(possiblestr","println(puzzleoutput","println(rightchannel.currentlevel","println(sayhello(\"anna","println(sayhello(\"brian","println(sayhelloagain(\"anna","println(sayhelloworld","println(someclass.computedtypeproperti","println(somestructure.storedtypeproperti","println(somethingtextrepresentable.astext","println(stringtoprint","println(text","println(thing.astext","println(“th","println函数输出传入的str","println(\"somebaseclass","println(\"somesubclass","printmathresult","printmathresult(addtwoint","printmathresult(mathfunct","printnumberofroom","prints\"hello","printwithoutcount","printwithoutcounting(\"hello","printwithoutcounting(stringtoprint","print(parent!.titl","print(self!.titl","print(self.titl","privat","procotol","productbarcod","productbarcode的新变量,并且赋给它一个barcode.upca的相关元组值(8","productcod","program","properit","properti","properties)构造器(initializers)方法(methods)修改实例方法(mut","properties),方法(methods),构造过程(initialization),扩展(extensions)和协议(protocol","property)在实例方法中修改值类型(modifi","property)还是计算型属性(calcul","property),也能够要求属性具有(设置权限)sett","property)还是计算型属性(comput","property),后者则把area写为存储型属性(stor","property),或下标脚本(subscript)提供自己定制的实现(implementation)。我们把这种行为叫重写(overrid","properyt","propetri","protocol","protocol<protocol","protocol<someprotocol","protocol(item","repeatedvalu","repeatedvalue:0.0","repetit","repetitions(task","report","represent","requierd","requir","requirements>","reserv","reset","reset将计数器重置为0","resid","residence?属性,如果residence存在则取回numberofroom","residence中也提供了一个printnumberofroom","residence具有一个int类型的numberofroom","residence存储了一个room实例的数组,它的numberofrooms属性值不是一个固定的存储值,而是通过计算而来的。numberofrooms属性值是由返回rooms数组的count","residence定义了一个可选属性叫address(address?)。address","residence实例给john.resid","residence实例给john.residence,且在他的rooms数组中有一个或多个room实例,那么你可以使用可选链通过residence子脚本来获取在room","residence属性numberofrooms属性值,将会引发运行时错误,因为这时没有可以供解析的resid","residence的printnumberofrooms方法会打印numberofroom","residence类中定义的子脚本来获取john.residence数组中第一个房间的名字。因为john.residence现在是nil","resolut","resolution()或videomod","resolution(width","resolution(width:640","resolution的结构体,用来描述一个显示器的像素分辨率。这个结构体包含了两个名为width和height的存储属性。存储属性是捆绑和存储在类或结构体中的常量或变量。当这两个属性被初始化为整数0的时候,它们会被推断为int","resolution结构体和videomode类的定义仅描述了什么是resolution和videomode。它们并没有描述一个特定的分辨率(resolution)或者视频模式(video","respond","respons","response声明为string?类型,或者说是可选字符串类型opt","result","result(str","result(sunris","retriev","return","returnfifteen","returntyp","return时,仅仅是将控制权从该函数或方法传递给调用者,而不返回一个值。(这就是说,该函数或方法的返回类型为void","return语句后面带表达式时,表达式的值将会返回给调用者。如果表达式值的类型与调用者期望的类型不匹配,swift","return语句时,可以只写return这个关键词,也可以在return","return)\\r","return)或换行符(lin","return)(u+000d","revers","rh","rhsitem","rich","rick","ridlei","right","right-hand","right.i","right.x","rightchannel","rightchannel.currentlevel","rise","roll","roll方法用来模拟骰子的面值。它先使用generator的random方法来创建一个[0-1","romeoandjuliet","room","room(","room(nam","roomcount","rooms.count","rooms[i","rooms数组的room类是一个很简单的类,它只有一个name属性和一个设定room","rooms数组,resid","rooms,它被初始化为一个room","roraw获得,如exampleenum.b.toraw()。你也可以通过调用fromraw","row","row0","row1","rowheight","rowheight定义成变量,因为它的值无需在if","row和column下标脚本的matrix","row和column的数量来构造一个新的matrix","runingtotal变量的内存管理操作,如果不再被incrementor","runningtot","runningtotal增加amount","runningtotal的值,incrementor捕获了当前runningtotal变量的引用,而不是仅仅复制该变量的初始值。捕获一个引用保证了当makeincrementor结束时候并不会消失,也保证了当下一次执行incrementor函数时,runningtot","runtim","s","s1","s2","s2),backwards函数返回true,表示在新的数组中s1应该出现在s2","s2),该表达式返回bool类型值,因此这里没有歧义,return","safe","safe)的语言。类型安全的语言可以让你清楚地知道代码要处理的值的类型。如果你的代码需要一个string,你绝对不可能不小心传进去一个int","same","samequot","sampl","sandwich","sankesandladders的实例都可以使用asprettytext","saturn","saygoodby","saygoodbye(\"dav","saygoodbye(personnam","sayhello","sayhello(personnam","sayhelloagain(personnam","sayhelloworld","sayhello。上面的例子展示的是用"anna"和"brian"","scalar","scarf","scene","scene.hasprefix(\"act","scene.hassuffix(\"capulet'","scene.hassuffix(\"friar","score","scott","second","secondforloop","secondnumb","secondvector","see","self","self.anm","self.area","self.artist","self.blu","self.capitalc","self.column","self.count","self.countri","self.custom","self.director","self.gener","self.green","self.greet","self.init(nam","self.init(origin","self.init在自定义的构造器中引用其它的属于相同值类型的构造器。并且你只能在构造器内部调用self.init","self.init(initi","self.leg","self.memb","self.nam","self.name)>\\(text)(somet","someresolut","someresolution.width","someresolution.width引用someresolution的width属性,返回width的初始值0","somestr","somestring变量通过字符串字面量进行初始化,swift","somestructur","somestructure.storedtypeproperti","somestructure等),以便符合标准swift","somesubclass","somesuperclass","somesupertyp","someth","somethingtextrepresent","sometupl","sometuple的类型被指定为(doubl","sometyp","sometype(ofinitialvalu","sometypemethod","sometypeproperti","someu","somevalu","somevalue是一个标识符模式,匹配了类型是int的42","somevehicl","somevideomod","somevideomode.resolution.width","somevideomode中resolution属性的width这个子属性,以上操作并不需要重新设置resolut","song","song(nam","song.artist","song.nam","songcount","songcount,用来计算数组librari","song检查item是否为song类型的实例。在循环结束后,moviecount","sorri","sort","sort([1","sort(nam","sort函数对一个str","sort函数当排序结束后传入的第一个参数排在第二个参数前面还是后面。如果第一个参数值出现在第二个参数值前面,排序闭包函数需要返回true,反之返回fals","sort函数的参数进行传入的,swift","sort函数的整体调用保持不变,一对圆括号仍然包裹住了函数中整个参数集合。而其中一个参数现在变成了内联闭包(相比于backward","sort函数的第二个参数函数类型明确了闭包必须返回一个bool","sort期望第二个参数是类型为(str","soup","south","space","space)(u+0020)、换行符(lin","spade","sparklingheart","specifi","speed","speedlimitedcar","speedlimitedcar实例的speed属性时,属性setter的实现会去检查新值与限制值40mph的大小,它会将超类的speed设置为newvalue和40.0中较小的那个。这两个值哪个较小由min函数决定,它是swift标准库中的一个全局函数。min","speedlimitedcar实例的speed属性设置为一个大于40mph的数,然后打印description函数的输出,你会发现速度被限制在40mph","speedlimitedcar,它是car的子类。类speedlimitedcar表示安装了限速装置的车,它的最高速度只能达到40mph。你可以通过重写继承来的spe","spici","spider","spread","spread","cheese",和"butter"替换为"bananas"","squar","square(sidelength","square.cent","square.origin","square.origin.i","square.origin.x","square.sidelength","squareisblackatrow(row","square增加board[square]的值向前或向后移动(遇到了梯子或者蛇)之前,检测square的值是否小于board的count","square的center属性可以通过点运算符(square.cent","square的rect实例,初始值原点是(0","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/barcode_qr_2x.png","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/barcode_upc_2x.png","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/computedproperties_2x.png","src=\"https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/art/staticpropertiesvumeter_2x.png","stack","stack(inout","swaptwovalues例子中,占位类型t是一种类型参数的示例。类型参数指定并命名为一个占位类型,并且紧随在函数名后面,使用一对尖括号括起来(如<t>","swaptwovalues函数中的参数a和b),或作为一个函数返回类型,或用作函数主体中的注释类型。在这种情况下,被类型参数所代表的占位类型不管函数任何时候被调用,都会被实际类型所替换(在上面swaptwovalues例子中,当函数第一次被调用时,t被int替换,第二次调用时,被str","swaptwovalues函数主体和swaptwoints函数是一样的,它只在第一行稍微有那么一点点不同于swaptwoint","swaptwovalues函数和stack","swaptwovalues函数的功能,你可以使用已存在的交换函数swap","swaptwovalues函数除了要求传入的两个任何类型值是同一类型外,也可以作为swaptwoints函数被调用。每次swaptwovalues被调用,t","swaptwovalues是受swap函数启发而实现的。swap","swaptwovalues泛型函数,或一个存储单一类型的泛型集,如数组),通常用一单个字母t","swfit为整型计算提供了5个&","swift","swift中有两类特性,用于修饰声明的以及用于修饰类型的。例如,required特性,当应用于一个类的指定或便利初始化器声明时,表明它的每个子类都必须实现那个初始化器。再比如noreturn","swift中,模式出现在变量和常量的声明(在它们的左侧),for-in语句和switch语句(在它们的case标签)中。尽管任何模式都可以出现在switch语句的case标签中,但在其他情况下,只有通配符模式(wildcard","swift中,类型信息也可以反方向流动——从根节点传向叶子节点。在下面的例子中,常量efloat上的显式类型注解(:float)导致数字字面量2.71828的类型是float而非doubl","swift内建类型int添加了一个整型下标。该下标[n]返回十进制数字从右向左数的第n","swift可以推断出这个常量或者变量的类型,请参考类型安全和类型推断。在上面的例子中,没有给welcomemessage赋初始值,所以变量welcomemessag","swift定义后缀?来作为标准库中的定义的命名型类型optional<t>","swift并不存在这个运算符。此处为了演示,我们让+++对vector2d","swift广泛的使用类型推断,从而允许你可以忽略很多变量和表达式的类型或部分类型。比如,对于var","swift支持如下所有c","swift标准库中array类型的细节讨论,见章节arrai","swift标准库中的~=操作符与输入表达式的值进行比较。如果~=操作符返回true,则匹配成功。默认情况下,~=操作符使用==操作符来比较两个相同类型的值。它也可以匹配一个整数值与一个rang","swift的array已经提供append方法,一个count属性和通过下标来查找一个自己的元素。这三个功能都达到container协议的要求。也就意味着你可以扩展array去遵循container协议,只要通过简单声明arrai","swift的int类型添加了一个新的名为squar","swift的运算符较c语言和objective-c来得更简单和保守,这意味着跟基于c的语言可能不一样。所以,在移植已有代码到swift","swift类型参考,你不用在intstack定义部分声明一个具体的int的itemtype。由于intstack遵循container协议的所有要求,只要通过简单的查找append方法的item参数类型和下标返回的类型,swift就可以推断出合适的itemtyp","swift语言使用类型名紧接中括号[]来简化标准库中定义的命名型类型array<t>","swift语言定义后缀!作为标准库中命名类型implicitlyunwrappedoptional<t>","swift语言相对小点,这是由于在swift代码中几乎无处不在的许多常见的的类型,函数以及运算符都由swift标准库来定义。虽然这些类型,函数和运算符不是swift","swift还有许多复杂的高级运算符,包括了c语和objective-c","switch","switchcas","switch中匹配到的子句之后,程序会退出switch语句,并不会继续向下运行,所以不需要在每个子句结尾写break","switch代码块中使用break时,会立即中断该switch代码块的执行,并且跳转到表示switch","switch代码块中嵌套循环体和switch代码块来创造复杂的控制流结构。然而,循环体和switch代码块两者都可以使用break语句来提前结束整个方法体。因此,显示地指明break语句想要终止的是哪个循环体或者switch代码块,会很有用。类似地,如果你有许多嵌套的循环体,显示指明continu","switch代码块完成了它的执行。相比之下,c","switch代码块执行完后,使用println函数打印该数字的描述。在这个例子中,数字5","switch代码块执行完后,接下来的代码通过使用可选绑定来判断possibleintegervalue是否曾经被设置过值。因为是可选类型的缘故,possibleintegervalue有一个隐式的初始值nil,所以仅仅当possibleintegervalue曾被switch","switch代码块,当使用break或者continu","switch分支仅仅包含注释时,会被报编译时错误。注释不是代码语句而且也不能让switch分支达到被忽略的效果。你总是可以使用break","switch来判断一个charact","switch语句不会同时匹配"a"和"a"。相反的,上面的代码会引起编译期错误:cas","switch语句中使用fallthrough","switch语句中测试多个值。元组中的元素可以是值,也可以是区间。另外,使用下划线(_","switch语句中的cas","switch语句中的控制流可以用break语句修改,详情请见break","switch语句也可以包含默认(default","switch语句会判断某个点是否在红色的x轴上,是否在黄色i","switch语句会判断某个点是否在绿色的对角线x","switch语句会判断某个点是否是原点(0","switch语句会尝试把某个值与若干个模式(pattern)进行匹配。根据第一个匹配成功的模式,switch语句会执行对应的代码。当有可能的情况较多时,通常用switch语句替换if","switch语句前面加上标签,它由标签名和紧随其后的冒号(:)组成。在break和continue后面跟上标签名可以显式地在循环语句或switch","switch语句只能有一个默认分支,而且必须在switch","switch语句来匹配is模式和as模式值的例子,请参阅typ","switch语句来匹配一个名为somecharact","switch语句来匹配包含关联值枚举用例的例子,请参阅associ","switch语句来检验枚举事件的值,正如使用switch语句匹配枚举值(match","switch语句的case中使用强制形式的类型转换操作符(a","switch语句的控制表达式(control","switch需要包含所有的分支而且不允许有为空的分支,有时为了使你的意图更明显,需要特意匹配或者忽略某个分支。那么当你想忽略某个分支时,可以在该分支内写上break语句。当那个分支被匹配到时,分支内的break语句立即结束switch","swith语句(match","syntax","syntax)和显式成员表达(implicit","syntax)根据上下文推断类型(inf","syntax)计算型属性(comput","syrup","syrup"的新数据项插入列表的最开始位置,并且使用0","t","t-shirt","t.0","t.1","t.element","t.generatortype.el","tab","tab(horizont","tab(vert","tab)\\t","tab)(u+0009","tab)(u+000b)、换页符(form","takalard","take","tandem","tandem.descript","tandem类也继承了descript","task","tast","tasti","tea","teamscor","temperatur","temperatureincelsiu","temperatureinfahrenheit","temporarya","temporaryboard","temporaryboard.append(isblack","ten","tenant","teneighti","teneighty.framer","teneighty.interlac","teneighty.nam","teneighty.resolut","teneighty和alsoteneighty被声明为常量((constants)而不是变量。然而你依然可以改变teneighty.framerate和alsoteneighty.framerate,因为这两个常量本身不会改变。它们并不存储这个videomode实例,在后台仅仅是对videomode实例的引用。所以,改变的是被引用的基础videomode的framer","teneighty的framerate属性,我们会发现它正确的显示了基本videomode实例的新帧率,其值为30.0","teneighty的常量,其引用了一个videomode类的新实例。在之前的示例中,这个视频模式(video","teneight和alsoteneight实际上引用的是相同的videomod","terminolog","ternari","terrapin","test","test.area","test.simpledescript","testnumb","text","text</p>"或者"<p","text"还是nil,闭包会返回"<p>som","textrepresent","textrepresentabl","textrepresentable协议含有一个astext","text值存在,该标签就包含可选值text;如果text不存在,该标签就不包含文本。对于段落元素,根据text是"som","theaceofspad","theaceofspades.descript","theeighti","thing","things.append(\"hello","things.append((3.0","things.append(0","things.append(0.0","things.append(3.14159","things.append(42","things.append(movie(nam","things数组中的每一项的并用switch语句查找每一项的类型。这几种switch","things数组可以被直接遍历,并调用其中元素的astext","thing被当做是textrepresentable类型而不是dice,dicegame,hamster等类型。因此能且仅能调用astext","think","thousand","three","threedescript","threedoubl","threefeet","threeofspad","threeofspades.simpledescript","threeofspadesdescript","threesourc","threesource作为数据源开实例化一个count","threesource实现了counterdatasourc","threetimest","threetimestable[6]。这条语句访问了threetimestable的第六个元素,返回6的3倍即18","three的值被用来创建一个doubl","thresholdlevel","through","through)控制传递语句break","time","timest","timestable(multipli","timestable例子是基于一个固定的数学公式。它并不适合开放写权限来对threetimestable[someindex","timestable结构体中使用只读下标脚本的用法,该结构体用来展示传入整数的n","timestable结构体创建了一个用来表示索引值三倍的实例。数值3作为结构体构造函数入参初始化实例成员multipli","timothyy","tobedoubl","todai","toggl","togglabl","togglable协议含有toggle函数。根据函数名称推测,toggle可能用于切换或恢复某个属性的状态。mut","togglabl协议时,必须在toggle方法前加上mut","toincrement","toint方法可能会失败,所以它返回一个可选类型(optional)int,而不是一个int。一个可选的int被写作int?而不是int。问号暗示包含的值是可选类型,也就是说可能包含int值也可能不包含值。(不能包含其他任何值比如bool值或者string值。只能是int","toint方法来尝试将一个string转换成int","tokyo","toobig","top","top-level","toraw","toraw和fromraw","tostr","tostring:\"world","total","total.conson","totalstep","totalsteps设置新值的时候,它的willset和didset","totwo","touch","towardszerosourc","towardszerosource实现了counterdatasource协议中的incrementforcount","to那些包含可选成员需求的协议。更多关于如何使用optional特性以及如何访问可选协议成员的指导,例如,当你不确定一个conform","tracker","tracker.advancetolevel(level","trail","transfer","translat","travel","tre","tree","tree)的叶子节点传向根节点。也就是说,var","triagl","triangl","triangle.perimet","triangle.sidelength","triangleandsquar","triangleandsquare(s","triangleandsquare.squar","triangleandsquare.square.sidelength","triangleandsquare.triangle.sidelength","tristateswitch","tristateswitch.low","true","true。从字面意思来说,断言“断言”一个条件是否为真。你可以使用断言来保证在运行其他代码之前,某些重要的条件已经被满足。如果条件判断为true,代码运行会继续进行;如果条件判断为fals","true和fals","true表示对应的是一个黑格,布尔值为fals","true,stat","true,则会执行大括号内部的代码(stat","true,即allowentry为fals","true,转到第1步。如果为false,do-whil","true,转到第2步。如果为false,whil","tualatrix","tuesdai","tulip","tupl","turn","turnip","turnipsaredelici","twlkyao","two","twobytwo","twothousand","twothousandandon","twothousand是uint16类型,然而常量one是uint8类型。它们不能直接相加,因为它们类型不同。所以要调用uint16(one)来创建一个新的uint16数字并用on","twothre","tyo","type","type)(译者注:特指结构体和枚举)中的的函数前缀加上mut","type)与先前的不同即可。此时,必须使用overrid","type),修改变量的值就相当于修改变量的类型,而swift默认不允许修改类型,因此需要前置mut","type),可以方便的修改实例及其属性的值而无需改变类型;而结构体和枚举中的成员均为值类型(valu","type-cast","type-casting-oper","type-casting-pattern","type-inheritance-claus","type-level","type-saf","type.self","typealia","types)结构体和枚举是值类型类是引用类型恒等运算符指针类和结构体的选择集合(collect","types中知道结构体有默认的成员构造函数,所以你可以用默认的initializer去初始化新的常量theaceofspad","types)——比如表示数字、字符和字符串——实际上就是命名型类型,swift","types)使用函数类型(us","types)使用字符(work","types)函数类型作为参数类型(funct","types)函数类型作为返回类型(funct","types)嵌套函数(nest","types,如int、character)外,你可以使用任何类型的值,包括浮点数、字符串、元组、自定义类的实例和可选(optional)类型,甚至是枚举类型中的成员值和指定的范围(range)等。关于在switch","type。协议类型的元类型——并不是运行时适配该协议的具体类型——是该协议名字紧跟.protocol。比如,类someclass的元类型就是someclass.type,协议someprotocol的元类型就是someprotocal.protocol","type。可选类型的属性将自动初始化为空nil","type在声明时候所定义(declar","type是int","type的名字(当然了,如果我都知道它的名字了还需要动态来获取它吗)。动态类型表达式会返回"运行时"某个instance的typ","type(in","type)。你可以在声明属性或者变量时,在前面加上关键字unown","type)。即使这个方法本身没有定义返回值,你也可以使用if语句来检查是否能成功调用printnumberofrooms方法:如果方法通过可选链调用成功,printnumberofrooms的隐式返回值将会是void,如果没有成功,将返回nil","type)向下转型(downcasting)any和anyobject的类型转换anyobject类型ani","type)在常量声明中是一个可选项,它可以用来描述在类型推断(typ","type)的上下文(context)中,隐式成员表达式是访问某个type的memb","t分别代表int和str","t则是跟这些type的公共supertype最接近的type.(closest","t和keytyp","t和u遵守generator协议,同时要求它们的关联类型等同,可以这样来表达:<t","t定义了一个名为“某种类型t”的节点提供给后来用。这种将来类型可以在结构体的定义里任何地方表示为“t”。在这种情况下,t","t就是数组中元素的type","t是swaptwovalues函数所定义的一个类型。因为t是一个占位命名类型,swift","t来表示)来代替实际类型名(如in、string或doubl)。占位类型名没有提示t必须是什么类型,但是它提示了a和b必须是同一类型t,而不管t表示什么类型。只有swaptwovalues函数在每次调用时所传入的实际类型才能决定t","t被用作append方法的item参数和下标的返回类型。swift","t)是用尖括号括起来的(<t>","t,u,v,keytype,valuetyp","t,是@noreturn","t,有一个需要t必须是someclass子类的类型约束;第二个类型参数u,有一个需要u必须遵循someprotocol","u","u+000a","u+000d的所有unicod","u+0024","u+00a8","u+00aa","u+00ad","u+00af","u+00b2–u+00b5","u+00b7–u+00ba","u+00bc–u+00b","u+00c0–u+00d6","u+00d8–u+00f6","u+00f8–u+00ff","u+0100–u+02ff","u+0300–u+036f","u+0370–u+167f","u+10000–u+1fffd","u+1681–u+180d","u+180f–u+1dbf","u+1dc0–u+1dff","u+1e00–u+1fff","u+1f436","u+1f496","u+20000–u+2fffd","u+200b–u+200d","u+202a–u+202","u+203f–u+2040","u+2054","u+2060–u+206f","u+2070–u+20cf","u+20d0–u+20ff","u+2100–u+218f","u+2460–u+24ff","u+2665","u+2776–u+2793","u+2c00–u+2dff","u+2e80–u+2fff","u+30000–u+3fffd","u+3004–u+3007","u+3021–u+302f","u+3031–u+303f","u+3040–u+d7ff","u+40000–u+4fffd","u+50000–u+5fffd","u+60000–u+6fffd","u+70000–u+7fffd","u+80000–u+8fffd","u+90000–u+9fffd","u+a0000–u+afffd","u+b0000–u+bfffd","u+c0000–u+cfffd","u+d0000–u+dfffd","u+d83d","u+e0000–u+efffd","u+f900–u+fd3d","u+fd40–u+fdcf","u+fdf0–u+fe1f","u+fe20–u+fe2f","u+fe30–u+fe44","u+fe47–u+fffd","u.element>","u.generatortype.el","u0001f496","u2665","uinavigationcontroller类使用来模拟试图控制器的导航结构。你通过调用uinavigationcontroller的pushviewcontroller:animated:方法来为导航栈添加(add)新的试图控制器;而通过popviewcontrolleranimated:的方法来从导航栈中移除(pop","uint","uint16","uint16(on","uint16有一个构造器,可以接受一个uint8类型的值,所以这个构造器可以用现有的uint8来创建一个新的uint16。注意,你并不能传入任意类型的值,只能传入uint16","uint16,可以进行相加。目标常量twothousandandone的类型被推断为uint16,因为它是两个uint16","uint32","uint32的命名为pink的常量来存储层叠样式表css中粉色的颜色值,css颜色#cc6699在swift用十六进制0xcc6699来表示。然后使用按位与(&)和按位右移就可以从这个颜色值中解析出红(cc),绿(66),蓝(99","uint8","uint8.max","uint8.min","uint8是8位无符整型,可以存储0~255之间的任意数。这个例子初始化一个整型为二进制值00001111(前4位为0,后4位为1),它的十进制值为15","uint8的最小值0","uint8的最小值是0(二进制为00000000)。使用&-进行溢出减1,就会得到二进制的11111111即十进制的255","uint,除非你真的需要存储一个和当前平台原生字长相同的无符号整数。除了这种情况,最好使用int,即使你要存储的值已知是非负的。统一使用int","umcsdon","unabl","unari","uncom","undefinedundefin","unicod","unicodescalar","unicodescalarview","unicodescalarview是unicodescalar","unicodescalar拥有一个值属性,可以返回对应的21位数值,用uint32","unicodescalar是21","union","union-style-enum-memb","unions)和变体(vari","unions),或者变体(vari","unions),标签联合(tag","unlock","unlocked\"(等级6","unlocklevel(level","unnam","unnnnnnnn,其中nnnnnnnn","unnnn,其中nnnn","uno","unown","unowned(saf","unowned(unsaf","unpurchased未购买状态开始的。为了展现这一事实,shoppinglistitem引入了一个布尔类型的属性purchased,它的默认值是false。shoppinglistitem还添加了一个计算型属性description,它提供了关于shoppinglistitem","unshar","unshare方法来确定数组引用的唯一性。(当数组赋给常量时,不能调用unshar","unshare方法调用后再修改b中第一个元素的值,这三个数组(a,b,c","unshare方法,而不是copy方法。unshare方法仅会在确有必要时才会创建数组拷贝。copi","unusualmenageri","unwrap","unwrappedc","unwrappedc.property.performact","up","upc-a","upca(int","upca(let","upca(numbersystem","updatevalue(forkey:)函数会返回包含一个字典值类型的可选值。举例来说:对于存储string值的字典,这个函数会返回一个str","updatevalue(forkey:)方法可以设置或者更新特定键对应的值。就像上面所示的示例,updatevalue(forkei","upper","uppercamelcas","uppercas","uppercasestring和lowercasestr","uranu","us","uss","utf-16","utf-16(以16","utf-8","utf-8(以8","utf16","utf16view类型的属性,utf16view是无符号16","utf16属性来访问它的utf-16","utf8","utf8view类型的属性,utf8view是无符号8","utf8属性来访问它的utf-8","v","valid","valu","value)。这些值的类型在原始值类型(raw","value)元组。下面的例子中,字典的键(key)解读为常量animalname,字典的值会被解读为常量legcount","value)元组的形式返回,你可以在for-in循环中使用显式的常量名称来解读(kei","value),当其不可访问时,?之后语句不会执行,并返回nil","value-bind","values(first","values)函数参数名称(funct","values)原始值(raw","values)可变参数(variad","values)多重输入参数(multipl","values)多重返回值函数(funct","values)闭包是引用类型(closur","values)默认值参数的外部参数名(extern","valuetofind","valuetyp","valuetype>定义,其中keytype是字典中键的数据类型,valuetyp","value的typ","value)都关联唯一的键(kei","value),因为这些量是不能被修改的。当传入的参数作为输入输出参数时,需要在参数前加&","value),检查另一个字典中所对应的值,来证明ages字典确实是被拷贝了。如果在copiedages字典中将peter的值设为24,那么ages字典仍然会返回修改前的值23","var","variabl","variablestr","variad","var关键字定义计算属性,包括只读计算属性,因为他们的值不是固定的。let","var关键字定义计算属性,包括只读计算属性,因为它们的值不是固定的。let","var定义),也可以是常量存储属性(用关键字let","var或者let","vclwei","vector","vector.i","vector.x","vector2d","vector2d(x","vector2d对象是否有相等的值,相等的概念就是它们有相同的x值和相同的i","vector2d类型提供了单目减运算-a,@prefix","vector2d类型的参数,返回值也是vector2d类型。需要定义和实现一个中置运算的时候,在关键字func","vector2d结构的成员方法,所以任意两个vector2d","vector2d,单目减运算将其x和i","vectortoadd","veget","vegetablecom","vehicl","vehicle的一个新的子类,叫car,它重写了从vehicle类继承来的descript","vehicle的基类。这个基类声明了两个对所有车辆都通用的属性(numberofwheels和maxpassengers)。这些属性在description方法中使用,这个方法返回一个str","vehicle类中maxpassengers的默认值对自行车来说已经是正确的,因此在bicycle的构造器中并没有改变它。而numberofwheel","vehicle类定义了构造器(initi","vehicle类的基础上创建起来。因此你需要将vehicl","vehicle类的构造器为任意的一辆车设置一些初始化属性值(numberofwheel","vendcoin","vendcoins(var","venu","veri","verona","verygreen","vga","vic","videomod","videomode中resolution属性的width","videomode的类,用来描述一个视频显示器的特定模式。这个类包含了四个储存属性变量。第一个是分辨率,它被初始化为一个新的resolution结构体的实例,具有resolution的属性类型。新videomode实例同时还会初始化其它三个属性,它们分别是,初始值为false(意为“non-interlac","video”)的interlaced,回放帧率初始值为0.0的framerate和值为可选string的name。name属性会被自动赋予一个默认值nil,意为“没有nam","viztor","void","void?,而不是void,因为当通过可选链调用方法时返回值总是可选类型(opt","void。在swift中,void","void。它其实是一个空的元组(tupl","void是空元组类型()的别名。如果括号内只有一个元素,那么该类型就是括号内元素的类型。比如,(int)的类型是int而不是(int","void(参见funct","volum","vowel","vowel代替character.kind.vowel","vumet","w","wai","want","warm","watch","water","watercress","wavegoodby","weak","weak或者unowned关键字和实例的引用(如self或someinst","wear","web","wei","welcom","welcomemessag","welcomemessage变量添加了类型标注,表示这个变量可以存储str","well","west","wh1100717","wheel","where子句。where子句由关键字wher","where子句中的要求用于指明该类型形参继承自某个类或遵守某个协议或协议的一部分。尽管where子句有助于表达类型形参上的简单约束(如t","where语句作为一个类型参数队列的一部分。一个where语句使你能够要求一个关联类型遵循一个特定的协议,以及(或)那个特定的类型参数和关联类型可以是相同的。你可写一个where语句,通过紧随放置wher","where语句的一部分,写在关键字wher","where,只在冒号后面写协议或者类名。<t","whiledo-while条件语句ifswitch不存在隐式的贯穿(no","while循环从计算单一条件开始。如果条件为true,会重复运行一系列语句,直到条件变为fals","while循环体中调用break和continu","while循环体和switch方法块来实现游戏的逻辑。while循环体有一个标签名gameloop","while循环体的条件判断语句是whil","while循环体的语法,同样的规则适用于所有的循环体和switch","while循环的另外一种形式是do-while,它和while的区别是在判断循环条件之前,先执行一次循环的代码块,然后重复循环直到条件为fals","while循环运行一系列语句直到条件变成false。这类循环适合使用在第一次迭代前迭代次数未知的情况下。swift","whisper","whitespac","whose","wide","width","width=\"169","width=\"243","width=\"252","width=\"388","widthlabel","width属性和height属性,两者均为doubl","wildcard","willoverflow","willoverflow用int8所能承载的最大值255(二进制11111111),然后用&+加1。然后uint8就无法表达这个新值的二进制了,也就导致了这个新值上溢出了,大家可以看下图。溢出后,新值在uint8的承载范围内的那部分是00000000,也就是0","willset","willset(newtotalstep","willset(sett","willset-didset","willset和didset","willset和didset的实际例子,其中定义了一个名为stepcount","willset和didset语句中,setter名和圆括号的语句是可选的。如果你写了一个setter名,它就会作为willset和didset的参数被使用。如果你不写sett","willset或didset","willset监视器会将新的属性值作为固定参数传入,在willset的实现代码中可以为这个参数指定一个名称,如果不指定则参数仍然可用,这时使用默认名称newvalu","willset监视器初始名为newvalue,didset监视器初始名为oldvalu","willset监视器只有在变量或属性值被改变之前运行。新的值作为一个常量经过过willset","willset监视器将表示新值的参数自定义为newtotalstep","willset语句中改变它。didset监视器在变量或属性值被改变后立即运行。和willset","willset语句时,didset语句是可选的。同样的,在你提供了一个didset语句时,willset","willunderflow","win","wincoins(coin","wiseword","wishhappybirthday(birthdayperson","wishhappybirthday(celebr","wishhappybirthday函数的形参celebrator的类型为protocol<named,aged>","within","withjoin","without","with,for,by等等。前面的counter类的例子中incrementby方法就是这样的。介词的使用让方法在被调用时能像一个句子一样被解读。和函数参数不同,对于方法的参数,swift","won","wongzigii","word","work","world","world"","world Swift 兴趣交流群:`305014012`,307017261(已满) +> [Swift 开发者社区](http://swiftist.org) -Swift 是苹果在 WWDC 2014 上发布的一款全新的编程语言,本书译自苹果官方的 Swift 教程《The Swift Programming Language》。 + +> 如果你觉得这个项目不错,请[点击Star一下](https://github.com/numbbbbb/the-swift-programming-language-in-chinese),您的支持我们最大的动力。 -翻译正在进行中,翻译完成的部分会实时同步到这里。您可以到[项目首页](https://github.com/numbbbbb/the-swift-programming-language-in-chinese)查看当前进度。 +# The Swift Programming Language 中文版 -由于是多人协同翻译,可能会有些术语或者句子翻译不太恰当,如果您在阅读过程中发现此类问题,请直接给我们提 issue 或者 pull request。翻译完成后我们会进行认真的校对,给大家提供一本高质量的 Swift 教程。 +###这一次,让中国和世界同步 -如果您愿意加入进来,帮助我们进行翻译和校对,请阅读[项目首页](https://github.com/numbbbbb/the-swift-programming-language-in-chinese)中的说明并加入QQ群:364279588,我们期待您的加入,在 Swift 的历史上留下您的足迹! +现在是6月12日凌晨4:38,我用了整整一晚上的时间来进行最后的校对,终于可以在12日拿出一个可以发布的版本。 -最后,非常感谢您的阅读,如果您觉得本文不错的话请分享给其他人,您的支持就是我们最大的动力! +9天时间,1317个 Star,310个 Fork,超过30人参与翻译和校对工作,项目最高排名GitHub总榜第4。 +设想过很多遍校对完成时的场景,仰天大笑还是泪流满面?真正到了这一刻才发现,疲倦已经不允许我有任何情绪。 + +说实话,刚开始发起项目的时候完全没想到会发展成今天这样,我一度计划自己一个人翻译完整本书。万万没想到,会有这么多的人愿意加入并贡献出自己的力量。 + +coverxit发给我最后一份文档的时候说,我要去背单词了,我问他,周末要考六级?他说是的。 + +pp-prog告诉我,这几天太累了,校对到一半睡着了,醒来又继续做。2点17分,发给我校对完成的文档。 + +lifedim说他平时12点就会睡,1点47分,发给我校对后的文档。 + +团队里每个人都有自己的事情,上班、上学、创业,但是我们只用了9天就完成整本书的翻译。我不知道大家付出了多少,牺牲了多少,但是我知道,他们的付出必将被这些文字记录下来,即使再过10年,20年,依然熠熠生辉,永不被人遗忘。 + +全体人员名单(排名不分先后): + +- [numbbbbb](https://github.com/numbbbbb) +- [stanzhai](https://github.com/stanzhai) +- [coverxit](https://github.com/coverxit) +- [wh1100717](https://github.com/wh1100717) +- [TimothyYe](https://github.com/TimothyYe) +- [honghaoz](https://github.com/honghaoz) +- [lyuka](https://github.com/lyuka) +- [JaySurplus](https://github.com/JaySurplus) +- [Hawstein](https://github.com/Hawstein) +- [geek5nan](https://github.com/geek5nan) +- [yankuangshi](https://github.com/yankuangshi) +- [xielingwang](https://github.com/xielingwang) +- [yulingtianxia](https://github.com/yulingtianxia) +- [twlkyao](https://github.com/twlkyao) +- [dabing1022](https://github.com/dabing1022) +- [vclwei](https://github.com/vclwei) +- [fd5788](https://github.com/fd5788) +- [siemenliu](https://github.com/siemenliu) +- [youkugems](https://github.com/youkugems) +- [haolloyin](https://github.com/haolloyin) +- [wxstars](https://github.com/wxstars) +- [IceskYsl](https://github.com/IceskYsl) +- [sg552](https://github.com/sg552) +- [superkam](https://github.com/superkam) +- [zac1st1k](https://github.com/zac1st1k) +- [bzsy](https://github.com/bzsy) +- [pyanfield](https://github.com/pyanfield) +- [ericzyh](https://github.com/ericzyh) +- [peiyucn](https://github.com/peiyucn) +- [sunfiled](https://github.com/sunfiled) +- [lzw120](https://github.com/lzw120) +- [viztor](https://github.com/viztor) +- [wongzigii](https://github.com/wongzigii) +- [umcsdon](https://github.com/umcsdon) +- [zq54zquan](https://github.com/zq54zquan) +- [xiehurricane](https://github.com/xiehurricane) +- [Jasonbroker](https://github.com/Jasonbroker) +- [tualatrix](https://github.com/tualatrix) +- [pp-prog](https://github.com/pp-prog) +- [088haizi](https://github.com/088haizi) +- [baocaixiong](https://github.com/baocaixiong) +- [yeahdongcn](https://github.com/yeahdongcn) +- [shinyzhu](https://github.com/shinyzhu) +- [lslxdx](https://github.com/lslxdx) +- [Evilcome](https://github.com/Evilcome) +- [zqp](https://github.com/zqp) +- [NicePiao](https://github.com/NicePiao) +- [LunaticM](https://github.com/LunaticM) +- [menlongsheng](https://github.com/menlongsheng) +- [lifedim](https://github.com/lifedim) +- [happyming](https://github.com/happyming) +- [bruce0505](https://github.com/bruce0505) +- [Lin-H](https://github.com/Lin-H) +- [takalard](https://github.com/takalard) +- [dabing1022](https://github.com/dabing1022) +- [marsprince](https://github.com/marsprince) diff --git a/source/SUMMARY.md b/source/SUMMARY.md old mode 100644 new mode 100755 index 8796bc54..0d4f98dd --- a/source/SUMMARY.md +++ b/source/SUMMARY.md @@ -15,7 +15,7 @@ * [类和结构体](chapter2/09_Classes_and_Structures.md) * [属性](chapter2/10_Properties.md) * [方法](chapter2/11_Methods.md) - * [附属脚本](chapter2/12_Subscripts.md) + * [下标脚本](chapter2/12_Subscripts.md) * [继承](chapter2/13_Inheritance.md) * [构造过程](chapter2/14_Initialization.md) * [析构过程](chapter2/15_Deinitialization.md) diff --git a/source/chapter1/01_swift.md b/source/chapter1/01_swift.md old mode 100644 new mode 100755 index 41859503..c598ce56 --- a/source/chapter1/01_swift.md +++ b/source/chapter1/01_swift.md @@ -1,13 +1,17 @@ -# 关于 Swift - -Swift 是一种新的编程语言,用于编写 iOS 和 OS X 应用。Swift 结合了 C 和 Objective-C 的优点并且不受C的兼容性的限制。Swift 使用安全的编程模式并添加了很多新特性,这将使编程更简单,扩展性更强,也更有趣。除此之外,Swift 还支持人见人爱的 Cocoa 和 Cocoa Touch 框架。拥有了这些特性,Swift将重新定义软件开发。 - -Swift 的开发从很久之前就开始了。为了给 Swift 打好基础,苹果公司改进了编译器,调试器和框架结构。我们使用自动引用计数(Automatic Reference Counting, ARC)来简化内存管理。我们在 Foundation 和 Cocoa的基础上构建框架栈并将其标准化。Objective-C 本身支持块、集合语法和模块,所以框架可以轻松支持现代编程语言技术。得益于这些基础工作,我们现在可以发布一个新语言,用于未来的苹果软件的开发。 - -Objective-C 开发者对于 Swift 并不会感到陌生。它采用了 Objective-C 的命名参数以及动态对象模型,可以无缝对接到现有的 Cocoa 框架,并且可以兼容 Objective-C 代码。在此基础之上,Swift 还有许多新特性并且支持过程式编程和面向对象编程。 - -Swift 对于初学者来说也很友好。它是第一个既满足工业标准又像脚本语言一样充满表现力和趣味的编程语言。它支持代码预览,这个革命性的特性可以允许程序员在不编译和运行应用程序的前提下运行 Swift 代码并实时查看结果。 - -Swift 将现代编程语言的精华和苹果工程师文化的智慧结合了起来。编译器对性能进行了优化,编程语言对开发进行了优化,两者互不干扰,鱼与熊掌兼得。Swift 即可以用于开发“hello, world”这样的小程序,也可以用于开发一个完整的操作系统。所有的这些特性让 Swift 对于开发者和苹果来说都是一项值得的投资。 - -用 Swift 编写 iOS 和 OS X 应用将是一场美妙的体验,Swift 之后也会不断开发新特性和兼容性。我们对 Swift 充满信心,你还在等什么! +> 翻译:[numbbbbb](https://github.com/numbbbbb) +> 校对:[yeahdongcn](https://github.com/yeahdongcn) + +# 关于 Swift +----------------- + +Swift 是一种新的编程语言,用于编写 iOS 和 OS X 应用。Swift 结合了 C 和 Objective-C 的优点并且不受 C 兼容性的限制。Swift 采用安全的编程模式并添加了很多新特性,这将使编程更简单,更灵活,也更有趣。Swift 是基于成熟而且倍受喜爱的 Cocoa 和 Cocoa Touch 框架,它的降临将重新定义软件开发。 + +Swift 的开发从很久之前就开始了。为了给 Swift 打好基础,苹果公司改进了编译器,调试器和框架结构。我们使用自动引用计数(Automatic Reference Counting, ARC)来简化内存管理。我们在 Foundation 和 Cocoa 的基础上构建框架栈并将其标准化。Objective-C 本身支持块、集合语法和模块,所以框架可以轻松支持现代编程语言技术。正是得益于这些基础工作,我们现在才能发布这样一个用于未来苹果软件开发的新语言。 + +Objective-C 开发者对 Swift 并不会感到陌生。它采用了 Objective-C 的命名参数以及动态对象模型,可以无缝对接到现有的 Cocoa 框架,并且可以兼容 Objective-C 代码。在此基础之上,Swift 还有许多新特性并且支持过程式编程和面向对象编程。 + +Swift 对于初学者来说也很友好。它是第一个既满足工业标准又像脚本语言一样充满表现力和趣味的编程语言。它支持代码预览,这个革命性的特性可以允许程序员在不编译和运行应用程序的前提下运行 Swift 代码并实时查看结果。 + +Swift 将现代编程语言的精华和苹果工程师文化的智慧结合了起来。编译器对性能进行了优化,编程语言对开发进行了优化,两者互不干扰,鱼与熊掌兼得。Swift 既可以用于开发 “hello, world” 这样的小程序,也可以用于开发一套完整的操作系统。所有的这些特性让 Swift 对于开发者和苹果来说都是一项值得的投资。 + +Swift 是编写 iOS 和 OS X 应用的极佳手段,并将伴随着新的特性和功能持续演进。我们对 Swift 充满信心,你还在等什么! diff --git a/source/chapter1/02_a_swift_tour.md b/source/chapter1/02_a_swift_tour.md old mode 100644 new mode 100755 index e39d65af..8fd30264 --- a/source/chapter1/02_a_swift_tour.md +++ b/source/chapter1/02_a_swift_tour.md @@ -1,300 +1,376 @@ +> 翻译:[numbbbbb](https://github.com/numbbbbb) +> 校对:[shinyzhu](https://github.com/shinyzhu), [stanzhai](https://github.com/stanzhai) + # Swift 初见 +--- + 本页内容包括: -- 简单值 -- 控制流 -- 函数和闭包 -- 对象和类 -- 枚举和结构体 -- 接口和扩展 -- 泛型 +- [简单值(Simple Values)](#simple_values) +- [控制流(Control Flow)](#control_flow) +- [函数和闭包(Functions and Closures)](#functions_and_closures) +- [对象和类(Objects and Classes)](#objects_and_classes) +- [枚举和结构体(Enumerations and Structures)](#enumerations_and_structures) +- [协议和扩展(Protocols and Extensions)](#protocols_and_extensions) +- [泛型(Generics)](#generics) 通常来说,编程语言教程中的第一个程序应该在屏幕上打印“Hello, world”。在 Swift 中,可以用一行代码实现: - println("Hello, world") +```swift +println("Hello, world") +``` 如果你写过 C 或者 Objective-C 代码,那你应该很熟悉这种形式——在 Swift 中,这行代码就是一个完整的程序。你不需要为了输入输出或者字符串处理导入一个单独的库。全局作用域中的代码会被自动当做程序的入口点,所以你也不需要`main`函数。你同样不需要在每个语句结尾写上分号。 这个教程会通过一系列编程例子来让你对 Swift 有初步了解,如果你有什么不理解的地方也不用担心——任何本章介绍的内容都会在后面的章节中详细讲解。 -> 注意:为了获得最好的体验,在 Xcode 当中使用代码预览功能。代码预览功能可以让你编辑代码并实时看到运行结果。 +> 注意: +> 为了获得最好的体验,在 Xcode 当中使用代码预览功能。代码预览功能可以让你编辑代码并实时看到运行结果。 +> 打开Playground + ## 简单值 -使用`let`来声明常量,使用`var`来声明变量。一个常量的值在编译时并不需要获取,但是你只能为它赋值一次。也就是说你可以用常量来表示这样一个值:你只需要决定一次,但是需要使用很多次。 +使用`let`来声明常量,使用`var`来声明变量。一个常量的值,在编译的时候,并不需要有明确的值,但是你只能为它赋值一次。也就是说你可以用常量来表示这样一个值:你只需要决定一次,但是需要使用很多次。 - var myVariable = 42 - myVariable = 50 - let myConstant = 42 +```swift +var myVariable = 42 +myVariable = 50 +let myConstant = 42 +``` 常量或者变量的类型必须和你赋给它们的值一样。然而,声明时类型是可选的,声明的同时赋值的话,编译器会自动推断类型。在上面的例子中,编译器推断出`myVariable`是一个整数(integer)因为它的初始值是整数。 如果初始值没有提供足够的信息(或者没有初始值),那你需要在变量后面声明类型,用冒号分割。 - let implicitInteger = 70 - let implicitDouble = 70.0 - let explicitDouble: Double = 70 +```swift +let implicitInteger = 70 +let implicitDouble = 70.0 +let explicitDouble: Double = 70 +``` -> 练习:创建一个常量,显式指定类型为`Float`并指定初始值为4。 +> 练习: +> 创建一个常量,显式指定类型为`Float`并指定初始值为4。 值永远不会被隐式转换为其他类型。如果你需要把一个值转换成其他类型,请显式转换。 - let label = "The width is" - let width = 94 - let widthLabel = label + String(width) - -> 练习:删除最后一行中的`String`,错误提示是什么? +```swift +let label = "The width is" +let width = 94 +let widthLabel = label + String(width) +``` +> 练习: +> 删除最后一行中的`String`,错误提示是什么? 有一种更简单的把值转换成字符串的方法:把值写到括号中,并且在括号之前写一个反斜杠。例如: - let apples = 3 - let oranges = 5 - let appleSummary = "I have \(apples) apples." - let fruitSummary = "I have \(apples + oranges) pieces of fruit." +```swift +let apples = 3 +let oranges = 5 +let appleSummary = "I have \(apples) apples." +let fruitSummary = "I have \(apples + oranges) pieces of fruit." +``` -> 练习:使用`\()`来把一个浮点计算转换成字符串,并加上某人的名字,和他打个招呼。 +> 练习: +> 使用`\()`来把一个浮点计算转换成字符串,并加上某人的名字,和他打个招呼。 使用方括号`[]`来创建数组和字典,并使用下标或者键(key)来访问元素。 - var shoppingList = ["catfish", "water", "tulips", "blue paint"] - shoppingList[1] = "bottle of water" +```swift +var shoppingList = ["catfish", "water", "tulips", "blue paint"] +shoppingList[1] = "bottle of water" +``` - var occupations = [ - "Malcolm": "Captain", - "Kaylee": "Mechanic", - ] - occupations["Jayne"] = "Public Relations" +```swift +var occupations = [ + "Malcolm": "Captain", + "Kaylee": "Mechanic", +] +occupations["Jayne"] = "Public Relations" +``` 要创建一个空数组或者字典,使用初始化语法。 - let emptyArray = String[]() - let emptyDictionary = Dictionary() +```swift +let emptyArray = String[]() +let emptyDictionary = Dictionary() +``` 如果类型信息可以被推断出来,你可以用`[]`和`[:]`来创建空数组和空字典——就像你声明变量或者给函数传参数的时候一样。 - shoppingList = [] // 去逛街并买点东西 +```swift +shoppingList = [] // 去逛街并买点东西 +``` + ## 控制流 使用`if`和`switch`来进行条件操作,使用`for-in`、`for`、`while`和`do-while`来进行循环。包裹条件和循环变量括号可以省略,但是语句体的大括号是必须的。 - let individualScores = [75, 43, 103, 87, 12] - var teamScore = 0 - for score in individualScores { - if score > 50 { - teamScore += 3 - } else { - teamScore += 1 - } +```swift +let individualScores = [75, 43, 103, 87, 12] +var teamScore = 0 +for score in individualScores { + if score > 50 { + teamScore += 3 + } else { + teamScore += 1 } - teamScore +} +teamScore +``` 在`if`语句中,条件必须是一个布尔表达式——这意味着像`if score { ... }`这样的代码将报错,而不会隐形地与 0 做对比。 你可以一起使用`if`和`let`来处理值缺失的情况。有些变量的值是可选的。一个可选的值可能是一个具体的值或者是`nil`,表示值缺失。在类型后面加一个问号来标记这个变量的值是可选的。 - var optionalString: String? = "Hello" - optionalString == nil +```swift +var optionalString: String? = "Hello" +optionalString == nil - var optionalName: String? = "John Appleseed" - var greeting = "Hello!" - if let name = optionalName { - greeting = "Hello, \(name)" - } +var optionalName: String? = "John Appleseed" +var greeting = "Hello!" +if let name = optionalName { + greeting = "Hello, \(name)" +} +``` -> 练习:把`optionalName`改成`nil`,greeting会是什么?添加一个`else`语句,当`optionalName`是`nil`时给greeting赋一个不同的值。 +> 练习: +> 把`optionalName`改成`nil`,greeting会是什么?添加一个`else`语句,当`optionalName`是`nil`时给greeting赋一个不同的值。 如果变量的可选值是`nil`,条件会判断为`false`,大括号中的代码会被跳过。如果不是`nil`,会将值赋给`let`后面的常量,这样代码块中就可以使用这个值了。 `switch`支持任意类型的数据以及各种比较操作——不仅仅是整数以及测试相等。 - let vegetable = "red pepper" - switch vegetable { - case "celery": - let vegetableComment = "Add some raisins and make ants on a log." - case "cucumber", "watercress": - let vegetableComment = "That would make a good tea sandwich." - case let x where x.hasSuffix("pepper"): - let vegetableComment = "Is it a spicy \(x)?" - default: - let vegetableComment = "Everything tastes good in soup." - } +```swift +let vegetable = "red pepper" +switch vegetable { +case "celery": + let vegetableComment = "Add some raisins and make ants on a log." +case "cucumber", "watercress": + let vegetableComment = "That would make a good tea sandwich." +case let x where x.hasSuffix("pepper"): + let vegetableComment = "Is it a spicy \(x)?" +default: + let vegetableComment = "Everything tastes good in soup." +} +``` -> 练习:删除`default`语句,看看会有什么错误? +> 练习: +> 删除`default`语句,看看会有什么错误? 运行`switch`中匹配到的子句之后,程序会退出`switch`语句,并不会继续向下运行,所以不需要在每个子句结尾写`break`。 你可以使用`for-in`来遍历字典,需要两个变量来表示每个键值对。 - let interestingNumbers = [ - "Prime": [2, 3, 5, 7, 11, 13], - "Fibonacci": [1, 1, 2, 3, 5, 8], - "Square": [1, 4, 9, 16, 25], - ] - var largest = 0 - for (kind, numbers) in interestingNumbers { - for number in numbers { - if number > largest { - largest = number - } +```swift +let interestingNumbers = [ + "Prime": [2, 3, 5, 7, 11, 13], + "Fibonacci": [1, 1, 2, 3, 5, 8], + "Square": [1, 4, 9, 16, 25], +] +var largest = 0 +for (kind, numbers) in interestingNumbers { + for number in numbers { + if number > largest { + largest = number } } - largest +} +largest +``` -> 练习:添加另一个变量来记录哪种类型的数字是最大的。 +> 练习: +> 添加另一个变量来记录哪种类型的数字是最大的。 使用`while`来重复运行一段代码直到不满足条件。循环条件可以在开头也可以在结尾。 - var n = 2 - while n < 100 { - n = n * 2 - } - n +```swift +var n = 2 +while n < 100 { + n = n * 2 +} +n - var m = 2 - do { - m = m * 2 - } while m < 100 - m +var m = 2 +do { + m = m * 2 +} while m < 100 +m +``` 你可以在循环中使用`..`来表示范围,也可以使用传统的写法,两者是等价的: - var firstForLoop = 0 - for i in 0..3 { - firstForLoop += i - } - firstForLoop +```swift +var firstForLoop = 0 +for i in 0..3 { + firstForLoop += i +} +firstForLoop - var secondForLoop = 0 - for var i = 0; i < 3; ++i { - secondForLoop += 1 - } - secondForLoop +var secondForLoop = 0 +for var i = 0; i < 3; ++i { + secondForLoop += 1 +} +secondForLoop +``` 使用`..`创建的范围不包含上界,如果想包含的话需要使用`...`。 + ## 函数和闭包 使用`func`来声明一个函数,使用名字和参数来调用函数。使用`->`来指定函数返回值。 - func greet(name: String, day: String) -> String { - return "Hello \(name), today is \(day)." - } - greet("Bob", "Tuesday") +```swift +func greet(name: String, day: String) -> String { + return "Hello \(name), today is \(day)." +} +greet("Bob", "Tuesday") +``` -> 练习:删除`day`参数,添加一个参数来表示今天吃了什么午饭。 +> 练习: +> 删除`day`参数,添加一个参数来表示今天吃了什么午饭。 使用一个元组来返回多个值。 - func getGasPrices() -> (Double, Double, Double) { - return (3.59, 3.69, 3.79) +```swift +func getGasPrices() -> (Double, Double, Double) { + return (3.59, 3.69, 3.79) +} +getGasPrices() +``` + +函数可以带有可变个数的参数,这些参数在函数内表现为数组的形式: + +```swift +func sumOf(numbers: Int...) -> Int { + var sum = 0 + for number in numbers { + sum += number } - getGasPrices() + return sum +} +sumOf() +sumOf(42, 597, 12) +``` -函数的参数数量是可变的,用一个数组来获取它们: - - func sumOf(numbers: Int...) -> Int { - var sum = 0 - for number in numbers { - sum += number - } - return sum - } - sumOf() - sumOf(42, 597, 12) - -> 练习:写一个计算参数平均值的函数。 +> 练习: +> 写一个计算参数平均值的函数。 函数可以嵌套。被嵌套的函数可以访问外侧函数的变量,你可以使用嵌套函数来重构一个太长或者太复杂的函数。 - func returnFifteen() -> Int { - var y = 10 - func add() { - y += 5 - } - add() - return y +```swift +func returnFifteen() -> Int { + var y = 10 + func add() { + y += 5 } - returnFifteen() + add() + return y +} +returnFifteen() +``` -函数是一等公民,这意味着函数可以作为另一个函数的返回值。 +函数是第一等类型,这意味着函数可以作为另一个函数的返回值。 - func makeIncrementer() -> (Int -> Int) { - func addOne(number: Int) -> Int { - return 1 + number - } - return addOne +```swift +func makeIncrementer() -> (Int -> Int) { + func addOne(number: Int) -> Int { + return 1 + number } - var increment = makeIncrementer() - increment(7) + return addOne +} +var increment = makeIncrementer() +increment(7) +``` 函数也可以当做参数传入另一个函数。 - func hasAnyMatches(list: Int[], condition: Int -> Bool) -> Bool { - for item in list { - if condition(item) { - return true - } +```swift +func hasAnyMatches(list: Int[], condition: Int -> Bool) -> Bool { + for item in list { + if condition(item) { + return true } - return false } - func lessThanTen(number: Int) -> Bool { - return number < 10 - } - var numbers = [20, 19, 7, 12] - hasAnyMatches(numbers, lessThanTen) + return false +} +func lessThanTen(number: Int) -> Bool { + return number < 10 +} +var numbers = [20, 19, 7, 12] +hasAnyMatches(numbers, lessThanTen) +``` -函数实际上是一种特殊的闭包,你可以使用`{}`来创建一个匿名闭包。使用`in`来分割参数、返回值与执行体。 +函数实际上是一种特殊的闭包,你可以使用`{}`来创建一个匿名闭包。使用`in`将参数和返回值类型声明与闭包函数体进行分离。 - numbers.map({ - (number: Int) -> Int in - let result = 3 * number - return result - }) +```swift +numbers.map({ + (number: Int) -> Int in + let result = 3 * number + return result +}) +``` -> 练习:重写闭包,对所有奇数返回0. +> 练习: +> 重写闭包,对所有奇数返回0。 有很多种创建闭包的方法。如果一个闭包的类型已知,比如作为一个回调函数,你可以忽略参数的类型和返回值。单个语句闭包会把它语句的值当做结果返回。 +```swift +numbers.map({ number in 3 * number }) +``` + 你可以通过参数位置而不是参数名字来引用参数——这个方法在非常短的闭包中非常有用。当一个闭包作为最后一个参数传给一个函数的时候,它可以直接跟在括号后面。 - sort([1, 5, 3, 12, 2]) { $0 > $1 } +```swift +sort([1, 5, 3, 12, 2]) { $0 > $1 } +``` + ## 对象和类 使用`class`和类名来创建一个类。类中属性的声明和常量、变量声明一样,唯一的区别就是它们的上下文是类。同样,方法和函数声明也一样。 - class Shape { - var numberOfSides = 0 - func simpleDescription() -> String { - return "A shape with \(numberOfSides) sides." - } +```swift +class Shape { + var numberOfSides = 0 + func simpleDescription() -> String { + return "A shape with \(numberOfSides) sides." } +} +``` -> 练习:使用`let`添加一个常量属性,再添加一个接收一个参数的方法。 +> 练习: +> 使用`let`添加一个常量属性,再添加一个接收一个参数的方法。 要创建一个类的实例,在类名后面加上括号。使用点语法来访问实例的属性和方法。 - var shape = Shape() - shape.numberOfSides = 7 - var shapeDescription = shape.simpleDescription() +```swift +var shape = Shape() +shape.numberOfSides = 7 +var shapeDescription = shape.simpleDescription() +``` 这个版本的`Shape`类缺少了一些重要的东西:一个构造函数来初始化类实例。使用`init`来创建一个构造器。 - class NamedShape { - var numberOfSides: Int = 0 - var name: String +```swift +class NamedShape { + var numberOfSides: Int = 0 + var name: String - init(name: String) { - self.name = name - } - - func simpleDescription() -> String { - return "A shape with \(numberOfSides) sides." - } + init(name: String) { + self.name = name } + func simpleDescription() -> String { + return "A shape with \(numberOfSides) sides." + } +} +``` + 注意`self`被用来区别实例变量。当你创建实例的时候,像传入函数参数一样给类传入构造器的参数。每个属性都需要赋值——无论是通过声明(就像`numberOfSides`)还是通过构造器(就像`name`)。 如果你需要在删除对象之前进行一些清理工作,使用`deinit`创建一个析构函数。 @@ -303,57 +379,62 @@ 子类如果要重写父类的方法的话,需要用`override`标记——如果没有添加`override`就重写父类方法的话编译器会报错。编译器同样会检测`override`标记的方法是否确实在父类中。 - class Square: NamedShape { - var sideLength: Double +```swift +class Square: NamedShape { + var sideLength: Double - init(sideLength: Double, name: String) { - self.sideLength = sideLength - super.init(name: name) - numberOfSides = 4 - } - - func area() -> Double { - return sideLength * sideLength - } - - override func simpleDescription() -> String { - return "A square with sides of length \(sideLength)." - } + init(sideLength: Double, name: String) { + self.sideLength = sideLength + super.init(name: name) + numberOfSides = 4 } - let test = Square(sideLength: 5.2, name: "my test square") - test.area() - test.simpleDescription() -> 练习:创建`NamedShape`的另一个子类`Circle`,构造器接收两个参数,一个是半径一个是名称,实现`area`和`describe`方法。 + func area() -> Double { + return sideLength * sideLength + } + + override func simpleDescription() -> String { + return "A square with sides of length \(sideLength)." + } +} +let test = Square(sideLength: 5.2, name: "my test square") +test.area() +test.simpleDescription() +``` + +> 练习: +> 创建`NamedShape`的另一个子类`Circle`,构造器接收两个参数,一个是半径一个是名称,实现`area`和`describe`方法。 属性可以有 getter 和 setter 。 - class EquilateralTriangle: NamedShape { - var sideLength: Double = 0.0 +```swift +class EquilateralTriangle: NamedShape { + var sideLength: Double = 0.0 - init(sideLength: Double, name: String) { - self.sideLength = sideLength - super.init(name: name) - numberOfSides = 3 - } - - var perimeter: Double { - get { - return 3.0 * sideLength - } - set { - sideLength = newValue / 3.0 - } - } - - override func simpleDescription() -> String { - return "An equilateral triagle with sides of length \(sideLength)." - } + init(sideLength: Double, name: String) { + self.sideLength = sideLength + super.init(name: name) + numberOfSides = 3 } - var triangle = EquilateralTriangle(sideLength: 3.1, name: "a triangle") - triangle.perimeter - triangle.perimeter = 9.9 - triangle.sideLength + + var perimeter: Double { + get { + return 3.0 * sideLength + } + set { + sideLength = newValue / 3.0 + } + } + + override func simpleDescription() -> String { + return "An equilateral triagle with sides of length \(sideLength)." + } +} +var triangle = EquilateralTriangle(sideLength: 3.1, name: "a triangle") +triangle.perimeter +triangle.perimeter = 9.9 +triangle.sideLength +``` 在`perimeter`的 setter 中,新值的名字是`newValue`。你可以在`set`之后显式的设置一个名字。 @@ -363,244 +444,283 @@ 2. 调用父类的构造器 3. 改变父类定义的属性值。其他的工作比如调用方法、getters和setters也可以在这个阶段完成。 -如果你不需要计算属性但是需要在设置一个新值之前运行一些代码,使用`willSet`和`didSet`。 +如果你不需要计算属性,但是仍然需要在设置一个新值之前或者之后运行代码,使用`willSet`和`didSet`。 比如,下面的类确保三角形的边长总是和正方形的边长相同。 - class TriangleAndSquare { - var triangle: EquilateralTriangle { - willSet { - square.sideLength = newValue.sideLength - } - } - var square: Square { - willSet { - triangle.sideLength = newValue.sideLength - } - } - init(size: Double, name: String) { - square = Square(sideLength: size, name: name) - triangle = EquilateralTriangle(sideLength: size, name: name) - } +```swift +class TriangleAndSquare { + var triangle: EquilateralTriangle { + willSet { + square.sideLength = newValue.sideLength } - var triangleAndSquare = TriangleAndSquare(size: 10, name: "another test shape") - triangleAndSquare.square.sideLength - triangleAndSquare.triangle.sideLength - triangleAndSquare.square = Square(sideLength: 50, name: "larger square") - triangleAndSquare.triangle.sideLength + } + var square: Square { + willSet { + triangle.sideLength = newValue.sideLength + } + } + init(size: Double, name: String) { + square = Square(sideLength: size, name: name) + triangle = EquilateralTriangle(sideLength: size, name: name) + } +} +var triangleAndSquare = TriangleAndSquare(size: 10, name: "another test shape") +triangleAndSquare.square.sideLength +triangleAndSquare.triangle.sideLength +triangleAndSquare.square = Square(sideLength: 50, name: "larger square") +triangleAndSquare.triangle.sideLength +``` 类中的方法和一般的函数有一个重要的区别,函数的参数名只在函数内部使用,但是方法的参数名需要在调用的时候显式说明(除了第一个参数)。默认情况下,方法的参数名和它在方法内部的名字一样,不过你也可以定义第二个名字,这个名字被用在方法内部。 - class Counter { - var count: Int = 0 - func incrementBy(amount: Int, numberOfTimes times: Int) { - count += amount * times - } +```swift +class Counter { + var count: Int = 0 + func incrementBy(amount: Int, numberOfTimes times: Int) { + count += amount * times } - var counter = Counter() - counter.incrementBy(2, numberOfTimes: 7) +} +var counter = Counter() +counter.incrementBy(2, numberOfTimes: 7) +``` 处理变量的可选值时,你可以在操作(比如方法、属性和子脚本)之前加`?`。如果`?`之前的值是`nil`,`?`后面的东西都会被忽略,并且整个表达式返回`nil`。否则,`?`之后的东西都会被运行。在这两种情况下,整个表达式的值也是一个可选值。 - let optionalSquare: Square? = Square(sideLength: 2.5, name: "optional square") - let sideLength = optionalSquare?.sideLength - +```swift +let optionalSquare: Square? = Square(sideLength: 2.5, name: "optional square") +let sideLength = optionalSquare?.sideLength +``` + ## 枚举和结构体 使用`enum`来创建一个枚举。就像类和其他所有命名类型一样,枚举可以包含方法。 - enum Rank: Int { - case Ace = 1 - case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten - case Jack, Queen, King - func simpleDescription() -> String { - switch self { - case .Ace: - return "ace" - case .Jack: - return "jack" - case .Queen: - return "queen" - case .King: - return "king" - default: - return String(self.toRaw()) - } +```swift +enum Rank: Int { + case Ace = 1 + case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten + case Jack, Queen, King + func simpleDescription() -> String { + switch self { + case .Ace: + return "ace" + case .Jack: + return "jack" + case .Queen: + return "queen" + case .King: + return "king" + default: + return String(self.toRaw()) } } - let ace = Rank.Ace - let aceRawValue = ace.toRaw() +} +let ace = Rank.Ace +let aceRawValue = ace.toRaw() +``` -> 练习:写一个函数,通过比较它们的原始值来比较两个`Rank`值。 +> 练习: +> 写一个函数,通过比较它们的原始值来比较两个`Rank`值。 在上面的例子中,枚举原始值的类型是`Int`,所以你只需要设置第一个原始值。剩下的原始值会按照顺序赋值。你也可以使用字符串或者浮点数作为枚举的原始值。 使用`toRaw`和`fromRaw`函数来在原始值和枚举值之间进行转换。 - if let convertedRank = Rank.fromRaw(3) { - let threeDescription = convertedRank.simpleDescription() - } +```swift +if let convertedRank = Rank.fromRaw(3) { + let threeDescription = convertedRank.simpleDescription() +} +``` 枚举的成员值是实际值,并不是原始值的另一种表达方法。实际上,如果原始值没有意义,你不需要设置。 - enum Suit { - case Spades, Hearts, Diamonds, Clubs - func simpleDescription() -> String { - switch self { - case .Spades: - return "spades" - case .Hearts: - return "hearts" - case .Diamonds: - return "diamonds" - case .Clubs: - return "clubs" - } +```swift +enum Suit { + case Spades, Hearts, Diamonds, Clubs + func simpleDescription() -> String { + switch self { + case .Spades: + return "spades" + case .Hearts: + return "hearts" + case .Diamonds: + return "diamonds" + case .Clubs: + return "clubs" } - } - let hearts = Suit.Hearts - let heartsDescription = hearts.simpleDescription() -> 练习:给`Suit`添加一个`color`方法,对`spades`和`clubs`返回“black”,对`hearts`和`diamonds`返回“red”。 +} +let hearts = Suit.Hearts +let heartsDescription = hearts.simpleDescription() +``` + +> 练习: +> 给`Suit`添加一个`color`方法,对`spades`和`clubs`返回“black”,对`hearts`和`diamonds`返回“red”。 注意,有两种方式可以引用`Hearts`成员:给`hearts`常量赋值时,枚举成员`Suit.Hearts`需要用全名来引用,因为常量没有显式指定类型。在`switch`里,枚举成员使用缩写`.Hearts`来引用,因为`self`的值已经知道是一个`suit`。已知变量类型的情况下你可以使用缩写。 使用`struct`来创建一个结构体。结构体和类有很多相同的地方,比如方法和构造器。它们之间最大的一个区别就是 结构体是传值,类是传引用。 - struct Card { - var rank: Rank - var suit: Suit - func simpleDescription() -> String { - return "The \(rank.simpleDescription()) of \ - (suit.simpleDescription())" - } +```swift +struct Card { + var rank: Rank + var suit: Suit + func simpleDescription() -> String { + return "The \(rank.simpleDescription()) of \ + (suit.simpleDescription())" } - let threeOfSpades = Card(rank: .Three, suit: .Spades) - let threeOfSpadesDescription = threeOfSpades.simpleDescription() +} +let threeOfSpades = Card(rank: .Three, suit: .Spades) +let threeOfSpadesDescription = threeOfSpades.simpleDescription() +``` -> 练习:给`Card`添加一个方法,创建一副完整的扑克牌并把每张牌的rank和suit对应起来。 +> 练习: +> 给`Card`添加一个方法,创建一副完整的扑克牌并把每张牌的 rank 和 suit 对应起来。 一个枚举成员的实例可以有实例值。相同枚举成员的实例可以有不同的值。创建实例的时候传入值即可。实例值和原始值是不同的:枚举成员的原始值对于所有实例都是相同的,而且你是在定义枚举的时候设置原始值。 例如,考虑从服务器获取日出和日落的时间。服务器会返回正常结果或者错误信息。 - enum ServerResponse { - case Result(String, String) - case Error(String) - } +```swift +enum ServerResponse { + case Result(String, String) + case Error(String) +} - let success = ServerResponse.Result("6:00 am", "8:09 pm") - let failure = ServerResponse.Error("Out of cheese.") +let success = ServerResponse.Result("6:00 am", "8:09 pm") +let failure = ServerResponse.Error("Out of cheese.") - switch success { - case let .Result(sunrise, sunset): - let serverResponse = "Sunrise is at \(sunrise) and sunset is at \(sunset)." - case let .Error(error): - let serverResponse = "Failure... \(error)" - } +switch success { +case let .Result(sunrise, sunset): + let serverResponse = "Sunrise is at \(sunrise) and sunset is at \(sunset)." +case let .Error(error): + let serverResponse = "Failure... \(error)" +} +``` -> 练习:给`ServerResponse`和`switch`添加第三种情况。 +> 练习: +> 给`ServerResponse`和`switch`添加第三种情况。 注意如何从`ServerResponse`中提取日升和日落时间。 -## 接口和扩展 + +## 协议和扩展 -使用`protocol`来声明一个接口。 +使用`protocol`来声明一个协议。 - protocol ExampleProtocol { - var simpleDescription: String { get } - mutating func adjust() +```swift +protocol ExampleProtocol { + var simpleDescription: String { get } + mutating func adjust() +} +``` + +类、枚举和结构体都可以实现协议。 + +```swift +class SimpleClass: ExampleProtocol { + var simpleDescription: String = "A very simple class." + var anotherProperty: Int = 69105 + func adjust() { + simpleDescription += " Now 100% adjusted." } +} +var a = SimpleClass() +a.adjust() +let aDescription = a.simpleDescription -类、枚举和结构体都可以实现接口。 - - class SimpleClass: ExampleProtocol { - var simpleDescription: String = "A very simple class." - var anotherProperty: Int = 69105 - func adjust() { - simpleDescription += " Now 100% adjusted." - } +struct SimpleStructure: ExampleProtocol { + var simpleDescription: String = "A simple structure" + mutating func adjust() { + simpleDescription += " (adjusted)" } - var a = SimpleClass() - a.adjust() - let aDescription = a.simpleDescription +} +var b = SimpleStructure() +b.adjust() +let bDescription = b.simpleDescription +``` - struct SimpleStructure: ExampleProtocol { - var simpleDescription: String = "A simple structure" - mutating func adjust() { - simpleDescription += " (adjusted)" - } - } - var b = SimpleStructure() - b.adjust() - let bDescription = b.simpleDescription - -> 练习:写一个实现这个接口的枚举。 +> 练习: +> 写一个实现这个协议的枚举。 注意声明`SimpleStructure`时候`mutating`关键字用来标记一个会修改结构体的方法。`SimpleClass`的声明不需要标记任何方法因为类中的方法经常会修改类。 -使用`extension`来为现有的类型添加功能,比如添加一个计算属性的方法。你可以使用扩展来给任意类型添加协议,甚至是你从外部库或者框架中导入的类型。 +使用`extension`来为现有的类型添加功能,比如新的方法和参数。你可以使用扩展来改造定义在别处,甚至是从外部库或者框架引入的一个类型,使得这个类型遵循某个协议。 - extension Int: ExampleProtocol { - var simpleDescription: String { - return "The number \(self)" - } - mutating func adjust() { - self += 42 - } +```swift +extension Int: ExampleProtocol { + var simpleDescription: String { + return "The number \(self)" } - 7.simpleDescription + mutating func adjust() { + self += 42 + } +} +7.simpleDescription +``` -> 练习:给`Double`类型写一个扩展,添加`absoluteValue`功能。 +> 练习: +> 给`Double`类型写一个扩展,添加`absoluteValue`功能。 -你可以像使用其他命名类型一样使用接口名——例如,创建一个有不同类型但是都实现一个接口的对象集合。当你处理类型是接口的值时,接口外定义的方法不可用。 +你可以像使用其他命名类型一样使用协议名——例如,创建一个有不同类型但是都实现一个协议的对象集合。当你处理类型是协议的值时,协议外定义的方法不可用。 - let protocolValue: ExampleProtocol = a - protocolValue.simpleDescription - // protocolValue.anotherProperty // Uncomment to see the error +```swift +let protocolValue: ExampleProtocol = a +protocolValue.simpleDescription +// protocolValue.anotherProperty // Uncomment to see the error +``` -即使`protocolValue`变量运行时的类型是`simpleClass`,编译器会把它的类型当做`ExampleProtocol`。这表示你不能调用类在它实现的接口之外实现的方法或者属性。 +即使`protocolValue`变量运行时的类型是`simpleClass`,编译器会把它的类型当做`ExampleProtocol`。这表示你不能调用类在它实现的协议之外实现的方法或者属性。 + ## 泛型 在尖括号里写一个名字来创建一个泛型函数或者类型。 - func repeat(item: ItemType, times: Int) -> ItemType[] { - var result = ItemType[]() - for i in 0..times { - result += item - } - return result +```swift +func repeat(item: ItemType, times: Int) -> ItemType[] { + var result = ItemType[]() + for i in 0..times { + result += item } - repeat("knock", 4) + return result +} +repeat("knock", 4) +``` 你也可以创建泛型类、枚举和结构体。 - // Reimplement the Swift standard library's optional type - enum OptionalValue { - case None - case Some(T) - } - var possibleInteger: OptionalValue = .None - possibleInteger = .Some(100) +```swift +// Reimplement the Swift standard library's optional type +enum OptionalValue { + case None + case Some(T) +} +var possibleInteger: OptionalValue = .None +possibleInteger = .Some(100) +``` -在类型名后面使用`where`来指定一个需求列表——例如,要限定实现一个协议的类型,需要限定两个类型要相同,或者限定一个类必须有一个特定的父类。 +在类型名后面使用`where`来指定对类型的需求,比如,限定类型实现某一个协议,限定两个类型是相同的,或者限定某个类必须有一个特定的父类 - func anyCommonElements (lhs: T, rhs: U) -> Bool { - for lhsItem in lhs { - for rhsItem in rhs { - if lhsItem == rhsItem { - return true - } +```swift +func anyCommonElements (lhs: T, rhs: U) -> Bool { + for lhsItem in lhs { + for rhsItem in rhs { + if lhsItem == rhsItem { + return true } } - return false } - anyCommonElements([1, 2, 3], [3]) + return false +} +anyCommonElements([1, 2, 3], [3]) +``` -> 练习:修改`anyCommonElements`函数来创建一个函数,返回一个数组,内容是两个序列的共有元素。 +> 练习: +> 修改`anyCommonElements`函数来创建一个函数,返回一个数组,内容是两个序列的共有元素。 -简单起见,你可以忽略`where`,只在冒号后面写接口或者类名。` `和``是等价的。 +简单起见,你可以忽略`where`,只在冒号后面写协议或者类名。` `和``是等价的。 diff --git a/source/chapter1/GuidedTour.playground.zip b/source/chapter1/GuidedTour.playground.zip new file mode 100644 index 00000000..13e2c05e Binary files /dev/null and b/source/chapter1/GuidedTour.playground.zip differ diff --git a/source/chapter1/chapter1.md b/source/chapter1/chapter1.md old mode 100644 new mode 100755 index f9b021a5..089600ca --- a/source/chapter1/chapter1.md +++ b/source/chapter1/chapter1.md @@ -1,4 +1,4 @@ -# 欢迎使用 Swift - -在本章中您将了解 Swift 的特性和开发历史,并对 Swift 有一个初步的了解。 - +# 欢迎使用 Swift + +在本章中您将了解 Swift 的特性和开发历史,并对 Swift 有一个初步的了解。 + diff --git a/source/chapter2/01_The_Basics.md b/source/chapter2/01_The_Basics.md old mode 100644 new mode 100755 index c69238b4..164898b4 --- a/source/chapter2/01_The_Basics.md +++ b/source/chapter2/01_The_Basics.md @@ -1,547 +1,696 @@ -# 基础部分 - -Swift 是 iOS 和 OS X 应用开发的一门新语言。然而,如果你有 C 或者 Objective-C 开发经验的话,你会发现 Swift 的很多内容都是你熟悉的。 - -Swift 的类型是在 C 和 Objective-C 的基础上提出的,`Int`是整型;`Double`和`Float`是浮点型;`Bool`是布尔型;`String`是字符串。Swift 还有两个有用的集合类型,`Array`和`Dictionary`,详情参见`集合类型(待添加链接)`。 - -就像 C 语言一样,Swift 使用变量来进行存储并通过变量名来关联值。在 Swift 中,值不可变的变量有着广泛的应用,它们就是常量,而且比 C 语言的常量更强大。在 Swift 中,如果你要处理的值不需要改变,那使用常量可以让你的代码更加安全并且更好地表达你的意图。 - -除了我们熟悉的类型,Swift 还增加了 Objective-C 中没有的类型比如元组(Tuple)。元组可以让你创建或者传递一组数据,比如作为函数的返回值时,你可以用一个元组可以返回多个值。 - -Swift 还增加了可选(Optional)类型,用于处理值缺失的情况。可选表示“那儿有一个值,并且它等于 x ”或者“那儿没有值”。可选有点像在 Objective-C 中使用`nil`,但是它可以用在任何类型上,不仅仅是类。可选类型比 Objective-C 中的`nil`指针更加安全也更具表现力,它是 Swift 许多强大特性的重要组成部分。 - -Swift 是一个类型安全的语言,可选就是一个很好的例子。Swift 可以让你清楚地知道值的类型。如果你的代码期望得到一个`String`,类型安全会阻止你不小心传入一个`Int`。你可以在开发阶段尽早发现并修正错误。 - -## 常量和变量 - -常量和变量把一个名字(比如`maximumNumberOfLoginAttempts`或者`welcomeMessage`)和一个指定类型的值(比如数字`10`或者字符串`Hello`)关联起来。常量的值一旦设定就不能改变,而变量的值可以随意更改。 - -### 声明常量和变量 - -常量和变量必须在使用前声明,用`let`来声明常量,用`var`来声明变量。下面的例子展示了如何用常量和变量来记录用户尝试登录的次数: - - let maximumNumberOfLoginAttempts = 10 - var currentLoginAttempt = 0 - -这两行代码可以被理解为 -: -“声明一个名字是`maximumNumberOfLoginAttempts`的新常量,并给它一个值`10`。然后,声明一个名字是`currentLoginAttempt`的变量并将它的值初始化为0.” - -在这个例子中,允许的最大尝试登录次数被声明为一个常量,因为这个值不会改变。当前尝试登录次数被声明为一个变量,因为每次尝试登录失败的时候都需要增加这个值。 - -你可以在一行中声明多个常量或者多个变量,用逗号隔开: - - var x = 0.0, y = 0.0, z = 0.0 - -> 注意:如果你的代码中有不需要改变的值,请将它声明为常量。只将需要改变的值声明为变量。 - -### 类型标注 - -当你声明常量或者变量的时候可以加上类型标注,说明常量或者变量中要存储的值的类型。如果要添加类型标注,在常量或者变量名后面加上一个冒号和空格,然后加上类型名称。 - -这个例子给`welcomeMessage`变量添加了类型标注,表示这个变量可以存储`String`类型的值: - - var welcomeMessage: String - -声明中的冒号代表着“是...类型”,所以这行代码可以被理解为:: - -“声明一个类型为`String`,名字为`welcomeMessage`的变量。” - -“类型为`String`”的意思是“可以存储任意`String`类型的值。” - -`welcomeMessage`变量现在可以被设置成任意字符串: - - welcomeMessage = "Hello" - -> 注意:一般来说你很少需要写类型标注。如果你在声明常量或者变量的时候赋了一个初始值,Swift可以推断出这个常量或者变量的类型,详情参见`类型安全和类型推断(待添加链接)`。在上面的例子中,没有给`welcomeMessage`赋初始值,所以添加了一个类型标注。 - -### 常量和变量的命名 - -你可以用任何你喜欢的字符作为常量和变量名,包括Unicode字符: - - let π = 3.14159 - let 你好 = "你好世界" - let 🐶🐮 = "dogcow" - -常量与变量名不能包含数学符号,箭头,保留的(或者非法的)Unicode码位,连线与制表符。尽管常量与变量名中可以包含数字,但是它们不能以数字打头。 - -一旦你将常量或者变量声明为确定的类型,你就不能使用相同的名字再次进行声明,或者以改变其存储的值为其他类型。同时,你也不能将常量与变量进行互转。 - -> 注意:如果你需要使用与Swift保留关键字相同的名称作为常量或者变量名,你可以使用反引号(`)将关键字围住的方式将其作为名字使用。无论如何,你应当避免使用关键字作为常量或变量名,除非你别无选择。 - -你可以更改现有的变量值为其他同类型的值,在下面的例子中,`friendlyWelcome`的值从`"Hello!"`改为了`"Bonjour!"`: - - var friendlyWelcome = "Hello!" - friendlyWelcome = "Bonjour!" - // friendlyWelcome is now "Bonjour!" - -和变量不一样,常量的值一旦被确定以后就不能更改了。尝试这样做会在编译时报错: - - let languageName = "Swift" - languageName = "Swift++" - // this is a compile-time error - languageName cannot be changed - -### 输出常量和变量 - -你可以用`println`函数来输出当前常量或变量的值: - - println(friendlyWelcome) - // prints "Bonjour!" - -`println`是一个用来输出的全局函数,输出的内容会在最后带换行。如果你用Xcode,`println`将会输出内容到“console”面板上。(另一种函数叫`print`,唯一区别是在输出内容最后不会加入换行。) - -`println`函数输出传入的`String`值: - - println("This is a string") - // prints "This is a string" - -像Cocoa里的`NSLog`函数一样,`println`函数可以输出更复杂的信息。这些信息可以包含当前常量和变量的值。 - -Swift用字符串插值(string interpolation)的方式把常量名或者变量名当做占位符加入到长字符串中,Swift会用当前常量或变量的值替换这些占位符。将常量或变量名放入反斜杠符加一对圆括号中`"\()"`: - - println("The current value of friendlyWelcome is \(friendlyWelcome)") - // prints "The current value of friendlyWelcome is Bonjour! - -> 注意:字符串插值所有可用的选项在 字符串插值 这章中讲述。 - -### 注释 -请将你的代码中的非执行文本注释成提示或者笔记以方便你将来阅读。Swift 的编译器将会在编译代码时自动忽略掉注释部分。 - -Swift 中的注释与C 语言的注释非常相似。单行注释以双正斜杠作(//)为起始标记: - - // this is a comment - -你也可以进行多行注释,其起始标记为单个正斜杠后跟随一个星号(/\*),终止标记为一个星号后跟随单个正斜杠(\*/): - - /* this is also a comment, - but written over multiple lines */ - -与C 语言多行注释不同的是,Swift 的多行注释可以嵌套在其它的多行注释之中。你可以先生成一个多行注释块,然后在这个注释块之中再嵌套成第二个多行注释。终止注释时先插入第二个注释块的终止标记,然后再插入第一个注释块的终止标记: - - /* this is the start of the first multiline comment - /* this is the second, nested multiline comment */ - this is the end of the first multiline comment */ - -通过运用嵌套多行注释,你可以快速方便的注释掉一大段代码,即使这段代码之中已经含有了多行注释块。 - -## 分号 -与其他大部分编程语言不同,Swift 并不强制要求你在每条语句的结尾处使用分号(;),当然,你也可以按照你自己的习惯添加分号。有一种情况下必须要用分号,即你打算在同一行内写多条独立的语句: - - let cat = "🐱"; println(cat) - // prints "🐱" - - -## 整数 - -整数就是没有小数部分的数字,比如`42`和`-23`。整数可以是有符号(正、负、零)或者无符号(正、零)。 - -Swift 提供了8、16、32和64位的有符号和无符号整数类型。这些整数类型和 C 语言的命名方式很像,比如8位无符号整数类型是`UInt8`,32位有符号整数类型是`Int32`。就像 Swift 的其他类型一样,整数类型采用大写命名法。 - -### 整数范围 - -你可以访问不同整数类型的`min`和`max`属性来获取对应类型的最大值和最小值: - - let minValue = UInt8.min // minValue 为 0,是 UInt8 类型的最小值 - let maxValue = UInt8.max // maxValue 为 255,是 UInt8 类型的最大值 - -### Int - -一般来说,你不需要专门指定整数的长度。Swift 提供了一个特殊的整数类型`Int`,长度与当前平台的原生字长相同: - -* 在32位平台上,`Int`和`Int32`长度相同。 -* 在64位平台上,`Int`和`Int64`长度相同。 - -除非你需要特定长度的整数,一般来说使用`Int`就够了。这可以提高代码一致性和可复用性。即使是在32位平台上,`Int`可以存储的整数范围也可以达到`-2147483648`~`2147483647`,大多数时候这已经足够大了。 - -### UInt - -Swift 也提供了一个特殊的无符号类型`UInt`,长度与当前平台的原生字长相同: - -* 在32位平台上,`UInt`和`UInt32`长度相同。 -* 在64位平台上,`UInt`和`UInt64`长度相同。 - -> 注意:尽量不要使用`UInt`,除非你真的需要存储一个和当前平台原生字长相同的无符号整数。除了这种情况,最好使用`Int`,即使你要存储的值已知是非负的。统一使用`Int`可以提高代码的可复用性,避免不同类型数字之间的转换,并且匹配数字的类型推测,详情参见[类型安全和类型推测](## 类型安全和类型推测)。 - -## 浮点数 - -浮点数是有小数部分的数字,比如`3.14159`,`0.1`和`-273.15`。 - -浮点类型比整数类型表示的范围更大,可以存储比`Int`类型更大或者更小的数字。Swift 提供了两种有符号浮点数类型: - -* `Double`表示64位浮点数。当你需要存储很大或者很高精度的浮点数时请使用此类型。 -* `Float`表示32位浮点数。精度要求不高的话可以使用此类型。 - -> 注意:`Double`精确度很高,至少有15位数字,而`Float`最少只有6位数字。选择哪个类型取决于你的代码需要处理的数字大小。 - -## 类型安全和类型推测 - -Swift 是一个类型安全的语言。类型安全的语言可以让你清楚地知道代码要处理的值的类型。如果你的代码需要一个`String`,你绝对不可能不小心传进去一个`Int`。 - -Swift 是类型安全的,会在编译你的代码时进行类型检查,如果遇到不匹配的类型会报错。这可以让你在开发的时候尽早发现并修复错误。 - -当你要处理不同类型的值时,类型检查可以帮你避免错误。然而,这并不是说你每次声明常量和变量的时候都需要显式指定类型。如果你没有显式指定类型,Swift 会使用类型推测来选择合适的类型。有了类型推测,编译器可以在编译代码的时候自动推测出表达式的类型。原理很简单,判断你赋的值即可。 - -因为有类型推测,和 C 或者 Objc 比起来 Swift 很少需要声明类型。常量和变量虽然需要明确类型,但是大部分工作并不需要你自己来完成。 - -当你声明常量或者变量并赋初值的时候类型推测非常有用。当你在声明常量或者变量的时候赋给它们一个原始值即可触发类型推测。(原始值就是会直接出现在你代码中的值,比如`42`和`3.14159`。) - -举个例子,如果你给一个新常量赋值`42`并且没有标明类型,Swift 可以推测出常量类型是`Int`,因为你给它赋的初值看起来很像一个整数: - - let meaningOfLife = 42 - // meaningOfLife 会被推测为 Int 类型 - -同理,如果你没有给浮点原始值标明类型,Swift 会推测你想要的是`Double`: - - let pi = 3.14159 - // pi 会被推测为 Double 类型 - -当推测浮点数的类型时,Swift 总是会选择`Double`而不是`Float`。 - -如果表达式中同时出现了整数和浮点数,会被推测为`Double`类型: - - let anotherPi = 3 + 0.14159 - // anotherPi 会被推测为 Double 类型 - -原始值`3`没有显式声明类型,而表达式中出现了一个浮点原始值,所以表达式会被推测为`Double`类型。 - -## 数值类原始值 - -整数原始值可以被写作: - -* 一个十进制数,没有前缀 -* 一个二进制数,前缀是`0b` -* 一个八进制数,前缀是`0o` -* 一个十六进制数,前缀是`0x` - -下面的所有整数原始值的十进制值都是`17`: - - let decimalInteger = 17 - let binaryInteger = 0b10001 // 二进制的17 - let octalInteger = 0o21 // 八进制的17 - let hexadecimalInteger = 0x11 // 十六机制的17 - -浮点原始值可以是十进制(没有前缀)或者是十六进制(前缀是`0x`)。小数点两边必须有至少一个十进制数字(或者是十六进制的数字)。浮点原始值还有一个可选的指数,在十进制浮点数中通过大写或者小写的`e`来指定,在十六进制浮点数中通过大写或者小写的`p`来指定。 - -如果一个十进制数的指数为`exp`,那这个数相当于基数和10^exp的乘积: -* 1.25e2 表示 1.25 × 10^2,等于 125.0。 -* 1.25e-2 表示 1.25 × 10^-2,等于 0.0125。 - -如果一个十六进制数的指数为`exp`,那这个数相当于基数和2^exp的乘积: -* 0xFp2 表示 15 × 2^2,等于 60.0。 -* 0xFp-2 表示 15 × 2^-2,等于 3.75。 - -下面的这些浮点原始值都等于十进制的`12.1875`: - - let decimalDouble = 12.1875 - let exponentDouble = 1.21875e1 - let hexadecimalDouble = 0xC.3p0 - -数值类原始值可以包括额外的格式来增强可读性。整数和浮点数都可以添加额外的零并且包含下划线,并不会影响原始值: - - let paddedDouble = 000123.456 - let oneMillion = 1_000_000 - let justOverOneMillion = 1_000_000.000_000_1 - -## 数值类型转换 - -通常来讲,即使代码中的整数常量和变量已知非负,也请使用`Int`类型。总是使用默认的整数类型可以保证你的整数常量和变量可以直接被复用并且可以匹配整数类原始值的类型推测。 -只有在必要的时候才使用其他整数类型,比如要处理外部的长度明确的数据或者为了优化性能、内存占用等等。使用显式指定长度的类型可以及时发现值溢出并且可以暗示正在处理特殊数据。 - -### 整数转换 - -不同整数类型的变量和常量可以存储不同大小的数字。`Int8`类型的常量或者变量可以存储的数字范围是`-128`~`127`,`UInt8`类型的常量或者变量能存储的数字范围是`0`~`255`。如果数字超出了常量或者变量可存储的范围,编译的时候会报错: - - let cannotBeNegative: UInt8 = -1 - // UInt8 类型不能存储负数,所以会报错 - let tooBig: Int8 = Int8.max + 1 - // Int8 类型不能存储超过最大值的数,所以会报错 - -因为每一个整数类型都可以存储不同范围的值,你必须根据情况来选择不同的转换方法。不同的转换方法可以暴露出隐藏的转换错误并让你的代码更加清晰。 - -要将一种数字类型转换成另一种,你要用当前值来初始化一个新数字,这个数字的类型就是你的目标类型。在下面的例子中,常量`twoThousand`类型是`UInt16`,然而常量`one`类型是`Uint8`。它们不能直接相加,因为它们类型不同。所以要调用`UInt16(one)`来创建一个新的`UInt16`数字并用`one`的值来初始化,然后使用这个新数字来计算: - - let twoThousand: UInt16 = 2_000 - let one: UInt8 = 1 - let twoThousandAndOne = twoThousand + UInt16(one) - -现在两个数字的类型都是`UInt16`,可以进行相加。目标常量`twoThousandAndOne`的类型被推测为`UInt16`,因为它是两个`UInt16`值的合。 - -`SomeType(ofInitialValue)`是调用 Swift 构造器并传入一个初始值的默认方法。在语言内部,`UInt16`有一个构造器,可以接受一个`UInt8`类型的值,所以这个构造器可以用现有的`UInt8`来创建一个新的`UInt16`。注意,你并不能传入任意类型的值,只能传入`UInt16`内部有对应构造器的值。不过你可以扩展现有的类型来让它可以接收其他类型的值(包括自定义类型),详情参见`扩展(链接待添加)`. - -### 整数和浮点数转换 - -整数和浮点数的转换必须显式指定类型: - - let three = 3 - let pointOneFourOneFiveNine = 0.14159 - let pi = Double(three) + pointOneFourOneFiveNine - // pi 等于 3.14159,所以被推测为 Double 类型 - -这个例子中,常量`three`的值被用来创建一个`Double`类型的值,所以加号两边的数类型相同。如果不进行转换,两者无法相加。 - -浮点数转换为整数也一样,整数类型可以用`Double`或者`Float`类型来初始化: - - let integerPi = Int(pi) - // integerPi 等于 3,所以被推测为 Int 类型 - -当用这种方式来初始化一个新的整数值时,浮点值会被截断。也就是说`4.75`会变成`4`,`-3.9`会变成`-3`。 - -> 注意:结合数字类常量和变量不同于结合数字类原始值。原始值`3`可以直接和原始值`0.14159`相加,因为数字原始值本身没有明确的类型。它们的类型只在编译器需要求值的时候被推测。 - -## 类型别名 - -类型别名就是给现有类型定义一个可选名字。你可以使用`typealias`关键字来定义类型别名。 - -当你想要给现有类型起一个更有意义的名字时,类型别名非常有用。假设你正在处理特定长度的外部资源的数据: - - typealias AudioSample = UInt16 - -定义了一个类型别名之后,你可以在任何使用原始名的地方使用别名: - - var maxAmplitudeFound = AudioSample.min - // maxAmplitudeFound 现在是 0 - -本例中,`AudioSample`被定义为`UInt16`的一个别名。因为它是别名,`AudioSample.min`实际上是`UInt16.min`,所以会给`maxAmplitudeFound`赋一个初值`0`。 - -## 布尔值 - -Swift 有一个基本的布尔类型,叫做`Bool`。布尔值是指逻辑,因为它们只能是真或者假。Swift 有两个布尔常量,`true`和`false`: - - let orangesAreOrange = true - let turnipsAreDelicious = false - -`orangesAreOrange`和`turnipsAreDelicious`的类型会被推测为`Bool`,因为它们的初值是布尔原始值。就像之前提到的`Int`和`Double`一样,如果你创建变量的时候给它们赋值`true`或者`false`,那你不需要给常量或者变量标明`Bool`类型。初始化常量或者变量的时候如果所赋的值类型已知,就可以触发类型推测,这让 Swift 代码更加简洁并且可读性更高。 - -当你编写条件语句比如`if`语句的时候,布尔值非常有用: - - if turnipsAreDelicious { - println("Mmm, tasty turnips!") - } else { - println("Eww, turnips are horrible.") - } - // 输出 "Eww, turnips are horrible." - -条件语句比如`if`语句的详细介绍参见`控制流(待添加链接)`。 - -如果你在需要使用`Bool`类型的地方使用了非布尔值,Swift 的类型安全机制会报错。下面的例子会报告一个编译时错误: - - let i = 1 - if i { - // 这个例子不会通过编译,会报错 - } - -然而,下面的例子是合法的: - - let i = 1 - if i == 1 { - // 这个例子会编译成功 - } - -`i == 1`的比较结果是`Bool`类型,所以第二个例子可以通过类型检查。类似`i == 1`这样的比较会在`基本操作符(待添加链接)`中详细讨论。 - -和 Swift 中的其他类型安全的例子一样,这个方法可以避免错误并保证这块代码的作用总是在意料之中。 - -## 元组 - -元组把多个值组合成一个复合值。元组内的值可以使任意类型,并不要求是相同类型。 - -下面这个例子中,`(404, "Not Found")`是一个描述 HTTP 状态码的元组。HTTP 状态码是当你请求网页的时候 web 服务器返回的一个特殊值。如果你请求的网页不存在就会返回一个`404 Not Found`状态码。 - - let http404Error = (404, "Not Found") - // http404Error 的类型是 (Int, String),值是 (404, "Not Found") - -`(404, "Not Found")`元组把一个`Int`值和一个`String`值组合起来表示 HTTP 状态码的两个部分:一个数字和一个可以读懂的描述。这个元组可以被描述为“一个类型为`(Int, String)`的元组”。 - -你可以把任意顺序的类型组合成一个元组,这个元组可以包含所有类型。只要你想,你可以创建一个类型为`(Int, Int, Int)`或者`(String, Bool)`或者包含其他类型的元组。 - -你可以将一个元组的内容分解成单独的常量和变量,然后你就可以正常使用它们了: - - let (statusCode, statusMessage) = http404Error - println("The status code is \(statusCode)") - // 输出 "The status code is 404" - println("The status message is \(statusMessage)") - // 输出 "The status message is Not Found" - -如果你只需要一部分元组值,分解的时候可以把要忽略的部分设置成`_`: - - let (justTheStatusCode, _) = http404Error - println("The status code is \(justTheStatusCode)") - // 输出 "The status code is 404" - -此外,你还可以通过下标来访问元组中的单个元素,下标从零开始: - - println("The status code is \(http404Error.0)") - // 输出 "The status code is 404" - println("The status message is \(http404Error.1)") - // 输出 "The status message is Not Found" - -你可以在定义元组的时候给单个元素命名: - - let http200Status = (statusCode: 200, description: "OK") - -给元组中的元素命名后,你可以通过名字来获取这些元素的值: - - println("The status code is \(http200Status.statusCode)") - // 输出 "The status code is 200" - println("The status message is \(http200Status.description)") - // 输出 "The status message is OK" - -作为函数返回值时,元组非常有用。一个用来获取网页的函数可能会返回一个`(Int, String)`元组来描述是否获取成功。和只能返回一个类型的值比较起来,一个包含两个不同类型值的元组可以让函数的返回信息更有用。详情参见`返回多个值的函数(待添加链接)`。 - -> 注意:元组在临时组织值的时候很有用,但是并不适合创建复杂的数据结构。如果你的数据结构并不是临时使用,请使用类或者结构体而不是元组。详情参见`类和结构体(待添加链接)`。 - -## 可选 - -使用可选来处理值可能缺失的情况。可选表示: - -* 有值,等于 x - -或者 - -* 没有值 - -> 注意:C 和 Objective-C 中并没有可选这个概念。最接近的是 Objective-C 中的一个特性,一个方法要不返回一个对象要不返回`nil`,`nil`表示“缺少一个合法的对象”。然而,这只对对象起作用——对于结构体,基本的 C 类型或者枚举类型不起作用。对于这些类型,Objective-C 方法一般会返回一个特殊值(比如`NSNotFound`)来暗示值缺失。这种方法假设方法的调用者知道并记得对特殊值进行判断。然而,Swift 的可选可以让你暗示任意类型的值缺失,并不需要一个特殊值。 - -来看一个例子。Swift 的`String`类型有一个叫做`toInt`的方法,作用是将一个`String`值转换成一个`Int`值。然而,并不是所有的字符串都可以转换成一个整数。字符串`"123"`可以被转换成数字`123`,但是字符串`"hello, world"`不行。 - -下面的例子使用`toInt`方法来尝试将一个`String`转换成`Int`: - - let possibleNumber = "123" - let convertedNumber = possibleNumber.toInt() - // convertedNumber 被推测为类型 "Int?", 或者类型 "optional Int" - -因为`toInt`方法可能会失败,所以它返回一个可选的`Int`,而不是一个`Int`。一个可选的`Int`被写作`Int?`而不是`Int`。问号暗示包含的值是可选,也就是说可能包含`Int`值也可能不包含值。(不能包含其他任何值比如`Bool`值或者`String`值。只能是`Int`或者什么都没有。) - -### if 语句以及强制解析 - -你可以使用`if`语句来判断一个可选是否包含值。如果可选有值,结果是`true`;如果没有值,结果是`false`。 - -当你确定可选包含值之后,你可以在可选的名字后面加一个`!`来获取值。这个惊叹号表示“我知道这个可选有值,请使用它。”这被称为可选值的强制解析: - - if convertedNumber { - println("\(possibleNumber) has an integer value of \(convertedNumber!)") - } else { - println("\(possibleNumber) could not be converted to an integer") - } - // 输出 "123 has an integer value of 123" - -更多关于`if`语句的内容参见`控制流(待添加链接)`。 - -> 注意:使用`!`来获取一个不存在的可选值会导致运行时错误。。使用`!`来强制解析值之前,一定要确定可选包含一个非`nil`的值。 - -### 可选绑定 - -使用可选绑定来判断可选是否包含值,如果包含就把值赋给一个临时常量或者变量。可选绑定可以用在`if`和`while`语句中来对可选的值进行判断并把值赋给一个常量或者变量。`if`和`while`语句详情参见`控制流`。 - -像下面这样写一个可选绑定: - - if let constantName = someOptional { - statements - } - -你可以像上面这样使用可选绑定来重写`possibleNumber`这个例子: - - if let actualNumber = possibleNumber.toInt() { - println("\(possibleNumber) has an integer value of \(actualNumber)") - } else { - println("\(possibleNumber) could not be converted to an integer") - } - // 输出 "123 has an integer value of 123" - -这段代码可以被理解为: - -“如果`possibleNumber.toInt`返回的可选`Int`包含一个值,创建一个叫做`actualNumber`的新常量并将可选包含的值赋给它。” - -如果转换成功,`actualNumber`常量可以在`if`语句的第一个分支中使用。它已经被可选包含的值初始化过,所以不需要再使用`!`后缀来获取它的值。在这个例子中,`actualNumber`只被用来输出转换结果。 - -你可以在可选绑定中使用常量和变量。如果你想在`if`语句的第一个分支中操作`actualNumber`的值,你可以改成`if var actualNumber`,这样可选包含的值就会被赋给一个变量。 - -### nil - -你可以给可选变量赋值为`nil`来表示它没有值: - - var serverResponseCode: Int? = 404 - // serverResponseCode 包含一个可选的 Int 值 404 - serverResponseCode = nil - // serverResponseCode 现在不包含值 - -> 注意:`nil`不能用于非可选的常量和变量。如果你的代码中有常量或者变量需要处理值缺失的情况,请把它们声明成对应的可选类型。 - -如果你声明一个可选常量或者变量但是没有赋值,它们会自动被设置为`nil`: - - var surveyAnswer: String? - // surveyAnswer 被自动设置为 nil - -> 注意:Swift 的`nil`和 Objective-C 中的`nil`并不一样。在 Objective-C 中,`nil`是一个指向不存在对象的指针。在 Swift 中,`nil`不是指针——它是一个确定的值,用来表示值缺失。任何类型的可选都可以被设置为`nil`,不只是对象类型。 - -### 隐式解析可选 - -如上所述,可选暗示了常量或者变量可以“没有值”。可选可以通过`if`语句来判断是否有值,如果有值的话可以通过可选绑定来解析值。 - -有时候在程序架构中,第一次被赋值之后,可以确定一个可选总会有值。在这种情况下,每次都要判断和解析可选值是非常低效的,因为可以确定它总会有值。 - -这种类型的可选被定义为隐式解析可选。把后缀`?`改成`!`来声明一个隐式解析可选,比如`String!`。 - -当可选被第一次赋值之后就可以确定之后一直有值的时候,隐式解析可选非常有用。隐式解析可选主要被用在 Swift 中类的构造过程中,详情参见`无主引用和隐式解析可选属性(Unowned References and Implicitly Unwrapped Optional Properties待添加链接)`。 - -一个隐式解析可选其实就是一个普通的可选,但是可以被当做非可选来使用,并不需要每次都使用解析来获取可选值。下面的例子展示了可选`String`和隐式解析可选`String`之间的区别: - - let possibleString: String? = "An optional string." - println(possibleString!) // 需要惊叹号来获取值 - // 输出 "An optional string." - - let assumedString: String! = "An implicitly unwrapped optional string." - println(assumedString) // 不需要惊叹号 - // 输出 "An implicitly unwrapped optional string." - -你可以把隐式解析可选当做一个可以自动解析的可选。你要做的只是声明的时候把惊叹号放到类型的结尾,而不是每次获取值的变量结尾。 - -> 注意:如果你在隐式解析可选没有值的时候尝试获取,会触发运行时错误。和你在没有值的普通可选后面加一个惊叹号一样。 - -你仍然可以把隐式解析可选当做普通可选来判断它是否包含值: - if assumedString { - println(assumedString) - } - // 输出 "An implicitly unwrapped optional string." - -你也可以在可选绑定中使用隐式解析可选来检查并解析它的值: - if let definiteString = assumedString { - println(definiteString) - } - // 输出 "An implicitly unwrapped optional string." - -> 注意:如果一个变量之后可能变成`nil`的话请不要使用隐式解析可选。如果你需要在变量的生命周期中判断是否是`nil`的话,请使用普通可选类型。 - -## 断言 - -可选可以让你判断值是否存在,你可以在代码中优雅地处理值缺失的情况。然而,在某些情况下,如果值缺失或者值并不满足特定的条件,你的代码可能并不需要继续执行。这时,你可以在你的代码中触发一个断言来结束代码运行并通过调试来找到值缺失的原因。 - -### 使用断言来调试 - -断言会在运行时判断一个逻辑条件是否为`true`。从字面意思来说,断言“断言”一个条件是否为真。你可以使用断言来保证在运行其他代码之前,某些重要的条件已经被满足。如果条件判断为`true`,代码运行会继续进行;如果条件判断为`false`,代码运行停止,你的应用被终止。 - -如果你的代码在调试环境下触发了一个断言,比如你在 Xcode 中构建并运行一个应用,你可以清楚地看到不合法的状态发生在哪里并检查断言被触发时你的应用的状态。此外,断言允许你附加一条调试信息。 - -你可以使用全局`assert`函数来写一个断言。给`assert`函数传入一个结果为`true`或者`false`的表达式以及一条信息,当表达式为`false`的时候这条信息会被显示: - - let age = -3 - assert(age >= 0, "A person's age cannot be less than zero") - // 因为 age < 0,所以断言会触发 - -在这个例子中,只有`age >= 0`为`true`的时候代码运行才会继续,也就是说,当`age`的值非负的时候。如果`age`的值是负数,就像代码中那样,`age >= 0`为`false`,断言被触发,结束应用。 - -断言信息不能使用字符串插值。断言信息可以省略,就像这样: - - assert(age >= 0) - -### 何时使用断言 - -当条件可能为假时使用断言,但是最终一定要保证条件为真,这样你的代码才能继续运行。断言的适用情景: - -* 整数的下标(subscript)索引被传入一个自定义下标实现,但是下标索引值可能太小或者太大。 -* 需要给函数传入一个值,但是非法的值可能导致函数不能正常执行。 -* 一个可选值现在是`nil`,但是后面的代码运行需要一个非`nil`值。 - -查看`下标(链接待添加)`和`函数(链接待添加)`。 - -> 注意:断言可能导致你的应用终止运行,所以你应当仔细设计你的代码来让非法条件不会出现。然而,在你的应用发布之前,有时候非法条件可能出现,这时使用断言可以快速发现问题。 +> 翻译:[numbbbbb](https://github.com/numbbbbb), [lyuka](https://github.com/lyuka), [JaySurplus](https://github.com/JaySurplus) +> 校对:[lslxdx](https://github.com/lslxdx) + +# 基础部分 +----------------- + +本页包含内容: + +- [常量和变量](#constants_and_variables) +- [注释](#comments) +- [分号](#semicolons) +- [整数](#integers) +- [浮点数](#floating-point_numbers) +- [类型安全和类型推断](#type_safety_and_type_inference) +- [数值型字面量](#numeric_literals) +- [数值型类型转换](#numeric_type_conversion) +- [类型别名](#type_aliases) +- [布尔值](#booleans) +- [元组](#tuples) +- [可选](#optionals) +- [断言](#assertions) + +Swift 是 iOS 和 OS X 应用开发的一门新语言。然而,如果你有 C 或者 Objective-C 开发经验的话,你会发现 Swift 的很多内容都是你熟悉的。 + +Swift 的类型是在 C 和 Objective-C 的基础上提出的,`Int`是整型;`Double`和`Float`是浮点型;`Bool`是布尔型;`String`是字符串。Swift 还有两个有用的集合类型,`Array`和`Dictionary`,请参考[集合类型](04_Collection_Types.html)。 + +就像 C 语言一样,Swift 使用变量来进行存储并通过变量名来关联值。在 Swift 中,值不可变的变量有着广泛的应用,它们就是常量,而且比 C 语言的常量更强大。在 Swift 中,如果你要处理的值不需要改变,那使用常量可以让你的代码更加安全并且更好地表达你的意图。 + +除了我们熟悉的类型,Swift 还增加了 Objective-C 中没有的类型比如元组(Tuple)。元组可以让你创建或者传递一组数据,比如作为函数的返回值时,你可以用一个元组可以返回多个值。 + +Swift 还增加了可选(Optional)类型,用于处理值缺失的情况。可选表示“那儿有一个值,并且它等于 x ”或者“那儿没有值”。可选有点像在 Objective-C 中使用`nil`,但是它可以用在任何类型上,不仅仅是类。可选类型比 Objective-C 中的`nil`指针更加安全也更具表现力,它是 Swift 许多强大特性的重要组成部分。 + +Swift 是一个类型安全的语言,可选就是一个很好的例子。Swift 可以让你清楚地知道值的类型。如果你的代码期望得到一个`String`,类型安全会阻止你不小心传入一个`Int`。你可以在开发阶段尽早发现并修正错误。 + + +## 常量和变量 + +常量和变量把一个名字(比如`maximumNumberOfLoginAttempts`或者`welcomeMessage`)和一个指定类型的值(比如数字`10`或者字符串`"Hello"`)关联起来。常量的值一旦设定就不能改变,而变量的值可以随意更改。 + +### 声明常量和变量 + +常量和变量必须在使用前声明,用`let`来声明常量,用`var`来声明变量。下面的例子展示了如何用常量和变量来记录用户尝试登录的次数: + +```swift +let maximumNumberOfLoginAttempts = 10 +var currentLoginAttempt = 0 +``` + +这两行代码可以被理解为: + +“声明一个名字是`maximumNumberOfLoginAttempts`的新常量,并给它一个值`10`。然后,声明一个名字是`currentLoginAttempt`的变量并将它的值初始化为`0`.” + +在这个例子中,允许的最大尝试登录次数被声明为一个常量,因为这个值不会改变。当前尝试登录次数被声明为一个变量,因为每次尝试登录失败的时候都需要增加这个值。 + +你可以在一行中声明多个常量或者多个变量,用逗号隔开: + +```swift +var x = 0.0, y = 0.0, z = 0.0 +``` + +>注意: +如果你的代码中有不需要改变的值,请使用`let`关键字将它声明为常量。只将需要改变的值声明为变量。 + +### 类型标注 + +当你声明常量或者变量的时候可以加上_类型标注(type annotation)_,说明常量或者变量中要存储的值的类型。如果要添加类型标注,需要在常量或者变量名后面加上一个冒号和空格,然后加上类型名称。 + +这个例子给`welcomeMessage`变量添加了类型标注,表示这个变量可以存储`String`类型的值: + +```swift +var welcomeMessage: String +``` + +声明中的冒号代表着“是...类型”,所以这行代码可以被理解为: + +“声明一个类型为`String`,名字为`welcomeMessage`的变量。” + +“类型为`String`”的意思是“可以存储任意`String`类型的值。” + +`welcomeMessage`变量现在可以被设置成任意字符串: + +```swift +welcomeMessage = "Hello" +``` + +> 注意: +一般来说你很少需要写类型标注。如果你在声明常量或者变量的时候赋了一个初始值,Swift可以推断出这个常量或者变量的类型,请参考[类型安全和类型推断](#type_safety_and_type_inference)。在上面的例子中,没有给`welcomeMessage`赋初始值,所以变量`welcomeMessage`的类型是通过一个类型标注指定的,而不是通过初始值推断的。 + +### 常量和变量的命名 + +你可以用任何你喜欢的字符作为常量和变量名,包括 Unicode 字符: + +```swift +let π = 3.14159 +let 你好 = "你好世界" +let 🐶🐮 = "dogcow" +``` + +常量与变量名不能包含数学符号,箭头,保留的(或者非法的)Unicode 码位,连线与制表符。也不能以数字开头,但是可以在常量与变量名的其他地方包含数字。 + +一旦你将常量或者变量声明为确定的类型,你就不能使用相同的名字再次进行声明,或者改变其存储的值的类型。同时,你也不能将常量与变量进行互转。 + +> 注意: +如果你需要使用与Swift保留关键字相同的名称作为常量或者变量名,你可以使用反引号(`)将关键字包围的方式将其作为名字使用。无论如何,你应当避免使用关键字作为常量或变量名,除非你别无选择。 + +你可以更改现有的变量值为其他同类型的值,在下面的例子中,`friendlyWelcome`的值从`"Hello!"`改为了`"Bonjour!"`: + +```swift +var friendlyWelcome = "Hello!" +friendlyWelcome = "Bonjour!" +// friendlyWelcome 现在是 "Bonjour!" +``` + +与变量不同,常量的值一旦被确定就不能更改了。尝试这样做会导致编译时报错: + +```swift +let languageName = "Swift" +languageName = "Swift++" +// 这会报编译时错误 - languageName 不可改变 +``` + +### 输出常量和变量 + +你可以用`println`函数来输出当前常量或变量的值: + +```swift +println(friendlyWelcome) +// 输出 "Bonjour!" +``` + +`println`是一个用来输出的全局函数,输出的内容会在最后换行。如果你用 Xcode,`println`将会输出内容到“console”面板上。(另一种函数叫`print`,唯一区别是在输出内容最后不会换行。) + +`println`函数输出传入的`String`值: + +```swift +println("This is a string") +// 输出 "This is a string" +``` + +与 Cocoa 里的`NSLog`函数类似的是,`println`函数可以输出更复杂的信息。这些信息可以包含当前常量和变量的值。 + +Swift 用_字符串插值(string interpolation)_的方式把常量名或者变量名当做占位符加入到长字符串中,Swift 会用当前常量或变量的值替换这些占位符。将常量或变量名放入圆括号中,并在开括号前使用反斜杠将其转义: + +```swift +println("The current value of friendlyWelcome is \(friendlyWelcome)") +// 输出 "The current value of friendlyWelcome is Bonjour! +``` + +> 注意: +字符串插值所有可用的选项,请参考[字符串插值](03_Strings_and_Characters.html#string_interpolation)。 + + +## 注释 +请将你的代码中的非执行文本注释成提示或者笔记以方便你将来阅读。Swift 的编译器将会在编译代码时自动忽略掉注释部分。 + +Swift 中的注释与C 语言的注释非常相似。单行注释以双正斜杠(`//`)作为起始标记: + +```swift +// 这是一个注释 +``` + +你也可以进行多行注释,其起始标记为单个正斜杠后跟随一个星号(`/*`),终止标记为一个星号后跟随单个正斜杠(`*/`): + +```swift +/* 这是一个, +多行注释 */ +``` + +与 C 语言多行注释不同,Swift 的多行注释可以嵌套在其它的多行注释之中。你可以先生成一个多行注释块,然后在这个注释块之中再嵌套成第二个多行注释。终止注释时先插入第二个注释块的终止标记,然后再插入第一个注释块的终止标记: + +```swift +/* 这是第一个多行注释的开头 +/* 这是第二个被嵌套的多行注释 */ +这是第一个多行注释的结尾 */ +``` + +通过运用嵌套多行注释,你可以快速方便的注释掉一大段代码,即使这段代码之中已经含有了多行注释块。 + + +## 分号 +与其他大部分编程语言不同,Swift 并不强制要求你在每条语句的结尾处使用分号(`;`),当然,你也可以按照你自己的习惯添加分号。有一种情况下必须要用分号,即你打算在同一行内写多条独立的语句: + +```swift +let cat = "🐱"; println(cat) +// 输出 "🐱" +``` + + +## 整数 + +整数就是没有小数部分的数字,比如`42`和`-23`。整数可以是`有符号`(正、负、零)或者`无符号`(正、零)。 + +Swift 提供了8,16,32和64位的有符号和无符号整数类型。这些整数类型和 C 语言的命名方式很像,比如8位无符号整数类型是`UInt8`,32位有符号整数类型是`Int32`。就像 Swift 的其他类型一样,整数类型采用大写命名法。 + +### 整数范围 + +你可以访问不同整数类型的`min`和`max`属性来获取对应类型的最大值和最小值: + +```swift +let minValue = UInt8.min // minValue 为 0,是 UInt8 类型的最小值 +let maxValue = UInt8.max // maxValue 为 255,是 UInt8 类型的最大值 +``` + +### Int + +一般来说,你不需要专门指定整数的长度。Swift 提供了一个特殊的整数类型`Int`,长度与当前平台的原生字长相同: + +* 在32位平台上,`Int`和`Int32`长度相同。 +* 在64位平台上,`Int`和`Int64`长度相同。 + +除非你需要特定长度的整数,一般来说使用`Int`就够了。这可以提高代码一致性和可复用性。即使是在32位平台上,`Int`可以存储的整数范围也可以达到`-2147483648`~`2147483647`,大多数时候这已经足够大了。 + +### UInt + +Swift 也提供了一个特殊的无符号类型`UInt`,长度与当前平台的原生字长相同: + +* 在32位平台上,`UInt`和`UInt32`长度相同。 +* 在64位平台上,`UInt`和`UInt64`长度相同。 + +> 注意: +尽量不要使用`UInt`,除非你真的需要存储一个和当前平台原生字长相同的无符号整数。除了这种情况,最好使用`Int`,即使你要存储的值已知是非负的。统一使用`Int`可以提高代码的可复用性,避免不同类型数字之间的转换,并且匹配数字的类型推断,请参考[类型安全和类型推断](#type_safety_and_type_inference)。 + + +## 浮点数 + +浮点数是有小数部分的数字,比如`3.14159`,`0.1`和`-273.15`。 + +浮点类型比整数类型表示的范围更大,可以存储比`Int`类型更大或者更小的数字。Swift 提供了两种有符号浮点数类型: + +* `Double`表示64位浮点数。当你需要存储很大或者很高精度的浮点数时请使用此类型。 +* `Float`表示32位浮点数。精度要求不高的话可以使用此类型。 + +> 注意: +`Double`精确度很高,至少有15位数字,而`Float`最少只有6位数字。选择哪个类型取决于你的代码需要处理的值的范围。 + + +## 类型安全和类型推断 + +Swift 是一个_类型安全(type safe)_的语言。类型安全的语言可以让你清楚地知道代码要处理的值的类型。如果你的代码需要一个`String`,你绝对不可能不小心传进去一个`Int`。 + +由于 Swift 是类型安全的,所以它会在编译你的代码时进行_类型检查(type checks)_,并把不匹配的类型标记为错误。这可以让你在开发的时候尽早发现并修复错误。 + +当你要处理不同类型的值时,类型检查可以帮你避免错误。然而,这并不是说你每次声明常量和变量的时候都需要显式指定类型。如果你没有显式指定类型,Swift 会使用_类型推断(type inference)_来选择合适的类型。有了类型推断,编译器可以在编译代码的时候自动推断出表达式的类型。原理很简单,只要检查你赋的值即可。 + +因为有类型推断,和 C 或者 Objective-C 比起来 Swift 很少需要声明类型。常量和变量虽然需要明确类型,但是大部分工作并不需要你自己来完成。 + +当你声明常量或者变量并赋初值的时候类型推断非常有用。当你在声明常量或者变量的时候赋给它们一个_字面量(literal value 或 literal)_即可触发类型推断。(字面量就是会直接出现在你代码中的值,比如`42`和`3.14159`。) + +例如,如果你给一个新常量赋值`42`并且没有标明类型,Swift 可以推断出常量类型是`Int`,因为你给它赋的初始值看起来像一个整数: + +```swift +let meaningOfLife = 42 +// meaningOfLife 会被推测为 Int 类型 +``` + +同理,如果你没有给浮点字面量标明类型,Swift 会推断你想要的是`Double`: + +```swift +let pi = 3.14159 +// pi 会被推测为 Double 类型 +``` + +当推断浮点数的类型时,Swift 总是会选择`Double`而不是`Float`。 + +如果表达式中同时出现了整数和浮点数,会被推断为`Double`类型: + +```swift +let anotherPi = 3 + 0.14159 +// anotherPi 会被推测为 Double 类型 +``` + +原始值`3`没有显式声明类型,而表达式中出现了一个浮点字面量,所以表达式会被推断为`Double`类型。 + + +## 数值型字面量 + +整数字面量可以被写作: + +* 一个十进制数,没有前缀 +* 一个二进制数,前缀是`0b` +* 一个八进制数,前缀是`0o` +* 一个十六进制数,前缀是`0x` + +下面的所有整数字面量的十进制值都是`17`: + +```swift +let decimalInteger = 17 +let binaryInteger = 0b10001 // 二进制的17 +let octalInteger = 0o21 // 八进制的17 +let hexadecimalInteger = 0x11 // 十六进制的17 +``` + +浮点字面量可以是十进制(没有前缀)或者是十六进制(前缀是`0x`)。小数点两边必须有至少一个十进制数字(或者是十六进制的数字)。浮点字面量还有一个可选的_指数(exponent)_,在十进制浮点数中通过大写或者小写的`e`来指定,在十六进制浮点数中通过大写或者小写的`p`来指定。 + +如果一个十进制数的指数为`exp`,那这个数相当于基数和10^exp的乘积: +* `1.25e2` 表示 1.25 × 10^2,等于 `125.0`。 +* `1.25e-2` 表示 1.25 × 10^-2,等于 `0.0125`。 + +如果一个十六进制数的指数为`exp`,那这个数相当于基数和2^exp的乘积: +* `0xFp2` 表示 15 × 2^2,等于 `60.0`。 +* `0xFp-2` 表示 15 × 2^-2,等于 `3.75`。 + +下面的这些浮点字面量都等于十进制的`12.1875`: + +```swift +let decimalDouble = 12.1875 +let exponentDouble = 1.21875e1 +let hexadecimalDouble = 0xC.3p0 +``` + +数值类字面量可以包括额外的格式来增强可读性。整数和浮点数都可以添加额外的零并且包含下划线,并不会影响字面量: + +```swift +let paddedDouble = 000123.456 +let oneMillion = 1_000_000 +let justOverOneMillion = 1_000_000.000_000_1 +``` + + +## 数值型类型转换 + +通常来讲,即使代码中的整数常量和变量已知非负,也请使用`Int`类型。总是使用默认的整数类型可以保证你的整数常量和变量可以直接被复用并且可以匹配整数类字面量的类型推断。 +只有在必要的时候才使用其他整数类型,比如要处理外部的长度明确的数据或者为了优化性能、内存占用等等。使用显式指定长度的类型可以及时发现值溢出并且可以暗示正在处理特殊数据。 + +### 整数转换 + +不同整数类型的变量和常量可以存储不同范围的数字。`Int8`类型的常量或者变量可以存储的数字范围是`-128`~`127`,而`UInt8`类型的常量或者变量能存储的数字范围是`0`~`255`。如果数字超出了常量或者变量可存储的范围,编译的时候会报错: + +```swift +let cannotBeNegative: UInt8 = -1 +// UInt8 类型不能存储负数,所以会报错 +let tooBig: Int8 = Int8.max + 1 +// Int8 类型不能存储超过最大值的数,所以会报错 +``` + +由于每种整数类型都可以存储不同范围的值,所以你必须根据不同情况选择性使用数值型类型转换。这种选择性使用的方式,可以预防隐式转换的错误并让你的代码中的类型转换意图变得清晰。 + +要将一种数字类型转换成另一种,你要用当前值来初始化一个期望类型的新数字,这个数字的类型就是你的目标类型。在下面的例子中,常量`twoThousand`是`UInt16`类型,然而常量`one`是`UInt8`类型。它们不能直接相加,因为它们类型不同。所以要调用`UInt16(one)`来创建一个新的`UInt16`数字并用`one`的值来初始化,然后使用这个新数字来计算: + +```swift +let twoThousand: UInt16 = 2_000 +let one: UInt8 = 1 +let twoThousandAndOne = twoThousand + UInt16(one) +``` + +现在两个数字的类型都是`UInt16`,可以进行相加。目标常量`twoThousandAndOne`的类型被推断为`UInt16`,因为它是两个`UInt16`值的和。 + +`SomeType(ofInitialValue)`是调用 Swift 构造器并传入一个初始值的默认方法。在语言内部,`UInt16`有一个构造器,可以接受一个`UInt8`类型的值,所以这个构造器可以用现有的`UInt8`来创建一个新的`UInt16`。注意,你并不能传入任意类型的值,只能传入`UInt16`内部有对应构造器的值。不过你可以扩展现有的类型来让它可以接收其他类型的值(包括自定义类型),请参考[扩展](20_Extensions.html)。 + +### 整数和浮点数转换 + +整数和浮点数的转换必须显式指定类型: + +```swift +let three = 3 +let pointOneFourOneFiveNine = 0.14159 +let pi = Double(three) + pointOneFourOneFiveNine +// pi 等于 3.14159,所以被推测为 Double 类型 +``` + +这个例子中,常量`three`的值被用来创建一个`Double`类型的值,所以加号两边的数类型须相同。如果不进行转换,两者无法相加。 + +浮点数到整数的反向转换同样行,整数类型可以用`Double`或者`Float`类型来初始化: + +```swift +let integerPi = Int(pi) +// integerPi 等于 3,所以被推测为 Int 类型 +``` + +当用这种方式来初始化一个新的整数值时,浮点值会被截断。也就是说`4.75`会变成`4`,`-3.9`会变成`-3`。 + +> 注意: +结合数字类常量和变量不同于结合数字类字面量。字面量`3`可以直接和字面量`0.14159`相加,因为数字字面量本身没有明确的类型。它们的类型只在编译器需要求值的时候被推测。 + + +## 类型别名 + +_类型别名(type aliases)_就是给现有类型定义另一个名字。你可以使用`typealias`关键字来定义类型别名。 + +当你想要给现有类型起一个更有意义的名字时,类型别名非常有用。假设你正在处理特定长度的外部资源的数据: + +```swift +typealias AudioSample = UInt16 +``` + +定义了一个类型别名之后,你可以在任何使用原始名的地方使用别名: + +```swift +var maxAmplitudeFound = AudioSample.min +// maxAmplitudeFound 现在是 0 +``` + +本例中,`AudioSample`被定义为`UInt16`的一个别名。因为它是别名,`AudioSample.min`实际上是`UInt16.min`,所以会给`maxAmplitudeFound`赋一个初值`0`。 + + +## 布尔值 + +Swift 有一个基本的_布尔(Boolean)_类型,叫做`Bool`。布尔值指_逻辑上的(logical)_,因为它们只能是真或者假。Swift 有两个布尔常量,`true`和`false`: + +```swift +let orangesAreOrange = true +let turnipsAreDelicious = false +``` + +`orangesAreOrange`和`turnipsAreDelicious`的类型会被推断为`Bool`,因为它们的初值是布尔字面量。就像之前提到的`Int`和`Double`一样,如果你创建变量的时候给它们赋值`true`或者`false`,那你不需要将常量或者变量声明为`Bool`类型。初始化常量或者变量的时候如果所赋的值类型已知,就可以触发类型推断,这让 Swift 代码更加简洁并且可读性更高。 + +当你编写条件语句比如`if`语句的时候,布尔值非常有用: + +```swift +if turnipsAreDelicious { + println("Mmm, tasty turnips!") +} else { + println("Eww, turnips are horrible.") +} +// 输出 "Eww, turnips are horrible." +``` + +条件语句,例如`if`,请参考[控制流](05_Control_Flow.html)。 + +如果你在需要使用`Bool`类型的地方使用了非布尔值,Swift 的类型安全机制会报错。下面的例子会报告一个编译时错误: + +```swift +let i = 1 +if i { + // 这个例子不会通过编译,会报错 +} +``` + +然而,下面的例子是合法的: + +```swift +let i = 1 +if i == 1 { + // 这个例子会编译成功 +} +``` + +`i == 1`的比较结果是`Bool`类型,所以第二个例子可以通过类型检查。类似`i == 1`这样的比较,请参考[基本操作符](05_Control_Flow.html)。 + +和 Swift 中的其他类型安全的例子一样,这个方法可以避免错误并保证这块代码的意图总是清晰的。 + + +## 元组 + +_元组(tuples)_把多个值组合成一个复合值。元组内的值可以使任意类型,并不要求是相同类型。 + +下面这个例子中,`(404, "Not Found")`是一个描述 _HTTP 状态码(HTTP status code)_的元组。HTTP 状态码是当你请求网页的时候 web 服务器返回的一个特殊值。如果你请求的网页不存在就会返回一个`404 Not Found`状态码。 + +```swift +let http404Error = (404, "Not Found") +// http404Error 的类型是 (Int, String),值是 (404, "Not Found") +``` + +`(404, "Not Found")`元组把一个`Int`值和一个`String`值组合起来表示 HTTP 状态码的两个部分:一个数字和一个人类可读的描述。这个元组可以被描述为“一个类型为`(Int, String)`的元组”。 + +你可以把任意顺序的类型组合成一个元组,这个元组可以包含所有类型。只要你想,你可以创建一个类型为`(Int, Int, Int)`或者`(String, Bool)`或者其他任何你想要的组合的元组。 + +你可以将一个元组的内容_分解(decompose)_成单独的常量和变量,然后你就可以正常使用它们了: + +```swift +let (statusCode, statusMessage) = http404Error +println("The status code is \(statusCode)") +// 输出 "The status code is 404" +println("The status message is \(statusMessage)") +// 输出 "The status message is Not Found" +``` + +如果你只需要一部分元组值,分解的时候可以把要忽略的部分用下划线(`_`)标记: + +```swift +let (justTheStatusCode, _) = http404Error +println("The status code is \(justTheStatusCode)") +// 输出 "The status code is 404" +``` + +此外,你还可以通过下标来访问元组中的单个元素,下标从零开始: + +```swift +println("The status code is \(http404Error.0)") +// 输出 "The status code is 404" +println("The status message is \(http404Error.1)") +// 输出 "The status message is Not Found" +``` + +你可以在定义元组的时候给单个元素命名: + +```swift +let http200Status = (statusCode: 200, description: "OK") +``` + +给元组中的元素命名后,你可以通过名字来获取这些元素的值: + +```swift +println("The status code is \(http200Status.statusCode)") +// 输出 "The status code is 200" +println("The status message is \(http200Status.description)") +// 输出 "The status message is OK" +``` + +作为函数返回值时,元组非常有用。一个用来获取网页的函数可能会返回一个`(Int, String)`元组来描述是否获取成功。和只能返回一个类型的值比较起来,一个包含两个不同类型值的元组可以让函数的返回信息更有用。请参考[函数参数与返回值](06_Functions.html#Function_Parameters_and_Return_Values)。 + +> 注意: +元组在临时组织值的时候很有用,但是并不适合创建复杂的数据结构。如果你的数据结构并不是临时使用,请使用类或者结构体而不是元组。请参考[类和结构体](09_Classes_and_Structures.html)。 + + +## 可选类型 + +使用_可选类型(optionals)_来处理值可能缺失的情况。可选类型表示: + +* _有_值,等于 x + +或者 + +* _没有_值 + +> 注意: +C 和 Objective-C 中并没有可选类型这个概念。最接近的是 Objective-C 中的一个特性,一个方法要不返回一个对象要不返回`nil`,`nil`表示“缺少一个合法的对象”。然而,这只对对象起作用——对于结构体,基本的 C 类型或者枚举类型不起作用。对于这些类型,Objective-C 方法一般会返回一个特殊值(比如`NSNotFound`)来暗示值缺失。这种方法假设方法的调用者知道并记得对特殊值进行判断。然而,Swift 的可选类型可以让你暗示_任意类型_的值缺失,并不需要一个特殊值。 + +来看一个例子。Swift 的`String`类型有一个叫做`toInt`的方法,作用是将一个`String`值转换成一个`Int`值。然而,并不是所有的字符串都可以转换成一个整数。字符串`"123"`可以被转换成数字`123`,但是字符串`"hello, world"`不行。 + +下面的例子使用`toInt`方法来尝试将一个`String`转换成`Int`: + +```swift +let possibleNumber = "123" +let convertedNumber = possibleNumber.toInt() +// convertedNumber 被推测为类型 "Int?", 或者类型 "optional Int" +``` + +因为`toInt`方法可能会失败,所以它返回一个_可选类型(optional)_`Int`,而不是一个`Int`。一个可选的`Int`被写作`Int?`而不是`Int`。问号暗示包含的值是可选类型,也就是说可能包含`Int`值也可能不包含值。(不能包含其他任何值比如`Bool`值或者`String`值。只能是`Int`或者什么都没有。) + +### if 语句以及强制解析 + +你可以使用`if`语句来判断一个可选是否包含值。如果可选类型有值,结果是`true`;如果没有值,结果是`false`。 + +当你确定可选类型_确实_包含值之后,你可以在可选的名字后面加一个感叹号(`!`)来获取值。这个惊叹号表示“我知道这个可选有值,请使用它。”这被称为可选值的_强制解析(forced unwrapping)_: + +```swift +if convertedNumber { + println("\(possibleNumber) has an integer value of \(convertedNumber!)") +} else { + println("\(possibleNumber) could not be converted to an integer") +} +// 输出 "123 has an integer value of 123" +``` + +更多关于`if`语句的内容,请参考[控制流](05_Control_Flow.html)。 + +> 注意: +使用`!`来获取一个不存在的可选值会导致运行时错误。使用`!`来强制解析值之前,一定要确定可选包含一个非`nil`的值。 + + +### 可选绑定 + +使用_可选绑定(optional binding)_来判断可选类型是否包含值,如果包含就把值赋给一个临时常量或者变量。可选绑定可以用在`if`和`while`语句中来对可选类型的值进行判断并把值赋给一个常量或者变量。`if`和`while`语句,请参考[控制流](05_Control_Flow.html)。 + +像下面这样在`if`语句中写一个可选绑定: + +```swift +if let constantName = someOptional { + statements +} +``` + +你可以像上面这样使用可选绑定来重写`possibleNumber`这个例子: + +```swift +if let actualNumber = possibleNumber.toInt() { + println("\(possibleNumber) has an integer value of \(actualNumber)") +} else { + println("\(possibleNumber) could not be converted to an integer") +} +// 输出 "123 has an integer value of 123" +``` + +这段代码可以被理解为: + +“如果`possibleNumber.toInt`返回的可选`Int`包含一个值,创建一个叫做`actualNumber`的新常量并将可选包含的值赋给它。” + +如果转换成功,`actualNumber`常量可以在`if`语句的第一个分支中使用。它已经被可选类型_包含的_值初始化过,所以不需要再使用`!`后缀来获取它的值。在这个例子中,`actualNumber`只被用来输出转换结果。 + +你可以在可选绑定中使用常量和变量。如果你想在`if`语句的第一个分支中操作`actualNumber`的值,你可以改成`if var actualNumber`,这样可选类型包含的值就会被赋给一个变量而非常量。 + +### nil + +你可以给可选变量赋值为`nil`来表示它没有值: + +```swift +var serverResponseCode: Int? = 404 +// serverResponseCode 包含一个可选的 Int 值 404 +serverResponseCode = nil +// serverResponseCode 现在不包含值 +``` + +> 注意: +`nil`不能用于非可选的常量和变量。如果你的代码中有常量或者变量需要处理值缺失的情况,请把它们声明成对应的可选类型。 + +如果你声明一个可选常量或者变量但是没有赋值,它们会自动被设置为`nil`: + +```swift +var surveyAnswer: String? +// surveyAnswer 被自动设置为 nil +``` + +> 注意: +Swift 的`nil`和 Objective-C 中的`nil`并不一样。在 Objective-C 中,`nil`是一个指向不存在对象的指针。在 Swift 中,`nil`不是指针——它是一个确定的值,用来表示值缺失。_任何_类型的可选状态都可以被设置为`nil`,不只是对象类型。 + +### 隐式解析可选类型 + +如上所述,可选类型暗示了常量或者变量可以“没有值”。可选可以通过`if`语句来判断是否有值,如果有值的话可以通过可选绑定来解析值。 + +有时候在程序架构中,第一次被赋值之后,可以确定一个可选类型_总会_有值。在这种情况下,每次都要判断和解析可选值是非常低效的,因为可以确定它总会有值。 + +这种类型的可选状态被定义为_隐式解析可选类型(implicitly unwrapped optionals)_。把想要用作可选的类型的后面的问号(`String?`)改成感叹号(`String!`)来声明一个隐式解析可选类型。 + +当可选类型被第一次赋值之后就可以确定之后一直有值的时候,隐式解析可选类型非常有用。隐式解析可选类型主要被用在 Swift 中类的构造过程中,请参考[类实例之间的循环强引用](16_Automatic_Reference_Counting.html#strong_reference_cycles_between_class_instances)。 + +一个隐式解析可选类型其实就是一个普通的可选类型,但是可以被当做非可选类型来使用,并不需要每次都使用解析来获取可选值。下面的例子展示了可选类型`String`和隐式解析可选类型`String`之间的区别: + +```swift +let possibleString: String? = "An optional string." +println(possibleString!) // 需要惊叹号来获取值 +// 输出 "An optional string." +``` + +```swift +let assumedString: String! = "An implicitly unwrapped optional string." +println(assumedString) // 不需要感叹号 +// 输出 "An implicitly unwrapped optional string." +``` + +你可以把隐式解析可选类型当做一个可以自动解析的可选类型。你要做的只是声明的时候把感叹号放到类型的结尾,而不是每次取值的可选名字的结尾。 + +> 注意: +如果你在隐式解析可选类型没有值的时候尝试取值,会触发运行时错误。和你在没有值的普通可选类型后面加一个惊叹号一样。 + +你仍然可以把隐式解析可选类型当做普通可选类型来判断它是否包含值: + +```swift +if assumedString { + println(assumedString) +} +// 输出 "An implicitly unwrapped optional string." +``` + +你也可以在可选绑定中使用隐式解析可选类型来检查并解析它的值: + +```swift +if let definiteString = assumedString { + println(definiteString) +} +// 输出 "An implicitly unwrapped optional string." +``` + +> 注意: +如果一个变量之后可能变成`nil`的话请不要使用隐式解析可选类型。如果你需要在变量的生命周期中判断是否是`nil`的话,请使用普通可选类型。 + + +## 断言 + +可选类型可以让你判断值是否存在,你可以在代码中优雅地处理值缺失的情况。然而,在某些情况下,如果值缺失或者值并不满足特定的条件,你的代码可能并不需要继续执行。这时,你可以在你的代码中触发一个_断言(assertion)_来结束代码运行并通过调试来找到值缺失的原因。 + +### 使用断言进行调试 + +断言会在运行时判断一个逻辑条件是否为`true`。从字面意思来说,断言“断言”一个条件是否为真。你可以使用断言来保证在运行其他代码之前,某些重要的条件已经被满足。如果条件判断为`true`,代码运行会继续进行;如果条件判断为`false`,代码运行停止,你的应用被终止。 + +如果你的代码在调试环境下触发了一个断言,比如你在 Xcode 中构建并运行一个应用,你可以清楚地看到不合法的状态发生在哪里并检查断言被触发时你的应用的状态。此外,断言允许你附加一条调试信息。 + +你可以使用全局`assert`函数来写一个断言。向`assert`函数传入一个结果为`true`或者`false`的表达式以及一条信息,当表达式为`false`的时候这条信息会被显示: + +```swift +let age = -3 +assert(age >= 0, "A person's age cannot be less than zero") +// 因为 age < 0,所以断言会触发 +``` + +在这个例子中,只有`age >= 0`为`true`的时候代码运行才会继续,也就是说,当`age`的值非负的时候。如果`age`的值是负数,就像代码中那样,`age >= 0`为`false`,断言被触发,结束应用。 + +断言信息不能使用字符串插值。断言信息可以省略,就像这样: + +```swift +assert(age >= 0) +``` + +### 何时使用断言 + +当条件可能为假时使用断言,但是最终一定要_保证_条件为真,这样你的代码才能继续运行。断言的适用情景: + +* 整数类型的下标索引被传入一个自定义下标脚本实现,但是下标索引值可能太小或者太大。 +* 需要给函数传入一个值,但是非法的值可能导致函数不能正常执行。 +* 一个可选值现在是`nil`,但是后面的代码运行需要一个非`nil`值。 + +请参考[下标脚本](12_Subscripts.html)和[函数](06_Functions.html)。 + +> 注意: +断言可能导致你的应用终止运行,所以你应当仔细设计你的代码来让非法条件不会出现。然而,在你的应用发布之前,有时候非法条件可能出现,这时使用断言可以快速发现问题。 + diff --git a/source/chapter2/02_Basic_Operators.md b/source/chapter2/02_Basic_Operators.md old mode 100644 new mode 100755 index ffa160dc..87c2d918 --- a/source/chapter2/02_Basic_Operators.md +++ b/source/chapter2/02_Basic_Operators.md @@ -1,456 +1,457 @@ -# 基础运算符 - -运算符是检查, 改变, 合并值的特殊符号或短语. 例如, 加号 `+` 把计算两个数的和(如 `let i = 1 + 2`). 复杂些的运行算包括逻辑与`&&`(如 `if enteredDoorCode && passedRetinaScan`), 还有自增运算符 `++i` 这样让自身加一的便捷运算. - -Swift支持大部分标准C语言的运算符, 且改进许多特性来减少常规编码错误. 如, 赋值符 `=` 不返回值, 以防止错把等号 `==` 写成赋值号 `=` 而导致Bug. 数值运算符( `+` , `-`, `*`, `/`, `%`等)会检测并不允许值溢出, 以此来避免保存变量时由于变量大于或小于其类型所能承载的范围时导致的异常结果. 当然允许你选择使用Swift的溢出运算符来玩溢出. 具体使用请移步[溢出运算符](Overflow Operators). - -区别于C语言, 在Swift中你可以对浮点数进行取余运算( `%` ), 还提供了C语言没有的表达两数之间的值的区间运算符, ( `a..b` 和 `a...b` ), 这方便我们表达一个区间内的数值. - -本章节只描述了Swift中的简单运算符, [高级运算符](http://#)包含了高级运算符,及如何自定义运算符, 及如何进行自定义类型的运算符重载. - -# 术语 - -运算符有一目, 双目和三目运算符. - -一目运算符对单一操作对象操作, 如 `-a`. - -一目运算符分前置符和后置运算符, 前置运算符需紧排操作对象之前, 如 `!b`, 后置运算符需紧跟操作对象之后,如 `i++`, - -双目运算符操作两个操作对象, 如 `2 + 3`. 是中置的, 因为它们出现在两个操作对象之间. - -三目运算符操作三个操作对象, 和C语言一样, Swift只有一个三目运算符, 就是三目条件运算符 `a ? b : c`. - -受运算符影响的值叫操作数, 在表达式 `1 + 2` 中, 加号 `+` 是双目运算符, 它的两个操作数是值 `1` 和 `2`. - -# 赋值运算符 - -赋值运算 `a = b`, 表示用 `b` 的值来初始化或更新 `a` 的值. - -```swift -let b = 10 -var a = 5 -a = b -// a 现在等于 10 -``` - -如果赋值的右边是一个多元组, 它的元素可以马上被分解多个变量或变量 -``` -let (x, y) = (1, 2) -// 现在 x 等于 1, y 等于 2 -``` -与C语言和Objective-C不同, Swift的赋值操作并不返回任何值. 所以以下代码是错误的: - -```swift -if x = y { - // 此句错误, 因为 x = y 并不返回任何值 -} -``` - -这个特性使得你不无法把`==`错写成`=`了, 由于`if x = y`是错误代码, Swift从底层帮你避免了这些代码错误. - -# 数值运算 - -Swift让所有数值类型都支持了基本的四则运算: - -- 加法 `+` -- 减法 `-` -- 乘法 `*` -- 除法 `/` - -```swift -1 + 2 // 等于 3 -5 - 3 // 等于 2 -2 * 3 // 等于 6 -10.0 / 2.5 // 等于 4.0 -``` - -与C语言和Objective-C不同的是, Swift默认不允许在数值运算中出现溢出情况. 但你可以使用Swift的溢出运算符来达到你有目的的溢出, (如 `a &+ b` ). 详情请移步: [溢出运算符](Overflow Operators). - -加法操作 `+` 也用于字符串的拼接: - -```swift -"hello, " + "world" // 等于 "hello, world" -``` - -两个字符类型或一个字符类型和一个字符串类型, 相加会生成一个新的字符串类型: - -```swift -let dog: Character = "d" -let cow: Character = "c" -let dogCow = dog + cow -// 译者注: 原谅的引号内是很可爱的小狗和小牛, 但win os下不支持表情字符, 所以改成了普通字符 -// dogCow 现在是 "dc" -``` -详细请点击 [字符,字符串的拼接](http://#). - -# 求余运算 - -求余运算 `a % b` 是计算 `b` 的多少倍刚刚好可以容入 `a` , 多出来的那部分叫余数. - -> 注意 - -> 求余运算(%)在其他语言也叫取模运算. 然而严格说来, 我们看该运算符对负数的操作结果, `求余` 比 `取模` 更合适些. - -我们来谈谈取余是怎么回事, 计算 `9 % 4`, 你先计算出4的多少倍会刚好可以容入 `9` 中. - -2倍, 非常好, 那余数是1 (用'*'标出) - - - - - - - - - - - - - - - - - - -
    1 2 3 4 5 6 7 8 9
    441*
    - -在Swift中这么来表达 - -```swift -9 % 4 // 等于 1 -``` - -为了得到 `a % b` 的结果, `%`计算了以下等式, 并输出`余数`作为结果: -``` -a = (b × 倍数) + 余数 -``` -当`倍数`取最大值的时候, 就会刚好可以容入 `a` 中. - -把 `9` 和 `4` 代入等式中, 我们得 `1`: - -```swift -9 = (4 × 2) + 1 -``` - -同样的方法, 我来们计算 `-9 % 4` : -``` --9 % 4 // 等于 -1 -``` - -把 `-9` 和 `4` 代入等式, `-2` 是取到的最大整数: - -```swift --9 = (4 × -2) + -1 -``` - -余数是 `-1`. - -在对负数 `-b` 求余时, `-b`的符号会被忽略. 这意味着 `a % b` 和 `a % -b`的结果是相同的. - -## 浮点数求余计算 - -不同于C和Objective-C, Swift中是可以对浮点数进行求余的. - -```swift -8 % 2.5 // 等于 0.5 -``` - -这个例子中, 8除于2.5等于3余0.5, 所以结果是0.5. - -# 自增和自增运算 - -和C一样, Swift也提供了方便对变量本身加1或减1的自增 `++` 和自减 `--` 的运算符. 其操作对象可以是整形和浮点型。 -‌ -``` -var i = 0 -++i // 现在 i = 1 -``` - -每调用一次 `++i`, `i` 的值就会加1. -实际上, `++i` 是 `i = i + 1` 的简写, 而 `--i` 是 `i = i - 1`的简写. - -`++` 和 `--`既是前置又是后置运算. `++i`, `i++`, `--i` 和 `i--` 都是有效的写法. - -我们需要注意的是这些运算符修改了 `i` 后有一个返回值. 如果你只想修改 `i` 的值, 那你就可以忽略这个返回值. 但如果你想使用返回值, 你就需要留意前置和后置操作的返回值是不同的. - -当 `++` 前置的时候, 先自増再返回. - -当 `++` 后置的时候, 先返回再自增. - -不懂? 我们看例子: - -```swift -var a = 0 -let b = ++a // a 和 b 现在都是 1 -let c = a++ // a 现在 2, 但 c 是 a 自增前的值 1 -``` - -上述例子, `let b = ++a`, 先把 `a` 加1了再返回 `a` 的值. 所以 `a` 和 `b` 都是新值 `1`. - -而 `let c = a++`, 是先返回了 `a` 的值, 然后 `a` 才加1. 所以 `c` 得到了 `a` 的旧值1, 而 `a` 加1后变成2. - -除非你需要使用 `i++` 的特性, 不然推荐你使用 `++i` 和 `--i`, 因为先修改后返回这样的行为更符合我们的逻辑. - - -# 单目负号 - -数值的正负号可以使用前缀 `-` (即单目负号) 来切换: - -```swift -let three = 3 -let minusThree = -three // minusThree 等于 -3 -let plusThree = -minusThree // plusThree 等于 3, 或 "负负3" -``` - -单目负号写在操作数之前, 中间没有空格. - -# 单目正号 - -单目正号 `+` 不做任何改变地返回操作数的值. - -```swift -let minusSix = -6 -let alsoMinusSix = +minusSix // alsoMinusSix 等于 -6 -``` -虽然单目 `+` 做无用功, 但当你在使用单目负号来表达负数时, 你可以使用单目正号来表达正数, 如此你的代码会具有对称美. - - -# 复合赋值 - -如同强大的C语言, Swift也提供把其他运算符和赋值运算 `=` 组合的复合赋值运算符, 加赋运算 `+=` 是其中一个例子: - -```swift -var a = 1 -a += 2 // a 现在是 3 -``` - -表达式 `a += 2` 是 `a = a + 2` 的简写, 一个加赋运算就把加法和赋值两件事完成了. - -> 注意: - -> 复合赋值运算没有返回值, `let b = a += 2` 这类代码是错误. 这不同于上面提到的自增和自减运算符. - -[表达式](http://#)里有复合运算符的完整列表. -‌ -# 比较运算 - -所有标准C中的比较运算都可以在Swift中使用. - -- 等于 `a == b` -- 不等于 `a != b` -- 大于 `a > b` -- 小于 `a < b` -- 大于等于 `a >= b` -- 小于等于 `a <= b` - -> 注意: - -> Swift也提供恒等 `===` 和不恒等 `!==` 这两个比较符来判断两个对象是否引用同一个对象实例. 更多细节在 [类与结构](Classes and Structures). - -每个比较运算都返回了一个标识表达式是否成立的布尔值: - -```swift -1 == 1 // true, 因为 1 等于 1 -2 != 1 // true, 因为 2 不等于 1 -2 > 1 // true, 因为 2 大于 1 -1 < 2 // true, 因为 1 小于2 -1 >= 1 // true, 因为 1 大于等于 1 -2 <= 1 // false, 因为 2 并不小于等于 1 -``` - -比较运算多用于条件语句, 如 `if` 条件: - -```swift -let name = "world" -if name == "world" { - println("hello, world") -} else { - println("对不起, \(name), 我不认识你!") -} -// 输出 "hello, world", 因为 `name` 就是等于 "world" -``` - -关于 `if` 语句, 请看 [控制流](Control Flow). - -# 三目条件运算 - -三目条件运算的特殊在于它是有三个操作数的运算符, 它的原型是 `问题 ? 答案1 : 答案2`. 它简洁地表达根据 `问题` 成立与否作出二选一的操作. 如果 `问题` 成立, 返回 `答案1` 的结果; 如果不成立, 返回 `答案2` 的结果. - -使用三目条件运算简化了以下代码: - -```swift -if question: { - answer1 -} -else { - answer2 -} -``` - -这里有个计算表格行高的例子. 如果有表头, 那行高应比内容高度要高出50像素; 如果没有表头, 只需高出20像素. - -```swift -let contentHeight = 40 -let hasHeader = true -let rowHeight = contentHeight + (hasHeader ? 50 : 20) -// rowHeight 现在是 90 -``` - -这样写会比下面的代码简洁: - -```swift -let contentHeight = 40 -let hasHeader = true -var rowHeight = contentHeight -if hasHeader { - rowHeight = rowHeight + 50 -} else { - rowHeight = rowHeight + 20 -} -// rowHeight 现在是 90 -``` - -第一段代码例子使用了三目条件运算, 所以一行代码就能让我们得到正确答案. 这比第二段代码简洁得多, 无需将 `rowHeight` 定义成变量, 因为它的值无需在 `if` 语句中改变. - -三目条件运算提供有效率且便捷的方式来表达二选一的选择. 需要注意的事, 过度使用三目条件运算就会由简洁的代码变成难懂的代码. 我们应避免在一个组合语句使用多个三目条件运算符. - -# 区间运算符 - -Swift提供了两个方便表达一个区间的值的运算符. - -## 闭区间运算符 -闭区间运算符 `a...b` 定义一个包含从 `a` 到 `b` (包括 `a` 和 `b`)的所有值的区间. -‌ -闭区间运算符在迭代一个区间的所有值时是非常有用的, 如在 `for-in` 循环中: - -```swift -for index in 1...5 { - println("\(index) * 5 = \(index * 5)") -} -// 1 * 5 = 5 -// 2 * 5 = 10 -// 3 * 5 = 15 -// 4 * 5 = 20 -// 5 * 5 = 25 -``` - -关于 `for-in`, 请看 [控制流](Control Flow). - -## 半闭区间 - -半闭区间 `a..b` 定义一个从 `a` 到 `b` 但不包括 `b` 的区间. -之所以称为半闭区间, 是因为该区间包含第一个值而不包括最后的值. - -半闭区间的实用性在于当你使用一个0始的列表(如数组)时, 非常方便地从0数到列表的长度. - -```swift -let names = ["Anna", "Alex", "Brian", "Jack"] -let count = names.count -for i in 0..count { - println("第 \(i + 1) 个人叫 \(names[i])") -} -// 第 1 个人叫 Anna -// 第 2 个人叫 Alex -// 第 3 个人叫 Brian -// 第 4 个人叫 Jack -``` - -> 注意: 数组有4个元素, 但 `0..count` 只数到 3 (最后一个元素的下标), 因为它是半闭区间. 关于数组, 请查阅 [数组](Arrays). - -# 逻辑运算 - -逻辑运算的操作对象是逻辑布尔值. Swift支持基于C语言的三个标准逻辑运算. - -- 逻辑非 `!a` -- 逻辑与 `a && b` -- 逻辑或 `a || b` - -## 逻辑非 - -逻辑非运算 `!a` 对一个布尔值取反, 使得 `true` 变 `false`, `false` 变 `true`. - -它是一个前置运算符, 需出现在操作数之前, 且不加空格. 读作 `非 a`, 然后我们看以下例子: - -```swift -let allowedEntry = false -if !allowedEntry { - println("ACCESS DENIED") -} -// prints "ACCESS DENIED" -``` - -`if !allowedEntry`语句可以读作 "如果 非 alowed entry.", 接下一行代码只有在如果 "非 allow entry" 为 `true`, 即 `allowEntry` 为 `false` 时被执行. - -在示例代码中, 小心地选择布尔常量或变量有助于代码的可读性, 并且避免使用双重逻辑非运算, 或混乱的逻辑语句. - -## 逻辑与 -逻辑与 `a && b` 表达了只有 `a` 和 `b` 的值都为 `true` 时, 整个表达式的值才会是 `true` . - -只要任意一个值为 `false`, 整个表达式的值就为 `false`. 事实上, 如果第一个值为 `false`, 那么是不去计算第二个值的, 因为它已经不可能影响整个表达式的结果了. 这被称做 "短路计算". - -以下例子, 只有两个值都为值的时候才允许进入: - -```swift -let enteredDoorCode = true -let passedRetinaScan = false -if enteredDoorCode && passedRetinaScan { - println("Welcome!") -} else { - println("ACCESS DENIED") -} -// 输出 "ACCESS DENIED -``` - -## 逻辑或 -逻辑或 `a || b` 是一个由两个连续的 `|` 组成的中置运算符. 它表示了两个逻辑表达式的其中一个为 `true`, 整个表达式就为 `true`. - -同逻辑与运算类似, 逻辑或也是"短路计算"的, 当左端的表达式为 `true` 时, 将不计算右边的表达式了, 因为它不可能改变整个表达式的值了. - -以下示例代码中, 第一个布尔值 `hasDoorKey` 为 `false`, 但第二个值 `knowsOverridePassword` 为 `true`, 所以整个表达是 `true`, 于是允许进入: - -```swift -let hasDoorKey = false -let knowsOverridePassword = true -if hasDoorKey || knowsOverridePassword { - println("Welcome!") -} else { - println("ACCESS DENIED") -} -// 输出 "Welcome!" -``` - -## 组合逻辑 - -我们可以组合多个逻辑运算来表达一个复合逻辑: - -```swift -if enteredDoorCode && passedRetinaScan || hasDoorKey || knowsOverridePassword { - println("Welcome!") -} else { - println("ACCESS DENIED") -} -// 输出 "Welcome!" -``` - -这个例子使用了含多个 `&&` 和 `||` 的复合逻辑. 但无论怎样, `&&` 和 `||` 始终只能操作两个值. 所以这实际是三个简单逻辑连续操作的结果. 我们来解读一下: - -如果我们输入了正确的密码并通过了视网膜扫描; 或者我们有一把有效的钥匙; 又或者我们知道紧急情况下重置的密码, 我们就能把门打开进入. - -前两种情况, 我们都不满足, 所以前两个简单逻辑的结果是 `false`, 但是我们是知道紧急情况下重置的密码的, 所以整个复杂表达式的值还是 `true`. - -## 使用括号来明确优先级 - -为了一个复杂表达式更容易读懂, 在合适的地方使用括号来明确优先级是很有效的, 虽然它并非必要的. 在上个关于门的权限的例子中, 我们给第一个部分加个括号, 使用它看起来逻辑更明确. - -```swift -if (enteredDoorCode && passedRetinaScan) || hasDoorKey || knowsOverridePassword { - println("Welcome!") -} else { - println("ACCESS DENIED") -} -// prints "Welcome!" -``` - -这括号使得前两个值被看成整个逻辑表达中独立的一个部分. 虽然有括号和没括号的输出结果是一样的, 但对于读代码的人来说有括号的代码更清晰. - -可读性比简洁性更重要, 请在可以让你代码变清晰地地方加个括号吧! +> 翻译:[xielingwang](https://github.com/xielingwang) +> 校对:[Evilcome](https://github.com/Evilcome) + +# 基本运算符 +----------------- + +本页包含内容: + +- [术语](#terminology) +- [赋值运算符](#assignment_operator) +- [数值运算符](#arithmetic_operators) +- [组合赋值运算符(Compound Assignment Operators)](#compound_assignment_operators) +- [比较运算符](#comparison_operators) +- [三元条件运算符(Ternary Conditional Operator)](#ternary_conditional_operator) +- [区间运算符](#range_operators) +- [逻辑运算符](#logical_operators) + +运算符是检查、改变、合并值的特殊符号或短语。例如,加号`+`将两个数相加(如`let i = 1 + 2`)。复杂些的运算例如逻辑与运算符`&&`(如`if enteredDoorCode && passedRetinaScan`),或让 i 值加1的便捷自增运算符`++i`等。 + +Swift 支持大部分标准 C 语言的运算符,且改进许多特性来减少常规编码错误。如:赋值符(`=`)不返回值,以防止把想要判断相等运算符(`==`)的地方写成赋值符导致的错误。数值运算符(`+`,`-`,`*`,`/`,`%`等)会检测并不允许值溢出,以此来避免保存变量时由于变量大于或小于其类型所能承载的范围时导致的异常结果。当然允许你使用 Swift 的溢出运算符来实现溢出。详情参见[溢出运算符](23_Advanced_Operators.html#overflow_operators)。 + +区别于 C 语言,在 Swift 中你可以对浮点数进行取余运算(`%`),Swift 还提供了 C 语言没有的表达两数之间的值的区间运算符,(`a..b`和`a...b`),这方便我们表达一个区间内的数值。 + +本章节只描述了 Swift 中的基本运算符,[高级运算符](23_Advanced_Operators.html)包含了高级运算符,及如何自定义运算符,及如何进行自定义类型的运算符重载。 + + +## 术语 + +运算符有一元、二元和三元运算符。 + +- 一元运算符对单一操作对象操作(如`-a`)。一元运算符分前置符和后置运算符,前置运算符需紧排操作对象之前(如`!b`),后置运算符需紧跟操作对象之后(如`i++`)。 +- 二元运算符操作两个操作对象(如`2 + 3`),是中置的,因为它们出现在两个操作对象之间。 +- 三元运算符操作三个操作对象,和 C 语言一样,Swift 只有一个三元运算符,就是三元条件运算符(`a ? b : c`)。 + +受运算符影响的值叫操作数,在表达式`1 + 2`中,加号`+`是二元运算符,它的两个操作数是值`1`和`2`。 + + +## 赋值运算符 + +赋值运算(`a = b`),表示用`b`的值来初始化或更新`a`的值: + +```swift +let b = 10 +var a = 5 +a = b +// a 现在等于 10 +``` + +如果赋值的右边是一个多元组,它的元素可以马上被分解多个变量或变量: + +```swiflt +let (x, y) = (1, 2) +// 现在 x 等于 1, y 等于 2 +``` + +与 C 语言和 Objective-C 不同,Swift 的赋值操作并不返回任何值。所以以下代码是错误的: + +```swift +if x = y { + // 此句错误, 因为 x = y 并不返回任何值 +} +``` + +这个特性使你无法把(`==`)错写成(`=`),由于`if x = y`是错误代码,Swift 从底层帮你避免了这些错误代码。 + + +## 数值运算 + +Swift 中所有数值类型都支持了基本的四则运算: + +- 加法(`+`) +- 减法(`-`) +- 乘法(`*`) +- 除法(`/`) + +```swift +1 + 2 // 等于 3 +5 - 3 // 等于 2 +2 * 3 // 等于 6 +10.0 / 2.5 // 等于 4.0 +``` + +与 C 语言和 Objective-C 不同的是,Swift 默认不允许在数值运算中出现溢出情况。但你可以使用 Swift 的溢出运算符来达到你有目的的溢出(如`a &+ b`)。详情参见[溢出运算符](23_Advanced_Operators.html#overflow_operators)。 + +加法运算符也可用于`String`的拼接: + +```swift +"hello, " + "world" // 等于 "hello, world" +``` + +两个`Character`值或一个`String`和一个`Character`值,相加会生成一个新的`String`值: + +```swift +let dog: Character = "d" +let cow: Character = "c" +let dogCow = dog + cow +// 译者注: 原来的引号内是很可爱的小狗和小牛, 但win os下不支持表情字符, 所以改成了普通字符 +// dogCow 现在是 "dc" +``` + +详情参见[字符,字符串的拼接](03_Strings_and_Characters.html#concatenating_strings_and_characters)。 + +### 求余运算 + +求余运算(`a % b`)是计算`b`的多少倍刚刚好可以容入`a`,返回多出来的那部分(余数)。 + +>注意: +求余运算(`%`)在其他语言也叫取模运算。然而严格说来,我们看该运算符对负数的操作结果,"求余"比"取模"更合适些。 + +我们来谈谈取余是怎么回事,计算`9 % 4`,你先计算出`4`的多少倍会刚好可以容入`9`中: + +![Art/remainderInteger_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/remainderInteger_2x.png "Art/remainderInteger_2x.png") + +2倍,非常好,那余数是1(用橙色标出) + +在 Swift 中这么来表达: + +```swift +9 % 4 // 等于 1 +``` + +为了得到`a % b`的结果,`%`计算了以下等式,并输出`余数`作为结果: + +*a = (b × 倍数) + 余数* + +当`倍数`取最大值的时候,就会刚好可以容入`a`中。 + +把`9`和`4`代入等式中,我们得`1`: + +```swift +9 = (4 × 2) + 1 +``` + +同样的方法,我来们计算 `-9 % 4`: + +```swift +-9 % 4 // 等于 -1 +``` + +把`-9`和`4`代入等式,`-2`是取到的最大整数: + +```swift +-9 = (4 × -2) + -1 +``` + +余数是`-1`。 + +在对负数`b`求余时,`b`的符号会被忽略。这意味着 `a % b` 和 `a % -b`的结果是相同的。 + +### 浮点数求余计算 + +不同于 C 语言和 Objective-C,Swift 中是可以对浮点数进行求余的。 + +```swift +8 % 2.5 // 等于 0.5 +``` + +这个例子中,`8`除于`2.5`等于`3`余`0.5`,所以结果是一个`Double`值`0.5`。 + +![Art/remainderFloat_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/remainderFloat_2x.png "Art/remainderFloat_2x.png") + +### 自增和自增运算 + +和 C 语言一样,Swift 也提供了方便对变量本身加1或减1的自增(`++`)和自减(`--`)的运算符。其操作对象可以是整形和浮点型。 +‌ +```swift +var i = 0 +++i // 现在 i = 1 +``` + +每调用一次`++i`,`i`的值就会加1。实际上,`++i`是`i = i + 1`的简写,而`--i`是`i = i - 1`的简写。 + +`++`和`--`既是前置又是后置运算。`++i`,`i++`,`--i`和`i--`都是有效的写法。 + +我们需要注意的是这些运算符修改了`i`后有一个返回值。如果你只想修改`i`的值,那你就可以忽略这个返回值。但如果你想使用返回值,你就需要留意前置和后置操作的返回值是不同的。 + +- 当`++`前置的时候,先自増再返回。 + +- 当`++`后置的时候,先返回再自增。 + +例如: + +```swift +var a = 0 +let b = ++a // a 和 b 现在都是 1 +let c = a++ // a 现在 2, 但 c 是 a 自增前的值 1 +``` + +上述例子,`let b = ++a`先把`a`加1了再返回`a`的值。所以`a`和`b`都是新值`1`。 + +而`let c = a++`,是先返回了`a`的值,然后`a`才加1。所以`c`得到了`a`的旧值1,而`a`加1后变成2。 + +除非你需要使用`i++`的特性,不然推荐你使用`++i`和`--i`,因为先修改后返回这样的行为更符合我们的逻辑。 + + +### 一元负号 + +数值的正负号可以使用前缀`-`(即一元负号)来切换: + +```swift +let three = 3 +let minusThree = -three // minusThree 等于 -3 +let plusThree = -minusThree // plusThree 等于 3, 或 "负负3" +``` + +一元负号(`-`)写在操作数之前,中间没有空格。 + +### 一元正号 + +一元正号(`+`)不做任何改变地返回操作数的值。 + +```swift +let minusSix = -6 +let alsoMinusSix = +minusSix // alsoMinusSix 等于 -6 +``` +虽然一元`+`做无用功,但当你在使用一元负号来表达负数时,你可以使用一元正号来表达正数,如此你的代码会具有对称美。 + + + +## 复合赋值(Compound Assignment Operators) + +如同强大的 C 语言,Swift 也提供把其他运算符和赋值运算(`=`)组合的复合赋值运算符,加赋运算(`+=`)是其中一个例子: + +```swift +var a = 1 +a += 2 // a 现在是 3 +``` + +表达式`a += 2`是`a = a + 2`的简写,一个加赋运算就把加法和赋值两件事完成了。 + +>注意: +复合赋值运算没有返回值,`let b = a += 2`这类代码是错误。这不同于上面提到的自增和自减运算符。 + +在[表达式](../chapter3/04_Expressions.html)章节里有复合运算符的完整列表。 +‌ + +## 比较运算 + +所有标准 C 语言中的比较运算都可以在 Swift 中使用。 + +- 等于(`a == b`) +- 不等于(`a != b`) +- 大于(`a > b`) +- 小于(`a < b`) +- 大于等于(`a >= b`) +- 小于等于(`a <= b`) + +> 注意: +Swift 也提供恒等`===`和不恒等`!==`这两个比较符来判断两个对象是否引用同一个对象实例。更多细节在[类与结构](09_Classes_and_Structures.html)。 + +每个比较运算都返回了一个标识表达式是否成立的布尔值: + +```swift +1 == 1 // true, 因为 1 等于 1 +2 != 1 // true, 因为 2 不等于 1 +2 > 1 // true, 因为 2 大于 1 +1 < 2 // true, 因为 1 小于2 +1 >= 1 // true, 因为 1 大于等于 1 +2 <= 1 // false, 因为 2 并不小于等于 1 +``` + +比较运算多用于条件语句,如`if`条件: + +```swift +let name = "world" +if name == "world" { + println("hello, world") +} else { + println("I'm sorry \(name), but I don't recognize you") +} +// 输出 "hello, world", 因为 `name` 就是等于 "world" +``` + +关于`if`语句,请看[控制流](05_Control_Flow.html)。 + + +## 三元条件运算(Ternary Conditional Operator) + +三元条件运算的特殊在于它是有三个操作数的运算符,它的原型是 `问题 ? 答案1 : 答案2`。它简洁地表达根据`问题`成立与否作出二选一的操作。如果`问题`成立,返回`答案1`的结果; 如果不成立,返回`答案2`的结果。 + +使用三元条件运算简化了以下代码: + +```swift +if question: { + answer1 +} else { + answer2 +} +``` + +这里有个计算表格行高的例子。如果有表头,那行高应比内容高度要高出50像素; 如果没有表头,只需高出20像素。 + +```swift +let contentHeight = 40 +let hasHeader = true +let rowHeight = contentHeight + (hasHeader ? 50 : 20) +// rowHeight 现在是 90 +``` + +这样写会比下面的代码简洁: + +```swift +let contentHeight = 40 +let hasHeader = true +var rowHeight = contentHeight +if hasHeader { + rowHeight = rowHeight + 50 +} else { + rowHeight = rowHeight + 20 +} +// rowHeight 现在是 90 +``` + +第一段代码例子使用了三元条件运算,所以一行代码就能让我们得到正确答案。这比第二段代码简洁得多,无需将`rowHeight`定义成变量,因为它的值无需在`if`语句中改变。 + +三元条件运算提供有效率且便捷的方式来表达二选一的选择。需要注意的事,过度使用三元条件运算就会由简洁的代码变成难懂的代码。我们应避免在一个组合语句使用多个三元条件运算符。 + + +## 区间运算符 + +Swift 提供了两个方便表达一个区间的值的运算符。 + +### 闭区间运算符 +闭区间运算符(`a...b`)定义一个包含从`a`到`b`(包括`a`和`b`)的所有值的区间。 +‌ +闭区间运算符在迭代一个区间的所有值时是非常有用的,如在`for-in`循环中: + +```swift +for index in 1...5 { + println("\(index) * 5 = \(index * 5)") +} +// 1 * 5 = 5 +// 2 * 5 = 10 +// 3 * 5 = 15 +// 4 * 5 = 20 +// 5 * 5 = 25 +``` + +关于`for-in`,请看[控制流](05_Control_Flow.html)。 + +### 半闭区间 + +半闭区间(`a..b`)定义一个从`a`到`b`但不包括`b`的区间。 +之所以称为半闭区间,是因为该区间包含第一个值而不包括最后的值。 + +半闭区间的实用性在于当你使用一个0始的列表(如数组)时,非常方便地从0数到列表的长度。 + +```swift +let names = ["Anna", "Alex", "Brian", "Jack"] +let count = names.count +for i in 0..count { + println("第 \(i + 1) 个人叫 \(names[i])") +} +// 第 1 个人叫 Anna +// 第 2 个人叫 Alex +// 第 3 个人叫 Brian +// 第 4 个人叫 Jack +``` + +数组有4个元素,但`0..count`只数到3(最后一个元素的下标),因为它是半闭区间。关于数组,请查阅[数组](04_Collection_Types.html#arrays)。 + + +## 逻辑运算 + +逻辑运算的操作对象是逻辑布尔值。Swift 支持基于 C 语言的三个标准逻辑运算。 + +- 逻辑非(`!a`) +- 逻辑与(`a && b`) +- 逻辑或(`a || b`) + +### 逻辑非 + +逻辑非运算(`!a`)对一个布尔值取反,使得`true`变`false`,`false`变`true`。 + +它是一个前置运算符,需出现在操作数之前,且不加空格。读作`非 a`,然后我们看以下例子: + +```swift +let allowedEntry = false +if !allowedEntry { + println("ACCESS DENIED") +} +// 输出 "ACCESS DENIED" +``` + +`if !allowedEntry`语句可以读作 "如果 非 alowed entry。",接下一行代码只有在如果 "非 allow entry" 为`true`,即`allowEntry`为`false`时被执行。 + +在示例代码中,小心地选择布尔常量或变量有助于代码的可读性,并且避免使用双重逻辑非运算,或混乱的逻辑语句。 + +### 逻辑与 +逻辑与(`a && b`)表达了只有`a`和`b`的值都为`true`时,整个表达式的值才会是`true`。 + +只要任意一个值为`false`,整个表达式的值就为`false`。事实上,如果第一个值为`false`,那么是不去计算第二个值的,因为它已经不可能影响整个表达式的结果了。这被称做 "短路计算(short-circuit evaluation)"。 + +以下例子,只有两个`Bool`值都为`true`值的时候才允许进入: + +```swift +let enteredDoorCode = true +let passedRetinaScan = false +if enteredDoorCode && passedRetinaScan { + println("Welcome!") +} else { + println("ACCESS DENIED") +} +// 输出 "ACCESS DENIED" +``` + +### 逻辑或 +逻辑或(`a || b`)是一个由两个连续的`|`组成的中置运算符。它表示了两个逻辑表达式的其中一个为`true`,整个表达式就为`true`。 + +同逻辑与运算类似,逻辑或也是"短路计算"的,当左端的表达式为`true`时,将不计算右边的表达式了,因为它不可能改变整个表达式的值了。 + +以下示例代码中,第一个布尔值(`hasDoorKey`)为`false`,但第二个值(`knowsOverridePassword`)为`true`,所以整个表达是`true`,于是允许进入: + +```swift +let hasDoorKey = false +let knowsOverridePassword = true +if hasDoorKey || knowsOverridePassword { + println("Welcome!") +} else { + println("ACCESS DENIED") +} +// 输出 "Welcome!" +``` + +### 组合逻辑 + +我们可以组合多个逻辑运算来表达一个复合逻辑: + +```swift +if enteredDoorCode && passedRetinaScan || hasDoorKey || knowsOverridePassword { + println("Welcome!") +} else { + println("ACCESS DENIED") +} +// 输出 "Welcome!" +``` + +这个例子使用了含多个`&&`和`||`的复合逻辑。但无论怎样,`&&`和`||`始终只能操作两个值。所以这实际是三个简单逻辑连续操作的结果。我们来解读一下: + +如果我们输入了正确的密码并通过了视网膜扫描; 或者我们有一把有效的钥匙; 又或者我们知道紧急情况下重置的密码,我们就能把门打开进入。 + +前两种情况,我们都不满足,所以前两个简单逻辑的结果是`false`,但是我们是知道紧急情况下重置的密码的,所以整个复杂表达式的值还是`true`。 + +### 使用括号来明确优先级 + +为了一个复杂表达式更容易读懂,在合适的地方使用括号来明确优先级是很有效的,虽然它并非必要的。在上个关于门的权限的例子中,我们给第一个部分加个括号,使用它看起来逻辑更明确: + +```swift +if (enteredDoorCode && passedRetinaScan) || hasDoorKey || knowsOverridePassword { + println("Welcome!") +} else { + println("ACCESS DENIED") +} +// 输出 "Welcome!" +``` + +这括号使得前两个值被看成整个逻辑表达中独立的一个部分。虽然有括号和没括号的输出结果是一样的,但对于读代码的人来说有括号的代码更清晰。可读性比简洁性更重要,请在可以让你代码变清晰地地方加个括号吧! diff --git a/source/chapter2/03_Strings_and_Characters.md b/source/chapter2/03_Strings_and_Characters.md old mode 100644 new mode 100755 index 83080b7f..9fd6b318 --- a/source/chapter2/03_Strings_and_Characters.md +++ b/source/chapter2/03_Strings_and_Characters.md @@ -1,415 +1,411 @@ -# 字符串和字符 (Strings and Characters) - -本页包含内容: - -- 字符串字面量 -- 初始化空字符串 -- 字符串可变性 -- 字符串是值类型 -- 使用字符 -- 计算字符数量 -- 连接字符串和字符 -- 字符串插值 -- 比较字符串 -- 字符串大小写 -- Unicode - ---- - -**String** 是例如 "hello, world", "海贼王" 这样的有序的 **Character** (字符) 类型的值的集合,通过 **String** 类型来表示。 - -Swift 的 **String** 和 **Character** 类型提供了一个快速的,兼容 Unicode 的方式来处理代码中的文本信息。 -创建和操作字符串的语法与 C 语言中字符串操作相似,轻量并且易读。 -字符串连接操作只需要简单地通过 `+` 号将两个字符串相连即可。 -与 Swift 中其他值一样,能否更改字符串的值,取决于其被定义为常量还是变量。 - -尽管语法简易,但 **String** 类型是一种快速、现代化的字符串实现。 -每一个字符串都是由独立编码的 Unicode 字符组成,并提供了以不同 Unicode 表示 (representations) 来访问这些字符的支持。 - -Swift可以在常量、变量、字面量和表达式中进行字符串插值操作,可以轻松创建用于展示、存储和打印的自定义字符串。 - -> 注意: -> -> Swift 的 **String** 类型与 Foundation NSString 类进行了无缝桥接。 -> 如果您利用 Cocoa 或 Cocoa Touch 中的 Foundation 框架进行工作。 -> 所有 **NSString** API 都可以调用您创建的任意 **String** 类型的值。 -> 除此之外,还可以使用本章介绍的 **String** 特性。 -> 您也可以在任意要求传入 **NSString** 实例作为参数的 API 中使用 **String** 类型的值作为替代。 -> ->更多关于在 Foundation 和 Cocoa 中使用 **String** 的信息请查看 [Using Swift with Cocoa and Objective-C](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/index.html#//apple_ref/doc/uid/TP40014216)。 - ---- - -### 字符串字面量 - -您可以在您的代码中包含一段预定义的字符串值作为字符串字面量。 -字符串字面量是由双引号 ("") 包裹着的具有固定顺序的文本字符集。 - -字符串字面量可以用于为常量和变量提供初始值。 - -``` -let someString = "Some string literal value" -``` - -> 注意: -> -> `someString` 变量通过字符串字面量进行初始化,Swift 因此推断该变量为 **String** 类型。 - -字符串字面量可以包含以下特殊字符: - -* 转义字符 `\0` (空字符)、`\\`(反斜线)、`\t` (水平制表符)、`\n` (换行符)、`\r` (回车符)、`\"` (双引号)、`\'` (单引号)。 -* 单字节 Unicode 标量,写成 `\xnn`,其中 `nn` 为两位十六进制数。 -* 双字节 Unicode 标量,写成 `\unnnn`,其中 `nnnn` 为四位十六进制数。 -* 四字节 Unicode 标量,写成 `\Unnnnnnnn`,其中 `nnnnnnnn` 为八位十六进制数。 - -下面的代码为各种特殊字符的使用示例。 -`wiseWords` 常量包含了两个转移特殊字符 (双括号); -`dollarSign`、`blackHeart` 和 `sparklingHeart` 常量演示了三种不同格式的 Unicode 标量: - -``` -let wiseWords = "\"我是要成为海贼王的男人\" - 路飞" -// "我是要成为海贼王的男人" - 路飞 -let dollarSign = "\x24" // $, Unicode 标量 U+0024 -let blackHeart = "\u2665" // ♥, Unicode 标量 U+2665 -let sparklingHeart = "\U0001F496" // 💖, Unicode 标量 U+1F496 -``` - ---- - -### 初始化空字符串 - -为了构造一个很长的字符串,可以创建一个空字符串作为初始值。 -可以将空的字符串字面量赋值给变量,也可以初始化一个新的 **String** 实例: - -``` -var emptyString = "" // 空字符串字面量 -var anotherEmptyString = String() // 初始化 String 实例 -// 两个字符串均为空并等价。 -``` - -您可以通过检查其 **Boolean** 类型的 `isEmpty` 属性来判断该字符串是否为空: - -``` -if emptyString.isEmpty { - println("什么都没有") -} -// 输出 "什么都没有" -``` - ---- - -### 字符串可变性 - -您可以通过将一个特定字符串分配给一个变量来对其进行修改,或者分配给一个常量来保证其不会被修改: - -``` -var variableString = "Horse" -variableString += " and carriage" -// variableString 现在为 "Horse and carriage" -let constantString = "Highlander" -constantString += " and another Highlander" -// 这会报告一个编译错误 (compile-time error) - 常量不可以被修改。 -``` - -> 注意: -> -> 在 Objective-C 和 Cocoa 中,您通过选择两个不同的类( `NSString` 和 `NSMutableString` )来指定该字符串是否可以被修改,Swift 中的字符串是否可以修改仅通过定义的是变量还是常量来决定,实现了多种类型可变性操作的统一。 - ---- - -### 字符串是值类型 - -Swift 的 **String** 类型是值类型。 -如果您创建了一个新的字符串,那么当其进行常量、变量赋值操作或在函数/方法中传递时,会进行值拷贝。 -任何情况下,都会对已有字符串值创建新副本,并对该新副本进行传递或赋值操作。 -值类型在 [Structures and Enumerations Are Value Types](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ClassesAndStructures.html#//apple_ref/doc/uid/TP40014097-CH13-XID_104) 中进行了说明。 - -> 注意: -> -> 与 Cocoa 中的 NSString 不同,当您在 Cocoa 中创建了一个 NSString 实例,并将其传递给一个函数/方法,或者赋值给一个变量,您传递或赋值的是该 NSString 实例的一个引用,除非您特别要求进行值拷贝,否则字符串不会生成新的副本来进行赋值操作。 - -Swift 默认字符串拷贝的方式保证了在函数/方法中传递的是字符串的值。 -很明显无论该值来自于哪里,都是您独自拥有的。 -您可以放心您传递的字符串本身不会被更改。 - -在实际编译时,Swift 编译器会优化字符串的使用,使实际的复制只发生在绝对必要的情况下,这意味着您将字符串作为值类型的同时可以获得极高的性能。 - ---- - -### 使用字符(Characters) - -Swift 的 **String** 类型表示特定序列的 **Character** (字符) 类型值的集合。 -每一个字符值代表一个 Unicode 字符。 -您可利用 for-in 循环来遍历字符串中的每一个字符: - -``` -for character in "Dog!🐶" { - println(character) -} -// D -// o -// g -// ! -// 🐶 -``` - -for-in 循环在[For Loops](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ControlFlow.html#//apple_ref/doc/uid/TP40014097-CH9-XID_154)中进行了详细描述。 - -另外,通过标明一个 **Character** 类型注解并通过字符字面量进行赋值,可以建立一个独立的字符常量或变量: - -``` -let yenSign: Character = "¥" -``` - ---- - -### 计算字符数量 - -通过调用全局 `countElements` 函数,并将字符串作为参数进行传递,可以获取该字符串的字符数量。 - -``` -let unusualMenagerie = "Koala 🐨, Snail 🐌, Penguin 🐧, Dromedary 🐪" -println("unusualMenagerie has \(countElements(unusualMenagerie)) characters") -// prints "unusualMenagerie has 40 characters" -``` - -> 注意: -> -> 不同的 Unicode 字符以及相同 Unicode 字符的不同表示方式可能需要不同数量的内存空间来存储。 -> 所以Swift 中的字符在一个字符串中并不一定占用相同的内存空间。 -> 因此字符串的长度不得不通过迭代字符串中每一个字符的长度来进行计算。 -> 如果您正在处理一个长字符串,需要注意 `countElements` 函数必须遍历字符串中的字符以精准计算字符串的长度。 -> -> 另外需要注意的是通过 `countElements` 返回的字符数量并不总是与包含相同字符的 NSString 的 `length` 属性相同。 -> NSString 的 `length` 属性是基于利用 UTF-16 表示的十六位代码单元数字,而不是基于 Unicode 字符。 -> 为了解决这个问题,NSString 的 `length` 属性在被 Swift的 **String** 访问时会成为 `utf16count`。 - ---- - -### 连接字符串和字符 - -字符串和字符的值可以通过加法运算符 (`+`) 相加在一起并创建一个新的字符串值: - -``` -let string1 = "hello" -let string2 = " there" -let character1: Character = "!" -let character2: Character = "?" - -let stringPlusCharacter = string1 + character1 // 等于 "hello!" -let stringPlusString = string1 + string2 // 等于 "hello there" -let characterPlusString = character1 + string1 // 等于 "!hello" -let characterPlusCharacter = character1 + character2 // 等于 "!?" -``` - -您也可以通过加法赋值运算符 (+=) 将一个字符串或者字符添加到一个已经存在字符串变量上: - -``` -var instruction = "look over" -instruction += string2 -// instruction 现在等于 "look over there" - -var welcome = "good morning" -welcome += character1 -// welcome 现在等于 "good morning!" -``` - ->注意: -> ->您不能将一个字符串或者字符添加到一个已经存在的字符变量上,因为字符变量只能包含一个字符。 - ---- - -### 字符串插值 - -字符串插值是一种构建新字符串的方式,可以在其中包含常量、变量、字面量和表达式。 -您插入的字符串字面量的每一项都被包裹在以反斜线为前缀的圆括号中: - -``` -let multiplier = 3 -let message = "\(multiplier) 乘以 2.5 是 \(Double(multiplier) * 2.5)" -// message is "3 乘以 2.5 是 7.5" -``` - -在上面的例子中,`multiplier` 作为 `\(multiplier)` 被插入到一个字符串字面量中。 -当创建字符串执行插值计算时此占位符会被替换为 `multiplier` 实际的值。 - -`multiplier` 的值也作为字符串中后面表达式的一部分。 -该表达式计算 `Double(multiplier) * 2.5` 的值并将结果 (7.5) 插入到字符串中。 -在这个例子中,表达式写为 `\(Double(multiplier) * 2.5)` 并包含在字符串字面量中。 - ->注意: -> ->您插值字符串中写在括号中的表达式不能包含非转义双引号 (`"`) 和反斜杠 (`\`),并且不能包含回车或换行符。 - ---- - -### 比较字符串 - -Swift 提供了三种方式来比较字符串的值:字符串相等,前缀相等和后缀相等。 - -##### 字符串相等 - -如果两个字符串以同一顺序包含完全相同的字符,则认为两者字符串相等: - -``` -let quotation = "我们是一样一样滴." -let sameQuotation = "我们是一样一样滴." -if quotation == sameQuotation { - println("这两个字符串被认为是相同的") -} -// prints "这两个字符串被认为是相同的" -``` - -##### 前缀/后缀相等 - -通过调用字符串的 `hasPrefix`/`hasSuffix` 方法来检查字符串是否拥有特定前缀/后缀。 -两个方法均需要以字符串作为参数传入并传出 **Boolean** 值。 -两个方法均执行基本字符串和前缀/后缀字符串之间逐个字符的比较操作。 - -下面的例子以一个字符串数组表示莎士比亚话剧 `罗密欧与朱丽叶` 中前两场的场景位置: - -``` -let romeoAndJuliet = [ - "Act 1 Scene 1: Verona, A public place", - "Act 1 Scene 2: Capulet's mansion", - "Act 1 Scene 3: A room in Capulet's mansion", - "Act 1 Scene 4: A street outside Capulet's mansion", - "Act 1 Scene 5: The Great Hall in Capulet's mansion", - "Act 2 Scene 1: Outside Capulet's mansion", - "Act 2 Scene 2: Capulet's orchard", - "Act 2 Scene 3: Outside Friar Lawrence's cell", - "Act 2 Scene 4: A street in Verona", - "Act 2 Scene 5: Capulet's mansion", - "Act 2 Scene 6: Friar Lawrence's cell" -] -``` - -您可以利用 `hasPrefix` 方法来计算话剧中第一幕的场景数: - -``` -var act1SceneCount = 0 -for scene in romeoAndJuliet { - if scene.hasPrefix("Act 1 ") { - ++act1SceneCount - } -} -println("There are \(act1SceneCount) scenes in Act 1") -// prints "There are 5 scenes in Act 1" -``` - -##### 大写和小写字符串 - -您可以通过字符串的 `uppercaseString` 和 `lowercaseString` 属性来访问大写/小写版本的字符串。 - -``` -let normal = "Could you help me, please?" -let shouty = normal.uppercaseString -// shouty 值为 "COULD YOU HELP ME, PLEASE?" -let whispered = normal.lowercaseString -// whispered 值为 "could you help me, please?" -``` - ---- - -### Unicode - -Unicode 是一个国际标准,用于文本的编码和表示。 -它使您可以用标准格式表示来自任意语言几乎所有的字符,并能够对文本文件或网页这样的外部资源中的字符进行读写操作。 - -Swift 的字符串和字符类型是完全兼容 Unicode 标准的,它支持如下所述的一系列不同的 Unicode 编码。 - -###### Unicode 术语(Terminology) - -Unicode 中每一个字符都可以被解释为一个或多个 unicode 标量。 -字符的 unicode 标量是一个唯一的21位数字(和名称),例如 `U+0061` 表示小写的拉丁字母A ("a"),`U+1F425` 表示小幺鸡表情 ("🐥") - -当 Unicode 字符串被写进文本文件或其他存储结构当中,这些 unicode 标量将会按照 Unicode 定义的集中格式之一进行编码。其包括 `UTF-8` (以8位代码单元进行编码) 和 `UTF-16` (以16位代码单元进行编码)。 - -##### 字符串的 Unicode 表示 - -Swift 提供了几种不同的方式来访问字符串的 Unicode 表示。 - -您可以利用 `for-in` 来对字符串进行遍历,从而以 Unicode 字符的方式访问每一个字符值。 -该过程在 [Working with Characters](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html#//apple_ref/doc/uid/TP40014097-CH7-XID_376) 中进行了描述。 - -另外,能够以其他三种 Unicode 兼容的方式访问字符串的值: - -* UTF-8 代码单元集合 (利用字符串的 `utf8` 属性进行访问) -* UTF-16 代码单元集合 (利用字符串的 `utf16` 属性进行访问) -* 21位的 Unicode 标量值集合 (利用字符串的 `unicodeScalars` 属性进行访问) - -下面由 `D` `o` `g` `!` 和 `🐶` (`DOG FACE`,Unicode 标量为 `U+1F436`)组成的字符串中的每一个字符代表着一种不同的表示: - -``` -let dogString = "Dog!🐶" -``` - -##### UTF-8 - -您可以通过遍历字符串的 `utf8` 属性来访问它的 `UTF-8` 表示。 -其为 **UTF8View** 类型的属性,**UTF8View** 是无符号8位 (`UInt8`) 值的集合,每一个 `UInt8` 值都是一个字符的 UTF-8 表示: - -``` -for codeUnit in dogString.utf8 { - print("\(codeUnit) ") -} -print("\n") -// 68 111 103 33 240 159 144 182 -``` - -上面的例子中,前四个10进制代码单元值 (68, 111, 103, 33) 代表了字符 `D` `o` `g` 和 `!` ,他们的 UTF-8 表示与 ASCII 表示相同。 -后四个代码单元值 (240, 159, 144, 182) 是 `DOG FACE` 的4位 UTF-8 表示。 - -##### UTF-16 - -您可以通过遍历字符串的 `utf16` 属性来访问它的 `UTF-16` 表示。 -其为 **UTF16View** 类型的属性,**UTF16View** 是无符号16位 (`UInt16`) 值的集合,每一个 `UInt16` 都是一个字符的 UTF-16 表示: - -``` -for codeUnit in dogString.utf16 { - print("\(codeUnit) ") -} -print("\n") -// 68 111 103 33 55357 56374 -``` - -同样,前四个代码单元值 (68, 111, 103, 33) 代表了字符 `D` `o` `g` 和 `!` ,他们的 UTF-16 代码单元和 UTF-8 完全相同。 - -第五和第六个代码单元值 (55357 and 56374) 是 `DOG FACE` 字符的UTF-16 表示。 -第一个值为 `U+D83D` (十进制值为 55357),第二个值为 `U+DC36` (十进制值为 56374)。 - -##### Unicode 标量 (Scalars) - -您可以通过遍历字符串的 `unicodeScalars` 属性来访问它的 Unicode 标量表示。 -其为 **UnicodeScalarView** 类型的属性, **UnicodeScalarView** 是 `UnicodeScalar` 的集合。 -`UnicodeScalar` 是21位的 Unicode 代码点。 - -每一个 `UnicodeScalar` 拥有一个值属性,可以返回对应的21位数值,用 `UInt32` 来表示。 - -``` -for scalar in dogString.unicodeScalars { - print("\(scalar.value) ") -} -print("\n") -// 68 111 103 33 128054 -``` - -同样,前四个代码单元值 (68, 111, 103, 33) 代表了字符 `D` `o` `g` 和 `!` 。 -第五位数值,128054,是一个十六进制1F436的十进制表示。 -其等同于 `DOG FACE` 的Unicode 标量 U+1F436。 - -作为查询字符值属性的一种替代方法,每个 `UnicodeScalar` 值也可以用来构建一个新的字符串值,比如在字符串插值中使用: - -``` -for scalar in dogString.unicodeScalars { - println("\(scalar) ") -} -// D -// o -// g -// ! -// 🐶 -``` - - \ No newline at end of file +> 翻译:[wh1100717](https://github.com/wh1100717) +> 校对:[Hawstein](https://github.com/Hawstein) + +# 字符串和字符(Strings and Characters) +----------------- + +本页包含内容: + +- [字符串字面量](#string_literals) +- [初始化空字符串](#initializing_an_empty_string) +- [字符串可变性](#string_mutability) +- [字符串是值类型](#strings_are_value_types) +- [使用字符](#working_with_characters) +- [计算字符数量](#counting_characters) +- [连接字符串和字符](#concatenating_strings_and_characters) +- [字符串插值](#string_interpolation) +- [比较字符串](#comparing_strings) +- [字符串大小写](#uppercase_and_lowercase_strings) +- [Unicode](#unicode) + +`String`是例如“hello, world”,“海贼王” 这样的有序的`Character`(字符)类型的值的集合,通过`String`类型来表示。 + +Swift 的`String`和`Character`类型提供了一个快速的,兼容 Unicode 的方式来处理代码中的文本信息。 +创建和操作字符串的语法与 C 语言中字符串操作相似,轻量并且易读。 +字符串连接操作只需要简单地通过`+`号将两个字符串相连即可。 +与 Swift 中其他值一样,能否更改字符串的值,取决于其被定义为常量还是变量。 + +尽管语法简易,但`String`类型是一种快速、现代化的字符串实现。 +每一个字符串都是由独立编码的 Unicode 字符组成,并提供了以不同 Unicode 表示(representations)来访问这些字符的支持。 + +Swift 可以在常量、变量、字面量和表达式中进行字符串插值操作,可以轻松创建用于展示、存储和打印的自定义字符串。 + +> 注意: +Swift 的`String`类型与 Foundation `NSString`类进行了无缝桥接。如果您利用 Cocoa 或 Cocoa Touch 中的 Foundation 框架进行工作。所有`NSString` API 都可以调用您创建的任意`String`类型的值。除此之外,还可以使用本章介绍的`String`特性。您也可以在任意要求传入`NSString`实例作为参数的 API 中使用`String`类型的值作为替代。 +>更多关于在 Foundation 和 Cocoa 中使用`String`的信息请查看 [Using Swift with Cocoa and Objective-C](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/index.html#//apple_ref/doc/uid/TP40014216)。 + + +## 字符串字面量(String Literals) + +您可以在您的代码中包含一段预定义的字符串值作为字符串字面量。 +字符串字面量是由双引号 ("") 包裹着的具有固定顺序的文本字符集。 + +字符串字面量可以用于为常量和变量提供初始值。 + +```swift +let someString = "Some string literal value" +``` + +> 注意: +`someString`变量通过字符串字面量进行初始化,Swift 因此推断该变量为`String`类型。 + +字符串字面量可以包含以下特殊字符: + +* 转义字符`\0`(空字符)、`\\`(反斜线)、`\t`(水平制表符)、`\n`(换行符)、`\r`(回车符)、`\"`(双引号)、`\'`(单引号)。 +* 单字节 Unicode 标量,写成`\xnn`,其中`nn`为两位十六进制数。 +* 双字节 Unicode 标量,写成`\unnnn`,其中`nnnn`为四位十六进制数。 +* 四字节 Unicode 标量,写成`\Unnnnnnnn`,其中`nnnnnnnn`为八位十六进制数。 + +下面的代码为各种特殊字符的使用示例。 +`wiseWords`常量包含了两个转移特殊字符 (双括号); +`dollarSign`、`blackHeart`和`sparklingHeart`常量演示了三种不同格式的 Unicode 标量: + +```swift +let wiseWords = "\"我是要成为海贼王的男人\" - 路飞" +// "我是要成为海贼王的男人" - 路飞 +let dollarSign = "\x24" // $, Unicode 标量 U+0024 +let blackHeart = "\u2665" // ♥, Unicode 标量 U+2665 +let sparklingHeart = "\U0001F496" // 💖, Unicode 标量 U+1F496 +``` + + +## 初始化空字符串 (Initializing an Empty String) + +为了构造一个很长的字符串,可以创建一个空字符串作为初始值。 +可以将空的字符串字面量赋值给变量,也可以初始化一个新的`String`实例: + +```swift +var emptyString = "" // 空字符串字面量 +var anotherEmptyString = String() // 初始化 String 实例 +// 两个字符串均为空并等价。 +``` + +您可以通过检查其`Boolean`类型的`isEmpty`属性来判断该字符串是否为空: + +```swift +if emptyString.isEmpty { + println("什么都没有") +} +// 打印输出:"什么都没有" +``` + + +## 字符串可变性 (String Mutability) + +您可以通过将一个特定字符串分配给一个变量来对其进行修改,或者分配给一个常量来保证其不会被修改: + +```swift +var variableString = "Horse" +variableString += " and carriage" +// variableString 现在为 "Horse and carriage" +let constantString = "Highlander" +constantString += " and another Highlander" +// 这会报告一个编译错误 (compile-time error) - 常量不可以被修改。 +``` + +> 注意: +在 Objective-C 和 Cocoa 中,您通过选择两个不同的类(`NSString`和`NSMutableString`)来指定该字符串是否可以被修改,Swift 中的字符串是否可以修改仅通过定义的是变量还是常量来决定,实现了多种类型可变性操作的统一。 + + +## 字符串是值类型(Strings Are Value Types) + +Swift 的`String`类型是值类型。 +如果您创建了一个新的字符串,那么当其进行常量、变量赋值操作或在函数/方法中传递时,会进行值拷贝。 +任何情况下,都会对已有字符串值创建新副本,并对该新副本进行传递或赋值操作。 +值类型在 [结构体和枚举是值类型](09_Classes_and_Structures.html#structures_and_enumerations_are_value_types) 中进行了说明。 + +> 注意: +与 Cocoa 中的`NSString`不同,当您在 Cocoa 中创建了一个`NSString`实例,并将其传递给一个函数/方法,或者赋值给一个变量,您传递或赋值的是该`NSString`实例的一个引用,除非您特别要求进行值拷贝,否则字符串不会生成新的副本来进行赋值操作。 + +Swift 默认字符串拷贝的方式保证了在函数/方法中传递的是字符串的值。 +很明显无论该值来自于哪里,都是您独自拥有的。 +您可以放心您传递的字符串本身不会被更改。 + +在实际编译时,Swift 编译器会优化字符串的使用,使实际的复制只发生在绝对必要的情况下,这意味着您将字符串作为值类型的同时可以获得极高的性能。 + + +## 使用字符(Working with Characters) + +Swift 的`String`类型表示特定序列的`Character`(字符) 类型值的集合。 +每一个字符值代表一个 Unicode 字符。 +您可利用`for-in`循环来遍历字符串中的每一个字符: + +```swift +for character in "Dog!🐶" { + println(character) +} +// D +// o +// g +// ! +// 🐶 +``` + +for-in 循环在 [For Loops](05_Control_Flow.html#for_loops) 中进行了详细描述。 + +另外,通过标明一个`Character`类型注解并通过字符字面量进行赋值,可以建立一个独立的字符常量或变量: + +```swift +let yenSign: Character = "¥" +``` + + +## 计算字符数量 (Counting Characters) + +通过调用全局`countElements`函数,并将字符串作为参数进行传递,可以获取该字符串的字符数量。 + +```swift +let unusualMenagerie = "Koala 🐨, Snail 🐌, Penguin 🐧, Dromedary 🐪" +println("unusualMenagerie has \(countElements(unusualMenagerie)) characters") +// 打印输出:"unusualMenagerie has 40 characters" +``` + +> 注意: +不同的 Unicode 字符以及相同 Unicode 字符的不同表示方式可能需要不同数量的内存空间来存储。所以 Swift 中的字符在一个字符串中并不一定占用相同的内存空间。因此字符串的长度不得不通过迭代字符串中每一个字符的长度来进行计算。如果您正在处理一个长字符串,需要注意`countElements`函数必须遍历字符串中的字符以精准计算字符串的长度。 +> 另外需要注意的是通过`countElements`返回的字符数量并不总是与包含相同字符的`NSString`的`length`属性相同。`NSString`的`length`属性是基于利用 UTF-16 表示的十六位代码单元数字,而不是基于 Unicode 字符。为了解决这个问题,`NSString`的`length`属性在被 Swift 的`String`访问时会成为`utf16count`。 + + +## 连接字符串和字符 (Concatenating Strings and Characters) + +字符串和字符的值可以通过加法运算符(`+`)相加在一起并创建一个新的字符串值: + +```swift +let string1 = "hello" +let string2 = " there" +let character1: Character = "!" +let character2: Character = "?" + +let stringPlusCharacter = string1 + character1 // 等于 "hello!" +let stringPlusString = string1 + string2 // 等于 "hello there" +let characterPlusString = character1 + string1 // 等于 "!hello" +let characterPlusCharacter = character1 + character2 // 等于 "!?" +``` + +您也可以通过加法赋值运算符 (`+=`) 将一个字符串或者字符添加到一个已经存在字符串变量上: + +```swift +var instruction = "look over" +instruction += string2 +// instruction 现在等于 "look over there" + +var welcome = "good morning" +welcome += character1 +// welcome 现在等于 "good morning!" +``` + +> 注意: +您不能将一个字符串或者字符添加到一个已经存在的字符变量上,因为字符变量只能包含一个字符。 + + +## 字符串插值 (String Interpolation) + +字符串插值是一种构建新字符串的方式,可以在其中包含常量、变量、字面量和表达式。 +您插入的字符串字面量的每一项都被包裹在以反斜线为前缀的圆括号中: + +```swift +let multiplier = 3 +let message = "\(multiplier) 乘以 2.5 是 \(Double(multiplier) * 2.5)" +// message 是 "3 乘以 2.5 是 7.5" +``` + +在上面的例子中,`multiplier`作为`\(multiplier)`被插入到一个字符串字面量中。 +当创建字符串执行插值计算时此占位符会被替换为`multiplier`实际的值。 + +`multiplier`的值也作为字符串中后面表达式的一部分。 +该表达式计算`Double(multiplier) * 2.5`的值并将结果 (7.5) 插入到字符串中。 +在这个例子中,表达式写为`\(Double(multiplier) * 2.5)`并包含在字符串字面量中。 + +> 注意: +插值字符串中写在括号中的表达式不能包含非转义双引号 (`"`) 和反斜杠 (`\`),并且不能包含回车或换行符。 + + +## 比较字符串 (Comparing Strings) + +Swift 提供了三种方式来比较字符串的值:字符串相等、前缀相等和后缀相等。 + + +### 字符串相等 (String Equality) + +如果两个字符串以同一顺序包含完全相同的字符,则认为两者字符串相等: + +```swift +let quotation = "我们是一样一样滴." +let sameQuotation = "我们是一样一样滴." +if quotation == sameQuotation { + println("这两个字符串被认为是相同的") +} +// 打印输出:"这两个字符串被认为是相同的" +``` + + +### 前缀/后缀相等 (Prefix and Suffix Equality) + +通过调用字符串的`hasPrefix`/`hasSuffix`方法来检查字符串是否拥有特定前缀/后缀。 +两个方法均需要以字符串作为参数传入并传出`Boolean`值。 +两个方法均执行基本字符串和前缀/后缀字符串之间逐个字符的比较操作。 + +下面的例子以一个字符串数组表示莎士比亚话剧《罗密欧与朱丽叶》中前两场的场景位置: + +```swift +let romeoAndJuliet = [ + "Act 1 Scene 1: Verona, A public place", + "Act 1 Scene 2: Capulet's mansion", + "Act 1 Scene 3: A room in Capulet's mansion", + "Act 1 Scene 4: A street outside Capulet's mansion", + "Act 1 Scene 5: The Great Hall in Capulet's mansion", + "Act 2 Scene 1: Outside Capulet's mansion", + "Act 2 Scene 2: Capulet's orchard", + "Act 2 Scene 3: Outside Friar Lawrence's cell", + "Act 2 Scene 4: A street in Verona", + "Act 2 Scene 5: Capulet's mansion", + "Act 2 Scene 6: Friar Lawrence's cell" +] +``` + +您可以利用`hasPrefix`方法来计算话剧中第一幕的场景数: + +```swift +var act1SceneCount = 0 +for scene in romeoAndJuliet { + if scene.hasPrefix("Act 1 ") { + ++act1SceneCount + } +} +println("There are \(act1SceneCount) scenes in Act 1") +// 打印输出:"There are 5 scenes in Act 1" +``` + +相似地,您可以用`hasSuffix`方法来计算发生在不同地方的场景数: + +```swift +var mansionCount = 0 +var cellCount = 0 +for scene in romeoAndJuliet { + if scene.hasSuffix("Capulet's mansion") { + ++mansionCount + } else if scene.hasSuffix("Friar Lawrence's cell") { + ++cellCount + } +} +println("\(mansionCount) mansion scenes; \(cellCount) cell scenes") +// 打印输出:"6 mansion scenes; 2 cell scenes” +``` + + +### 大写和小写字符串(Uppercase and Lowercase Strings) + +您可以通过字符串的`uppercaseString`和`lowercaseString`属性来访问大写/小写版本的字符串。 + +```swift +let normal = "Could you help me, please?" +let shouty = normal.uppercaseString +// shouty 值为 "COULD YOU HELP ME, PLEASE?" +let whispered = normal.lowercaseString +// whispered 值为 "could you help me, please?" +``` + + +## Unicode + +Unicode 是一个国际标准,用于文本的编码和表示。 +它使您可以用标准格式表示来自任意语言几乎所有的字符,并能够对文本文件或网页这样的外部资源中的字符进行读写操作。 + +Swift 的字符串和字符类型是完全兼容 Unicode 标准的,它支持如下所述的一系列不同的 Unicode 编码。 + + +### Unicode 术语(Unicode Terminology) + +Unicode 中每一个字符都可以被解释为一个或多个 unicode 标量。 +字符的 unicode 标量是一个唯一的21位数字(和名称),例如`U+0061`表示小写的拉丁字母A ("a"),`U+1F425`表示小鸡表情 ("🐥") + +当 Unicode 字符串被写进文本文件或其他存储结构当中,这些 unicode 标量将会按照 Unicode 定义的集中格式之一进行编码。其包括`UTF-8`(以8位代码单元进行编码) 和`UTF-16`(以16位代码单元进行编码)。 + + +### 字符串的 Unicode 表示(Unicode Representations of Strings) + +Swift 提供了几种不同的方式来访问字符串的 Unicode 表示。 + +您可以利用`for-in`来对字符串进行遍历,从而以 Unicode 字符的方式访问每一个字符值。 +该过程在 [使用字符](#working_with_characters) 中进行了描述。 + +另外,能够以其他三种 Unicode 兼容的方式访问字符串的值: + +* UTF-8 代码单元集合 (利用字符串的`utf8`属性进行访问) +* UTF-16 代码单元集合 (利用字符串的`utf16`属性进行访问) +* 21位的 Unicode 标量值集合 (利用字符串的`unicodeScalars`属性进行访问) + +下面由`D``o``g``!`和`🐶`(`DOG FACE`,Unicode 标量为`U+1F436`)组成的字符串中的每一个字符代表着一种不同的表示: + +```swift +let dogString = "Dog!🐶" +``` + + +### UTF-8 + +您可以通过遍历字符串的`utf8`属性来访问它的`UTF-8`表示。 +其为`UTF8View`类型的属性,`UTF8View`是无符号8位 (`UInt8`) 值的集合,每一个`UInt8`值都是一个字符的 UTF-8 表示: + +```swift +for codeUnit in dogString.utf8 { + print("\(codeUnit) ") +} +print("\n") +// 68 111 103 33 240 159 144 182 +``` + +上面的例子中,前四个10进制代码单元值 (68, 111, 103, 33) 代表了字符`D` `o` `g`和`!`,它们的 UTF-8 表示与 ASCII 表示相同。 +后四个代码单元值 (240, 159, 144, 182) 是`DOG FACE`的4字节 UTF-8 表示。 + + +### UTF-16 + +您可以通过遍历字符串的`utf16`属性来访问它的`UTF-16`表示。 +其为`UTF16View`类型的属性,`UTF16View`是无符号16位 (`UInt16`) 值的集合,每一个`UInt16`都是一个字符的 UTF-16 表示: + +```swift +for codeUnit in dogString.utf16 { + print("\(codeUnit) ") +} +print("\n") +// 68 111 103 33 55357 56374 +``` + +同样,前四个代码单元值 (68, 111, 103, 33) 代表了字符`D` `o` `g`和`!`,它们的 UTF-16 代码单元和 UTF-8 完全相同。 + +第五和第六个代码单元值 (55357 和 56374) 是`DOG FACE`字符的UTF-16 表示。 +第一个值为`U+D83D`(十进制值为 55357),第二个值为`U+DC36`(十进制值为 56374)。 + + +### Unicode 标量 (Unicode Scalars) + +您可以通过遍历字符串的`unicodeScalars`属性来访问它的 Unicode 标量表示。 +其为`UnicodeScalarView`类型的属性, `UnicodeScalarView`是`UnicodeScalar`的集合。 +`UnicodeScalar`是21位的 Unicode 代码点。 + +每一个`UnicodeScalar`拥有一个值属性,可以返回对应的21位数值,用`UInt32`来表示。 + +```swift +for scalar in dogString.unicodeScalars { + print("\(scalar.value) ") +} +print("\n") +// 68 111 103 33 128054 +``` + +同样,前四个代码单元值 (68, 111, 103, 33) 代表了字符`D` `o` `g`和`!`。 +第五位数值,128054,是一个十六进制1F436的十进制表示。 +其等同于`DOG FACE`的Unicode 标量 U+1F436。 + +作为查询字符值属性的一种替代方法,每个`UnicodeScalar`值也可以用来构建一个新的字符串值,比如在字符串插值中使用: + +```swift +for scalar in dogString.unicodeScalars { + println("\(scalar) ") +} +// D +// o +// g +// ! +// 🐶 +``` diff --git a/source/chapter2/04_Collection_Types.md b/source/chapter2/04_Collection_Types.md old mode 100644 new mode 100755 index c25bf7b0..83eaec15 --- a/source/chapter2/04_Collection_Types.md +++ b/source/chapter2/04_Collection_Types.md @@ -1 +1,428 @@ -# 集合类型 (Collection Types) \ No newline at end of file +> 翻译:[zqp](https://github.com/zqp) +> 校对:[shinyzhu](https://github.com/shinyzhu), [stanzhai](https://github.com/stanzhai) + +# 集合类型 (Collection Types) +----------------- + +本页包含内容: + +- [数组(Arrays)](#arrays) +- [字典(Dictionaries)](#dictionaries) +- [集合的可变性(Mutability of Collections)](#mutability_of_collections) + +Swift 语言提供经典的数组和字典两种集合类型来存储集合数据。数组用来按顺序存储相同类型的数据。字典虽然无序存储相同类型数据值但是需要由独有的标识符引用和寻址(就是键值对)。 + +Swift 语言里的数组和字典中存储的数据值类型必须明确。 这意味着我们不能把不正确的数据类型插入其中。 同时这也说明我们完全可以对获取出的值类型非常自信。 Swift 对显式类型集合的使用确保了我们的代码对工作所需要的类型非常清楚,也让我们在开发中可以早早地找到任何的类型不匹配错误。 + +> 注意: +Swift 的数组结构在被声明成常量和变量或者被传入函数与方法中时会相对于其他类型展现出不同的特性。 获取更多信息请参见[集合的可变性](#mutability_of_collections)与[集合在赋值和复制中的行为](09_Classes_and_Structures.html#assignment_and_copy_behavior_for_collection_types)章节。 + + +## 数组 + +数组使用有序列表存储同一类型的多个值。相同的值可以多次出现在一个数组的不同位置中。 + +Swift 数组特定于它所存储元素的类型。这与 Objective-C 的 NSArray 和 NSMutableArray 不同,这两个类可以存储任意类型的对象,并且不提供所返回对象的任何特别信息。在 Swift 中,数据值在被存储进入某个数组之前类型必须明确,方法是通过显式的类型标注或类型推断,而且不是必须是`class`类型。例如: 如果我们创建了一个`Int`值类型的数组,我们不能往其中插入任何不是`Int`类型的数据。 Swift 中的数组是类型安全的,并且它们中包含的类型必须明确。 + + +### 数组的简单语法 + +写 Swift 数组应该遵循像`Array`这样的形式,其中`SomeType`是这个数组中唯一允许存在的数据类型。 我们也可以使用像`SomeType[]`这样的简单语法。 尽管两种形式在功能上是一样的,但是推荐较短的那种,而且在本文中都会使用这种形式来使用数组。 + + +### 数组构造语句 + +我们可以使用字面量来进行数组构造,这是一种用一个或者多个数值构造数组的简单方法。字面量是一系列由逗号分割并由方括号包含的数值。 +`[value 1, value 2, value 3]`。 + +下面这个例子创建了一个叫做`shoppingList`并且存储字符串的数组: + +```swift +var shoppingList: String[] = ["Eggs", "Milk"] +// shoppingList 已经被构造并且拥有两个初始项。 +``` + +`shoppingList`变量被声明为“字符串值类型的数组“,记作`String[]`。 因为这个数组被规定只有`String`一种数据结构,所以只有`String`类型可以在其中被存取。 在这里,`shoppinglist`数组由两个`String`值(`"Eggs"` 和`"Milk"`)构造,并且由字面量定义。 + +> 注意: +> `Shoppinglist`数组被声明为变量(`var`关键字创建)而不是常量(`let`创建)是因为以后可能会有更多的数据项被插入其中。 + +在这个例子中,字面量仅仅包含两个`String`值。匹配了该数组的变量声明(只能包含`String`的数组),所以这个字面量的分配过程就是允许用两个初始项来构造`shoppinglist`。 + +由于 Swift 的类型推断机制,当我们用字面量构造只拥有相同类型值数组的时候,我们不必把数组的类型定义清楚。 `shoppinglist`的构造也可以这样写: + +```swift +var shoppingList = ["Eggs", "Milk"] +``` + +因为所有字面量中的值都是相同的类型,Swift 可以推断出`String[]`是`shoppinglist`中变量的正确类型。 + + +### 访问和修改数组 + +我们可以通过数组的方法和属性来访问和修改数组,或者下标语法。 +还可以使用数组的只读属性`count`来获取数组中的数据项数量。 + +```swift +println("The shopping list contains \(shoppingList.count) items.") +// 输出"The shopping list contains 2 items."(这个数组有2个项) +``` + +使用布尔项`isEmpty`来作为检查`count`属性的值是否为 0 的捷径。 + +```swift +if shoppingList.isEmpty { + println("The shopping list is empty.") +} else { + println("The shopping list is not empty.") +} +// 打印 "The shopping list is not empty."(shoppinglist不是空的) +``` + +也可以使用`append`方法在数组后面添加新的数据项: + +```swift +shoppingList.append("Flour") +// shoppingList 现在有3个数据项,有人在摊煎饼 +``` + +除此之外,使用加法赋值运算符(`+=`)也可以直接在数组后面添加数据项: + +```swift +shoppingList += "Baking Powder" +// shoppingList 现在有四项了 +``` + +我们也可以使用加法赋值运算符(`+=`)直接添加拥有相同类型数据的数组。 + +```swift +shoppingList += ["Chocolate Spread", "Cheese", "Butter"] +// shoppingList 现在有7项了 +``` + +可以直接使用下标语法来获取数组中的数据项,把我们需要的数据项的索引值放在直接放在数组名称的方括号中: + +```swift +var firstItem = shoppingList[0] +// 第一项是 "Eggs" +``` + +注意第一项在数组中的索引值是`0`而不是`1`。 Swift 中的数组索引总是从零开始。 + +我们也可以用下标来改变某个已有索引值对应的数据值: + +```swift +shoppingList[0] = "Six eggs" +// 其中的第一项现在是 "Six eggs" 而不是 "Eggs" +``` + +还可以利用下标来一次改变一系列数据值,即使新数据和原有数据的数量是不一样的。下面的例子把`"Chocolate Spread"`,`"Cheese"`,和`"Butter"`替换为`"Bananas"`和 `"Apples"`: + +```swift +shoppingList[4...6] = ["Bananas", "Apples"] +// shoppingList 现在有六项 +``` + +> 注意: +>我们不能使用下标语法在数组尾部添加新项。如果我们试着用这种方法对索引越界的数据进行检索或者设置新值的操作,我们会引发一个运行期错误。我们可以使用索引值和数组的`count`属性进行比较来在使用某个索引之前先检验是否有效。除了当`count`等于 0 时(说明这是个空数组),最大索引值一直是`count - 1`,因为数组都是零起索引。 + +调用数组的`insert(atIndex:)`方法来在某个具体索引值之前添加数据项: + +```swift +shoppingList.insert("Maple Syrup", atIndex: 0) +// shoppingList 现在有7项 +// "Maple Syrup" 现在是这个列表中的第一项 +``` + +这次`insert`函数调用把值为`"Maple Syrup"`的新数据项插入列表的最开始位置,并且使用`0`作为索引值。 + +类似的我们可以使用`removeAtIndex`方法来移除数组中的某一项。这个方法把数组在特定索引值中存储的数据项移除并且返回这个被移除的数据项(我们不需要的时候就可以无视它): + +```swift +let mapleSyrup = shoppingList.removeAtIndex(0) +// 索引值为0的数据项被移除 +// shoppingList 现在只有6项,而且不包括Maple Syrup +// mapleSyrup常量的值等于被移除数据项的值 "Maple Syrup" +``` + +数据项被移除后数组中的空出项会被自动填补,所以现在索引值为`0`的数据项的值再次等于`"Six eggs"`: + +```swift +firstItem = shoppingList[0] +// firstItem 现在等于 "Six eggs" +``` + +如果我们只想把数组中的最后一项移除,可以使用`removeLast`方法而不是`removeAtIndex`方法来避免我们需要获取数组的`count`属性。就像后者一样,前者也会返回被移除的数据项: + +```swift +let apples = shoppingList.removeLast() +// 数组的最后一项被移除了 +// shoppingList现在只有5项,不包括cheese +// apples 常量的值现在等于"Apples" 字符串 +``` + + +### 数组的遍历 + +我们可以使用`for-in`循环来遍历所有数组中的数据项: + +```swift +for item in shoppingList { + println(item) +} +// Six eggs +// Milk +// Flour +// Baking Powder +// Bananas +``` + +如果我们同时需要每个数据项的值和索引值,可以使用全局`enumerate`函数来进行数组遍历。`enumerate`返回一个由每一个数据项索引值和数据值组成的元组。我们可以把这个元组分解成临时常量或者变量来进行遍历: + +```swift +for (index, value) in enumerate(shoppingList) { + println("Item \(index + 1): \(value)") +} +// Item 1: Six eggs +// Item 2: Milk +// Item 3: Flour +// Item 4: Baking Powder +// Item 5: Bananas +``` + +更多关于`for-in`循环的介绍请参见[for 循环](05_Control_Flow.html#for_loops)。 + + +### 创建并且构造一个数组 + +我们可以使用构造语法来创建一个由特定数据类型构成的空数组: + +```swift +var someInts = Int[]() +println("someInts is of type Int[] with \(someInts.count) items。") +// 打印 "someInts is of type Int[] with 0 items。"(someInts是0数据项的Int[]数组) +``` + +注意`someInts`被设置为一个`Int[]`构造函数的输出所以它的变量类型被定义为`Int[]`。 + +除此之外,如果代码上下文中提供了类型信息, 例如一个函数参数或者一个已经定义好类型的常量或者变量,我们可以使用空数组语句创建一个空数组,它的写法很简单:`[]`(一对空方括号): + +```swift +someInts.append(3) +// someInts 现在包含一个INT值 +someInts = [] +// someInts 现在是空数组,但是仍然是Int[]类型的。 +``` + +Swift 中的`Array`类型还提供一个可以创建特定大小并且所有数据都被默认的构造方法。我们可以把准备加入新数组的数据项数量(`count`)和适当类型的初始值(`repeatedValue`)传入数组构造函数: + +```swift +var threeDoubles = Double[](count: 3, repeatedValue:0.0) +// threeDoubles 是一种 Double[]数组, 等于 [0.0, 0.0, 0.0] +``` + +因为类型推断的存在,我们使用这种构造方法的时候不需要特别指定数组中存储的数据类型,因为类型可以从默认值推断出来: + +```swift +var anotherThreeDoubles = Array(count: 3, repeatedValue: 2.5) +// anotherThreeDoubles is inferred as Double[], and equals [2.5, 2.5, 2.5] +``` + +最后,我们可以使用加法操作符(`+`)来组合两种已存在的相同类型数组。新数组的数据类型会被从两个数组的数据类型中推断出来: + +```swift +var sixDoubles = threeDoubles + anotherThreeDoubles +// sixDoubles 被推断为 Double[], 等于 [0.0, 0.0, 0.0, 2.5, 2.5, 2.5] +``` + + +## 字典 + +字典是一种存储多个相同类型的值的容器。每个值(value)都关联唯一的键(key),键作为字典中的这个值数据的标识符。和数组中的数据项不同,字典中的数据项并没有具体顺序。我们在需要通过标识符(键)访问数据的时候使用字典,这种方法很大程度上和我们在现实世界中使用字典查字义的方法一样。 + +Swift 的字典使用时需要具体规定可以存储键和值类型。不同于 Objective-C 的`NSDictionary`和`NSMutableDictionary` 类可以使用任何类型的对象来作键和值并且不提供任何关于这些对象的本质信息。在 Swift 中,在某个特定字典中可以存储的键和值必须提前定义清楚,方法是通过显性类型标注或者类型推断。 + +Swift 的字典使用`Dictionary`定义,其中`KeyType`是字典中键的数据类型,`ValueType`是字典中对应于这些键所存储值的数据类型。 + +`KeyType`的唯一限制就是可哈希的,这样可以保证它是独一无二的,所有的 Swift 基本类型(例如`String`,`Int`, `Double`和`Bool`)都是默认可哈希的,并且所有这些类型都可以在字典中当做键使用。未关联值的枚举成员(参见[枚举](08_Enumerations.html))也是默认可哈希的。 + + +## 字典字面量 + +我们可以使用字典字面量来构造字典,它们和我们刚才介绍过的数组字面量拥有相似语法。一个字典字面量是一个定义拥有一个或者多个键值对的字典集合的简单语句。 + +一个键值对是一个`key`和一个`value`的结合体。在字典字面量中,每一个键值对的键和值都由冒号分割。这些键值对构成一个列表,其中这些键值对由方括号包含并且由逗号分割: + +```swift +[key 1: value 1, key 2: value 2, key 3: value 3] +``` + +下面的例子创建了一个存储国际机场名称的字典。在这个字典中键是三个字母的国际航空运输相关代码,值是机场名称: + +```swift +var airports: Dictionary = ["TYO": "Tokyo", "DUB": "Dublin"] +``` + +`airports`字典被定义为一种`Dictionary`,它意味着这个字典的键和值都是`String`类型。 + +> 注意: +> `airports`字典被声明为变量(用`var`关键字)而不是常量(`let`关键字)因为后来更多的机场信息会被添加到这个示例字典中。 + +`airports`字典使用字典字面量初始化,包含两个键值对。第一对的键是`TYO`,值是`Tokyo`。第二对的键是`DUB`,值是`Dublin`。 + +这个字典语句包含了两个`String: String`类型的键值对。它们对应`airports`变量声明的类型(一个只有`String`键和`String`值的字典)所以这个字典字面量是构造两个初始数据项的`airport`字典。 + +和数组一样,如果我们使用字面量构造字典就不用把类型定义清楚。`airports`的也可以用这种方法简短定义: + +```swift +var airports = ["TYO": "Tokyo", "DUB": "Dublin"] +``` + +因为这个语句中所有的键和值都分别是相同的数据类型,Swift 可以推断出`Dictionary`是`airports`字典的正确类型。 + + +### 读取和修改字典 + +我们可以通过字典的方法和属性来读取和修改字典,或者使用下标语法。和数组一样,我们可以通过字典的只读属性`count`来获取某个字典的数据项数量: + +```swift +println("The dictionary of airports contains \(airports.count) items.") +// 打印 "The dictionary of airports contains 2 items."(这个字典有两个数据项) +``` + +我们也可以在字典中使用下标语法来添加新的数据项。可以使用一个合适类型的 key 作为下标索引,并且分配新的合适类型的值: + +```swift +airports["LHR"] = "London" +// airports 字典现在有三个数据项 +``` + +我们也可以使用下标语法来改变特定键对应的值: + +```swift +airports["LHR"] = "London Heathrow" +// "LHR"对应的值 被改为 "London Heathrow +``` + +作为另一种下标方法,字典的`updateValue(forKey:)`方法可以设置或者更新特定键对应的值。就像上面所示的示例,`updateValue(forKey:)`方法在这个键不存在对应值的时候设置值或者在存在时更新已存在的值。和上面的下标方法不一样,这个方法返回更新值之前的原值。这样方便我们检查更新是否成功。 + +`updateValue(forKey:)`函数会返回包含一个字典值类型的可选值。举例来说:对于存储`String`值的字典,这个函数会返回一个`String?`或者“可选 `String`”类型的值。如果值存在,则这个可选值值等于被替换的值,否则将会是`nil`。 + +```swift +if let oldValue = airports.updateValue("Dublin Internation", forKey: "DUB") { + println("The old value for DUB was \(oldValue).") +} +// 输出 "The old value for DUB was Dublin."(DUB原值是dublin) +``` + +我们也可以使用下标语法来在字典中检索特定键对应的值。由于使用一个没有值的键这种情况是有可能发生的,可选类型返回这个键存在的相关值,否则就返回`nil`: + +```swift +if let airportName = airports["DUB"] { + println("The name of the airport is \(airportName).") +} else { + println("That airport is not in the airports dictionary.") +} +// 打印 "The name of the airport is Dublin Internation."(机场的名字是都柏林国际) +``` + +我们还可以使用下标语法来通过给某个键的对应值赋值为`nil`来从字典里移除一个键值对: + +```swift +airports["APL"] = "Apple Internation" +// "Apple Internation"不是真的 APL机场, 删除它 +airports["APL"] = nil +// APL现在被移除了 +``` + +另外,`removeValueForKey`方法也可以用来在字典中移除键值对。这个方法在键值对存在的情况下会移除该键值对并且返回被移除的value或者在没有值的情况下返回`nil`: + +```swift +if let removedValue = airports.removeValueForKey("DUB") { + println("The removed airport's name is \(removedValue).") +} else { + println("The airports dictionary does not contain a value for DUB.") +} +// prints "The removed airport's name is Dublin International." +``` + + +### 字典遍历 + +我们可以使用`for-in`循环来遍历某个字典中的键值对。每一个字典中的数据项都由`(key, value)`元组形式返回,并且我们可以使用临时常量或者变量来分解这些元组: + +```swift +for (airportCode, airportName) in airports { + println("\(airportCode): \(airportName)") +} +// TYO: Tokyo +// LHR: London Heathrow +``` + +`for-in`循环请参见[For 循环](05_Control_Flow.html#for_loops)。 + +我们也可以通过访问它的`keys`或者`values`属性(都是可遍历集合)检索一个字典的键或者值: + +```swift +for airportCode in airports.keys { + println("Airport code: \(airportCode)") +} +// Airport code: TYO +// Airport code: LHR + +for airportName in airports.values { + println("Airport name: \(airportName)") +} +// Airport name: Tokyo +// Airport name: London Heathrow +``` + +如果我们只是需要使用某个字典的键集合或者值集合来作为某个接受`Array`实例 API 的参数,可以直接使用`keys`或者`values`属性直接构造一个新数组: + +```swift +let airportCodes = Array(airports.keys) +// airportCodes is ["TYO", "LHR"] + +let airportNames = Array(airports.values) +// airportNames is ["Tokyo", "London Heathrow"] +``` + +> 注意: +> Swift 的字典类型是无序集合类型。其中字典键,值,键值对在遍历的时候会重新排列,而且其中顺序是不固定的。 + + +### 创建一个空字典 + +我们可以像数组一样使用构造语法创建一个空字典: + +```swift +var namesOfIntegers = Dictionary() +// namesOfIntegers 是一个空的 Dictionary +``` + +这个例子创建了一个`Int, String`类型的空字典来储存英语对整数的命名。它的键是`Int`型,值是`String`型。 + +如果上下文已经提供了信息类型,我们可以使用空字典字面量来创建一个空字典,记作`[:]`(中括号中放一个冒号): + +```swift +namesOfIntegers[16] = "sixteen" +// namesOfIntegers 现在包含一个键值对 +namesOfIntegers = [:] +// namesOfIntegers 又成为了一个 Int, String类型的空字典 +``` + +> 注意: +> 在后台,Swift 的数组和字典都是由泛型集合来实现的,想了解更多泛型和集合信息请参见[泛型](22_Generics.html)。 + + +## 集合的可变性 + +数组和字典都是在单个集合中存储可变值。如果我们创建一个数组或者字典并且把它分配成一个变量,这个集合将会是可变的。这意味着我们可以在创建之后添加更多或移除已存在的数据项来改变这个集合的大小。与此相反,如果我们把数组或字典分配成常量,那么它就是不可变的,它的大小不能被改变。 + +对字典来说,不可变性也意味着我们不能替换其中任何现有键所对应的值。不可变字典的内容在被首次设定之后不能更改。 +不可变性对数组来说有一点不同,当然我们不能试着改变任何不可变数组的大小,但是我们可以重新设定相对现存索引所对应的值。这使得 Swift 数组在大小被固定的时候依然可以做的很棒。 + +Swift 数组的可变性行为同时影响了数组实例如何被分配和修改,想获取更多信息,请参见[集合在赋值和复制中的行为](09_Classes_and_Structures.html#assignment_and_copy_behavior_for_collection_types)。 + +> 注意: +> 在我们不需要改变数组大小的时候创建不可变数组是很好的习惯。如此 Swift 编译器可以优化我们创建的集合。 \ No newline at end of file diff --git a/source/chapter2/05_Control_Flow.md b/source/chapter2/05_Control_Flow.md old mode 100644 new mode 100755 index 5ad51630..8ee3f8de --- a/source/chapter2/05_Control_Flow.md +++ b/source/chapter2/05_Control_Flow.md @@ -1,3 +1,726 @@ -# 控制流 - -Swift提供了类似C语言的流程控制结构,包括将任务执行多次的`for`和`while`循环,基于特定条件选择执行不同分支的`if`和`switch`语句,还有控制流程跳转到其他代码的`break`和`continue`语句。 \ No newline at end of file +> 翻译:[vclwei](https://github.com/vclwei), [coverxit](https://github.com/coverxit), [NicePiao](https://github.com/NicePiao) +> 校对:[coverxit](https://github.com/coverxit), [stanzhai](https://github.com/stanzhai) + +# 控制流 +----------------- + +本页包含内容: + +- [For 循环](#for_loops) +- [While 循环](#while_loops) +- [条件语句](#conditional_statement) +- [控制转移语句(Control Transfer Statements)](#control_transfer_statements) + +Swift提供了类似 C 语言的流程控制结构,包括可以多次执行任务的`for`和`while`循环,基于特定条件选择执行不同代码分支的`if`和`switch`语句,还有控制流程跳转到其他代码的`break`和`continue`语句。 + +除了 C 语言里面传统的 for 条件递增(`for-condition-increment`)循环,Swift 还增加了`for-in`循环,用来更简单地遍历数组(array),字典(dictionary),区间(range),字符串(string)和其他序列类型。 + +Swift 的`switch`语句比 C 语言中更加强大。在 C 语言中,如果某个 case 不小心漏写了`break`,这个 case 就会贯穿(fallthrough)至下一个 case,Swift 无需写`break`,所以不会发生这种贯穿(fallthrough)的情况。case 还可以匹配更多的类型模式,包括区间匹配(range matching),元组(tuple)和特定类型的描述。`switch`的 case 语句中匹配的值可以是由 case 体内部临时的常量或者变量决定,也可以由`where`分句描述更复杂的匹配条件。 + + +## For 循环 + +`for`循环用来按照指定的次数多次执行一系列语句。Swift 提供两种`for`循环形式: + +* `for-in`用来遍历一个区间(range),序列(sequence),集合(collection),系列(progression)里面所有的元素执行一系列语句。 +* for条件递增(`for-condition-increment`)语句,用来重复执行一系列语句直到达成特定条件达成,一般通过在每次循环完成后增加计数器的值来实现。 + + +### For-In + +你可以使用`for-in`循环来遍历一个集合里面的所有元素,例如由数字表示的区间、数组中的元素、字符串中的字符。 + +下面的例子用来输出乘 5 乘法表前面一部分内容: + +```swift +for index in 1...5 { + println("\(index) times 5 is \(index * 5)") +} +// 1 times 5 is 5 +// 2 times 5 is 10 +// 3 times 5 is 15 +// 4 times 5 is 20 +// 5 times 5 is 25 +``` + +例子中用来进行遍历的元素是一组使用闭区间操作符(`...`)表示的从`1`到`5`的数字。`index`被赋值为闭区间中的第一个数字(`1`),然后循环中的语句被执行一次。在本例中,这个循环只包含一个语句,用来输出当前`index`值所对应的乘 5 乘法表结果。该语句执行后,`index`的值被更新为闭区间中的第二个数字(`2`),之后`println`方法会再执行一次。整个过程会进行到闭区间结尾为止。 + +上面的例子中,`index`是一个每次循环遍历开始时被自动赋值的常量。这种情况下,`index`在使用前不需要声明,只需要将它包含在循环的声明中,就可以对其进行隐式声明,而无需使用`let`关键字声明。 + +>注意: +`index`常量只存在于循环的生命周期里。如果你想在循环完成后访问`index`的值,又或者想让`index`成为一个变量而不是常量,你必须在循环之前自己进行声明。 + +如果你不需要知道区间内每一项的值,你可以使用下划线(`_`)替代变量名来忽略对值的访问: + +```swift +let base = 3 +let power = 10 +var answer = 1 +for _ in 1...power { + answer *= base +} +println("\(base) to the power of \(power) is \(answer)") +// 输出 "3 to the power of 10 is 59049" +``` + +这个例子计算 base 这个数的 power 次幂(本例中,是`3`的`10`次幂),从`1`(`3`的`0`次幂)开始做`3`的乘法, 进行`10`次,使用`1`到`10`的闭区间循环。这个计算并不需要知道每一次循环中计数器具体的值,只需要执行了正确的循环次数即可。下划线符号`_`(替代循环中的变量)能够忽略具体的值,并且不提供循环遍历时对值的访问。 + +使用`for-in`遍历一个数组所有元素: + +```swift +let names = ["Anna", "Alex", "Brian", "Jack"] +for name in names { + println("Hello, \(name)!") +} +// Hello, Anna! +// Hello, Alex! +// Hello, Brian! +// Hello, Jack! +``` + +你也可以通过遍历一个字典来访问它的键值对(key-value pairs)。遍历字典时,字典的每项元素会以`(key, value)`元组的形式返回,你可以在`for-in`循环中使用显式的常量名称来解读`(key, value)`元组。下面的例子中,字典的键(key)解读为常量`animalName`,字典的值会被解读为常量`legCount`: + +```swift +let numberOfLegs = ["spider": 8, "ant": 6, "cat": 4] +for (animalName, legCount) in numberOfLegs { + println("\(animalName)s have \(legCount) legs") +} +// spiders have 8 legs +// ants have 6 legs +// cats have 4 legs +``` + +字典元素的遍历顺序和插入顺序可能不同,字典的内容在内部是无序的,所以遍历元素时不能保证顺序。关于数组和字典,详情参见[集合类型](../chapter2/04_Collection_Types.html)。 + +除了数组和字典,你也可以使用`for-in`循环来遍历字符串中的字符(`Character`): + +```swift +for character in "Hello" { + println(character) +} +// H +// e +// l +// l +// o +``` + + +### For条件递增(for-condition-increment) + +除了`for-in`循环,Swift 提供使用条件判断和递增方法的标准 C 样式`for`循环: + +```swift +for var index = 0; index < 3; ++index { + println("index is \(index)") +} +// index is 0 +// index is 1 +// index is 2 +``` + +下面是一般情况下这种循环方式的格式: + +> for `initialization`; `condition`; `increment` { +> `statements` +> } + +和 C 语言中一样,分号将循环的定义分为 3 个部分,不同的是,Swift 不需要使用圆括号将“initialization; condition; increment”包括起来。 + +这个循环执行流程如下: + +1. 循环首次启动时,初始化表达式(_initialization expression_)被调用一次,用来初始化循环所需的所有常量和变量。 +2. 条件表达式(_condition expression_)被调用,如果表达式调用结果为`false`,循环结束,继续执行`for`循环关闭大括号 +(`}`)之后的代码。如果表达式调用结果为`true`,则会执行大括号内部的代码(_statements_)。 +3. 执行所有语句(_statements_)之后,执行递增表达式(_increment expression_)。通常会增加或减少计数器的值,或者根据语句(_statements_)输出来修改某一个初始化的变量。当递增表达式运行完成后,重复执行第 2 步,条件表达式会再次执行。 + +上述描述和循环格式等同于: + +> `initialization` +> while `condition` { +> `statements` +> `increment` +> } + +在初始化表达式中声明的常量和变量(比如`var index = 0`)只在`for`循环的生命周期里有效。如果想在循环结束后访问`index`的值,你必须要在循环生命周期开始前声明`index`。 + +```swift +var index: Int +for index = 0; index < 3; ++index { + println("index is \(index)") +} +// index is 0 +// index is 1 +// index is 2 +println("The loop statements were executed \(index) times") +// 输出 "The loop statements were executed 3 times +``` + +注意`index`在循环结束后最终的值是`3`而不是`2`。最后一次调用递增表达式`++index`会将`index`设置为`3`,从而导致`index < 3`条件为`false`,并终止循环。 + + +## While 循环 + +`while`循环运行一系列语句直到条件变成`false`。这类循环适合使用在第一次迭代前迭代次数未知的情况下。Swift 提供两种`while`循环形式: + +* `while`循环,每次在循环开始时计算条件是否符合; +* `do-while`循环,每次在循环结束时计算条件是否符合。 + + +###While + +`while`循环从计算单一条件开始。如果条件为`true`,会重复运行一系列语句,直到条件变为`false`。 + +下面是一般情况下 `while` 循环格式: + +> while `condition` { +> `statements` +> } + +下面的例子来玩一个叫做_蛇和梯子(Snakes and Ladders)_的小游戏,也叫做_滑道和梯子(Chutes and Ladders)_: + +![image](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/snakesAndLadders_2x.png) + +游戏的规则如下: + +* 游戏盘面包括 25 个方格,游戏目标是达到或者超过第 25 个方格; +* 每一轮,你通过掷一个 6 边的骰子来确定你移动方块的步数,移动的路线由上图中横向的虚线所示; +* 如果在某轮结束,你移动到了梯子的底部,可以顺着梯子爬上去; +* 如果在某轮结束,你移动到了蛇的头部,你会顺着蛇的身体滑下去。 + +游戏盘面可以使用一个`Int`数组来表达。数组的长度由一个`finalSquare`常量储存,用来初始化数组和检测最终胜利条件。游戏盘面由 26 个 `Int` 0 值初始化,而不是 25 个(由`0`到`25`,一共 26 个): + +```swift +let finalSquare = 25 +var board = Int[](count: finalSquare + 1, repeatedValue: 0) +``` + +一些方块被设置成有蛇或者梯子的指定值。梯子底部的方块是一个正值,使你可以向上移动,蛇头处的方块是一个负值,会让你向下移动: + +```swift +board[03] = +08; board[06] = +11; board[09] = +09; board[10] = +02 +board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08 +``` + +3 号方块是梯子的底部,会让你向上移动到 11 号方格,我们使用`board[03]`等于`+08`(来表示`11`和`3`之间的差值)。使用一元加运算符(`+i`)是为了和一元减运算符(`-i`)对称,为了让盘面代码整齐,小于 10 的数字都使用 0 补齐(这些风格上的调整都不是必须的,只是为了让代码看起来更加整洁)。 + +玩家由左下角编号为 0 的方格开始游戏。一般来说玩家第一次掷骰子后才会进入游戏盘面: + +```swift +var square = 0 +var diceRoll = 0 +while square < finalSquare { + // 掷骰子 + if ++diceRoll == 7 { diceRoll = 1 } + // 根据点数移动 + square += diceRoll + if square < board.count { + // 如果玩家还在棋盘上,顺着梯子爬上去或者顺着蛇滑下去 + square += board[square] + } +} +println("Game over!") +``` + +本例中使用了最简单的方法来模拟掷骰子。 `diceRoll`的值并不是一个随机数,而是以`0`为初始值,之后每一次`while`循环,`diceRoll`的值使用前置自增操作符(`++i`)来自增 1 ,然后检测是否超出了最大值。`++diceRoll`调用完成_后_,返回值等于`diceRoll`自增后的值。任何时候如果`diceRoll`的值等于7时,就超过了骰子的最大值,会被重置为`1`。所以`diceRoll`的取值顺序会一直是`1`,`2`,`3`,`4`,`5`,`6`,`1`,`2`。 + +掷完骰子后,玩家向前移动`diceRoll`个方格,如果玩家移动超过了第 25 个方格,这个时候游戏结束,相应地,代码会在`square`增加`board[square]`的值向前或向后移动(遇到了梯子或者蛇)之前,检测`square`的值是否小于`board`的`count`属性。 + +如果没有这个检测(`square < board.count`),`board[square]`可能会越界访问`board`数组,导致错误。例如如果`square`等于`26`, 代码会去尝试访问`board[26]`,超过数组的长度。 + +当本轮`while`循环运行完毕,会再检测循环条件是否需要再运行一次循环。如果玩家移动到或者超过第 25 个方格,循环条件结果为`false`,此时游戏结束。 + +`while` 循环比较适合本例中的这种情况,因为在 `while` 循环开始时,我们并不知道游戏的长度或者循环的次数,只有在达成指定条件时循环才会结束。 + + + +###Do-While + +`while`循环的另外一种形式是`do-while`,它和`while`的区别是在判断循环条件之前,先执行一次循环的代码块,然后重复循环直到条件为`false`。 + +下面是一般情况下 `do-while`循环的格式: + +> do { +> `statements` +> } while `condition` + +还是蛇和梯子的游戏,使用`do-while`循环来替代`while`循环。`finalSquare`、`board`、`square`和`diceRoll`的值初始化同`while`循环一样: + +``` swift +let finalSquare = 25 +var board = Int[](count: finalSquare + 1, repeatedValue: 0) +board[03] = +08; board[06] = +11; board[09] = +09; board[10] = +02 +board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08 +var square = 0 +var diceRoll = 0 +``` + +`do-while`的循环版本,循环中_第一步_就需要去检测是否在梯子或者蛇的方块上。没有梯子会让玩家直接上到第 25 个方格,所以玩家不会通过梯子直接赢得游戏。这样在循环开始时先检测是否踩在梯子或者蛇上是安全的。 + +游戏开始时,玩家在第 0 个方格上,`board[0]`一直等于 0, 不会有什么影响: + +```swift +do { + // 顺着梯子爬上去或者顺着蛇滑下去 + square += board[square] + // 掷骰子 + if ++diceRoll == 7 { diceRoll = 1 } + // 根据点数移动 + square += diceRoll +} while square < finalSquare +println("Game over!") +``` + +检测完玩家是否踩在梯子或者蛇上之后,开始掷骰子,然后玩家向前移动`diceRoll`个方格,本轮循环结束。 + +循环条件(`while square < finalSquare`)和`while`方式相同,但是只会在循环结束后进行计算。在这个游戏中,`do-while`表现得比`while`循环更好。`do-while`方式会在条件判断`square`没有超出后直接运行`square += board[square]`,这种方式可以去掉`while`版本中的数组越界判断。 + + +## 条件语句 + +根据特定的条件执行特定的代码通常是十分有用的,例如:当错误发生时,你可能想运行额外的代码;或者,当输入的值太大或太小时,向用户显示一条消息等。要实现这些功能,你就需要使用*条件语句*。 + +Swift 提供两种类型的条件语句:`if`语句和`switch`语句。通常,当条件较为简单且可能的情况很少时,使用`if`语句。而`switch`语句更适用于条件较复杂、可能情况较多且需要用到模式匹配(pattern-matching)的情境。 + + +### If + +`if`语句最简单的形式就是只包含一个条件,当且仅当该条件为`true`时,才执行相关代码: + +```swift +var temperatureInFahrenheit = 30 +if temperatureInFahrenheit <= 32 { + println("It's very cold. Consider wearing a scarf.") +} +// 输出 "It's very cold. Consider wearing a scarf." +``` + +上面的例子会判断温度是否小于等于 32 华氏度(水的冰点)。如果是,则打印一条消息;否则,不打印任何消息,继续执行`if`块后面的代码。 + +当然,`if`语句允许二选一,也就是当条件为`false`时,执行 *else 语句*: + +```swift +temperatureInFahrenheit = 40 +if temperatureInFahrenheit <= 32 { + println("It's very cold. Consider wearing a scarf.") +} else { + println("It's not that cold. Wear a t-shirt.") +} +// 输出 "It's not that cold. Wear a t-shirt." +``` + +显然,这两条分支中总有一条会被执行。由于温度已升至 40 华氏度,不算太冷,没必要再围围巾——因此,`else`分支就被触发了。 + +你可以把多个`if`语句链接在一起,像下面这样: + +```swift +temperatureInFahrenheit = 90 +if temperatureInFahrenheit <= 32 { + println("It's very cold. Consider wearing a scarf.") +} else if temperatureInFahrenheit >= 86 { + println("It's really warm. Don't forget to wear sunscreen.") +} else { + println("It's not that cold. Wear a t-shirt.") +} +// 输出 "It's really warm. Don't forget to wear sunscreen." +``` + +在上面的例子中,额外的`if`语句用于判断是不是特别热。而最后的`else`语句被保留了下来,用于打印既不冷也不热时的消息。 + +实际上,最后的`else`语句是可选的: + +```swift +temperatureInFahrenheit = 72 +if temperatureInFahrenheit <= 32 { + println("It's very cold. Consider wearing a scarf.") +} else if temperatureInFahrenheit >= 86 { + println("It's really warm. Don't forget to wear sunscreen.") +} +``` + +在这个例子中,由于既不冷也不热,所以不会触发`if`或`else if`分支,也就不会打印任何消息。 + + +### Switch + +`switch`语句会尝试把某个值与若干个模式(pattern)进行匹配。根据第一个匹配成功的模式,`switch`语句会执行对应的代码。当有可能的情况较多时,通常用`switch`语句替换`if`语句。 + +`switch`语句最简单的形式就是把某个值与一个或若干个相同类型的值作比较: + +> switch `some value to consider` { +> case `value 1`: +> `respond to value 1` +> case `value 2`, +> `value 3`: +> `respond to value 2 or 3` +> default: +> `otherwise, do something else` +> } + +`switch`语句都由*多个 case* 构成。为了匹配某些更特定的值,Swift 提供了几种更复杂的匹配模式,这些模式将在本节的稍后部分提到。 + +每一个 case 都是代码执行的一条分支,这与`if`语句类似。与之不同的是,`switch`语句会决定哪一条分支应该被执行。 + +`switch`语句必须是_完备的_。这就是说,每一个可能的值都必须至少有一个 case 分支与之对应。在某些不可能涵盖所有值的情况下,你可以使用默认(`default`)分支满足该要求,这个默认分支必须在`switch`语句的最后面。 + +下面的例子使用`switch`语句来匹配一个名为`someCharacter`的小写字符: + +```swift +let someCharacter: Character = "e" +switch someCharacter { +case "a", "e", "i", "o", "u": + println("\(someCharacter) is a vowel") +case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", +"n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z": + println("\(someCharacter) is a consonant") +default: + println("\(someCharacter) is not a vowel or a consonant") +} +// 输出 "e is a vowel" +``` + +在这个例子中,第一个 case 分支用于匹配五个元音,第二个 case 分支用于匹配所有的辅音。 + +由于为其它可能的字符写 case 分支没有实际的意义,因此在这个例子中使用了默认分支来处理剩下的既不是元音也不是辅音的字符——这就保证了`switch`语句的完备性。 + + +#### 不存在隐式的贯穿(No Implicit Fallthrough) + +与 C 语言和 Objective-C 中的`switch`语句不同,在 Swift 中,当匹配的 case 分支中的代码执行完毕后,程序会终止`switch`语句,而不会继续执行下一个 case 分支。这也就是说,不需要在 case 分支中显式地使用`break`语句。这使得`switch`语句更安全、更易用,也避免了因忘记写`break`语句而产生的错误。 + +> 注意: +你依然可以在 case 分支中的代码执行完毕前跳出,详情请参考[Switch 语句中的 break](#break_in_a_switch_statement)。 + +每一个 case 分支都*必须*包含至少一条语句。像下面这样书写代码是无效的,因为第一个 case 分支是空的: + +```swift +let anotherCharacter: Character = "a" +switch anotherCharacter { +case "a": +case "A": + println("The letter A") +default: + println("Not the letter A") +} +// this will report a compile-time error +``` + +不像 C 语言里的`switch`语句,在 Swift 中,`switch`语句不会同时匹配`"a"`和`"A"`。相反的,上面的代码会引起编译期错误:`case "a": does not contain any executable statements`——这就避免了意外地从一个 case 分支贯穿到另外一个,使得代码更安全、也更直观。 + +一个 case 也可以包含多个模式,用逗号把它们分开(如果太长了也可以分行写): + +> switch `some value to consider` { +> case `value 1`, +> `value 2`: +> `statements` +> } + +> 注意: +如果想要贯穿至特定的 case 分支中,请使用`fallthrough`语句,详情请参考[贯穿(Fallthrough)](#fallthrough)。 + + +#### 区间匹配(Range Matching) + +case 分支的模式也可以是一个值的区间。下面的例子展示了如何使用区间匹配来输出任意数字对应的自然语言格式: + +```swift +let count = 3_000_000_000_000 +let countedThings = "stars in the Milky Way" +var naturalCount: String +switch count { +case 0: + naturalCount = "no" +case 1...3: + naturalCount = "a few" +case 4...9: + naturalCount = "several" +case 10...99: + naturalCount = "tens of" +case 100...999: + naturalCount = "hundreds of" +case 1000...999_999: + naturalCount = "thousands of" +default: + naturalCount = "millions and millions of" +} +println("There are \(naturalCount) \(countedThings).") +// 输出 "There are millions and millions of stars in the Milky Way." +``` + + +#### 元组(Tuple) + +你可以使用元组在同一个`switch`语句中测试多个值。元组中的元素可以是值,也可以是区间。另外,使用下划线(`_`)来匹配所有可能的值。 + +下面的例子展示了如何使用一个`(Int, Int)`类型的元组来分类下图中的点(x, y): + +```swift +let somePoint = (1, 1) +switch somePoint { +case (0, 0): + println("(0, 0) is at the origin") +case (_, 0): + println("(\(somePoint.0), 0) is on the x-axis") +case (0, _): + println("(0, \(somePoint.1)) is on the y-axis") +case (-2...2, -2...2): + println("(\(somePoint.0), \(somePoint.1)) is inside the box") +default: + println("(\(somePoint.0), \(somePoint.1)) is outside of the box") +} +// 输出 "(1, 1) is inside the box" +``` + +![image](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/coordinateGraphSimple_2x.png) + +在上面的例子中,`switch`语句会判断某个点是否是原点(0, 0),是否在红色的x轴上,是否在黄色y轴上,是否在一个以原点为中心的4x4的矩形里,或者在这个矩形外面。 + +不像 C 语言,Swift 允许多个 case 匹配同一个值。实际上,在这个例子中,点(0, 0)可以匹配所有_四个 case_。但是,如果存在多个匹配,那么只会执行第一个被匹配到的 case 分支。考虑点(0, 0)会首先匹配`case (0, 0)`,因此剩下的能够匹配(0, 0)的 case 分支都会被忽视掉。 + + + +#### 值绑定(Value Bindings) + +case 分支的模式允许将匹配的值绑定到一个临时的常量或变量,这些常量或变量在该 case 分支里就可以被引用了——这种行为被称为*值绑定*(value binding)。 + +下面的例子展示了如何在一个`(Int, Int)`类型的元组中使用值绑定来分类下图中的点(x, y): + +```swift +let anotherPoint = (2, 0) +switch anotherPoint { +case (let x, 0): + println("on the x-axis with an x value of \(x)") +case (0, let y): + println("on the y-axis with a y value of \(y)") +case let (x, y): + println("somewhere else at (\(x), \(y))") +} +// 输出 "on the x-axis with an x value of 2" +``` + +![image](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/coordinateGraphMedium_2x.png) + +在上面的例子中,`switch`语句会判断某个点是否在红色的x轴上,是否在黄色y轴上,或者不在坐标轴上。 + +这三个 case 都声明了常量`x`和`y`的占位符,用于临时获取元组`anotherPoint`的一个或两个值。第一个 case ——`case (let x, 0)`将匹配一个纵坐标为`0`的点,并把这个点的横坐标赋给临时的常量`x`。类似的,第二个 case ——`case (0, let y)`将匹配一个横坐标为`0`的点,并把这个点的纵坐标赋给临时的常量`y`。 + +一旦声明了这些临时的常量,它们就可以在其对应的 case 分支里引用。在这个例子中,它们用于简化`println`的书写。 + +请注意,这个`switch`语句不包含默认分支。这是因为最后一个 case ——`case let(x, y)`声明了一个可以匹配余下所有值的元组。这使得`switch`语句已经完备了,因此不需要再书写默认分支。 + +在上面的例子中,`x`和`y`是常量,这是因为没有必要在其对应的 case 分支中修改它们的值。然而,它们也可以是变量——程序将会创建临时变量,并用相应的值初始化它。修改这些变量只会影响其对应的 case 分支。 + + +#### Where + +case 分支的模式可以使用`where`语句来判断额外的条件。 + +下面的例子把下图中的点(x, y)进行了分类: + +```swift +let yetAnotherPoint = (1, -1) +switch yetAnotherPoint { +case let (x, y) where x == y: + println("(\(x), \(y)) is on the line x == y") +case let (x, y) where x == -y: + println("(\(x), \(y)) is on the line x == -y") +case let (x, y): + println("(\(x), \(y)) is just some arbitrary point") +} +// 输出 "(1, -1) is on the line x == -y" +``` + +![image](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/coordinateGraphComplex_2x.png) + +在上面的例子中,`switch`语句会判断某个点是否在绿色的对角线`x == y`上,是否在紫色的对角线`x == -y`上,或者不在对角线上。 + +这三个 case 都声明了常量`x`和`y`的占位符,用于临时获取元组`yetAnotherPoint`的两个值。这些常量被用作`where`语句的一部分,从而创建一个动态的过滤器(filter)。当且仅当`where`语句的条件为`true`时,匹配到的 case 分支才会被执行。 + +就像是值绑定中的例子,由于最后一个 case 分支匹配了余下所有可能的值,`switch`语句就已经完备了,因此不需要再书写默认分支。 + + +## 控制转移语句(Control Transfer Statements) + +控制转移语句改变你代码的执行顺序,通过它你可以实现代码的跳转。Swift有四种控制转移语句。 + +- continue +- break +- fallthrough +- return + +我们将会在下面讨论`continue`、`break`和`fallthrough`语句。`return`语句将会在[函数](../chapter2/06_Functions.html)章节讨论。 + + +### Continue + +`continue`语句告诉一个循环体立刻停止本次循环迭代,重新开始下次循环迭代。就好像在说“本次循环迭代我已经执行完了”,但是并不会离开整个循环体。 + +>注意: +在一个for条件递增(`for-condition-increment`)循环体中,在调用`continue`语句后,迭代增量仍然会被计算求值。循环体继续像往常一样工作,仅仅只是循环体中的执行代码会被跳过。 + +下面的例子把一个小写字符串中的元音字母和空格字符移除,生成了一个含义模糊的短句: + +```swift +let puzzleInput = "great minds think alike" +var puzzleOutput = "" +for character in puzzleInput { + switch character { + case "a", "e", "i", "o", "u", " ": + continue + default: + puzzleOutput += character + } +} +println(puzzleOutput) + // 输出 "grtmndsthnklk" +``` + +在上面的代码中,只要匹配到元音字母或者空格字符,就调用`continue`语句,使本次循环迭代结束,从新开始下次循环迭代。这种行为使`switch`匹配到元音字母和空格字符时不做处理,而不是让每一个匹配到的字符都被打印。 + + +### Break + +`break`语句会立刻结束整个控制流的执行。当你想要更早的结束一个`switch`代码块或者一个循环体时,你都可以使用`break`语句。 + + +#### 循环语句中的 break + +当在一个循环体中使用`break`时,会立刻中断该循环体的执行,然后跳转到表示循环体结束的大括号(`}`)后的第一行代码。不会再有本次循环迭代的代码被执行,也不会再有下次的循环迭代产生。 + + +#### Switch 语句中的 break + +当在一个`switch`代码块中使用`break`时,会立即中断该`switch`代码块的执行,并且跳转到表示`switch`代码块结束的大括号(`}`)后的第一行代码。 + +这种特性可以被用来匹配或者忽略一个或多个分支。因为 Swift 的`switch`需要包含所有的分支而且不允许有为空的分支,有时为了使你的意图更明显,需要特意匹配或者忽略某个分支。那么当你想忽略某个分支时,可以在该分支内写上`break`语句。当那个分支被匹配到时,分支内的`break`语句立即结束`switch`代码块。 + +>注意: +当一个`switch`分支仅仅包含注释时,会被报编译时错误。注释不是代码语句而且也不能让`switch`分支达到被忽略的效果。你总是可以使用`break`来忽略某个分支。 + +下面的例子通过`switch`来判断一个`Character`值是否代表下面四种语言之一。为了简洁,多个值被包含在了同一个分支情况中。 + +```swift +let numberSymbol: Character = "三" // 简体中文里的数字 3 +var possibleIntegerValue: Int? +switch numberSymbol { +case "1", "١", "一", "๑": + possibleIntegerValue = 1 +case "2", "٢", "二", "๒": + possibleIntegerValue = 2 +case "3", "٣", "三", "๓": + possibleIntegerValue = 3 +case "4", "٤", "四", "๔": + possibleIntegerValue = 4 +default: + break +} +if let integerValue = possibleIntegerValue { + println("The integer value of \(numberSymbol) is \(integerValue).") +} else { + println("An integer value could not be found for \(numberSymbol).") +} +// 输出 "The integer value of 三 is 3." +``` + +这个例子检查`numberSymbol`是否是拉丁,阿拉伯,中文或者泰语中的`1`到`4`之一。如果被匹配到,该`switch`分支语句给`Int?`类型变量`possibleIntegerValue`设置一个整数值。 + +当`switch`代码块执行完后,接下来的代码通过使用可选绑定来判断`possibleIntegerValue`是否曾经被设置过值。因为是可选类型的缘故,`possibleIntegerValue`有一个隐式的初始值`nil`,所以仅仅当`possibleIntegerValue`曾被`switch`代码块的前四个分支中的某个设置过一个值时,可选的绑定将会被判定为成功。 + +在上面的例子中,想要把`Character`所有的的可能性都枚举出来是不现实的,所以使用`default`分支来包含所有上面没有匹配到字符的情况。由于这个`default`分支不需要执行任何动作,所以它只写了一条`break`语句。一旦落入到`default`分支中后,`break`语句就完成了该分支的所有代码操作,代码继续向下,开始执行`if let`语句。 + + +### 贯穿(Fallthrough) + +Swift 中的`switch`不会从上一个 case 分支落入到下一个 case 分支中。相反,只要第一个匹配到的 case 分支完成了它需要执行的语句,整个`switch`代码块完成了它的执行。相比之下,C 语言要求你显示的插入`break`语句到每个`switch`分支的末尾来阻止自动落入到下一个 case 分支中。Swift 的这种避免默认落入到下一个分支中的特性意味着它的`switch` 功能要比 C 语言的更加清晰和可预测,可以避免无意识地执行多个 case 分支从而引发的错误。 + +如果你确实需要 C 风格的贯穿(fallthrough)的特性,你可以在每个需要该特性的 case 分支中使用`fallthrough`关键字。下面的例子使用`fallthrough`来创建一个数字的描述语句。 + +```swift +let integerToDescribe = 5 +var description = "The number \(integerToDescribe) is" +switch integerToDescribe { +case 2, 3, 5, 7, 11, 13, 17, 19: + description += " a prime number, and also" + fallthrough +default: + description += " an integer." +} +println(description) +// 输出 "The number 5 is a prime number, and also an integer." +``` + +这个例子定义了一个`String`类型的变量`description`并且给它设置了一个初始值。函数使用`switch`逻辑来判断`integerToDescribe`变量的值。当`integerToDescribe`的值属于列表中的质数之一时,该函数添加一段文字在`description`后,来表明这个是数字是一个质数。然后它使用`fallthrough`关键字来“贯穿”到`default`分支中。`default`分支添加一段额外的文字在`description`的最后,至此`switch`代码块执行完了。 + +如果`integerToDescribe`的值不属于列表中的任何质数,那么它不会匹配到第一个`switch`分支。而这里没有其他特别的分支情况,所以`integerToDescribe`匹配到包含所有的`default`分支中。 + +当`switch`代码块执行完后,使用`println`函数打印该数字的描述。在这个例子中,数字`5`被准确的识别为了一个质数。 + +>注意: +`fallthrough`关键字不会检查它下一个将会落入执行的 case 中的匹配条件。`fallthrough`简单地使代码执行继续连接到下一个 case 中的执行代码,这和 C 语言标准中的`switch`语句特性是一样的。 + + +### 带标签的语句(Labeled Statements) + +在 Swift 中,你可以在循环体和`switch`代码块中嵌套循环体和`switch`代码块来创造复杂的控制流结构。然而,循环体和`switch`代码块两者都可以使用`break`语句来提前结束整个方法体。因此,显示地指明`break`语句想要终止的是哪个循环体或者`switch`代码块,会很有用。类似地,如果你有许多嵌套的循环体,显示指明`continue`语句想要影响哪一个循环体也会非常有用。 + +为了实现这个目的,你可以使用标签来标记一个循环体或者`switch`代码块,当使用`break`或者`continue`时,带上这个标签,可以控制该标签代表对象的中断或者执行。 + +产生一个带标签的语句是通过在该语句的关键词的同一行前面放置一个标签,并且该标签后面还需带着一个冒号。下面是一个`while`循环体的语法,同样的规则适用于所有的循环体和`switch`代码块。 + +> `label name`: while `condition` { +> `statements` +> } + +下面的例子是在一个带有标签的`while`循环体中调用`break`和`continue`语句,该循环体是前面章节中_蛇和梯子_的改编版本。这次,游戏增加了一条额外的规则: + +- 为了获胜,你必须_刚好_落在第 25 个方块中。 + +如果某次掷骰子使你的移动超出第 25 个方块,你必须重新掷骰子,直到你掷出的骰子数刚好使你能落在第 25 个方块中。 + +游戏的棋盘和之前一样: + +![image](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/snakesAndLadders_2x.png) + +值`finalSquare`、`board`、`square`和`diceRoll`的初始化也和之前一样: + +```swift +let finalSquare = 25 +var board = Int[](count: finalSquare + 1, repeatedValue: 0) +board[03] = +08; board[06] = +11; board[09] = +09; board[10] = +02 +board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08 +var square = 0 +var diceRoll = 0 +``` + +这个版本的游戏使用`while`循环体和`switch`方法块来实现游戏的逻辑。`while`循环体有一个标签名`gameLoop`,来表明它是蛇与梯子的主循环。 + +该`while`循环体的条件判断语句是`while square !=finalSquare`,这表明你必须刚好落在方格25中。 + +```swift +gameLoop: while square != finalSquare { + if ++diceRoll == 7 { diceRoll = 1 } + switch square + diceRoll { + case finalSquare: + // 到达最后一个方块,游戏结束 + break gameLoop + case let newSquare where newSquare > finalSquare: + // 超出最后一个方块,再掷一次骰子 + continue gameLoop + default: + // 本次移动有效 + square += diceRoll + square += board[square] + } +} +println("Game over!") +``` + +每次循环迭代开始时掷骰子。与之前玩家掷完骰子就立即移动不同,这里使用了`switch`来考虑每次移动可能产生的结果,从而决定玩家本次是否能够移动。 + +- 如果骰子数刚好使玩家移动到最终的方格里,游戏结束。`break gameLoop`语句跳转控制去执行`while`循环体后的第一行代码,游戏结束。 +- 如果骰子数将会使玩家的移动超出最后的方格,那么这种移动是不合法的,玩家需要重新掷骰子。`continue gameLoop`语句结束本次`while`循环的迭代,开始下一次循环迭代。 +- 在剩余的所有情况中,骰子数产生的都是合法的移动。玩家向前移动骰子数个方格,然后游戏逻辑再处理玩家当前是否处于蛇头或者梯子的底部。本次循环迭代结束,控制跳转到`while`循环体的条件判断语句处,再决定是否能够继续执行下次循环迭代。 + +>注意: +如果上述的`break`语句没有使用`gameLoop`标签,那么它将会中断`switch`代码块而不是`while`循环体。使用`gameLoop`标签清晰的表明了`break`想要中断的是哪个代码块。 +同时请注意,当调用`continue gameLoop`去跳转到下一次循环迭代时,这里使用`gameLoop`标签并不是严格必须的。因为在这个游戏中,只有一个循环体,所以`continue`语句会影响到哪个循环体是没有歧义的。然而,`continue`语句使用`gameLoop`标签也是没有危害的。这样做符合标签的使用规则,同时参照旁边的`break gameLoop`,能够使游戏的逻辑更加清晰和易于理解。 diff --git a/source/chapter2/06_Functions.md b/source/chapter2/06_Functions.md old mode 100644 new mode 100755 index 4c8d1e5e..1c057135 --- a/source/chapter2/06_Functions.md +++ b/source/chapter2/06_Functions.md @@ -1,55 +1,67 @@ +> 翻译:[honghaoz](https://github.com/honghaoz) +> 校对:[LunaticM](https://github.com/LunaticM) + # 函数(Functions) +----------------- 本页包含内容: -- 函数定义与调用 -- 函数参数与返回值 -- 函数参数名称 -- 函数类型 -- 函数嵌套 +- [函数定义与调用(Defining and Calling Functions)](#Defining_and_Calling_Functions) +- [函数参数与返回值(Function Parameters and Return Values)](#Function_Parameters_and_Return_Values) +- [函数参数名称(Function Parameter Names)](#Function_Parameter_Names) +- [函数类型(Function Types)](#Function_Types) +- [函数嵌套(Nested Functions)](#Nested_Functions) -函数是用来完成特定任务的独立的代码块。你给一个函数起一个合适的名字,用来标示函数做什么,并且当函数需要执行的时候,这个名字会被“调用”。 +函数是用来完成特定任务的独立的代码块。你给一个函数起一个合适的名字,用来标识函数做什么,并且当函数需要执行的时候,这个名字会被“调用”。 -Swift统一的函数语法足够灵活,可以用来表示任何函数,包括从最简单的没有参数名字的C风格函数,到复杂的带局部和外部参数名的Objective-C风格函数。参数可以提供默认值,以简化函数调用。参数也可以即当做传入参数,也当做传出参数,也就是说,一旦函数执行结束,传入的参数值可以被修改。 +Swift 统一的函数语法足够灵活,可以用来表示任何函数,包括从最简单的没有参数名字的 C 风格函数,到复杂的带局部和外部参数名的 Objective-C 风格函数。参数可以提供默认值,以简化函数调用。参数也可以既当做传入参数,也当做传出参数,也就是说,一旦函数执行结束,传入的参数值可以被修改。 -在Swift中,每个函数都有一种类型,包括函数的参数值类型和返回值类型。你可以把函数类型当做任何其他普通变量类型一样处理,这样就可以更简单地把函数当做别的函数的参数,也可以从其他函数中返回函数。函数的定义可以写在在其他函数定义中,这样可以在嵌套函数范围内实现功能封装。 +在 Swift 中,每个函数都有一种类型,包括函数的参数值类型和返回值类型。你可以把函数类型当做任何其他普通变量类型一样处理,这样就可以更简单地把函数当做别的函数的参数,也可以从其他函数中返回函数。函数的定义可以写在在其他函数定义中,这样可以在嵌套函数范围内实现功能封装。 + ## 函数的定义与调用(Defining and Calling Functions) 当你定义一个函数时,你可以定义一个或多个有名字和类型的值,作为函数的输入(称为参数,parameters),也可以定义某种类型的值作为函数执行结束的输出(称为返回类型)。 每个函数有个函数名,用来描述函数执行的任务。要使用一个函数时,你用函数名“调用”,并传给它匹配的输入值(称作实参,arguments)。一个函数的实参必须与函数参数表里参数的顺序一致。 -在下面例子中的函数叫做`"greetingForPerson"`,之所以叫这个名字是因为这个函数用一个人的名字当做输入,并返回给这个人的问候语。为了完成这个任务,你定义一个输入参数-一个叫做`personName`的`String`值,和一个包含给这个人问候语的`String`类型的返回值: +在下面例子中的函数叫做`"greetingForPerson"`,之所以叫这个名字是因为这个函数用一个人的名字当做输入,并返回给这个人的问候语。为了完成这个任务,你定义一个输入参数-一个叫做 `personName` 的 `String` 值,和一个包含给这个人问候语的 `String` 类型的返回值: - func sayHello(personName: String) -> String { - let greeting = "Hello, " + personName + "!" - return greeting - } +```swift +func sayHello(personName: String) -> String { + let greeting = "Hello, " + personName + "!" + return greeting +} +``` -所有的这些信息汇总起来成为函数的定义,并以`func`作为前缀。指定函数返回类型时,用返回箭头`->`(一个连字符后跟一个右尖括号)后跟返回类型的名称的方式来表示。 +所有的这些信息汇总起来成为函数的定义,并以 `func` 作为前缀。指定函数返回类型时,用返回箭头 `->`(一个连字符后跟一个右尖括号)后跟返回类型的名称的方式来表示。 该定义描述了函数做什么,它期望接收什么和执行结束时它返回的结果是什么。这样的定义使的函数可以在别的地方以一种清晰的方式被调用: - println(sayHello("Anna")) - // prints "Hello, Anna!" - println(sayHello("Brian")) - // prints "Hello, Brian! +```swift +println(sayHello("Anna")) +// prints "Hello, Anna!" +println(sayHello("Brian")) +// prints "Hello, Brian!" +``` -调用`sayHello`函数时,在圆括号中传给它一个`String`类型的实参。因为这个函数返回一个`String`类型的值,`sayHello`可以被包含在`println`的调用中,用来输出这个函数的返回值,正如上面所示。 +调用 `sayHello` 函数时,在圆括号中传给它一个 `String` 类型的实参。因为这个函数返回一个 `String` 类型的值,`sayHello` 可以被包含在 `println` 的调用中,用来输出这个函数的返回值,正如上面所示。 -在`sayHello`的函数体中,先定义了一个新的名为`greeting`的`String`常量,同时赋值了给`personName`的一个简单问候消息。然后用`return`关键字把这个问候返回出去。一旦`return greeting`被调用,该函数结束它的执行并返回`greeting`的当前值。 +在 `sayHello` 的函数体中,先定义了一个新的名为 `greeting` 的 `String` 常量,同时赋值了给 `personName` 的一个简单问候消息。然后用 `return` 关键字把这个问候返回出去。一旦 `return greeting` 被调用,该函数结束它的执行并返回 `greeting` 的当前值。 -你可以用不同的输入值多次调用`sayHello`。上面的例子展示的是用`"Anna"`和`"Brian"`调用的结果,该函数分别返回了不同的结果。 +你可以用不同的输入值多次调用 `sayHello`。上面的例子展示的是用`"Anna"`和`"Brian"`调用的结果,该函数分别返回了不同的结果。 为了简化这个函数的定义,可以将问候消息的创建和返回写成一句: - func sayHelloAgain(personName: String) -> String { - return "Hello again, " + personName + "!" - } - println(sayHelloAgain("Anna")) - // prints "Hello again, Anna! +```swift +func sayHelloAgain(personName: String) -> String { + return "Hello again, " + personName + "!" +} +println(sayHelloAgain("Anna")) +// prints "Hello again, Anna!" +``` + ## 函数参数与返回值(Function Parameters and Return Values) 函数参数与返回值在Swift中极为灵活。你可以定义任何类型的函数,包括从只带一个未名参数的简单函数到复杂的带有表达性参数名和不同参数选项的复杂函数。 @@ -60,96 +72,112 @@ Swift统一的函数语法足够灵活,可以用来表示任何函数,包括 下面这个函数用一个半开区间的开始点和结束点,计算出这个范围内包含多少数字: - func halfOpenRangeLength(start: Int, end: Int) -> Int { - return end - start - } - println(halfOpenRangeLength(1, 10)) - // prints "9 +```swift +func halfOpenRangeLength(start: Int, end: Int) -> Int { + return end - start +} +println(halfOpenRangeLength(1, 10)) +// prints "9" +``` ### 无参函数(Functions Without Parameters) -函数可以没有参数。下面这个函数就是一个无参函数,当被调用时,它返回固定的`String`消息: +函数可以没有参数。下面这个函数就是一个无参函数,当被调用时,它返回固定的 `String` 消息: - func sayHelloWorld() -> String { - return "hello, world" - } - println(sayHelloWorld()) - // prints "hello, world +```swift +func sayHelloWorld() -> String { + return "hello, world" +} +println(sayHelloWorld()) +// prints "hello, world" +``` 尽管这个函数没有参数,但是定义中在函数名后还是需要一对圆括号。当被调用时,也需要在函数名后写一对圆括号。 ### 无返回值函数(Functions Without Return Values) -函数可以没有返回值。下面是`sayHello`函数的另一个版本,叫`waveGoodbye`,这个函数直接输出`String`值,而不是返回它: +函数可以没有返回值。下面是 `sayHello` 函数的另一个版本,叫 `waveGoodbye`,这个函数直接输出 `String` 值,而不是返回它: - func sayGoodbye(personName: String) { - println("Goodbye, \(personName)!") - } - sayGoodbye("Dave") - // prints "Goodbye, Dave! +```swift +func sayGoodbye(personName: String) { + println("Goodbye, \(personName)!") +} +sayGoodbye("Dave") +// prints "Goodbye, Dave!" +``` 因为这个函数不需要返回值,所以这个函数的定义中没有返回箭头(->)和返回类型。 -> 注意: -> 严格上来说,虽然没有返回值被定义,`sayGoodbye`函数依然返回了值。没有定义返回类型的函数会返回特殊的值,叫`Void`。它其实是一个空的元组(tuple),没有任何元素,可以写成`()`。 +> 注意: +> 严格上来说,虽然没有返回值被定义,`sayGoodbye` 函数依然返回了值。没有定义返回类型的函数会返回特殊的值,叫 `Void`。它其实是一个空的元组(tuple),没有任何元素,可以写成`()`。 被调用时,一个函数的返回值可以被忽略: - func printAndCount(stringToPrint: String) -> Int { - println(stringToPrint) - return countElements(stringToPrint) - } - func printWithoutCounting(stringToPrint: String) { - printAndCount(stringToPrint) - } - printAndCount("hello, world") - // prints "hello, world" and returns a value of 12 - printWithoutCounting("hello, world") - // prints "hello, world" but does not return a value +```swift +func printAndCount(stringToPrint: String) -> Int { + println(stringToPrint) + return countElements(stringToPrint) +} +func printWithoutCounting(stringToPrint: String) { + printAndCount(stringToPrint) +} +printAndCount("hello, world") +// prints "hello, world" and returns a value of 12 +printWithoutCounting("hello, world") +// prints "hello, world" but does not return a value -第一个函数`printAndCount`,输出一个字符串并返回`Int`类型的字符数。第二个函数`printWithoutCounting`调用了第一个函数,但是忽略了它的返回值。当第二个函数被调用时,消息依然会由第一个函数输出,但是返回值不会被用到。 +``` -> 注意: -> 返回值可以被忽略,但定义了有返回值的函数必须返回一个值,如果在函数定义底部没有返回任何值,这叫导致编译错误(compile-time error)。 +第一个函数 `printAndCount`,输出一个字符串并返回 `Int` 类型的字符数。第二个函数 `printWithoutCounting`调用了第一个函数,但是忽略了它的返回值。当第二个函数被调用时,消息依然会由第一个函数输出,但是返回值不会被用到。 + +> 注意: +> 返回值可以被忽略,但定义了有返回值的函数必须返回一个值,如果在函数定义底部没有返回任何值,这将导致编译错误(compile-time error)。 ### 多重返回值函数(Functions with Multiple Return Values) 你可以用元组(tuple)类型让多个值作为一个复合值从函数中返回。 -下面的这个例子中,`count`函数用来计算一个字符串中元音,辅音和其他字母的个数(基于美式英语的标准)。 +下面的这个例子中,`count` 函数用来计算一个字符串中元音,辅音和其他字母的个数(基于美式英语的标准)。 - func count(string: String) -> (vowels: Int, consonants: Int, others: Int) { - var vowels = 0, consonants = 0, others = 0 - for character in string { - switch String(character).lowercaseString { - case "a", "e", "i", "o", "u": - ++vowels - case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", - "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z": - ++consonants - default: - ++others - } - } - return (vowels, consonants, others) - } +```swift +func count(string: String) -> (vowels: Int, consonants: Int, others: Int) { + var vowels = 0, consonants = 0, others = 0 + for character in string { + switch String(character).lowercaseString { + case "a", "e", "i", "o", "u": + ++vowels + case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", + "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z": + ++consonants + default: + ++others + } + } + return (vowels, consonants, others) +} +``` -你可以用`count`函数来处理任何一个字符串,返回的值将是一个包含三个`Int`型值的元组(tuple): +你可以用 `count` 函数来处理任何一个字符串,返回的值将是一个包含三个 `Int` 型值的元组(tuple): - let total = count("some arbitrary string!") - println("\(total.vowels) vowels and \(total.consonants) consonants") - // prints "6 vowels and 13 consonants +```swift +let total = count("some arbitrary string!") +println("\(total.vowels) vowels and \(total.consonants) consonants") +// prints "6 vowels and 13 consonants" +``` -需要注意的是,元组的成员不需要在函数中返回时命名,因为它们的名字已经在函数返回类型有有了定义。 +需要注意的是,元组的成员不需要在函数中返回时命名,因为它们的名字已经在函数返回类型中有了定义。 -## 函数参数名(Function Parameter Names) + +## 函数参数名称(Function Parameter Names) 以上所有的函数都给它们的参数定义了`参数名(parameter name)`: - func someFunction(parameterName: Int) { - // function body goes here, and can use parameterName - // to refer to the argument value for that parameter - } +```swift +func someFunction(parameterName: Int) { + // function body goes here, and can use parameterName + // to refer to the argument value for that parameter +} +``` 但是,这些参数名仅在函数体中使用,不能在函数调用时使用。这种类型的参数名被称作`局部参数名(local parameter name)`,因为它们只能在函数体中使用。 @@ -159,129 +187,154 @@ Swift统一的函数语法足够灵活,可以用来表示任何函数,包括 如果你希望函数的使用者在调用函数时提供参数名字,那就需要给每个参数除了局部参数名外再定义一个`外部参数名`。外部参数名写在局部参数名之前,用空格分隔。 - func someFunction(externalParameterName localParameterName: Int) { - // function body goes here, and can use localParameterName - // to refer to the argument value for that parameter - } +```swift +func someFunction(externalParameterName localParameterName: Int) { + // function body goes here, and can use localParameterName + // to refer to the argument value for that parameter +} +``` -> 注意: -> 如果你提供了外部参数名,那么函数在被调用时,必须使用外部参数名。 +> 注意: +> 如果你提供了外部参数名,那么函数在被调用时,必须使用外部参数名。 以下是个例子,这个函数使用一个`结合者(joiner)`把两个字符串联在一起: - func join(s1: String, s2: String, joiner: String) -> String { - return s1 + joiner + s2 - } +```swift +func join(s1: String, s2: String, joiner: String) -> String { + return s1 + joiner + s2 +} +``` 当你调用这个函数时,这三个字符串的用途是不清楚的: - join("hello", "world", ", ") - // returns "hello, world +```swift +join("hello", "world", ", ") +// returns "hello, world" +``` -为了让这些字符串的用途更为明显,我们为`join`函数添加外部参数名: +为了让这些字符串的用途更为明显,我们为 `join` 函数添加外部参数名: - func join(string s1: String, toString s2: String, withJoiner joiner: String) -> String { - return s1 + joiner + s2 - } +```swift +func join(string s1: String, toString s2: String, withJoiner joiner: String) -> String { + return s1 + joiner + s2 +} +``` -在这个版本的`join`函数中,第一个参数有一个叫`string`的外部参数名和`s1`的局部参数名,第二个参数有一个叫`toString`的外部参数名和`s2`的局部参数名,第三个参数有一个叫`withJoiner`的外部参数名和`joiner`的局部参数名。 +在这个版本的 `join` 函数中,第一个参数有一个叫 `string` 的外部参数名和 `s1` 的局部参数名,第二个参数有一个叫 `toString` 的外部参数名和 `s2` 的局部参数名,第三个参数有一个叫 `withJoiner` 的外部参数名和 `joiner` 的局部参数名。 现在,你可以使用这些外部参数名以一种清晰地方式来调用函数了: - join(string: "hello", toString: "world", withJoiner: ", ") - // returns "hello, world +```swift +join(string: "hello", toString: "world", withJoiner: ", ") +// returns "hello, world" +``` -使用外部参数名让第二个版本的`join`函数的调用更为有表现力,更为通顺,同时还保持了函数体是可读的和有明确意图的。 +使用外部参数名让第二个版本的 `join` 函数的调用更为有表现力,更为通顺,同时还保持了函数体是可读的和有明确意图的。 -> 注意: -> 当其他人在第一次读你的代码,函数参数的意图显得不明显时,考虑使用外部参数名。如果函数参数名的意图是很明显的,那就不需要定义外部参数名了。 +> 注意: +> 当其他人在第一次读你的代码,函数参数的意图显得不明显时,考虑使用外部参数名。如果函数参数名的意图是很明显的,那就不需要定义外部参数名了。 ### 简写外部参数名(Shorthand External Parameter Names) -如果你需要提供外部参数名,但是局部参数名已经定义好了,那么你不需要写两次这些参数名。相反,只写一次参数名,并用`井号(#)`作为前缀就可以了。这告诉Swift使用这个参数名作为局部和外部参数名。 +如果你需要提供外部参数名,但是局部参数名已经定义好了,那么你不需要写两次参数名。相反,只写一次参数名,并用`井号(#)`作为前缀就可以了。这告诉 Swift 使用这个参数名作为局部和外部参数名。 -下面这个例子定义了一个叫`containsCharacter`的函数,使用`井号(#)`的方式定义了外部参数名: +下面这个例子定义了一个叫 `containsCharacter` 的函数,使用`井号(#)`的方式定义了外部参数名: - func containsCharacter(#string: String, #characterToFind: Character) -> Bool { - for character in string { - if character == characterToFind { - return true - } - } - return false - } +```swift +func containsCharacter(#string: String, #characterToFind: Character) -> Bool { + for character in string { + if character == characterToFind { + return true + } + } + return false +} +``` 这样定义参数名,使得函数体更为可读,清晰,同时也可以以一个不含糊的方式被调用: - let containsAVee = containsCharacter(string: "aardvark", characterToFind: "v") - // containsAVee equals true, because "aardvark" contains a "v” - +```swift +let containsAVee = containsCharacter(string: "aardvark", characterToFind: "v") +// containsAVee equals true, because "aardvark" contains a "v” +``` ### 默认参数值(Default Parameter Values) -你可以在函数体中为每个参数定义`默认值`。当默认值被定义后,调用这个函数时可以略去这个参数。 +你可以在函数体中为每个参数定义`默认值`。当默认值被定义后,调用这个函数时可以忽略这个参数。 -> 注意: -> 将带有默认值的参数放在函数参数表的最后。这样可以保证在函数调用时,非默认参数的顺序是一致的,同时使得相同的函数在不同情况下调用时显得更为清晰。 +> 注意: +> 将带有默认值的参数放在函数参数列表的最后。这样可以保证在函数调用时,非默认参数的顺序是一致的,同时使得相同的函数在不同情况下调用时显得更为清晰。 以下是另一个版本的`join`函数,其中`joiner`有了默认参数值: - func join(string s1: String, toString s2: String, withJoiner joiner: String = " ") -> String { - return s1 + joiner + s2 - } +```swift +func join(string s1: String, toString s2: String, withJoiner joiner: String = " ") -> String { + return s1 + joiner + s2 +} +``` -像第一个版本的`join`函数一样,如果`joiner`被幅值时,函数将使用这个字符串值来连接两个字符串: +像第一个版本的 `join` 函数一样,如果 `joiner` 被赋值时,函数将使用这个字符串值来连接两个字符串: - join(string: "hello", toString: "world", withJoiner: "-") - // returns "hello-world +```swift +join(string: "hello", toString: "world", withJoiner: "-") +// returns "hello-world" +``` -当这个函数被调用时,如果`joiner`的值没有被指定,函数会使用默认值(" "): +当这个函数被调用时,如果 `joiner` 的值没有被指定,函数会使用默认值(" "): - join(string: "hello", toString:"world") - // returns "hello world" +```swift +join(string: "hello", toString:"world") +// returns "hello world" +``` ### 默认值参数的外部参数名(External Names for Parameters with Default Values) 在大多数情况下,给带默认值的参数起一个外部参数名是很有用的。这样可以保证当函数被调用且带默认值的参数被提供值时,实参的意图是明显的。 -为了使定义外部参数名更加简单,当你未给带默认值的参数提供外部参数名时,Swift会自动提供外部名字。此时外部参数名与局部名字是一样的,就像你已经在局部参数名前写了`井号(#)`一样。 +为了使定义外部参数名更加简单,当你未给带默认值的参数提供外部参数名时,Swift 会自动提供外部名字。此时外部参数名与局部名字是一样的,就像你已经在局部参数名前写了`井号(#)`一样。 -下面是`join`函数的另一个版本,这个版本中并没有为它的参数提供外部参数名,但是`joiner`参数依然有外部参数名: +下面是 `join` 函数的另一个版本,这个版本中并没有为它的参数提供外部参数名,但是 `joiner` 参数依然有外部参数名: - func join(s1: String, s2: String, joiner: String = " ") -> String { - return s1 + joiner + s2 - } +```swift +func join(s1: String, s2: String, joiner: String = " ") -> String { + return s1 + joiner + s2 +} +``` -在这个例子中,Swift自动为`joiner`提供了外部参数名。因此,当函数调用时,外部参数名必须使用,这样使得参数的用途变得清晰。 +在这个例子中,Swift 自动为 `joiner` 提供了外部参数名。因此,当函数调用时,外部参数名必须使用,这样使得参数的用途变得清晰。 - join("hello", "world", joiner: "-") - // returns "hello-world" +```swift +join("hello", "world", joiner: "-") +// returns "hello-world" +``` -> 注意: -> 你可以使用`下划线(_)`作为默认值参数的外部参数名,这样可以在调用时不用提供外部参数名。但是给带默认值的参数命名总是更加合适的。 +> 注意: +> 你可以使用`下划线(_)`作为默认值参数的外部参数名,这样可以在调用时不用提供外部参数名。但是给带默认值的参数命名总是更加合适的。 ### 可变参数(Variadic Parameters) 一个`可变参数(variadic parameter)`可以接受一个或多个值。函数调用时,你可以用可变参数来传入不确定数量的输入参数。通过在变量类型名后面加入`(...)`的方式来定义可变参数。 -传入可变参数的值在函数体内当做这个类型的一个数组。例如,一个叫做`numbers`的`Double...`型可变参数,在函数体内可以当做一个叫`numbers`的`Double[]`型的数组常量。 +传入可变参数的值在函数体内当做这个类型的一个数组。例如,一个叫做 `numbers` 的 `Double...` 型可变参数,在函数体内可以当做一个叫 `numbers` 的 `Double[]` 型的数组常量。 下面的这个函数用来计算一组任意长度数字的算术平均数: - func arithmeticMean(numbers: Double...) -> Double { - var total: Double = 0 - for number in numbers { - total += number - } - return total / Double(numbers.count) - } - arithmeticMean(1, 2, 3, 4, 5) - // returns 3.0, which is the arithmetic mean of these five numbers - arithmeticMean(3, 8, 19) - // returns 10.0, which is the arithmetic mean of these three numbers +```swift +func arithmeticMean(numbers: Double...) -> Double { + var total: Double = 0 + for number in numbers { + total += number + } + return total / Double(numbers.count) +} +arithmeticMean(1, 2, 3, 4, 5) +// returns 3.0, which is the arithmetic mean of these five numbers +arithmeticMean(3, 8, 19) +// returns 10.0, which is the arithmetic mean of these three numbers +``` -> 注意: -> 一个函数至多能有一个可变参数,而且它必须是参数表中最后的一个。这样做是为了避免函数调用时出现歧义。 +> 注意: +> 一个函数至多能有一个可变参数,而且它必须是参数表中最后的一个。这样做是为了避免函数调用时出现歧义。 如果函数有一个或多个带默认值的参数,而且还有一个可变参数,那么把可变参数放在参数表的最后。 @@ -291,115 +344,134 @@ Swift统一的函数语法足够灵活,可以用来表示任何函数,包括 但是,有时候,如果函数中有传入参数的变量值副本将是很有用的。你可以通过指定一个或多个参数为变量参数,从而避免自己在函数中定义新的变量。变量参数不是常量,你可以在函数中把它当做新的可修改副本来使用。 -通过在参数名前加关键字`var`来定义变量参数: +通过在参数名前加关键字 `var` 来定义变量参数: - func alignRight(var string: String, count: Int, pad: Character) -> String { - let amountToPad = count - countElements(string) - for _ in 1...amountToPad { - string = pad + string - } - return string - } - let originalString = "hello" - let paddedString = alignRight(originalString, 10, "-") - // paddedString is equal to "-----hello" - // originalString is still equal to "hello” +```swift +func alignRight(var string: String, count: Int, pad: Character) -> String { + let amountToPad = count - countElements(string) + for _ in 1...amountToPad { + string = pad + string + } + return string +} +let originalString = "hello" +let paddedString = alignRight(originalString, 10, "-") +// paddedString is equal to "-----hello" +// originalString is still equal to "hello" +``` -这个例子中定义了一个新的叫做`alignRight`的函数,用来右对齐输入的字符串到一个长的输出字符串中。左侧空余的地方用指定的填充字符填充。这个例子中,字符串`"hello"`被转换成了`"-----hello"`。 +这个例子中定义了一个新的叫做 `alignRight` 的函数,用来右对齐输入的字符串到一个长的输出字符串中。左侧空余的地方用指定的填充字符填充。这个例子中,字符串`"hello"`被转换成了`"-----hello"`。 -`alignRight`函数将参数`string`定义为变量参数。这意味着`string`现在可以作为一个局部变量,用传入的字符串值初始化,并且可以在函数体中进行操作。 +`alignRight` 函数将参数 `string` 定义为变量参数。这意味着 `string` 现在可以作为一个局部变量,用传入的字符串值初始化,并且可以在函数体中进行操作。 -该函数首先计算出多少个字符需要被添加到`string`的左边,以右对齐到总的字符串中。这个值存在局部常量`amountToPad`中。这个函数然后将`amountToPad`多的填充(pad)字符填充到`string`左边,并返回结果。它使用了`string`这个变量参数来进行所有字符串操作。 +该函数首先计算出多少个字符需要被添加到 `string` 的左边,以右对齐到总的字符串中。这个值存在局部常量 `amountToPad` 中。这个函数然后将 `amountToPad` 多的填充(pad)字符填充到 `string` 左边,并返回结果。它使用了 `string` 这个变量参数来进行所有字符串操作。 -> 注意: -> 对变量参数所进行的修改在函数调用结束后变消息了,并且对于函数体外是不可见的。变量参数仅仅存在于函数调用的生命周期中。 +> 注意: +> 对变量参数所进行的修改在函数调用结束后便消失了,并且对于函数体外是不可见的。变量参数仅仅存在于函数调用的生命周期中。 ### 输入输出参数(In-Out Parameters) 变量参数,正如上面所述,仅仅能在函数体内被更改。如果你想要一个函数可以修改参数的值,并且想要在这些修改在函数调用结束后仍然存在,那么就应该把这个参数定义为输入输出参数(In-Out Parameters)。 -定义一个输入输出参数时,在参数定义前加`inout`关键字。一个输入输出参数有传入函数的值,这个值被函数修改,然后被传出函数,替换原来的值。 +定义一个输入输出参数时,在参数定义前加 `inout` 关键字。一个输入输出参数有传入函数的值,这个值被函数修改,然后被传出函数,替换原来的值。 你只能传入一个变量作为输入输出参数。你不能传入常量或者字面量(literal value),因为这些量是不能被修改的。当传入的参数作为输入输出参数时,需要在参数前加`&`符,表示这个值可以被函数修改。 -> 注意: -> 输入输出参数不能有默认值,而且变量参数不能用`inout`标记。如果你用`inout`标记一个参数,这个参数不能别`var`或者`let`标记。 +> 注意: +> 输入输出参数不能有默认值,而且可变参数不能用 `inout` 标记。如果你用 `inout` 标记一个参数,这个参数不能被 `var` 或者 `let` 标记。 -下面是例子,`swapTwoInts`函数,有两个分别叫做`a`和`b`的输出输出参数: +下面是例子,`swapTwoInts` 函数,有两个分别叫做 `a` 和 `b` 的输出输出参数: - func swapTwoInts(inout a: Int, inout b: Int) { - let temporaryA = a - a = b - b = temporaryA - } +```swift +func swapTwoInts(inout a: Int, inout b: Int) { + let temporaryA = a + a = b + b = temporaryA +} +``` -这个`swapTwoInts`函数仅仅交换`a`与`b`的值。该函数先将`a`的值存到一个暂时常量`temporaryA`中,然后将`b`的值赋给`a`,最后将`temporaryA`幅值给`b`。 +这个 `swapTwoInts` 函数仅仅交换 `a` 与 `b` 的值。该函数先将 `a` 的值存到一个暂时常量 `temporaryA` 中,然后将 `b` 的值赋给 `a`,最后将 `temporaryA` 幅值给 `b`。 -你可以用两个`Int`型的变量来调用`swapTwoInts`。需要注意的是,`someInt`和`anotherInt`在传入`swapTwoInts`函数前,都加了`&`的前缀: +你可以用两个 `Int` 型的变量来调用 `swapTwoInts`。需要注意的是,`someInt` 和 `anotherInt` 在传入 `swapTwoInts` 函数前,都加了 `&` 的前缀: - var someInt = 3 - var anotherInt = 107 - swapTwoInts(&someInt, &anotherInt) - println("someInt is now \(someInt), and anotherInt is now \(anotherInt)") - // prints "someInt is now 107, and anotherInt is now 3” +```swift +var someInt = 3 +var anotherInt = 107 +swapTwoInts(&someInt, &anotherInt) +println("someInt is now \(someInt), and anotherInt is now \(anotherInt)") +// prints "someInt is now 107, and anotherInt is now 3” +``` -从上面这个例子中,我们可以看到`someInt`和`anotherInt`的原始值在`swapTwoInts`函数中被修改,尽管它们的定义在函数体外。 +从上面这个例子中,我们可以看到 `someInt` 和 `anotherInt` 的原始值在 `swapTwoInts` 函数中被修改,尽管它们的定义在函数体外。 -> 注意: -> 输出输出参数和返回值是不一样的。上面的`swapTwoInts`函数并没有定义任何返回值,但仍然修改了`someInt`和`anotherInt`的值。输入输出参数是函数对函数体外产生影响的另一种方式。 +> 注意: +> 输出输出参数和返回值是不一样的。上面的 `swapTwoInts` 函数并没有定义任何返回值,但仍然修改了 `someInt` 和 `anotherInt` 的值。输入输出参数是函数对函数体外产生影响的另一种方式。 + ## 函数类型(Function Types) 每个函数都有种特定的函数类型,由函数的参数类型和返回类型组成。 例如: - func addTwoInts(a: Int, b: Int) -> Int { - return a + b - } - func multiplyTwoInts(a: Int, b: Int) -> Int { - return a * b - } +```swift +func addTwoInts(a: Int, b: Int) -> Int { + return a + b +} +func multiplyTwoInts(a: Int, b: Int) -> Int { + return a * b +} +``` -这个例子中定义了两个简单的数学函数:`addTwoInts`和`multiplyTwoInts`。这两个函数都传入两个`Int`类型, 返回一个合适的`Int`值。 +这个例子中定义了两个简单的数学函数:`addTwoInts` 和 `multiplyTwoInts`。这两个函数都传入两个 `Int` 类型, 返回一个合适的`Int`值。 -这两个函数的类型是`(Int, Int) -> Int`,可以读作“这个函数类型,它有两个`Int`型的参数并返回一个`Int`型的值。”。 +这两个函数的类型是 `(Int, Int) -> Int`,可以读作“这个函数类型,它有两个 `Int` 型的参数并返回一个 `Int` 型的值。”。 下面是另一个例子,一个没有参数,也没有返回值的函数: - func printHelloWorld() { - println("hello, world") - } +```swift +func printHelloWorld() { + println("hello, world") +} +``` -这个函数的类型是:`() -> ()`,或者叫“没有参数,并返回`Void`类型的函数。”。没有指定返回类型的函数总返回 `Void`。在Swift中,`Void`与空的元组是一样的。 +这个函数的类型是:`() -> ()`,或者叫“没有参数,并返回 `Void` 类型的函数”。没有指定返回类型的函数总返回 `Void`。在Swift中,`Void` 与空的元组是一样的。 ### 使用函数类型(Using Function Types) -在Swift中,使用函数类型就像使用其他类型一样。例如,你可以定义一个常量或变量,它的类型是函数,并且可以幅值为一个函数: +在 Swift 中,使用函数类型就像使用其他类型一样。例如,你可以定义一个类型为函数的常量或变量,并将函数赋值给它: - var mathFunction: (Int, Int) -> Int = addTwoInts +```swift +var mathFunction: (Int, Int) -> Int = addTwoInts +``` 这个可以读作: -“定义一个叫做`mathFunction`的变量,类型是‘一个有两个`Int`型的参数并返回一个`Int`型的值的函数’,并让这个新变量指向`addTwoInts`函数”。 +“定义一个叫做 `mathFunction` 的变量,类型是‘一个有两个 `Int` 型的参数并返回一个 `Int` 型的值的函数’,并让这个新变量指向 `addTwoInts` 函数”。 -`addTwoInts`和`mathFunction`有同样的类型,所以这个赋值过程在Swift类型检查中是允许的。 +`addTwoInts` 和 `mathFunction` 有同样的类型,所以这个赋值过程在 Swift 类型检查中是允许的。 -现在,你可以用`mathFunction`来调用被赋值的函数了: +现在,你可以用 `mathFunction` 来调用被赋值的函数了: - println("Result: \(mathFunction(2, 3))") - // prints "Result: 5 +```swift +println("Result: \(mathFunction(2, 3))") +// prints "Result: 5" +``` 有相同匹配类型的不同函数可以被赋值给同一个变量,就像非函数类型的变量一样: - mathFunction = multiplyTwoInts - println("Result: \(mathFunction(2, 3))") - // prints "Result: 6" +```swift +mathFunction = multiplyTwoInts +println("Result: \(mathFunction(2, 3))") +// prints "Result: 6" +``` -就像其他类型一样,当赋值一个函数给常量或变量时,你可以让Swift来推测其函数类型: +就像其他类型一样,当赋值一个函数给常量或变量时,你可以让 Swift 来推断其函数类型: - let anotherMathFunction = addTwoInts - // anotherMathFunction is inferred to be of type (Int, Int) -> Int +```swift +let anotherMathFunction = addTwoInts +// anotherMathFunction is inferred to be of type (Int, Int) -> Int +``` ### 函数类型作为参数类型(Function Types as Parameter Types) @@ -407,82 +479,95 @@ Swift统一的函数语法足够灵活,可以用来表示任何函数,包括 下面是另一个例子,正如上面的函数一样,同样是输出某种数学运算结果: - func printMathResult(mathFunction: (Int, Int) -> Int, a: Int, b: Int) { - println("Result: \(mathFunction(a, b))") - } - printMathResult(addTwoInts, 3, 5) - // prints "Result: 8” +```swift +func printMathResult(mathFunction: (Int, Int) -> Int, a: Int, b: Int) { + println("Result: \(mathFunction(a, b))") +} +printMathResult(addTwoInts, 3, 5) +// prints "Result: 8” +``` -这个例子定义了`printMathResult`函数,它有三个参数:第一个参数叫`mathFunction`,类型是`(Int, Int) -> Int`,你可以传入任何这种类型的函数;第二个和第三个参数叫`a`和`b`,它们的类型都是`Int`,这两个值作为已给的函数的输入值。 +这个例子定义了 `printMathResult` 函数,它有三个参数:第一个参数叫 `mathFunction`,类型是`(Int, Int) -> Int`,你可以传入任何这种类型的函数;第二个和第三个参数叫 `a` 和 `b`,它们的类型都是 `Int`,这两个值作为已给的函数的输入值。 -当`printMathResult`被调用时,它被传入`addTwoInts`函数和整数`3`和`5`。它用传入`3`和`5`调用`addTwoInts`,并输出结果:`8`。 +当 `printMathResult` 被调用时,它被传入 `addTwoInts` 函数和整数`3`和`5`。它用传入`3`和`5`调用 `addTwoInts`,并输出结果:`8`。 -`printMathResult`函数的作用就是输出另一个合适类型的数学函数的调用结果。它不关心传入函数是如何实现的,它只关心这个传入的函数类型是正确的。这使得`printMathResult`可以以一种类型安全(type-safe)的方式来保证传入函数的调用是正确的。 +`printMathResult` 函数的作用就是输出另一个合适类型的数学函数的调用结果。它不关心传入函数是如何实现的,它只关心这个传入的函数类型是正确的。这使得 `printMathResult` 可以以一种类型安全(type-safe)的方式来保证传入函数的调用是正确的。 ### 函数类型作为返回类型(Function Type as Return Types) 你可以用函数类型作为另一个函数的返回类型。你需要做的是在返回箭头(`->`)后写一个完整的函数类型。 -下面的这个例子中定义了两个简单函数,分别是`stepForward`和`stepBackward`。`stepForward`函数返回一个比输入值大一的值。`stepBackward`函数返回一个比输入值小一的值。这两个函数的类型都是`(Int) -> Int`: +下面的这个例子中定义了两个简单函数,分别是 `stepForward` 和`stepBackward`。`stepForward` 函数返回一个比输入值大一的值。`stepBackward` 函数返回一个比输入值小一的值。这两个函数的类型都是 `(Int) -> Int`: - func stepForward(input: Int) -> Int { - return input + 1 - } - func stepBackward(input: Int) -> Int { - return input - 1 - } +```swift +func stepForward(input: Int) -> Int { + return input + 1 +} +func stepBackward(input: Int) -> Int { + return input - 1 +} +``` -下面这个叫做`chooseStepFunction`的函数,它的返回类型是`(Int) -> Int`的函数。`chooseStepFunction`根据布尔值`backwards`来返回`stepForward`函数或`stepBackward`函数: +下面这个叫做 `chooseStepFunction` 的函数,它的返回类型是 `(Int) -> Int` 的函数。`chooseStepFunction` 根据布尔值 `backwards` 来返回 `stepForward` 函数或 `stepBackward` 函数: - func chooseStepFunction(backwards: Bool) -> (Int) -> Int { - return backwards ? stepBackward : stepForward - } +```swift +func chooseStepFunction(backwards: Bool) -> (Int) -> Int { + return backwards ? stepBackward : stepForward +} +``` -你现在可以用`chooseStepFunction`来获得一个函数,不管是那个方向: +你现在可以用 `chooseStepFunction` 来获得一个函数,不管是那个方向: - var currentValue = 3 - let moveNearerToZero = chooseStepFunction(currentValue > 0) - // moveNearerToZero now refers to the stepBackward() function +```swift +var currentValue = 3 +let moveNearerToZero = chooseStepFunction(currentValue > 0) +// moveNearerToZero now refers to the stepBackward() function +``` -上面这个例子中计算出从`currentValue`逐渐接近到`0`是需要向正数走还是向负数走。`currentValue`的初始值是`3`,这意味着`currentValue > 0`是真的(`true`),这将使得`chooseStepFunction`返回`stepBackward`函数。一个指向返回的函数的引用保存在了`moveNearerToZero`常量中。 +上面这个例子中计算出从 `currentValue` 逐渐接近到`0`是需要向正数走还是向负数走。`currentValue` 的初始值是`3`,这意味着 `currentValue > 0` 是真的(`true`),这将使得 `chooseStepFunction` 返回 `stepBackward` 函数。一个指向返回的函数的引用保存在了 `moveNearerToZero` 常量中。 -现在,`moveNearerToZero`指向了正确的函数,它可以被用来数到`0`: +现在,`moveNearerToZero` 指向了正确的函数,它可以被用来数到`0`: - println("Counting to zero:") - // Counting to zero: - while currentValue != 0 { - println("\(currentValue)... ") - currentValue = moveNearerToZero(currentValue) - } - println("zero!") - // 3... - // 2... - // 1... - // zero! +```swift +println("Counting to zero:") +// Counting to zero: +while currentValue != 0 { + println("\(currentValue)... ") + currentValue = moveNearerToZero(currentValue) +} +println("zero!") +// 3... +// 2... +// 1... +// zero! +``` + ## 嵌套函数(Nested Functions) 这章中你所见到的所有函数都叫全局函数(global functions),它们定义在全局域中。你也可以把函数定义在别的函数体中,称作嵌套函数(nested functions)。 默认情况下,嵌套函数是对外界不可见的,但是可以被他们封闭函数(enclosing function)来调用。一个封闭函数也可以返回它的某一个嵌套函数,使得这个函数可以在其他域中被使用。 -你可以用返回嵌套函数的方式重写`chooseStepFunction`函数: +你可以用返回嵌套函数的方式重写 `chooseStepFunction` 函数: - func chooseStepFunction(backwards: Bool) -> (Int) -> Int { - func stepForward(input: Int) -> Int { return input + 1 } - func stepBackward(input: Int) -> Int { return input - 1 } - return backwards ? stepBackward : stepForward - } - var currentValue = -4 - let moveNearerToZero = chooseStepFunction(currentValue > 0) - // moveNearerToZero now refers to the nested stepForward() function - while currentValue != 0 { - println("\(currentValue)... ") - currentValue = moveNearerToZero(currentValue) - } - println("zero!") - // -4... - // -3... - // -2... - // -1... - // zero! +```swift +func chooseStepFunction(backwards: Bool) -> (Int) -> Int { + func stepForward(input: Int) -> Int { return input + 1 } + func stepBackward(input: Int) -> Int { return input - 1 } + return backwards ? stepBackward : stepForward +} +var currentValue = -4 +let moveNearerToZero = chooseStepFunction(currentValue > 0) +// moveNearerToZero now refers to the nested stepForward() function +while currentValue != 0 { + println("\(currentValue)... ") + currentValue = moveNearerToZero(currentValue) +} +println("zero!") +// -4... +// -3... +// -2... +// -1... +// zero! +``` diff --git a/source/chapter2/07_Closures.md b/source/chapter2/07_Closures.md old mode 100644 new mode 100755 index 15658a18..6141c945 --- a/source/chapter2/07_Closures.md +++ b/source/chapter2/07_Closures.md @@ -1,365 +1,375 @@ -# 闭包 - -本页内容包含: - -- 闭包表达式 -- Trailing闭包 -- 值捕获 -- 闭包是引用类型 - -闭包是功能性自包含模块,可以在代码中被传递和使用。 -Swift 中的闭包与 C 和 Objective-C 中的 `blocks` 以及其他一些编程语言中的 `lambdas` 比较相似。 - -闭包可以 **捕获** 和存储其所在上下文中任意常量和变量的引用。 -这就是所谓的闭合并包裹着这些常量和变量,俗称闭包。Swift 会为您管理在 **捕获** 过程中涉及到的内存操作。 - -> 注意: -> -> 如果您不熟悉 **捕获** (capturing) 这个概念也不用担心,后面会详细对其进行介绍。 - -在 `函数` 章节中介绍的全局和嵌套函数实际上也是特殊的闭包,闭包采取如下三种形式之一: - -* 全局函数是一个有名字但不会捕获任何值的闭包 -* 嵌套函数是一个有名字并可以捕获其封闭函数域内值的闭包 -* 闭包表达式是一个利用轻量级语法所写的可以捕获其上下文中变量或常量值的没有名字的闭包 - -Swift 的闭包表达式拥有简洁的风格,并鼓励在常见场景中进行语法优化,主要优化如下: - -* 利用上下文推断参数和返回值类型 -* 单表达式闭包可以省略 `return` 关键字 -* 参数名称缩写 -* Trailing 闭包语法 - -### 闭包表达式 - -嵌套函数是一个在较复杂函数中方便进行命名和定义自包含代码模块的方式。 -当然,有时候撰写小巧的没有完整定义和命名的类函数结构也是很有用处的,尤其是在您处理一些函数并需要将另外一些函数作为该函数的参数时。 - -闭包表达式是一种利用简洁语法构建内联闭包的方式。 -闭包表达式提供了一些语法优化,使得撰写闭包变得简单明了。 -下面闭包表达式的例子通过使用几次迭代展示了 `sort` 函数定义和语法优化的方式。 -每一次迭代都用更简洁的方式描述了相同的功能。 - -##### `sort` 函数 - -Swift 标准库提供了 `sort` 函数,会根据您提供的排序闭包将已知类型数组中的值进行排序。 -一旦排序完成,函数会返回一个与原数组大小相同的新数组,该数组中包含已经正确排序的同类型元素。 - -下面的闭包表达式示例使用 `sort` 函数对一个 **String** 类型的数组进行字母逆序排序,以下是初始数组值: - -``` -let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"] -``` - -该例子对一个 **String** 类型的数组进行排序,因此排序闭包需为 `(String, String) -> Bool` 类型的函数。 - -提供排序闭包的一种方式是撰写一个符合其类型要求的普通函数,并将其作为 `sort` 函数的第二个参数传入: - -``` -func backwards(s1: String, s2: String) -> Bool { - return s1 > s2 -} -var reversed = sort(names, backwards) -// reversed is equal to ["Ewa", "Daniella", "Chris", "Barry", "Alex"] -``` - -如果第一个字符串 (s1) 大于第二个字符串 (s2),`backwards` 函数则返回 `true`,表示在新的数组中 s1 应该出现在 s2 前。 -字符中的 "大于" 表示 "按照字母顺序后出现"。 -这意味着字母 "B" 大于字母 "A", 字符串 "Tom" 大于字符串 "Tim"。 -其将进行字母逆序排序,"Barry" 将会排在 "Alex" 之后。 - -然而,这是一个相当冗长的方式,本质上只是写了一个单表达式函数 (a > b)。 -在下面的例子中,利用闭合表达式语法可以更好的构造一个内联排序闭包。 - -##### 闭包表达式语法 - -闭包表达式语法有如下一般形式: - -``` -{ (parameters) -> returnType in - statements -} -``` - -闭包表达式语法可以使用常量、变量和 `inout` 类型作为参数,不提供默认值。 -也可以在参数列表的最后使用可变参数。元组也可以作为参数和返回值。 - -下面的例子展示了之前 `backwards` 函数对应的闭包表达式版本的代码: - -``` -reversed = sort(names, { (s1: String, s2: String) -> Bool in - return s1 > s2 - }) -``` - -需要注意的是内联闭包参数和返回值类型声明与 `backwards` 函数类型声明相同。 -在这两种方式中,都写成了 (s1: String, s2: String) -> Bool。 -然而在内联闭包表达式中,函数和返回值类型都写在大括号内,而不是大括号外。 - -闭包的函数体部分由关键字 `in` 引入。 -该关键字表示闭包的参数和返回值类型定义已经完成,闭包函数体即将开始。 - -因为这个闭包的函数体部分如此短以至于可以将其改写成一行代码: - -``` -reversed = sort(names, { (s1: String, s2: String) -> Bool in return s1 > s2 } ) -``` - -这说明 `sort` 函数的整体调用保持不变,一对圆括号仍然包裹住了函数中整个参数集合。而其中一个参数现在变成了内联闭包 (相比于 `backwards` 版本的代码)。 - -##### 根据上下文推断类型 - -因为排序闭包是作为函数的参数进行传入的,Swift可以推断其参数和返回值的类型。 -`sort` 期望第二个参数是类型为 `(String, String) -> Bool` 的函数,因此实际上 `String`, `String` 和 `Bool` 类型并不需要作为闭包表达式定义中的一部分。 -因为所有的类型都可以被正确推断,返回箭头 (->) 和 围绕在参数周围的括号也可以被省略: - -``` -reversed = sort(names, { s1, s2 in return s1 > s2 } ) -``` - -实际上任何情况下,通过内联闭包表达式构造的闭包作为参数传递给函数时,都可以推断出闭包的参数和返回值类型,这意味着您几乎不需要利用完整格式构造任何内联闭包。 - -##### 单行表达式闭包可以省略 `return` - -单行表达式闭包可以通过隐藏 `return` 关键字来隐式返回单行表达式的结果,如上版本的例子可以改写为: - -``` -reversed = sort(names, { s1, s2 in s1 > s2 } ) -``` - -在这个例子中,`sort` 函数的第二个参数函数类型明确了闭包必须返回一个 **Bool** 类型值。 -因为闭包函数体只包含了一个单一表达式 (s1 > s2),该表达式返回 **Bool** 类型值,因此这里没有歧义,`return`关键字可以省略。 - -##### 参数名称缩写 - -Swift 自动为内联函数提供了参数名称缩写功能,您可以直接通过 `$0`,`$1`,`$2` 来顺序调用闭包的参数。 - -如果您在闭包表达式中使用参数名称缩写,您可以在闭包参数列表中省略对其的定义,并且对应参数名称缩写的类型会通过函数类型进行推断。 -`in` 关键字也同样可以被省略,因为此时闭包表达式完全由闭包函数体构成: - -``` -reversed = sort(names, { $0 > $1 } ) -``` - -在这个例子中,`$0` 和 `$1` 表示闭包中第一个和第二个 **String** 类型的参数。 - -##### 运算符函数 - -实际上还有一种更简短的方式来撰写上面例子中的闭包表达式。 -Swift 的 **String** 类型定义了关于大于号 (>) 的字符串实现,其作为一个函数接受两个 **String** 类型的参数并返回 **Bool** 类型的值。 -而这正好与 `sort` 函数的第二个参数需要的函数类型相符合。 -因此,您可以简单地传递一个大于号,Swift可以自动推断出您想使用大于号的字符串函数实现: - -``` -reversed = sort(names, >) -``` - -更多关于运算符表达式的内容请查看 [Operator Functions](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-XID_43) 。 - -### Trailing 闭包 - -如果您需要将一个很长的闭包表达式作为最后一个参数传递给函数,可以使用 trailing 闭包来增强函数的可读性。 -Trailing 闭包是一个书写在函数括号之外(之后)的闭包表达式,函数支持将其作为最后一个参数调用。 - -``` -func someFunctionThatTakesAClosure(closure: () -> ()) { - // 函数体部分 -} - -// 以下是不使用 trailing 闭包进行函数调用 - -someFunctionThatTakesAClosure({ - // 闭包主体部分 - }) - -// 以下是使用 trailing 闭包进行函数调用 - -someFunctionThatTakesAClosure() { - // 闭包主体部分 -} -``` -> 注意: -> -> 如果函数只需要闭包表达式一个参数,当您使用 trailing 闭包时,您甚至可以把 () 省略掉。 -NOTE - -在上例中作为 `sort` 函数参数的字符串排序闭包可以改写为: - -``` -reversed = sort(names) { $0 > $1 } -``` - -当闭包非常长以至于不能在一行中进行书写时,Trailing 闭包变得非常有用。 -举例来说,Swift 的 **Array** 类型有一个 `map` 方法,其获取一个闭包表达式作为其唯一参数。 -数组中的每一个元素调用一次该闭包函数,并返回该元素所映射的值(也可以是不同类型的值)。 -具体的映射方式和返回值类型由闭包来指定。 - -当提供给数组闭包函数后,`map` 方法将返回一个新的数组,数组中包含了与原数组一一对应的映射后的值。 - -下例介绍了如何在 `map` 方法中使用 trailing 闭包将 **Int** 类型数组 `[16,58,510]` 转换为包含对应 **String** 类型的数组 `["OneSix", "FiveEight", "FiveOneZero"]`: - -``` -let digitNames = [ - 0: "Zero", 1: "One", 2: "Two", 3: "Three", 4: "Four", - 5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine" -] -let numbers = [16, 58, 510] -``` - -如上代码创建了一个数字位和他们名字映射的英文版本字典。 -同时定义了一个准备转换为字符串的整型数组。 - -您现在可以通过传递一个 trailing 闭包给 `numbers` 的 `map` 方法来创建对应的字符串版本数组。 -需要注意的时调用 `numbers.map` 不需要在 `map` 后面包含任何括号,因为其只需要传递闭包表达式这一个参数,并且该闭包表达式参数通过 trailing 方式进行撰写: - -``` -let strings = numbers.map { - (var number) -> String in - var output = "" - while number > 0 { - output = digitNames[number % 10]! + output - number /= 10 - } - return output -} -// strings 常量被推断为字符串类型数组,即 String[] -// 其值为 ["OneSix", "FiveEight", "FiveOneZero"] -``` - -`map` 在数组中为每一个元素调用了闭包表达式。 -您不需要指定闭包的输入参数 `number` 的类型,因为可以通过要映射的数组类型进行推断。 - -闭包 `number` 参数被声明为一个变量参数 (变量的具体描述请参看[Constant and Variable Parameters](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Functions.html#//apple_ref/doc/uid/TP40014097-CH10-XID_224)),因此可以在闭包函数体内对其进行修改。 -闭包表达式制定了返回类型为 **String**,以表明存储映射值的新数组类型为 **String**。 - -闭包表达式在每次被调用的时候创建了一个字符串并返回。 -其使用求余运算符 (number % 10) 计算最后一位数字并利用 `digitNames` 字典获取所映射的字符串。 - -> 注意: -> -> 字典 `digitNames` 下标后跟着一个叹号 (!),因为字典下标返回一个可选值 (optional value),表明即使该 key 不存在也不会查找失败。 -> 在上例中,它保证了 `number % 10` 可以总是作为一个 `digitNames` 字典的有效下标 key。 -> 因此叹号可以用于强制展开 (force-unwrap) 存储在可选下标项中的 **String** 类型值。 - -从 `digitNames` 字典中获取的字符串被添加到输出的前部,逆序建立了一个字符串版本的数字。 -(在表达式 `number % 10`中,如果number为16,则返回6,58返回8,510返回0)。 - -`number` 变量之后除以10。 -因为其是整数,在计算过程中未除尽部分被忽略。 -因此 16变成了1,58变成了5,510变成了51。 - -整个过程重复进行,直到 `number /= 10` 为0,这时闭包会将字符串输出,而map函数则会将字符串添加到所映射的数组中。 - -上例中 trailing 闭包语法在函数后整洁封装了具体的闭包功能,而不再需要将整个闭包包裹在 `map` 函数的括号内。 - -### 捕获 (Caputure) - -闭包可以在其定义的上下文中捕获常量或变量。 -即使定义这些常量和变量的原域已经不存在,闭包仍然可以在闭包函数体内引用和修改这些值。 - -Swift最简单的闭包形式是嵌套函数,也就是定义在其他函数的函数体内的函数。 -嵌套函数可以捕获其外部函数所有的参数以及定义的常量和变量。 - -下例为一个叫做 `makeIncrementor` 的函数,其包含了一个叫做 `incrementor` 嵌套函数。 -嵌套函数 `incrementor` 从上下文中捕获了两个值,`runningTotal` 和 `amount`。 -之后 `makeIncrementor` 将 `incrementor` 作为闭包返回。 -每次调用 `incrementor` 时,其会以 `amount` 作为增量增加 `runningTotal` 的值。 - -``` -func makeIncrementor(forIncrement amount: Int) -> () -> Int { - var runningTotal = 0 - func incrementor() -> Int { - runningTotal += amount - return runningTotal - } - return incrementor -} -``` - -`makeIncrementor` 返回类型为 `() -> Int`。 -这意味着其返回的是一个函数,而不是一个简单类型值。 -该函数在每次调用时不接受参数只返回一个 **Int** 类型的值。 -关于函数返回其他函数的内容,请查看[Function Types as Return Types](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Functions.html#//apple_ref/doc/uid/TP40014097-CH10-XID_232)。 - -`makeIncrementor` 函数定义了一个整型变量 `runningTotal` (初始为0) 用来存储当前跑步总数。 -该值通过 `incrementor` 返回。 - -`makeIncrementor` 有一个 **Int** 类型的参数,其外部命名为 `forIncrement`, 内部命名为 `amount`,表示每次 `incrementor` 被调用时 `runningTotal` 将要增加的量。 - -`incrementor` 函数用来执行实际的增加操作。 -该函数简单地使 `runningTotal` 增加 `amount`,并将其返回。 - -如果我们单独看这个函数,会发现看上去不同寻常: - -``` -func incrementor() -> Int { - runningTotal += amount - return runningTotal -} -``` - -`incrementor` 函数并没有获取任何参数,但是在函数体内访问了 `runningTotal` 和 `amount` 变量。这是因为其通过捕获在包含它的函数体内已经存在的 `runningTotal` 和 `amount` 变量而实现。 - -由于没有修改 `amount` 变量,`incrementor` 实际上捕获并存储了该变量的一个副本,而该副本随着 `incrementor` 一同被存储。 - -然而,因为每次调用该函数的时候都会修改 `runningTotal` 的值,`incrementor` 捕获了当前 `runningTotal` 变量的引用,而不是仅仅复制该变量的初始值。捕获一个引用保证了当 `makeIncrementor` 结束时候并不会消失,也保证了当下一次执行 `incrementor` 函数时,`runningTotal` 可以继续增加。 - -> 注意: -> -> Swift 会决定捕获引用还是拷贝值。 -> 您不需要标注 `amount` 或者 `runningTotal` 来声明在嵌入的 `incrementor` 函数中的使用方式。 -> Swift 同时也处理 `runingTotal` 变量的内存管理操作,如果不再被 `incrementor` 函数使用,则会被清除。 - -下面为一个使用 `makeIncrementor` 的例子: - -``` -let incrementByTen = makeIncrementor(forIncrement: 10) -``` - -该例子定义了一个叫做 `incrementByTen` 的常量,该常量指向一个每次调用会加10的 `incrementor` 函数。 -调用这个函数多次可以得到以下结果: - -``` -incrementByTen() -// 返回的值为10 -incrementByTen() -// 返回的值为20 -incrementByTen() -// 返回的值为30 -``` - -如果您创建了另一个 `incrementor`,其会有一个属于自己的独立的 `runningTotal` 变量的引用。 -下面的例子中,`incrementBySevne` 捕获了一个新的 `runningTotal` 变量,该变量和 `incrementByTen` 中捕获的变量没有任何联系: - -``` -let incrementBySeven = makeIncrementor(forIncrement: 7) -incrementBySeven() -// 返回的值为7 -incrementByTen() -// 返回的值为40 -``` - -> 注意: -> -> 如果您闭包分配给一个类实例的属性,并且该闭包通过指向该实例或其成员来捕获了该实例,您将创建一个在闭包和实例间的强引用环。 -> Swift 使用捕获列表来打破这种强引用环。更多信息,请参考 [Strong Reference Cycles for Closures](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AutomaticReferenceCounting.html#//apple_ref/doc/uid/TP40014097-CH20-XID_61)。 - -### 闭包是引用类型 - -上面的例子中,`incrementBySeven` 和 `incrementByTen` 是常量,但是这些常量指向的闭包仍然可以增加其捕获的变量值。 -这是因为函数和闭包都是引用类型。 - -无论您将函数/闭包赋值给一个常量还是变量,您实际上都是将常量/变量的值设置为对应函数/闭包的引用。 -上面的例子中,`incrementByTen` 指向闭包的引用是一个常量,而并非闭包内容本身。 - -这也意味着如果您将闭包赋值给了两个不同的常量/变量,两个值都会指向同一个闭包: - -``` -let alsoIncrementByTen = incrementByTen -alsoIncrementByTen() -// 返回的值为50 -``` - - - - +> 翻译:[wh1100717](https://github.com/wh1100717) +> 校对:[lyuka](https://github.com/lyuka) + +# 闭包(Closures) +----------------- + +本页包含内容: + +- [闭包表达式(Closure Expressions)](#closure_expressions) +- [尾随闭包(Trailing Closures)](#trailing_closures) +- [值捕获(Capturing Values)](#capturing_values) +- [闭包是引用类型(Closures Are Reference Types)](#closures_are_reference_types) + +闭包是自包含的函数代码块,可以在代码中被传递和使用。 +Swift 中的闭包与 C 和 Objective-C 中的代码块(blocks)以及其他一些编程语言中的 lambdas 函数比较相似。 + +闭包可以捕获和存储其所在上下文中任意常量和变量的引用。 +这就是所谓的闭合并包裹着这些常量和变量,俗称闭包。Swift 会为您管理在捕获过程中涉及到的所有内存操作。 + +> 注意: +> 如果您不熟悉捕获(capturing)这个概念也不用担心,您可以在 [值捕获](#capturing_values) 章节对其进行详细了解。 + +在[函数](../chapter2/06_Functions.html) 章节中介绍的全局和嵌套函数实际上也是特殊的闭包,闭包采取如下三种形式之一: + +* 全局函数是一个有名字但不会捕获任何值的闭包 +* 嵌套函数是一个有名字并可以捕获其封闭函数域内值的闭包 +* 闭包表达式是一个利用轻量级语法所写的可以捕获其上下文中变量或常量值的匿名闭包 + +Swift 的闭包表达式拥有简洁的风格,并鼓励在常见场景中进行语法优化,主要优化如下: + +* 利用上下文推断参数和返回值类型 +* 隐式返回单表达式闭包,即单表达式闭包可以省略`return`关键字 +* 参数名称缩写 +* 尾随(Trailing)闭包语法 + + +## 闭包表达式(Closure Expressions) + + +[嵌套函数](../chapter2/06_Functions.html#nested_function) 是一个在较复杂函数中方便进行命名和定义自包含代码模块的方式。当然,有时候撰写小巧的没有完整定义和命名的类函数结构也是很有用处的,尤其是在您处理一些函数并需要将另外一些函数作为该函数的参数时。 + +闭包表达式是一种利用简洁语法构建内联闭包的方式。 +闭包表达式提供了一些语法优化,使得撰写闭包变得简单明了。 +下面闭包表达式的例子通过使用几次迭代展示了`sort`函数定义和语法优化的方式。 +每一次迭代都用更简洁的方式描述了相同的功能。 + + +### sort 函数(The Sort Function) + +Swift 标准库提供了`sort`函数,会根据您提供的基于输出类型排序的闭包函数将已知类型数组中的值进行排序。 +一旦排序完成,函数会返回一个与原数组大小相同的新数组,该数组中包含已经正确排序的同类型元素。 + +下面的闭包表达式示例使用`sort`函数对一个`String`类型的数组进行字母逆序排序,以下是初始数组值: + +```swift +let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"] +``` + +`sort`函数需要传入两个参数: + +* 已知类型的数组 +* 闭包函数,该闭包函数需要传入与数组类型相同的两个值,并返回一个布尔类型值来告诉`sort`函数当排序结束后传入的第一个参数排在第二个参数前面还是后面。如果第一个参数值出现在第二个参数值前面,排序闭包函数需要返回`true`,反之返回`false`。 + +该例子对一个`String`类型的数组进行排序,因此排序闭包函数类型需为`(String, String) -> Bool`。 + +提供排序闭包函数的一种方式是撰写一个符合其类型要求的普通函数,并将其作为`sort`函数的第二个参数传入: + +```swift +func backwards(s1: String, s2: String) -> Bool { + return s1 > s2 +} +var reversed = sort(names, backwards) +// reversed 为 ["Ewa", "Daniella", "Chris", "Barry", "Alex"] +``` + +如果第一个字符串 (`s1`) 大于第二个字符串 (`s2`),`backwards`函数返回`true`,表示在新的数组中`s1`应该出现在`s2`前。 +对于字符串中的字符来说,“大于” 表示 “按照字母顺序较晚出现”。 +这意味着字母`"B"`大于字母`"A"`,字符串`"Tom"`大于字符串`"Tim"`。 +其将进行字母逆序排序,`"Barry"`将会排在`"Alex"`之后。 + +然而,这是一个相当冗长的方式,本质上只是写了一个单表达式函数 (a > b)。 +在下面的例子中,利用闭合表达式语法可以更好的构造一个内联排序闭包。 + + +### 闭包表达式语法(Closure Expression Syntax) + +闭包表达式语法有如下一般形式: + +```swift +{ (parameters) -> returnType in + statements +} +``` + +闭包表达式语法可以使用常量、变量和`inout`类型作为参数,不提供默认值。 +也可以在参数列表的最后使用可变参数。 +元组也可以作为参数和返回值。 + +下面的例子展示了之前`backwards`函数对应的闭包表达式版本的代码: + +```swift +reversed = sort(names, { (s1: String, s2: String) -> Bool in + return s1 > s2 +}) +``` + +需要注意的是内联闭包参数和返回值类型声明与`backwards`函数类型声明相同。 +在这两种方式中,都写成了`(s1: String, s2: String) -> Bool`。 +然而在内联闭包表达式中,函数和返回值类型都写在大括号内,而不是大括号外。 + +闭包的函数体部分由关键字`in`引入。 +该关键字表示闭包的参数和返回值类型定义已经完成,闭包函数体即将开始。 + +因为这个闭包的函数体部分如此短以至于可以将其改写成一行代码: + +```swift +reversed = sort(names, { (s1: String, s2: String) -> Bool in return s1 > s2 } ) +``` + +这说明`sort`函数的整体调用保持不变,一对圆括号仍然包裹住了函数中整个参数集合。而其中一个参数现在变成了内联闭包(相比于`backwards`版本的代码)。 + + +### 根据上下文推断类型(Inferring Type From Context) + +因为排序闭包函数是作为`sort`函数的参数进行传入的,Swift可以推断其参数和返回值的类型。 +`sort`期望第二个参数是类型为`(String, String) -> Bool`的函数,因此实际上`String`,`String`和`Bool`类型并不需要作为闭包表达式定义中的一部分。 +因为所有的类型都可以被正确推断,返回箭头 (`->`) 和围绕在参数周围的括号也可以被省略: + +```swift +reversed = sort(names, { s1, s2 in return s1 > s2 } ) +``` + +实际上任何情况下,通过内联闭包表达式构造的闭包作为参数传递给函数时,都可以推断出闭包的参数和返回值类型,这意味着您几乎不需要利用完整格式构造任何内联闭包。 + + +### 单表达式闭包隐式返回(Implicit Return From Single-Expression Clossures) + +单行表达式闭包可以通过隐藏`return`关键字来隐式返回单行表达式的结果,如上版本的例子可以改写为: + +```swift +reversed = sort(names, { s1, s2 in s1 > s2 } ) +``` + +在这个例子中,`sort`函数的第二个参数函数类型明确了闭包必须返回一个`Bool`类型值。 +因为闭包函数体只包含了一个单一表达式 (`s1 > s2`),该表达式返回`Bool`类型值,因此这里没有歧义,`return`关键字可以省略。 + + +### 参数名称缩写(Shorthand Argument Names) + +Swift 自动为内联函数提供了参数名称缩写功能,您可以直接通过`$0`,`$1`,`$2`来顺序调用闭包的参数。 + +如果您在闭包表达式中使用参数名称缩写,您可以在闭包参数列表中省略对其的定义,并且对应参数名称缩写的类型会通过函数类型进行推断。 +`in`关键字也同样可以被省略,因为此时闭包表达式完全由闭包函数体构成: + +```swift +reversed = sort(names, { $0 > $1 } ) +``` + +在这个例子中,`$0`和`$1`表示闭包中第一个和第二个`String`类型的参数。 + + +### 运算符函数(Operator Functions) + +实际上还有一种更简短的方式来撰写上面例子中的闭包表达式。 +Swift 的`String`类型定义了关于大于号 (`>`) 的字符串实现,其作为一个函数接受两个`String`类型的参数并返回`Bool`类型的值。 +而这正好与`sort`函数的第二个参数需要的函数类型相符合。 +因此,您可以简单地传递一个大于号,Swift可以自动推断出您想使用大于号的字符串函数实现: + +```swift +reversed = sort(names, >) +``` + +更多关于运算符表达式的内容请查看 [运算符函数](../chapter2/23_Advanced_Operators.html#operator_functions)。 + + +## 尾随闭包(Trailing Closures) + + +如果您需要将一个很长的闭包表达式作为最后一个参数传递给函数,可以使用尾随闭包来增强函数的可读性。 +尾随闭包是一个书写在函数括号之后的闭包表达式,函数支持将其作为最后一个参数调用。 + +```swift +func someFunctionThatTakesAClosure(closure: () -> ()) { + // 函数体部分 +} + +// 以下是不使用尾随闭包进行函数调用 +someFunctionThatTakesAClosure({ + // 闭包主体部分 +}) + +// 以下是使用尾随闭包进行函数调用 +someFunctionThatTakesAClosure() { + // 闭包主体部分 +} +``` + +> 注意: +> 如果函数只需要闭包表达式一个参数,当您使用尾随闭包时,您甚至可以把`()`省略掉。 + +在上例中作为`sort`函数参数的字符串排序闭包可以改写为: + +```swift +reversed = sort(names) { $0 > $1 } +``` + +当闭包非常长以至于不能在一行中进行书写时,尾随闭包变得非常有用。 +举例来说,Swift 的`Array`类型有一个`map`方法,其获取一个闭包表达式作为其唯一参数。 +数组中的每一个元素调用一次该闭包函数,并返回该元素所映射的值(也可以是不同类型的值)。 +具体的映射方式和返回值类型由闭包来指定。 + +当提供给数组闭包函数后,`map`方法将返回一个新的数组,数组中包含了与原数组一一对应的映射后的值。 + +下例介绍了如何在`map`方法中使用尾随闭包将`Int`类型数组`[16,58,510]`转换为包含对应`String`类型的数组`["OneSix", "FiveEight", "FiveOneZero"]`: + +```swift +let digitNames = [ + 0: "Zero", 1: "One", 2: "Two", 3: "Three", 4: "Four", + 5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine" +] +let numbers = [16, 58, 510] +``` + +如上代码创建了一个数字位和它们名字映射的英文版本字典。 +同时定义了一个准备转换为字符串的整型数组。 + +您现在可以通过传递一个尾随闭包给`numbers`的`map`方法来创建对应的字符串版本数组。 +需要注意的时调用`numbers.map`不需要在`map`后面包含任何括号,因为其只需要传递闭包表达式这一个参数,并且该闭包表达式参数通过尾随方式进行撰写: + +```swift +let strings = numbers.map { + (var number) -> String in + var output = "" + while number > 0 { + output = digitNames[number % 10]! + output + number /= 10 + } + return output +} +// strings 常量被推断为字符串类型数组,即 String[] +// 其值为 ["OneSix", "FiveEight", "FiveOneZero"] +``` + +`map`在数组中为每一个元素调用了闭包表达式。 +您不需要指定闭包的输入参数`number`的类型,因为可以通过要映射的数组类型进行推断。 + +闭包`number`参数被声明为一个变量参数(变量的具体描述请参看[常量参数和变量参数](../chapter2/06_Functions.html#constant_and_variable_parameters)),因此可以在闭包函数体内对其进行修改。闭包表达式制定了返回类型为`String`,以表明存储映射值的新数组类型为`String`。 + +闭包表达式在每次被调用的时候创建了一个字符串并返回。 +其使用求余运算符 (number % 10) 计算最后一位数字并利用`digitNames`字典获取所映射的字符串。 + +> 注意: +> 字典`digitNames`下标后跟着一个叹号 (!),因为字典下标返回一个可选值 (optional value),表明即使该 key 不存在也不会查找失败。 +> 在上例中,它保证了`number % 10`可以总是作为一个`digitNames`字典的有效下标 key。 +> 因此叹号可以用于强制解析 (force-unwrap) 存储在可选下标项中的`String`类型值。 + +从`digitNames`字典中获取的字符串被添加到输出的前部,逆序建立了一个字符串版本的数字。 +(在表达式`number % 10`中,如果number为16,则返回6,58返回8,510返回0)。 + +`number`变量之后除以10。 +因为其是整数,在计算过程中未除尽部分被忽略。 +因此 16变成了1,58变成了5,510变成了51。 + +整个过程重复进行,直到`number /= 10`为0,这时闭包会将字符串输出,而`map`函数则会将字符串添加到所映射的数组中。 + +上例中尾随闭包语法在函数后整洁封装了具体的闭包功能,而不再需要将整个闭包包裹在`map`函数的括号内。 + + +## 捕获值(Capturing Values) + + +闭包可以在其定义的上下文中捕获常量或变量。 +即使定义这些常量和变量的原域已经不存在,闭包仍然可以在闭包函数体内引用和修改这些值。 + +Swift最简单的闭包形式是嵌套函数,也就是定义在其他函数的函数体内的函数。 +嵌套函数可以捕获其外部函数所有的参数以及定义的常量和变量。 + +下例为一个叫做`makeIncrementor`的函数,其包含了一个叫做`incrementor`嵌套函数。 +嵌套函数`incrementor`从上下文中捕获了两个值,`runningTotal`和`amount`。 +之后`makeIncrementor`将`incrementor`作为闭包返回。 +每次调用`incrementor`时,其会以`amount`作为增量增加`runningTotal`的值。 + +```swift +func makeIncrementor(forIncrement amount: Int) -> () -> Int { + var runningTotal = 0 + func incrementor() -> Int { + runningTotal += amount + return runningTotal + } + return incrementor +} +``` + +`makeIncrementor`返回类型为`() -> Int`。 +这意味着其返回的是一个函数,而不是一个简单类型值。 +该函数在每次调用时不接受参数只返回一个`Int`类型的值。 +关于函数返回其他函数的内容,请查看[函数类型作为返回类型](../chapter2/06_Functions.html#function_types_as_return_types)。 + +`makeIncrementor`函数定义了一个整型变量`runningTotal`(初始为0) 用来存储当前跑步总数。 +该值通过`incrementor`返回。 + +`makeIncrementor`有一个`Int`类型的参数,其外部命名为`forIncrement`, 内部命名为`amount`,表示每次`incrementor`被调用时`runningTotal`将要增加的量。 + +`incrementor`函数用来执行实际的增加操作。 +该函数简单地使`runningTotal`增加`amount`,并将其返回。 + +如果我们单独看这个函数,会发现看上去不同寻常: + +```swift +func incrementor() -> Int { + runningTotal += amount + return runningTotal +} +``` + +`incrementor`函数并没有获取任何参数,但是在函数体内访问了`runningTotal`和`amount`变量。这是因为其通过捕获在包含它的函数体内已经存在的`runningTotal`和`amount`变量而实现。 + +由于没有修改`amount`变量,`incrementor`实际上捕获并存储了该变量的一个副本,而该副本随着`incrementor`一同被存储。 + +然而,因为每次调用该函数的时候都会修改`runningTotal`的值,`incrementor`捕获了当前`runningTotal`变量的引用,而不是仅仅复制该变量的初始值。捕获一个引用保证了当`makeIncrementor`结束时候并不会消失,也保证了当下一次执行`incrementor`函数时,`runningTotal`可以继续增加。 + +> 注意: +> Swift 会决定捕获引用还是拷贝值。 +> 您不需要标注`amount`或者`runningTotal`来声明在嵌入的`incrementor`函数中的使用方式。 +> Swift 同时也处理`runingTotal`变量的内存管理操作,如果不再被`incrementor`函数使用,则会被清除。 + +下面代码为一个使用`makeIncrementor`的例子: + +```swift +let incrementByTen = makeIncrementor(forIncrement: 10) +``` + +该例子定义了一个叫做`incrementByTen`的常量,该常量指向一个每次调用会加10的`incrementor`函数。 +调用这个函数多次可以得到以下结果: + +```swift +incrementByTen() +// 返回的值为10 +incrementByTen() +// 返回的值为20 +incrementByTen() +// 返回的值为30 +``` + +如果您创建了另一个`incrementor`,其会有一个属于自己的独立的`runningTotal`变量的引用。 +下面的例子中,`incrementBySevne`捕获了一个新的`runningTotal`变量,该变量和`incrementByTen`中捕获的变量没有任何联系: + +```swift +let incrementBySeven = makeIncrementor(forIncrement: 7) +incrementBySeven() +// 返回的值为7 +incrementByTen() +// 返回的值为40 +``` + +> 注意: +> 如果您将闭包赋值给一个类实例的属性,并且该闭包通过指向该实例或其成员来捕获了该实例,您将创建一个在闭包和实例间的强引用环。 +> Swift 使用捕获列表来打破这种强引用环。更多信息,请参考 [闭包引起的循环强引用](../chapter2/16_Automatic_Reference_Counting.html#strong_reference_cycles_for_closures)。 + + +## 闭包是引用类型(Closures Are Reference Types) + +上面的例子中,`incrementBySeven`和`incrementByTen`是常量,但是这些常量指向的闭包仍然可以增加其捕获的变量值。 +这是因为函数和闭包都是引用类型。 + +无论您将函数/闭包赋值给一个常量还是变量,您实际上都是将常量/变量的值设置为对应函数/闭包的引用。 +上面的例子中,`incrementByTen`指向闭包的引用是一个常量,而并非闭包内容本身。 + +这也意味着如果您将闭包赋值给了两个不同的常量/变量,两个值都会指向同一个闭包: + +```swift +let alsoIncrementByTen = incrementByTen +alsoIncrementByTen() +// 返回的值为50 +``` diff --git a/source/chapter2/08_Enumerations.md b/source/chapter2/08_Enumerations.md old mode 100644 new mode 100755 index 5fb758a8..c9206d51 --- a/source/chapter2/08_Enumerations.md +++ b/source/chapter2/08_Enumerations.md @@ -1,76 +1,94 @@ -# 枚举 +> 翻译:[yankuangshi](https://github.com/yankuangshi) +> 校对:[shinyzhu](https://github.com/shinyzhu) + +# 枚举(Enumerations) +--- 本页内容包含: -- 枚举语法 -- 匹配枚举值与`Swith`语句 -- 关联值(associated values) -- 原始值(raw values) +- [枚举语法(Enumeration Syntax)](#enumeration_syntax) +- [匹配枚举值与`Swith`语句(Matching Enumeration Values with a Switch Statement)](#matching_enumeration_values_with_a_switch_statement) +- [相关值(Associated Values)](#associated_values) +- [原始值(Raw Values)](#raw_values) -枚举(enumeration)定义了一个通用类型的一组相关的值,使你可以在你的代码中以一个安全的方式来使用这些值。 +枚举定义了一个通用类型的一组相关的值,使你可以在你的代码中以一个安全的方式来使用这些值。 -如果你熟悉C语言,你就会知道,在C语言中枚举指定相关名称为一组整型值。Swift中的枚举更加灵活,不必给每一个枚举成员(enumeration member)提供一个值。如果一个值(被认为是“原始”值)被提供给每个枚举成员,则该值可以是一个字符串,一个字符,或是一个整型值或浮点值。 +如果你熟悉 C 语言,你就会知道,在 C 语言中枚举指定相关名称为一组整型值。Swift 中的枚举更加灵活,不必给每一个枚举成员提供一个值。如果一个值(被认为是“原始”值)被提供给每个枚举成员,则该值可以是一个字符串,一个字符,或是一个整型值或浮点值。 -此外,枚举成员可以指定任何类型的关联值存储到枚举成员值中,就像其他语言中的联合体(unions)和变体(variants)。你可以定义一组通用的相关成员作为枚举的一部分,每一组都有不同的一组与它相关的适当类型的数值。 +此外,枚举成员可以指定任何类型的相关值存储到枚举成员值中,就像其他语言中的联合体(unions)和变体(variants)。你可以定义一组通用的相关成员作为枚举的一部分,每一组都有不同的一组与它相关的适当类型的数值。 -在Swift中,枚举类型是一等(first-class)类型。它们采用了很多传统上只被类(class)所支持的特征,例如计算型属性(computed properties),用于提供关于枚举当前值的附加信息,实例方法(instance methods),用于提供和枚举所代表的值相关联的功能。枚举也可以定义构造函数(initializers)来提供一个初始成员值;可以在原始的实现基础上扩展它们的功能;可以遵守协议(protocols)来提供标准的功能。 +在 Swift 中,枚举类型是一等(first-class)类型。它们采用了很多传统上只被类(class)所支持的特征,例如计算型属性(computed properties),用于提供关于枚举当前值的附加信息, 实例方法(instance methods),用于提供和枚举所代表的值相关联的功能。枚举也可以定义构造函数(initializers)来提供一个初始成员值;可以在原始的实现基础上扩展它们的功能;可以遵守协议(protocols)来提供标准的功能。 -欲了解更多相关功能,请参见属性(Properties),方法(Methods),构造过程(Initialization),扩展(Extensions),和协议(Protocols)。 +欲了解更多相关功能,请参见[属性(Properties)](10_Properties.html),[方法(Methods)](11_Methods.html),[构造过程(Initialization)](14_Initialization.html),[扩展(Extensions)](20_Extensions.html)和[协议(Protocols)](21_Protocols.html)。 + ## 枚举语法 使用`enum`关键词并且把它们的整个定义放在一对大括号内: - enum SomeEumeration { - // enumeration definition goes here - } +```swift +enum SomeEnumeration { + // enumeration definition goes here +} +``` 以下是指南针四个方向的一个例子: - enum CompassPoint { - case North - case South - case East - case West - } +```swift +enum CompassPoint { + case North + case South + case East + case West +} +``` 一个枚举中被定义的值(例如 `North`,`South`,`East`和`West`)是枚举的***成员值***(或者***成员***)。`case`关键词表明新的一行成员值将被定义。 -> 注意: -> 不像C和Objective-C一样,Swift的枚举成员在被创建时不会被赋予一个默认的整数值。在上面的`CompassPoints`例子中,`North`,`South`,`East`和`West`不是隐式得等于`0`,`1`,`2`和`3`。相反的,这些不同的枚举成员在`CompassPoint`的一种显示定义中拥有各自不同的值。 +> 注意: +> 不像 C 和 Objective-C 一样,Swift 的枚举成员在被创建时不会被赋予一个默认的整数值。在上面的`CompassPoints`例子中,`North`,`South`,`East`和`West`不是隐式的等于`0`,`1`,`2`和`3`。相反的,这些不同的枚举成员在`CompassPoint`的一种显示定义中拥有各自不同的值。 多个成员值可以出现在同一行上,用逗号隔开: - enum Planet { - case Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Nepturn - } +```swift +enum Planet { + case Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Nepturn +} +``` -每个枚举定义了一个全新的类型。像Swift中其他类型一样,它们的名字(例如`CompassPoint`和`Planet`)必须以一个大写字母开头。给枚举类型起一个单数名字而不是复数名字,以便于读起来更加容易理解: +每个枚举定义了一个全新的类型。像 Swift 中其他类型一样,它们的名字(例如`CompassPoint`和`Planet`)必须以一个大写字母开头。给枚举类型起一个单数名字而不是复数名字,以便于读起来更加容易理解: - var directionToHead = CompassPoint.West +```swift +var directionToHead = CompassPoint.West +``` `directionToHead`的类型被推断当它被`CompassPoint`的一个可能值初始化。一旦`directionToHead`被声明为一个`CompassPoint`,你可以使用更短的点(.)语法将其设置为另一个`CompassPoint`的值: - directionToHead = .East +```swift +directionToHead = .East +``` `directionToHead`的类型已知时,当设定它的值时,你可以不再写类型名。使用显示类型的枚举值可以让代码具有更好的可读性。 + ## 匹配枚举值和`Switch`语句 你可以匹配单个枚举值和`switch`语句: - directionToHead = .South - switch directionToHead { - case .North: - println("Lots of planets have a north") - case .South: - println("Watch out for penguins") - case .East: - println("Where the sun rises") - case .West: - println("Where the skies are blue") - } - // prints "Watch out for penguins” +```swift +directionToHead = .South +switch directionToHead { +case .North: + println("Lots of planets have a north") +case .South: + println("Watch out for penguins") +case .East: + println("Where the sun rises") +case .West: + println("Where the skies are blue") +} +// 输出 "Watch out for penguins” +``` 你可以如此理解这段代码: @@ -78,131 +96,156 @@ 等等依次类推。 -正如在控制流(Control Flow)中介绍,当考虑一个枚举的成员们时,一个`switch`语句必须全面。如果忽略了`.West`这种情况,上面那段代码将无法通过编译,因为它没有考虑到`CompassPoint`的全部成员。全面性的要求确保了枚举成员不会被意外遗漏。 +正如在[控制流(Control Flow)](05_Control_Flow.html)中介绍,当考虑一个枚举的成员们时,一个`switch`语句必须全面。如果忽略了`.West`这种情况,上面那段代码将无法通过编译,因为它没有考虑到`CompassPoint`的全部成员。全面性的要求确保了枚举成员不会被意外遗漏。 当不需要匹配每个枚举成员的时候,你可以提供一个默认`default`分支来涵盖所有未明确被提出的任何成员: - let somePlanet = Planet.Earth - switch somePlanet { - case .Earth: - println("Mostly harmless") - default: - println("Not a safe place for humans") - } - // prints "Mostly harmless” +```swift +let somePlanet = Planet.Earth +switch somePlanet { +case .Earth: + println("Mostly harmless") +default: + println("Not a safe place for humans") +} +// 输出 "Mostly harmless” +``` -## 关联值(Associated Values) + +## 相关值(Associated Values) -上一小节的例子演示了一个枚举的成员是如何被定义(分类)的。你可以为`Planet.Earth`设置一个常量或则变量,并且在之后查看这个值。然而,有时候会很有用如果能够把其他类型的关联值和成员值一起存储起来。这能让你随着成员值存储额外的自定义信息,并且当每次你在代码中利用该成员时允许这个信息产生变化。 +上一小节的例子演示了一个枚举的成员是如何被定义(分类)的。你可以为`Planet.Earth`设置一个常量或则变量,并且在之后查看这个值。然而,有时候会很有用如果能够把其他类型的相关值和成员值一起存储起来。这能让你存储成员值之外的自定义信息,并且当你每次在代码中使用该成员时允许这个信息产生变化。 -你可以定义Swift的枚举存储任何类型的关联值,如果需要的话,每个成员的数据类型可以是各不相同的。枚举的这种特性跟其他语言中的可辨识联合(discriminated unions),标签联合(tagged unions),或者变体(variants)相似。 +你可以定义 Swift 的枚举存储任何类型的相关值,如果需要的话,每个成员的数据类型可以是各不相同的。枚举的这种特性跟其他语言中的可辨识联合(discriminated unions),标签联合(tagged unions),或者变体(variants)相似。 -例如,假设一个库存跟踪系统需要利用两种不同类型的条形码来跟踪商品。有些商品上标有UPC-A格式的一维码,它使用数字0到9.每一个条形码都有一个代表“数字系统”的数字,该数字后接10个代表“标识符”的数字。最后一个数字是“检查”位,用来验证代码是否被正确扫描: +例如,假设一个库存跟踪系统需要利用两种不同类型的条形码来跟踪商品。有些商品上标有 UPC-A 格式的一维码,它使用数字 0 到 9。每一个条形码都有一个代表“数字系统”的数字,该数字后接 10 个代表“标识符”的数字。最后一个数字是“检查”位,用来验证代码是否被正确扫描: - + -其他商品上标有QR码格式的二维码,它可以使用任何ISO8859-1字符,并且可以编码一个最多拥有2,953字符的字符串: +其他商品上标有 QR 码格式的二维码,它可以使用任何 ISO8859-1 字符,并且可以编码一个最多拥有 2,953 字符的字符串: -对于库存跟踪系统来说,能够把UPC-A码作为三个整型值的元组,和把QR码作为一个任何长度的字符串存储起来是方便的。 +对于库存跟踪系统来说,能够把 UPC-A 码作为三个整型值的元组,和把 QR 码作为一个任何长度的字符串存储起来是方便的。 -在Swift中,用来定义两种商品条码的枚举是这样子的: +在 Swift 中,用来定义两种商品条码的枚举是这样子的: - enum Barcode { - case UPCA(Int, Int, Int) - case QRCode(String) - } +```swift +enum Barcode { + case UPCA(Int, Int, Int) + case QRCode(String) +} +``` 以上代码可以这么理解: -“定义一个名为`Barcode`的枚举类型,它可以是`UPCA`的一个关联值(`Int`,`Int`,`Int`),或者`QRCode`的一个字符串类型(`String`)关联值。” +“定义一个名为`Barcode`的枚举类型,它可以是`UPCA`的一个相关值(`Int`,`Int`,`Int`),或者`QRCode`的一个字符串类型(`String`)相关值。” -这个定义不提供任何`Int`或`String`的实际值,它只是定义了,当`Barcode`常量和变量等于`Barcode.UPCA`或`Barcode.QRCode`时,关联值的类型。 +这个定义不提供任何`Int`或`String`的实际值,它只是定义了,当`Barcode`常量和变量等于`Barcode.UPCA`或`Barcode.QRCode`时,相关值的类型。 然后可以使用任何一种条码类型创建新的条码,如: - var productBarcode = Barcode.UPCA(8, 85909_51226, 3) +```swift +var productBarcode = Barcode.UPCA(8, 85909_51226, 3) +``` -以上例子创建了一个名为`productBarcode`的新变量,并且赋给它一个`Barcode.UPCA`的关联元组值`(8, 8590951226, 3)`。提供的“标识符”值在整数字中有一个下划线,使其便于阅读条形码。 +以上例子创建了一个名为`productBarcode`的新变量,并且赋给它一个`Barcode.UPCA`的相关元组值`(8, 8590951226, 3)`。提供的“标识符”值在整数字中有一个下划线,使其便于阅读条形码。 同一个商品可以被分配给一个不同类型的条形码,如: - productBarcode = .QRCode("ABCDEFGHIJKLMNOP") +```swift +productBarcode = .QRCode("ABCDEFGHIJKLMNOP") +``` -这时,原始的`Barcode.UPCA`和其整数值被新的`Barcode.QRCode`和其字符串值所替代。条形码的常量和变量可以存储一个`.UPCA`或者一个`.QRCode`(连同它的关联值),但是在任何指定时间只能存储其中之一。 +这时,原始的`Barcode.UPCA`和其整数值被新的`Barcode.QRCode`和其字符串值所替代。条形码的常量和变量可以存储一个`.UPCA`或者一个`.QRCode`(连同它的相关值),但是在任何指定时间只能存储其中之一。 -像以前那样,不同的条形码类型可以使用一个switch语句来检查,然而这次关联值可以被提取作为switch语句的一部分。你可以在`switch`的case分支代码中提取每个关联值作为一个常量(用`let`前缀)或者作为一个变量(用`var`前缀)来使用: +像以前那样,不同的条形码类型可以使用一个 switch 语句来检查,然而这次相关值可以被提取作为 switch 语句的一部分。你可以在`switch`的 case 分支代码中提取每个相关值作为一个常量(用`let`前缀)或者作为一个变量(用`var`前缀)来使用: - switch productBarcode { - case .UPCA(let numberSystem, let identifier, let check): - println("UPC-A with value of \(numberSystem), \(identifier), \(check).") - case .QRCode(let productCode): - println("QR code with value of \(productCode).") - } - // prints "QR code with value of ABCDEFGHIJKLMNOP.” +```swift +switch productBarcode { +case .UPCA(let numberSystem, let identifier, let check): + println("UPC-A with value of \(numberSystem), \(identifier), \(check).") +case .QRCode(let productCode): + println("QR code with value of \(productCode).") +} +// 输出 "QR code with value of ABCDEFGHIJKLMNOP.” +``` -如果一个枚举成员的所有关联值被提取为常量,或者它们全部被提取为变量,为了简洁,你可以只放置一个`var`或者`let`标注在成员名称前: +如果一个枚举成员的所有相关值被提取为常量,或者它们全部被提取为变量,为了简洁,你可以只放置一个`var`或者`let`标注在成员名称前: - switch productBarcode { - case let .UPCA(numberSystem, identifier, check): - println("UPC-A with value of \(numberSystem), \(identifier), \(check).") - case let .QRCode(productCode): - println("QR code with value of \(productCode).") - } - // prints "QR code with value of ABCDEFGHIJKLMNOP." +```swift +switch productBarcode { +case let .UPCA(numberSystem, identifier, check): + println("UPC-A with value of \(numberSystem), \(identifier), \(check).") +case let .QRCode(productCode): + println("QR code with value of \(productCode).") +} +// 输出 "QR code with value of ABCDEFGHIJKLMNOP." +``` + ## 原始值(Raw Values) -在关联值小节的条形码例子中演示了一个枚举的成员如何声明它们存储不同类型的关联值。作为关联值的替代,枚举成员可以被默认值(称为原始值)预先填充,其中这些原始值具有相同的类型。 +在[Associated Values](#raw_values)小节的条形码例子中演示了一个枚举的成员如何声明它们存储不同类型的相关值。作为相关值的替代,枚举成员可以被默认值(称为原始值)预先填充,其中这些原始值具有相同的类型。 -这里是一个枚举成员存储原始ASCII值的例子: +这里是一个枚举成员存储原始 ASCII 值的例子: - enum ASCIIControlCharacter: Character { - case Tab = "\t" - case LineFeed = "\n" - case CarriageReturn = "\r" - } +```swift +enum ASCIIControlCharacter: Character { + case Tab = "\t" + case LineFeed = "\n" + case CarriageReturn = "\r" +} +``` -在这里,称为`ASCIIControlCharacter`的枚举的原始值类型被定义为字符型`Character`,并被设置了一些比较常见的ASCII控制字符。字符值的描述请详见字符串和字符`Strings and Characters`部分。 +在这里,称为`ASCIIControlCharacter`的枚举的原始值类型被定义为字符型`Character`,并被设置了一些比较常见的 ASCII 控制字符。字符值的描述请详见字符串和字符[`Strings and Characters`](03_Strings_and_Characters.html)部分。 -注意,原始值和关联值是不相同的。当你开始在你的代码中定义枚举的时候原始值是被预先填充的值,像上述三个ASCII码。对于一个特定的枚举成员,它的原始值始终是相同的。关联值是当你在创建一个基于枚举成员的新常量或变量时才会被设置,并且每次当你这么做得时候,它的值可以是不同的。 +注意,原始值和相关值是不相同的。当你开始在你的代码中定义枚举的时候原始值是被预先填充的值,像上述三个 ASCII 码。对于一个特定的枚举成员,它的原始值始终是相同的。相关值是当你在创建一个基于枚举成员的新常量或变量时才会被设置,并且每次当你这么做得时候,它的值可以是不同的。 原始值可以是字符串,字符,或者任何整型值或浮点型值。每个原始值在它的枚举声明中必须是唯一的。当整型值被用于原始值,如果其他枚举成员没有值时,它们会自动递增。 -下面的枚举是对之前`Planet`这个枚举的一个细化,利用原始整型值来表示每个planet在太阳系中的顺序: +下面的枚举是对之前`Planet`这个枚举的一个细化,利用原始整型值来表示每个 planet 在太阳系中的顺序: - enum Planet: Int { - case Mercury = 1, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune - } +```swift +enum Planet: Int { + case Mercury = 1, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune +} +``` 自动递增意味着`Planet.Venus`的原始值是`2`,依次类推。 使用枚举成员的`toRaw`方法可以访问该枚举成员的原始值: - let earthsOrder = Planet.Earth.toRaw() - // earthsOrder is 3 +```swift +let earthsOrder = Planet.Earth.toRaw() +// earthsOrder is 3 +``` 使用枚举的`fromRaw`方法来试图找到具有特定原始值的枚举成员。这个例子通过原始值`7`识别`Uranus`: - let possiblePlanet = Planet.fromRaw(7) - // possiblePlanet is of type Planet? and equals Planet.Uranus +```swift +let possiblePlanet = Planet.fromRaw(7) +// possiblePlanet is of type Planet? and equals Planet.Uranus +``` 然而,并非所有可能的`Int`值都可以找到一个匹配的行星。正因为如此,`fromRaw`方法可以返回一个***可选***的枚举成员。在上面的例子中,`possiblePlanet`是`Planet?`类型,或“可选的`Planet`”。 如果你试图寻找一个位置为9的行星,通过`fromRaw`返回的可选`Planet`值将是`nil`: - let positionToFind = 9 - if let somePlanet = Planet.fromRaw(positionToFind) { - switch somePlanet { - case .Earth: - println("Mostly harmless") - default: - println("Not a safe place for humans") - } - } else { - println("There isn't a planet at position \(positionToFind)") - } - // prints "There isn't a planet at position 9 +```swift +let positionToFind = 9 +if let somePlanet = Planet.fromRaw(positionToFind) { + switch somePlanet { + case .Earth: + println("Mostly harmless") + default: + println("Not a safe place for humans") + } +} else { + println("There isn't a planet at position \(positionToFind)") +} +// 输出 "There isn't a planet at position 9 +``` 这个范例使用可选绑定(optional binding),通过原始值`9`试图访问一个行星。`if let somePlanet = Planet.fromRaw(9)`语句获得一个可选`Planet`,如果可选`Planet`可以被获得,把`somePlanet`设置成该可选`Planet`的内容。在这个范例中,无法检索到位置为`9`的行星,所以`else`分支被执行。 + diff --git a/source/chapter2/09_Classes_and_Structures.md b/source/chapter2/09_Classes_and_Structures.md old mode 100644 new mode 100755 index 43ceaa7c..1813f35a --- a/source/chapter2/09_Classes_and_Structures.md +++ b/source/chapter2/09_Classes_and_Structures.md @@ -1,9 +1,443 @@ -### 类和结构体 - -本页包含内容: - -- 类和结构体对比 -- 结构体和枚举是值类型 -- 类是引用类型 -- 类和结构体的选择 -- 集合(collection)类型的赋值与复制行为 \ No newline at end of file +> 翻译:[JaySurplus](https://github.com/JaySurplus) +> 校对:[sg552](https://github.com/sg552) + +# 类和结构体 + +本页包含内容: + +- [类和结构体对比](#comparing_classes_and_structures) +- [结构体和枚举是值类型](#structures_and_enumerations_are_value_types) +- [类是引用类型](#classes_are_reference_types) +- [类和结构体的选择](#choosing_between_classes_and_structures) +- [集合(collection)类型的赋值与复制行为](#assignment_and_copy_behavior_for_collection_types) + +类和结构体是人们构建代码所用的一种通用且灵活的构造体。为了在类和结构体中实现各种功能,我们必须要严格按照常量、变量以及函数所规定的语法规则来定义属性和添加方法。 + +与其他编程语言所不同的是,Swift 并不要求你为自定义类和结构去创建独立的接口和实现文件。你所要做的是在一个单一文件中定义一个类或者结构体,系统将会自动生成面向其它代码的外部接口。 + +> 注意: +通常一个`类`的实例被称为`对象`。然而在Swift 中,类和结构体的关系要比在其他语言中更加的密切,本章中所讨论的大部分功能都可以用在类和结构体上。因此,我们会主要使用`实例`而不是`对象`。 + + +###类和结构体对比 + +Swift 中类和结构体有很多共同点。共同处在于: + +* 定义属性用于存储值 +* 定义方法用于提供功能 +* 定义附属脚本用于访问值 +* 定义构造器用于生成初始化值 +* 通过扩展以增加默认实现的功能 +* 符合协议以对某类提供标准功能 + +更多信息请参见 [属性](10_Properties.html),[方法](11_Methods.html),[下标脚本](12_Subscripts.html),[初始过程](14_Initialization.html),[扩展](20_Extensions.html),和[协议](21_Protocols.html)。 + +与结构体相比,类还有如下的附加功能: + +* 继承允许一个类继承另一个类的特征 +* 类型转换允许在运行时检查和解释一个类实例的类型 +* 解构器允许一个类实例释放任何其所被分配的资源 +* 引用计数允许对一个类的多次引用 + +更多信息请参见[继承](http://),[类型转换](http://),[初始化](http://),和[自动引用计数](http://)。 + +> 注意: +结构体总是通过被复制的方式在代码中传递,因此请不要使用引用计数。 + +### 定义 + +类和结构体有着类似的定义方式。我们通过关键字`class`和`struct`来分别表示类和结构体,并在一对大括号中定义它们的具体内容: + +```swift +class SomeClass { + // class definition goes here +} +struct SomeStructure { + // structure definition goes here +} +``` + +> 注意: +在你每次定义一个新类或者结构体的时候,实际上你是有效地定义了一个新的 Swift 类型。因此请使用 `UpperCamelCase` 这种方式来命名(如 `SomeClass` 和`SomeStructure`等),以便符合标准Swift 类型的大写命名风格(如`String`,`Int`和`Bool`)。相反的,请使用`lowerCamelCase`这种方式为属性和方法命名(如`framerate`和`incrementCount`),以便和类区分。 + +以下是定义结构体和定义类的示例: + +```swift +struct Resolution { + var width = 0 + var heigth = 0 +} +class VideoMode { + var resolution = Resolution() + var interlaced = false + var frameRate = 0.0 + var name: String? +} +``` + +在上面的示例中我们定义了一个名为`Resolution`的结构体,用来描述一个显示器的像素分辨率。这个结构体包含了两个名为`width`和`height`的存储属性。存储属性是捆绑和存储在类或结构体中的常量或变量。当这两个属性被初始化为整数`0`的时候,它们会被推断为`Int`类型。 + +在上面的示例中我们还定义了一个名为`VideoMode`的类,用来描述一个视频显示器的特定模式。这个类包含了四个储存属性变量。第一个是`分辨率`,它被初始化为一个新的`Resolution`结构体的实例,具有`Resolution`的属性类型。新`VideoMode`实例同时还会初始化其它三个属性,它们分别是,初始值为`false`(意为“non-interlaced video”)的`interlaced`,回放帧率初始值为`0.0`的`frameRate`和值为可选`String`的`name`。`name`属性会被自动赋予一个默认值`nil`,意为“没有`name`值”,因为它是一个可选类型。 + +### 类和结构体实例 + +`Resolution`结构体和`VideoMode`类的定义仅描述了什么是`Resolution`和`VideoMode`。它们并没有描述一个特定的分辨率(resolution)或者视频模式(video mode)。为了描述一个特定的分辨率或者视频模式,我们需要生成一个它们的实例。 + +生成结构体和类实例的语法非常相似: + +```swift +let someResolution = Resolution() +let someVideoMode = VideoMode() +``` + +结构体和类都使用构造器语法来生成新的实例。构造器语法的最简单形式是在结构体或者类的类型名称后跟随一个空括弧,如`Resolution()`或`VideoMode()`。通过这种方式所创建的类或者结构体实例,其属性均会被初始化为默认值。[构造过程](14_Initialization.html)章节会对类和结构体的初始化进行更详细的讨论。 + +### 属性访问 + +通过使用*点语法*(*dot syntax*),你可以访问实例中所含有的属性。其语法规则是,实例名后面紧跟属性名,两者通过点号(.)连接: + +```swift +println("The width of someResolution is \(someResolution.width)") +// 输出 "The width of someResolution is 0" +``` + +在上面的例子中,`someResolution.width`引用`someResolution`的`width`属性,返回`width`的初始值`0`。 + +你也可以访问子属性,如何`VideoMode`中`Resolution`属性的`width`属性: + +```swift +println("The width of someVideoMode is \(someVideoMode.resolution.width)") +// 输出 "The width of someVideoMode is 0" +``` + +你也可以使用点语法为属性变量赋值: + +```swift +someVideoMode.resolution.width = 12880 +println("The width of someVideoMode is now \(someVideoMode.resolution.width)") +// 输出 "The width of someVideoMode is now 1280" +``` + +> 注意: +与 Objective-C 语言不同的是,Swift 允许直接设置结构体属性的子属性。上面的最后一个例子,就是直接设置了`someVideoMode`中`resolution`属性的`width`这个子属性,以上操作并不需要重新设置`resolution`属性。 + +### 结构体类型的成员逐一构造器(Memberwise Initializers for structure Types) + +所有结构体都有一个自动生成的成员逐一构造器,用于初始化新结构体实例中成员的属性。新实例中各个属性的初始值可以通过属性的名称传递到成员逐一构造器之中: + +```swift +let vga = resolution(width:640, heigth: 480) +``` + +与结构体不同,类实例没有默认的成员逐一构造器。[构造过程](14_Initialization.html)章节会对构造器进行更详细的讨论。 + + +## 结构体和枚举是值类型 + +值类型被赋予给一个变量,常数或者本身被传递给一个函数的时候,实际上操作的是其的拷贝。 + +在之前的章节中,我们已经大量使用了值类型。实际上,在 Swift 中,所有的基本类型:整数(Integer)、浮点数(floating-point)、布尔值(Booleans)、字符串(string)、数组(array)和字典(dictionaries),都是值类型,并且都是以结构体的形式在后台所实现。 + +在 Swift 中,所有的结构体和枚举都是值类型。这意味着它们的实例,以及实例中所包含的任何值类型属性,在代码中传递的时候都会被复制。 + +请看下面这个示例,其使用了前一个示例中`Resolution`结构体: + +```swift +let hd = Resolution(width: 1920, height: 1080) +var cinema = hd +``` + +在以上示例中,声明了一个名为`hd`的常量,其值为一个初始化为全高清视频分辨率(1920 像素宽,1080 像素高)的`Resolution`实例。 + +然后示例中又声明了一个名为`cinema`的变量,其值为之前声明的`hd`。因为`Resolution`是一个结构体,所以`cinema`的值其实是`hd`的一个拷贝副本,而不是`hd`本身。尽管`hd`和`cinema`有着相同的宽(width)和高(height)属性,但是在后台中,它们是两个完全不同的实例。 + +下面,为了符合数码影院放映的需求(2048 像素宽,1080 像素高),`cinema`的`width`属性需要作如下修改: + +```swift +cinema.width = 2048 +``` + +这里,将会显示`cinema`的`width`属性确已改为了`2048`: + +```swift +println("cinema is now \(cinema.width) pixels wide") +// 输出 "cinema is now 2048 pixels wide" +``` + +然而,初始的`hd`实例中`width`属性还是`1920`: + +```swift +println("hd is still \(hd.width ) pixels wide") +// 输出 "hd is still 1920 pixels wide" +``` + +在将`hd`赋予给`cinema`的时候,实际上是将`hd`中所存储的`值(values)`进行拷贝,然后将拷贝的数据存储到新的`cinema`实例中。结果就是两个完全独立的实例碰巧包含有相同的数值。由于两者相互独立,因此将`cinema`的`width`修改为`2048`并不会影响`hd`中的宽(width)。 + +枚举也遵循相同的行为准则: + +```swift +enum CompassPoint { + case North, South, East, West +} +var currentDirection = CompassPoint.West +let rememberedDirection = currentDirection +currentDirection = .East +if rememberDirection == .West { + println("The remembered direction is still .West") +} +// 输出 "The remembered direction is still .West" +``` + +上例中`rememberedDirection`被赋予了`currentDirection`的值(value),实际上它被赋予的是值(value)的一个拷贝。赋值过程结束后再修改`currentDirection`的值并不影响`rememberedDirection`所储存的原始值(value)的拷贝。 + + +## 类是引用类型 + +与值类型不同,引用类型在被赋予到一个变量、常量或者被传递到一个函数时,操作的是引用,其并不是拷贝。因此,引用的是已存在的实例本身而不是其拷贝。 + +请看下面这个示例,其使用了之前定义的`VideoMode`类: + +```swift +let tenEighty = VideoMode() +tenEighty.resolution = hd +tenEighty.interlaced = true +tenEighty.name = "1080i" +tenEighty.frameRate = 25.0 +``` + +以上示例中,声明了一个名为`tenEighty`的常量,其引用了一个`VideoMode`类的新实例。在之前的示例中,这个视频模式(video mode)被赋予了HD分辨率(1920*1080)的一个拷贝(`hd`)。同时设置为交错(interlaced),命名为`“1080i”`。最后,其帧率是`25.0`帧每秒。 + +然后,`tenEighty` 被赋予名为`alsoTenEighty`的新常量,同时对`alsoTenEighty`的帧率进行修改: + +```swift +let alsoTenEighty = tenEighty +alsoTenEighty.frameRate = 30.0 +``` + +因为类是引用类型,所以`tenEight`和`alsoTenEight`实际上引用的是相同的`VideoMode`实例。换句话说,它们是同一个实例的两种叫法。 + +下面,通过查看`tenEighty`的`frameRate`属性,我们会发现它正确的显示了基本`VideoMode`实例的新帧率,其值为`30.0`: + +```swift +println("The frameRate property of tenEighty is now \(tenEighty.frameRate)") +// 输出 "The frameRate property of theEighty is now 30.0" +``` + +需要注意的是`tenEighty`和`alsoTenEighty`被声明为*常量((constants)*而不是变量。然而你依然可以改变`tenEighty.frameRate`和`alsoTenEighty.frameRate`,因为这两个常量本身不会改变。它们并不`存储`这个`VideoMode`实例,在后台仅仅是对`VideoMode`实例的引用。所以,改变的是被引用的基础`VideoMode`的`frameRate`参数,而不改变常量的值。 + +### 恒等运算符 + +因为类是引用类型,有可能有多个常量和变量在后台同时引用某一个类实例。(对于结构体和枚举来说,这并不成立。因为它们作为值类型,在被赋予到常量、变量或者传递到函数时,其值总是会被拷贝。) + +如果能够判定两个常量或者变量是否引用同一个类实例将会很有帮助。为了达到这个目的,Swift 内建了两个恒等运算符: + +* 等价于 ( === ) +* 不等价于 ( !== ) + +以下是运用这两个运算符检测两个常量或者变量是否引用同一个实例: + +```swift +if tenEighty === alsoTenTighty { + println("tenTighty and alsoTenEighty refer to the same Resolution instance.") +} +//输出 "tenEighty and alsoTenEighty refer to the same Resolution instance." +``` + +请注意```“等价于"```(用三个等号表示,===) 与```“等于"```(用两个等号表示,==)的不同: + +* “等价于”表示两个类类型(class type)的常量或者变量引用同一个类实例。 +* “等于”表示两个实例的值“相等”或“相同”,判定时要遵照类设计者定义定义的评判标准,因此相比于“相等”,这是一种更加合适的叫法。 + +当你在定义你的自定义类和结构体的时候,你有义务来决定判定两个实例“相等”的标准。在章节[运算符函数(Operator Functions)](23_Advanced_Operators.html#operator_functions)中将会详细介绍实现自定义“等于”和“不等于”运算符的流程。 + +### 指针 + +如果你有 C,C++ 或者 Objective-C 语言的经验,那么你也许会知道这些语言使用指针来引用内存中的地址。一个 Swift 常量或者变量引用一个引用类型的实例与 C 语言中的指针类似,不同的是并不直接指向内存中的某个地址,而且也不要求你使用星号(*)来表明你在创建一个引用。Swift 中这些引用与其它的常量或变量的定义方式相同。 + + +## 类和结构体的选择 + +在你的代码中,你可以使用类和结构体来定义你的自定义数据类型。 + +然而,结构体实例总是通过值传递,类实例总是通过引用传递。这意味两者适用不同的任务。当你在考虑一个工程项目的数据构造和功能的时候,你需要决定每个数据构造是定义成类还是结构体。 + +按照通用的准则,当符合一条或多条以下条件时,请考虑构建结构体: + +* 结构体的主要目的是用来封装少量相关简单数据值。 +* 有理由预计一个结构体实例在赋值或传递时,封装的数据将会被拷贝而不是被引用。 +* 任何在结构体中储存的值类型属性,也将会被拷贝,而不是被引用。 +* 结构体不需要去继承另一个已存在类型的属性或者行为。 + +合适的结构体候选者包括: + +* 几何形状的大小,封装一个`width`属性和`height`属性,两者均为`Double`类型。 +* 一定范围内的路径,封装一个`start`属性和`length`属性,两者均为`Int`类型。 +* 三维坐标系内一点,封装`x`,`y`和`z`属性,三者均为`Double`类型。 + +在所有其它案例中,定义一个类,生成一个它的实例,并通过引用来管理和传递。实际中,这意味着绝大部分的自定义数据构造都应该是类,而非结构体。 + + +## 集合(Collection)类型的赋值和拷贝行为 + +Swift 中`数组(Array)`和`字典(Dictionary)`类型均以结构体的形式实现。然而当数组被赋予一个常量或变量,或被传递给一个函数或方法时,其拷贝行为与字典和其它结构体有些许不同。 + +以下对`数组`和`结构体`的行为描述与对`NSArray`和`NSDictionary`的行为描述在本质上不同,后者是以类的形式实现,前者是以结构体的形式实现。`NSArray`和`NSDictionary`实例总是以对已有实例引用,而不是拷贝的方式被赋值和传递。 + +> 注意: +以下是对于数组,字典,字符串和其它值的`拷贝`的描述。 +在你的代码中,拷贝好像是确实是在有拷贝行为的地方产生过。然而,在 Swift 的后台中,只有确有必要,`实际(actual)`拷贝才会被执行。Swift 管理所有的值拷贝以确保性能最优化的性能,所以你也没有必要去避免赋值以保证最优性能。(实际赋值由系统管理优化) + +### 字典类型的赋值和拷贝行为 + +无论何时将一个`字典`实例赋给一个常量或变量,或者传递给一个函数或方法,这个字典会即会在赋值或调用发生时被拷贝。在章节[结构体和枚举是值类型](#structures_and_enumerations_are_value_types)中将会对此过程进行详细介绍。 + +如果`字典`实例中所储存的键(keys)和/或值(values)是值类型(结构体或枚举),当赋值或调用发生时,它们都会被拷贝。相反,如果键(keys)和/或值(values)是引用类型,被拷贝的将会是引用,而不是被它们引用的类实例或函数。`字典`的键和值的拷贝行为与结构体所储存的属性的拷贝行为相同。 + +下面的示例定义了一个名为`ages`的字典,其中储存了四个人的名字和年龄。`ages`字典被赋予了一个名为`copiedAges`的新变量,同时`ages`在赋值的过程中被拷贝。赋值结束后,`ages`和`copiedAges`成为两个相互独立的字典。 + +```swift +var ages = ["Peter": 23, "Wei": 35, "Anish": 65, "Katya": 19] +var copiedAges = ages +``` + +这个字典的键(keys)是`字符串(String)`类型,值(values)是`整(Int)`类型。这两种类型在Swift 中都是值类型(value types),所以当字典被拷贝时,两者都会被拷贝。 + +我们可以通过改变一个字典中的年龄值(age value),检查另一个字典中所对应的值,来证明`ages`字典确实是被拷贝了。如果在`copiedAges`字典中将`Peter`的值设为`24`,那么`ages`字典仍然会返回修改前的值`23`: + +```swift +copiedAges["Peter"] = 24 +println(ages["Peter"]) +// 输出 "23" +``` + +### 数组的赋值和拷贝行为 + +在Swift 中,`数组(Arrays)`类型的赋值和拷贝行为要比`字典(Dictionary)`类型的复杂的多。当操作数组内容时,`数组(Array)`能提供接近C语言的的性能,并且拷贝行为只有在必要时才会发生。 + +如果你将一个`数组(Array)`实例赋给一个变量或常量,或者将其作为参数传递给函数或方法调用,在事件发生时数组的内容`不`会被拷贝。相反,数组公用相同的元素序列。当你在一个数组内修改某一元素,修改结果也会在另一数组显示。 + +对数组来说,拷贝行为仅仅当操作有可能修改数组`长度`时才会发生。这种行为包括了附加(appending),插入(inserting),删除(removing)或者使用范围下标(ranged subscript)去替换这一范围内的元素。只有当数组拷贝确要发生时,数组内容的行为规则与字典中键值的相同,参见章节[集合(collection)类型的赋值与复制行为](#assignment_and_copy_behavior_for_collection_types。 + +下面的示例将一个`整数(Int)`数组赋给了一个名为`a`的变量,继而又被赋给了变量`b`和`c`: + +```swift +var a = [1, 2, 3] +var b = a +var c = a +``` + +我们可以在`a`,`b`,`c`上使用下标语法以得到数组的第一个元素: + +```swift +println(a[0]) +// 1 +println(b[0]) +// 1 +println(c[0]) +// 1 +``` + +如果通过下标语法修改数组中某一元素的值,那么`a`,`b`,`c`中的相应值都会发生改变。请注意当你用下标语法修改某一值时,并没有拷贝行为伴随发生,因为下表语法修改值时没有改变数组长度的可能: + +```swift +a[0] = 42 +println(a[0]) +// 42 +println(b[0]) +// 42 +println(c[0]) +// 42 +``` + +然而,当你给`a`附加新元素时,数组的长度`会`改变。 +当附加元素这一事件发生时,Swift 会创建这个数组的一个拷贝。从此以后,`a`将会是原数组的一个独立拷贝。 + +拷贝发生后,如果再修改`a`中元素值的话,`a`将会返回与`b`,`c`不同的结果,因为后两者引用的是原来的数组: + +```swift +a.append(4) +a[0] = 777 +println(a[0]) +// 777 +println(b[0]) +// 42 +println(c[0]) +// 42 +``` + +### 确保数组的唯一性 + +在操作一个数组,或将其传递给函数以及方法调用之前是很有必要先确定这个数组是有一个唯一拷贝的。通过在数组变量上调用`unshare`方法来确定数组引用的唯一性。(当数组赋给常量时,不能调用`unshare`方法) + +如果一个数组被多个变量引用,在其中的一个变量上调用`unshare`方法,则会拷贝此数组,此时这个变量将会有属于它自己的独立数组拷贝。当数组仅被一个变量引用时,则不会有拷贝发生。 + +在上一个示例的最后,`b`和`c`都引用了同一个数组。此时在`b`上调用`unshare`方法则会将`b`变成一个唯一个拷贝: + +```swift +b.unshare() +``` + +在`unshare`方法调用后再修改`b`中第一个元素的值,这三个数组(`a`,`b`,`c`)会返回不同的三个值: + +```swift +b[0] = -105 +println(a[0]) +// 77 +println(b[0]) +// -105 +println(c[0]) +// 42 +``` + + +### 判定两个数组是否共用相同元素 + +我们通过使用恒等运算符(identity operators)( === 和 !==)来判定两个数组或子数组共用相同的储存空间或元素。 + +下面这个示例使用了“等同(identical to)” 运算符(===) 来判定`b`和`c`是否共用相同的数组元素: + +```swift +if b === c { + println("b and c still share the same array elements.") +} else { + println("b and c now refer to two independent sets of array elements.") +} +``` + +```swift +// 输出 "b and c now refer totwo independent sets of array elements." +``` + +此外,我们还可以使用恒等运算符来判定两个子数组是否共用相同的元素。下面这个示例中,比较了`b`的两个相等的子数组,并且确定了这两个子数组都引用相同的元素: + +```swift +if b[0...1] === b[0...1] { + println("These two subarrays share the same elements.") +} else { + println("These two subarrays do not share the same elements.") +} +// 输出 "These two subarrays share the same elements." +``` + +### 强制复制数组 + +我们通过调用数组的`copy`方法进行强制显式复制。这个方法对数组进行了浅拷贝(shallow copy),并且返回一个包含此拷贝数组的新数组。 + +下面这个示例中定义了一个`names`数组,其包含了七个人名。还定义了一个`copiedNames`变量,用以储存在`names`上调用`copy`方法所返回的结果: + +```swift +var names = ["Mohsen", "Hilary", "Justyn", "Amy", "Rich", "Graham", "Vic"] +var copiedNames = names.copy() +``` + +我们可以通过修改数组中某一个元素,并且检查另一个数组中对应元素的方法来判定`names`数组确已被复制。如果你将`copiedNames`中第一个元素从"`Mohsen`"修改为"`Mo`",则`names`数组返回的仍是拷贝发生前的"`Mohsen`": + +```swift +copiedName[0] = "Mo" +println(name[0]) +// 输出 "Mohsen" +``` + +> 注意: +如果你仅需要确保你对数组的引用是唯一引用,请调用`unshare`方法,而不是`copy`方法。`unshare`方法仅会在确有必要时才会创建数组拷贝。`copy`方法会在任何时候都创建一个新的拷贝,即使引用已经是唯一引用。 + diff --git a/source/chapter2/10_Properties.md b/source/chapter2/10_Properties.md old mode 100644 new mode 100755 index 2f1b9cbc..7275024f --- a/source/chapter2/10_Properties.md +++ b/source/chapter2/10_Properties.md @@ -1,421 +1,428 @@ -# 属性 (Properties) - -**属性**将值跟特定的类、结构或枚举关联。一种是存储属性,把常量或变量的值作为实例的一部分,一种是计算属性,它计算一个值。计算属性可以用于类、结构和枚举里,存储属性只能用于类和结构。 - -存储属性和计算属性通常用于特定类型的实例,但是,属性也可以直接用于类型本身,这种属性称为类属性。 - -另外,还可以定义属性监视器来监控属性值的变化,以此来触发一个自定义的操作。属性监视器可以添加到自己写的存储属性上,也可以添加到从父类继承的属性上。 - -## 存储属性 - -简单来说,一个存储属性就是一个特定类型实例里表示常量或变量的部分,存储属性可以是*变量存储属性*(用关键字`var`定义),也可以是*常量存储属性*(用关键字`let`定义)。 - -可以在定义存储属性的时候指定默认值,详见[默认属性值](#)一节。也可以在初始化阶段设置或修改存储属性的值,甚至修改常量存储属性的值,详见[在初始化阶段修改常量存储属性](#)一节。 - -下面的例子定义了一个名为`FixedLengthRange`的结构体,表示一个在创建后无法修改整数范围的类型: - -``` -struct FixedLengthRange { - var firstValue: Int - let length: Int -} -var rangeOfThreeItems = FixedLengthRange(firstValue: 0, length: 3) -// the range represents integer values 0, 1, and 2 -rangeOfThreeItems.firstValue = 6 -// the range now represents integer values 6, 7, and 8 - -``` - -`FixedLengthRange`的实例包含一个名为`firstValue`的变量存储属性和一个名为`length`的常量存储属性。在上面的例子中,`length`在创建实例的时候被赋值,因为它是一个常量存储属性,所以再无法修改它的值。 - -### 常量和存储属性 - -如果创建了一个结构体的实例并赋值给一个常量,则无法修改实例的任何属性,即使定义了变量存储属性: - -``` -let rangeOfFourItems = FixedLengthRange(firstValue: 0, length: 4) -// this range represents integer values 0, 1, 2, and 3 -rangeOfFourItems.firstValue = 6 -// this will report an error, even thought firstValue is a variable property - -``` - -因为`rangeOfFourItems`声明成了常量(用`let`关键字),即使`firstValue`是一个变量属性,也无法再修改属性它的值。 - -这种行为是由于结构体(struct)属于*值类型*。当值类型的实例被声明为常量的时候,它的所有属性也就成了常量。 - -属于*引用类型*的类(class)则不一样,把一个引用类型的实例赋给一个常量后,仍然可以修改实例的变量属性。 - -### 延迟存储属性 - -延迟存储属性是指当第一次被调用的时候才有初始值的属性。在属性声明前使用`@lazy`特性来表示一个延迟存储属性。 - -> 注意 -> -> 必须将延迟存储属性声明成变量(使用`var`关键字),因为可能在实例构造完成之前属性的值无法得到。常量属性在构造过程完成之前必须要有初始值,因此无法声明成延迟属性。 - -延迟属性很有用,当属性的值依赖于在实例的构造过程结束前无法知道具体值的外部因素时,或者当属性的值需要复杂或大量计算时,可以只在需要的时候来计算它。 - -下面复合类的例子使用了延迟存储属性来避免不必要的初始化。例子中定义了`DataImporter`和`DataManager`两个类,下面是部分代码: - -``` -class DataImporter { - /* - DataImporter is a class to import data from an external file. - The class is assumed to take a non-trivial amount of time to initialize. - */ - var fileName = "data.txt" - // the DataImporter class would provide data importing functionality here -} - -class DataManager { - @lazy var importer = DataImporter() - var data = String[]() - // the DataManager class would provide data management functionality here -} - -let manager = DataManager() -manager.data += "Some data" -manager.data += "Some more data" -// the DataImporter instance for the importer property has not yet been created - -``` - -`DataManager`类包含一个名为`data`的存储属性,初始值是一个空的字符串(`String`)数组。虽然没有写出全部代码,`DataManager`类的目的是管理和提供对这个字符串数组的访问。 - -`DataManager`的一个功能是从文件导入数据,该功能由`DataImporter`类提供,它需要一定的时间来处理。因为它需要在实例化之后打开文件、读取文件内容到内存。 - -`DataManager`也可以不从文件中导入数据,所以当`DataManager`的实例被创建时,就没有必要创建一个`DataImporter`的实例。同时,更有意义的是当用到`DataImporter`的时候才去创建它。 - -由于使用了`@lazy`特性(Attribute),`importer`属性只有在第一次被访问的时候才被创建。比如访问它的属性`fileName`时: - -``` -println(manager.importer.fileName) -// the DataImporter instance for the importer property has now been created -// prints "data.txt” - -``` - -### 存储属性和实例变量 - -如果您有过Objective-C经验,应该知道有2种方式在类实例存储值和引用。对于属性来说,也可以使用实例变量作为属性值的后端存储。 - -Swift编程语言中把这些理论统一用属性来实现。Swift中的属性没有对应的实例变量,属性的后端存储也无法直接访问。这就避免了不同场景下访问方式的困扰,同时也将属性的定义简化成一个语句。 -一个类型中属性的全部信息——包括命名、类型和内存管理特征——都在唯一一个地方定义。 - -## 计算属性 - -除存储属性外,类、结构体和枚举可以定义*计算属性*,计算属性不直接存储值,而是提供一个getter来获取值,一个可选的setter来间接设置其他属性或变量的值。 - -``` -struct Point { - var x = 0.0, y = 0.0 -} -struct Size { - var width = 0.0, height = 0.0 -} -struct Rect { - var origin = Point() - var size = Size() - var center: Point { - get { - let centerX = origin.x + (size.width / 2) - let centerY = origin.y + (size.height / 2) - return Point(x: centerX, y: centerY) - } - set(newCenter) { - origin.x = newCenter.x - (size.width / 2) - origin.y = newCenter.y - (size.height / 2) - } - } -} -var square = Rect(origin: Point(x: 0.0, y: 0.0), - size: Size(width: 10.0, height: 10.0)) -let initialSquareCenter = square.center -square.center = Point(x: 15.0, y: 15.0) -println("square.origin is now at (\(square.origin.x), \(square.origin.y))") -// prints "square.origin is now at (10.0, 10.0)” - -``` - -这个例子定义了3个几何形状的结构体: - -- `Point`封装了一个`(x, y)`的坐标 -- `Size`封装了一个`width`和`height` -- `Rect`表示一个有原点和尺寸的矩形 - -`Rect`也提供了一个名为`center`的计算属性。一个矩形的中心点可以从原点和尺寸来算出,所以不需要将它以显式声明的`Point`来保存。`Rect`的计算属性`center`提供了自定义的getter和setter来获取和设置矩形的中心点,就像它有一个存储属性一样。 - -例子中接下来创建了一个名为`square`的`Rect`实例,初始值原点是`(0, 0)`,宽度高度都是`10`。如图所示蓝色正方形。 - -`square`的`center`属性可以通过点运算符(`square.center`)来访问,这会调用getter来获取属性的值。跟直接返回已经存在的值不同,getter实际上通过计算然后返回一个新的`Point`实例表示`square`的中心点。如代码所示,它正确返回了中心点`(5, 5)`。 - -`center`属性之后被设置了一个新的值`(15, 15)`,表示向右上方移动正方形到如图所示橙色正方形的位置。设置属性`center`的值会调用setter来修改属性`origin`的`x`和`y`的值,从而实现移动正方形到新的位置。 - -Computed Properties sample - - -### 便捷Setter声明 - -如果计算属性的setter没有定义表示新值的参数名,则可以使用默认名称`newValue`。下面是使用了便捷Setter声明的`Rect`结构体代码: - -``` -struct AlternativeRect { - var origin = Point() - var size = Size() - var center: Point { - get { - let centerX = origin.x + (size.width / 2) - let centerY = origin.y + (size.height / 2) - return Point(x: centerX, y: centerY) - } - set { - origin.x = newValue.x - (size.width / 2) - origin.y = newValue.y - (size.height / 2) - } - } -} - -``` - -### 只读计算属性 - -只有getter没有setter的计算属性就是*只读计算属性*。只读计算属性总是返回一个值,可以通过点运算符访问,但不能设置新的值。 - -> 注意 -> -> 必须使用`var`关键字定义计算属性,包括只读计算属性,因为他们的值不是固定的。`let`关键字只用来声明常量属性,表示初始化后再也无法修改的值。 - -只读计算属性的声明可以去掉`get`关键字和花括号: - -``` -struct Cuboid { - var width = 0.0, height = 0.0, depth = 0.0 - var volume: Double { - return width * height * depth - } -} -let fourByFiveByTwo = Cuboid(width: 4.0, height: 5.0, depth: 2.0) -println("the volume of fourByFiveByTwo is \(fourByFiveByTwo.volume)") -// prints "the volume of fourByFiveByTwo is 40.0" - -``` - -这个例子定义了一个名为`Cuboid`的结构体,表示三维空间的立方体,包含`width`、`height`和`depth`属性,还有一个名为`volume`的只读计算属性用来返回立方体的体积,设置`volume`的值毫无意义,因为无法确定`width`、`height`和`depth`的值。 - -尽管如此,`Cuboid`提供一个只读计算属性来让外部用户直接获取体积是很有用的。 - -## 属性监视器 - -*属性监视器*监控和响应属性值的变化,每次属性被设置值的时候都会调用属性监视器,甚至新的值和现在的值相同的时候也不例外。 - -可以为除了延迟存储属性之外的其他存储属性添加属性监视器,也可以通过重载属性的方式为继承的属性(包括存储属性和计算属性)添加属性监视器。属性重载详见[重载](#)一节。 - -> 注意 -> -> 不需要为无法重载的计算属性添加属性监视器,因为可以通过setter直接监控和响应值的变化。 - -可以为属性添加如下的一个或全部监视器: - -- `willSet`在设置新的值之前调用 -- `didSet`在新的值被设置之后立即调用 - -`willSet`监视器会将新的属性值作为固定参数传入,在`willSet`的实现代码中可以为这个参数指定一个名称,如果不指定则参数仍然可用,这时使用默认名称`newValue`表示。 - -类似地,`didSet`监视器会将旧的属性值作为参数传入,可以为该参数命名或者使用默认参数名`oldValue`。 - -> 注意 -> -> `willSet`和`didSet`监视器在属性初始化过程中不会被调用,他们只会当属性的值在初始化之外的地方被设置时被调用。 - -这里是一个`willSet`和`didSet`的实际例子,其中定义了一个名为`StepCounter`的类,用来统计当人步行时的总步数,可以跟计步器或其他日常锻炼的统计装置的输入数据配合使用。 - -``` -class StepCounter { - var totalSteps: Int = 0 { - willSet(newTotalSteps) { - println("About to set totalSteps to \(newTotalSteps)") - } - didSet { - if totalSteps > oldValue { - println("Added \(totalSteps - oldValue) steps") - } - } - } -} -let stepCounter = StepCounter() -stepCounter.totalSteps = 200 -// About to set totalSteps to 200 -// Added 200 steps -stepCounter.totalSteps = 360 -// About to set totalSteps to 360 -// Added 160 steps -stepCounter.totalSteps = 896 -// About to set totalSteps to 896 -// Added 536 steps - -``` - -`StepCounter`类定义了一个`Int`类型的属性`totalSteps`,它是一个存储属性,包含`willSet`和`didSet`监视器。 - -当`totalSteps`设置新值的时候,它的`willSet`和`didSet`监视器都会被调用,甚至当新的值和现在的值完全相同也会调用。 - -例子中的`willSet`监视器将表示新值的参数自定义为`newTotalSteps`,这个监视器只是简单的将新的值输出。 - -`didSet`监视器在`totalSteps`的值改变后被调用,它把新的值和旧的值进行对比,如果总的步数增加了,就输出一个消息表示增加了多少步。`didSet`没有提供自定义名称,所以默认值`oldValue`表示旧值的参数名。 - -> 注意 -> -> 如果在`didSet`监视器里为属性赋值,这个值会替换监视器之前设置的值。 - -##全局变量和局部变量 - -计算属性和属性监视器所描述的模式也可以用于全局变量和局部变量,全局变量是在函数、方法、闭包或任何类型之外定义的变量,局部变量是在函数、方法或闭包内部定义的变量。 - -前面章节提到的全局或局部变量都属于存储型变量,跟存储属性类似,它提供特定类型的存储空间,并允许读取和写入。 - -另外,在全局或局部范围都可以定义计算型变量和为存储型变量定义监视器,计算型变量跟计算属性一样,返回一个计算的值而不是存储值,声明格式也完全一样。 - -> 注意 -> -> 全局的常量或变量都是延迟计算的,跟[延迟存储属性](#)相似,不同的地方在于,全局的常量或变量不需要标记`@lazy`特性。 -> -> 局部范围的常量或变量不会延迟计算。 - -##类属性 - -实例的属性属于一个特定类型实例,每次类型实例化后都拥有自己的一套属性值,实例之间的属性相互独立。 - -也可以为类型本身定义属性,不管类型有多少个实例,这些属性都只有唯一一份。这种属性就是*类属性*。 - -类属性用于定义特定类型所有实例共享的数据,比如所有实例都能用的一个常量(就像 C 语言中的静态常量),或者所有实例都能访问的一个变量(就像 C 语言中的静态变量)。 - -对于值类型(指结构体和枚举)可以定义存储型和计算型类属性,对于类(class)则只能定义计算型类属性。 - -值类型的存储型类属性可以是变量或常量,计算型类属性跟实例的计算属性一样定义成变量属性。 - -> 注意 -> -> 跟实例的存储属性不同,必须给存储型类属性指定默认值,因为类型本身无法在初始化过程中使用构造器给类属性赋值。 - -###类属性语法 - -在 C 或 Objective-C 中,静态常量和静态变量的定义是通过特定类型加上`global`关键字。在 Swift 编程语言中,类属性是作为类型定义的一部分写在类型最外层的花括号内,因此它的作用范围也就在类型支持的范围内。 - -使用关键字`static`来定义值类型的类属性,关键字`class`来为类(class)定义类属性。下面的例子演示了存储型和计算型类属性的语法: - -``` -struct SomeStructure { - static var storedTypeProperty = "Some value." - static var computedTypeProperty: Int { - // return an Int value here - } -} -enum SomeEnumeration { - static var storedTypeProperty = "Some value." - static var computedTypeProperty: Int { - // return an Int value here - } -} -class SomeClass { - class var computedTypeProperty: Int { - // return an Int value here - } -} - -``` - -> 注意 -> -> 例子中的计算型类属性是只读的,但也可以定义可读可写的计算型类属性,跟实例计算属性的语法类似。 - -###获取和设置类属性的值 - -跟实例的属性一样,类属性的访问也是通过点运算符来进行,但是,类属性是通过类型本身来获取和设置,而不是通过实例。比如: - -``` -println(SomeClass.computedTypeProperty) -// prints "42" - -println(SomeStructure.storedTypeProperty) -// prints "Some value." -SomeStructure.storedTypeProperty = "Another value." -println(SomeStructure.storedTypeProperty) -// prints "Another value.” - -``` - -下面的例子定义了一个结构体,使用两个存储型类属性来表示多个声道的声音电平值,每个声道有一个 0 到 10 之间的整数表示声音电平值。 - -后面的图表展示了如何联合使用两个声道来表示一个立体声的声音电平值。当声道的电平值是 0,没有一个灯会亮;当声道的电平值是 10,所有灯点亮。本图中,左声道的电平是 9,右声道的电平是 7。 - -Static Properties VUMeter - -上面所描述的声道模型使用`AudioChannel`结构体来表示: - -``` -struct AudioChannel { - static let thresholdLevel = 10 - static var maxInputLevelForAllChannels = 0 - var currentLevel: Int = 0 { - didSet { - if currentLevel > AudioChannel.thresholdLevel { - // cap the new audio level to the threshold level - currentLevel = AudioChannel.thresholdLevel - } - if currentLevel > AudioChannel.maxInputLevelForAllChannels { - // store this as the new overall maximum input level - AudioChannel.maxInputLevelForAllChannels = currentLevel - } - } - } -} - -``` - -结构`AudioChannel`定义了 2 个存储型类属性来实现上述功能。第一个是`thresholdLevel`,表示声音电平的最大上限阈值,它是一个取值为 10 的常量,对所有实例都可见,如果声音电平高于 10,则取最大上限值 10(见后面描述)。 - -第二个类属性是变量存储型属性`maxInputLevelForAllChannels`,它用来表示所有`AudioChannel`实例的电平值的最大值,初始值是 0。 - -`AudioChannel`也定义了一个名为`currentLevel`的实例存储属性,表示当前声道现在的电平值,取值为 0 到 10。 - -属性`currentLevel`包含`didSet`属性监视器来检查每次新设置后的属性值,有如下两个检查: - -- 如果`currentLevel`的新值大于允许的阈值`thresholdLevel`,属性监视器将`currentLevel`的值限定为阈值`thresholdLevel`。 -- 如果修正后的`currentLevel`值大于任何之前任意`AudioChannel`实例中的值,属性监视器将新值保存在静态属性`maxInputLevelForAllChannels`中。 - -> 注意 -> -> 在第一个检查过程中,`didSet`属性监视器将`currentLevel`设置成了不同的值,但这不会再次调用属性监视器。 - -可以使用结构`AudioChannel`来创建表示立体声系统的两个声道`leftChannel`和`rightChannel`: - -``` -var leftChannel = AudioChannel() -var rightChannel = AudioChannel() - -``` - -如果将左声道的电平设置成 7,类属性`maxInputLevelForAllChannels`也会更新成 7: - -``` -leftChannel.currentLevel = 7 -println(leftChannel.currentLevel) -// prints "7" -println(AudioChannel.maxInputLevelForAllChannels) -// prints "7” - -``` - -如果试图将右声道的电平设置成 11,则会将右声道的`currentLevel`修正到最大值 10,同时`maxInputLevelForAllChannels`的值也会更新到 10: - -``` -rightChannel.currentLevel = 11 -println(rightChannel.currentLevel) -// prints "10" -println(AudioChannel.maxInputLevelForAllChannels) -// prints "10” - -``` - -[本章完] \ No newline at end of file +> 翻译:[shinyzhu](https://github.com/shinyzhu) +> 校对:[pp-prog](https://github.com/pp-prog) + +# 属性 (Properties) +--- + +本页包含内容: + +- [存储属性(Stored Properties)](#stored_properties) +- [计算属性(Computed Properties)](#computed_properties) +- [属性监视器(Property Observers)](#property_observers) +- [全局变量和局部变量(Global and Local Variables)](global_and_local_variables) +- [类型属性(Type Properties)](#type_properties) + +**属性**将值跟特定的类、结构或枚举关联。存储属性存储常量或变量作为实例的一部分,计算属性计算(而不是存储)一个值。计算属性可以用于类、结构体和枚举里,存储属性只能用于类和结构体。 + +存储属性和计算属性通常用于特定类型的实例,但是,属性也可以直接用于类型本身,这种属性称为类型属性。 + +另外,还可以定义属性监视器来监控属性值的变化,以此来触发一个自定义的操作。属性监视器可以添加到自己写的存储属性上,也可以添加到从父类继承的属性上。 + + +## 存储属性 + +简单来说,一个存储属性就是存储在特定类或结构体的实例里的一个常量或变量,存储属性可以是*变量存储属性*(用关键字`var`定义),也可以是*常量存储属性*(用关键字`let`定义)。 + +可以在定义存储属性的时候指定默认值,请参考[构造过程](../chapter2/14_Initialization.html)一章的[默认属性值](../chapter2/14_Initialization.html#default_property_values)一节。也可以在构造过程中设置或修改存储属性的值,甚至修改常量存储属性的值,请参考[构造过程](../chapter2/14_Initialization.html)一章的[在初始化阶段修改常量存储属性](../chapter2/14_Initialization.html#modifying_constant_properties_during_initialization)一节。 + +下面的例子定义了一个名为`FixedLengthRange`的结构体,它描述了一个在创建后无法修改值域宽度的区间: + +```swift +struct FixedLengthRange { + var firstValue: Int + let length: Int +} +var rangeOfThreeItems = FixedLengthRange(firstValue: 0, length: 3) +// 该区间表示整数0,1,2 +rangeOfThreeItems.firstValue = 6 +// 该区间现在表示整数6,7,8 +``` + +`FixedLengthRange`的实例包含一个名为`firstValue`的变量存储属性和一个名为`length`的常量存储属性。在上面的例子中,`length`在创建实例的时候被赋值,因为它是一个常量存储属性,所以之后无法修改它的值。 + + +### 常量和存储属性 + +如果创建了一个结构体的实例并赋值给一个常量,则无法修改实例的任何属性,即使定义了变量存储属性: + +```swift +let rangeOfFourItems = FixedLengthRange(firstValue: 0, length: 4) +// 该区间表示整数0,1,2,3 +rangeOfFourItems.firstValue = 6 +// 尽管 firstValue 是个变量属性,这里还是会报错 +``` + +因为`rangeOfFourItems`声明成了常量(用`let`关键字),即使`firstValue`是一个变量属性,也无法再修改它了。 + +这种行为是由于结构体(struct)属于*值类型*。当值类型的实例被声明为常量的时候,它的所有属性也就成了常量。 + +属于*引用类型*的类(class)则不一样,把一个引用类型的实例赋给一个常量后,仍然可以修改实例的变量属性。 + + +### 延迟存储属性 + +延迟存储属性是指当第一次被调用的时候才会计算其初始值的属性。在属性声明前使用`@lazy`来标示一个延迟存储属性。 + +> 注意: +> 必须将延迟存储属性声明成变量(使用`var`关键字),因为属性的值在实例构造完成之前可能无法得到。而常量属性在构造过程完成之前必须要有初始值,因此无法声明成延迟属性。 + +延迟属性很有用,当属性的值依赖于在实例的构造过程结束前无法知道具体值的外部因素时,或者当属性的值需要复杂或大量计算时,可以只在需要的时候来计算它。 + +下面的例子使用了延迟存储属性来避免复杂类的不必要的初始化。例子中定义了`DataImporter`和`DataManager`两个类,下面是部分代码: + +```swift +class DataImporter { + /* + DataImporter 是一个将外部文件中的数据导入的类。 + 这个类的初始化会消耗不少时间。 + */ + var fileName = "data.txt" + // 这是提供数据导入功能 +} + +class DataManager { + @lazy var importer = DataImporter() + var data = String[]() + // 这是提供数据管理功能 +} + +let manager = DataManager() +manager.data += "Some data" +manager.data += "Some more data" +// DataImporter 实例的 importer 属性还没有被创建 +``` + +`DataManager`类包含一个名为`data`的存储属性,初始值是一个空的字符串(`String`)数组。虽然没有写出全部代码,`DataManager`类的目的是管理和提供对这个字符串数组的访问。 + +`DataManager`的一个功能是从文件导入数据,该功能由`DataImporter`类提供,`DataImporter`需要消耗不少时间完成初始化:因为它的实例在初始化时可能要打开文件,还要读取文件内容到内存。 + +`DataManager`也可能不从文件中导入数据。所以当`DataManager`的实例被创建时,没必要创建一个`DataImporter`的实例,更明智的是当用到`DataImporter`的时候才去创建它。 + +由于使用了`@lazy`,`importer`属性只有在第一次被访问的时候才被创建。比如访问它的属性`fileName`时: + +```swift +println(manager.importer.fileName) +// DataImporter 实例的 importer 属性现在被创建了 +// 输出 "data.txt” +``` + + +### 存储属性和实例变量 + +如果您有过 Objective-C 经验,应该知道有两种方式在类实例存储值和引用。对于属性来说,也可以使用实例变量作为属性值的后端存储。 + +Swift 编程语言中把这些理论统一用属性来实现。Swift 中的属性没有对应的实例变量,属性的后端存储也无法直接访问。这就避免了不同场景下访问方式的困扰,同时也将属性的定义简化成一个语句。 +一个类型中属性的全部信息——包括命名、类型和内存管理特征——都在唯一一个地方(类型定义中)定义。 + + +## 计算属性 + +除存储属性外,类、结构体和枚举可以定义*计算属性*,计算属性不直接存储值,而是提供一个 getter 来获取值,一个可选的 setter 来间接设置其他属性或变量的值。 + +```swift +struct Point { + var x = 0.0, y = 0.0 +} +struct Size { + var width = 0.0, height = 0.0 +} +struct Rect { + var origin = Point() + var size = Size() + var center: Point { + get { + let centerX = origin.x + (size.width / 2) + let centerY = origin.y + (size.height / 2) + return Point(x: centerX, y: centerY) + } + set(newCenter) { + origin.x = newCenter.x - (size.width / 2) + origin.y = newCenter.y - (size.height / 2) + } + } +} +var square = Rect(origin: Point(x: 0.0, y: 0.0), + size: Size(width: 10.0, height: 10.0)) +let initialSquareCenter = square.center +square.center = Point(x: 15.0, y: 15.0) +println("square.origin is now at (\(square.origin.x), \(square.origin.y))") +// 输出 "square.origin is now at (10.0, 10.0)” +``` + +这个例子定义了 3 个几何形状的结构体: + +- `Point`封装了一个`(x, y)`的坐标 +- `Size`封装了一个`width`和`height` +- `Rect`表示一个有原点和尺寸的矩形 + +`Rect`也提供了一个名为`center`的计算属性。一个矩形的中心点可以从原点和尺寸来算出,所以不需要将它以显式声明的`Point`来保存。`Rect`的计算属性`center`提供了自定义的 getter 和 setter 来获取和设置矩形的中心点,就像它有一个存储属性一样。 + +例子中接下来创建了一个名为`square`的`Rect`实例,初始值原点是`(0, 0)`,宽度高度都是`10`。如图所示蓝色正方形。 + +`square`的`center`属性可以通过点运算符(`square.center`)来访问,这会调用 getter 来获取属性的值。跟直接返回已经存在的值不同,getter 实际上通过计算然后返回一个新的`Point`来表示`square`的中心点。如代码所示,它正确返回了中心点`(5, 5)`。 + +`center`属性之后被设置了一个新的值`(15, 15)`,表示向右上方移动正方形到如图所示橙色正方形的位置。设置属性`center`的值会调用 setter 来修改属性`origin`的`x`和`y`的值,从而实现移动正方形到新的位置。 + +Computed Properties sample + + +### 便捷 setter 声明 + +如果计算属性的 setter 没有定义表示新值的参数名,则可以使用默认名称`newValue`。下面是使用了便捷 setter 声明的`Rect`结构体代码: + +```swift +struct AlternativeRect { + var origin = Point() + var size = Size() + var center: Point { + get { + let centerX = origin.x + (size.width / 2) + let centerY = origin.y + (size.height / 2) + return Point(x: centerX, y: centerY) + } + set { + origin.x = newValue.x - (size.width / 2) + origin.y = newValue.y - (size.height / 2) + } + } +} +``` + + +### 只读计算属性 + +只有 getter 没有 setter 的计算属性就是*只读计算属性*。只读计算属性总是返回一个值,可以通过点运算符访问,但不能设置新的值。 + +<<<<<<< HEAD +> 注意: +> 必须使用`var`关键字定义计算属性,包括只读计算属性,因为他们的值不是固定的。`let`关键字只用来声明常量属性,表示初始化后再也无法修改的值。 +======= +> 注意: +> +> 必须使用`var`关键字定义计算属性,包括只读计算属性,因为它们的值不是固定的。`let`关键字只用来声明常量属性,表示初始化后再也无法修改的值。 +>>>>>>> a516af6a531a104ec88da0d236ecf389a5ec72af + +只读计算属性的声明可以去掉`get`关键字和花括号: + +```swift +struct Cuboid { + var width = 0.0, height = 0.0, depth = 0.0 + var volume: Double { + return width * height * depth + } +} +let fourByFiveByTwo = Cuboid(width: 4.0, height: 5.0, depth: 2.0) +println("the volume of fourByFiveByTwo is \(fourByFiveByTwo.volume)") +// 输出 "the volume of fourByFiveByTwo is 40.0" +``` + +这个例子定义了一个名为`Cuboid`的结构体,表示三维空间的立方体,包含`width`、`height`和`depth`属性,还有一个名为`volume`的只读计算属性用来返回立方体的体积。设置`volume`的值毫无意义,因为通过`width`、`height`和`depth`就能算出`volume`。然而,`Cuboid`提供一个只读计算属性来让外部用户直接获取体积是很有用的。 + + +## 属性监视器 + +*属性监视器*监控和响应属性值的变化,每次属性被设置值的时候都会调用属性监视器,甚至新的值和现在的值相同的时候也不例外。 + +可以为除了延迟存储属性之外的其他存储属性添加属性监视器,也可以通过重载属性的方式为继承的属性(包括存储属性和计算属性)添加属性监视器。属性重载请参考[继承](chapter/13_Inheritance.html)一章的[重载](chapter/13_Inheritance.html#overriding)。 + +> 注意: +> 不需要为无法重载的计算属性添加属性监视器,因为可以通过 setter 直接监控和响应值的变化。 + +可以为属性添加如下的一个或全部监视器: + +- `willSet`在设置新的值之前调用 +- `didSet`在新的值被设置之后立即调用 + +`willSet`监视器会将新的属性值作为固定参数传入,在`willSet`的实现代码中可以为这个参数指定一个名称,如果不指定则参数仍然可用,这时使用默认名称`newValue`表示。 + +类似地,`didSet`监视器会将旧的属性值作为参数传入,可以为该参数命名或者使用默认参数名`oldValue`。 + +<<<<<<< HEAD +> 注意: +> `willSet`和`didSet`监视器在属性初始化过程中不会被调用,他们只会当属性的值在初始化之外的地方被设置时被调用。 +======= +> 注意: +> +> `willSet`和`didSet`监视器在属性初始化过程中不会被调用,它们只会当属性的值在初始化之外的地方被设置时被调用。 +>>>>>>> a516af6a531a104ec88da0d236ecf389a5ec72af + +这里是一个`willSet`和`didSet`的实际例子,其中定义了一个名为`StepCounter`的类,用来统计当人步行时的总步数,可以跟计步器或其他日常锻炼的统计装置的输入数据配合使用。 + +```swift +class StepCounter { + var totalSteps: Int = 0 { + willSet(newTotalSteps) { + println("About to set totalSteps to \(newTotalSteps)") + } + didSet { + if totalSteps > oldValue { + println("Added \(totalSteps - oldValue) steps") + } + } + } +} +let stepCounter = StepCounter() +stepCounter.totalSteps = 200 +// About to set totalSteps to 200 +// Added 200 steps +stepCounter.totalSteps = 360 +// About to set totalSteps to 360 +// Added 160 steps +stepCounter.totalSteps = 896 +// About to set totalSteps to 896 +// Added 536 steps +``` + +`StepCounter`类定义了一个`Int`类型的属性`totalSteps`,它是一个存储属性,包含`willSet`和`didSet`监视器。 + +当`totalSteps`设置新值的时候,它的`willSet`和`didSet`监视器都会被调用,甚至当新的值和现在的值完全相同也会调用。 + +例子中的`willSet`监视器将表示新值的参数自定义为`newTotalSteps`,这个监视器只是简单的将新的值输出。 + +`didSet`监视器在`totalSteps`的值改变后被调用,它把新的值和旧的值进行对比,如果总的步数增加了,就输出一个消息表示增加了多少步。`didSet`没有提供自定义名称,所以默认值`oldValue`表示旧值的参数名。 + +> 注意: +> 如果在`didSet`监视器里为属性赋值,这个值会替换监视器之前设置的值。 + + +##全局变量和局部变量 + +计算属性和属性监视器所描述的模式也可以用于*全局变量*和*局部变量*,全局变量是在函数、方法、闭包或任何类型之外定义的变量,局部变量是在函数、方法或闭包内部定义的变量。 + +前面章节提到的全局或局部变量都属于存储型变量,跟存储属性类似,它提供特定类型的存储空间,并允许读取和写入。 + +另外,在全局或局部范围都可以定义计算型变量和为存储型变量定义监视器,计算型变量跟计算属性一样,返回一个计算的值而不是存储值,声明格式也完全一样。 + +> 注意: +> 全局的常量或变量都是延迟计算的,跟[延迟存储属性](#lazy_stored_properties)相似,不同的地方在于,全局的常量或变量不需要标记`@lazy`特性。 +> 局部范围的常量或变量不会延迟计算。 + + +##类型属性 + +实例的属性属于一个特定类型实例,每次类型实例化后都拥有自己的一套属性值,实例之间的属性相互独立。 + +也可以为类型本身定义属性,不管类型有多少个实例,这些属性都只有唯一一份。这种属性就是*类型属性*。 + +类型属性用于定义特定类型所有实例共享的数据,比如所有实例都能用的一个常量(就像 C 语言中的静态常量),或者所有实例都能访问的一个变量(就像 C 语言中的静态变量)。 + +对于值类型(指结构体和枚举)可以定义存储型和计算型类型属性,对于类(class)则只能定义计算型类型属性。 + +值类型的存储型类型属性可以是变量或常量,计算型类型属性跟实例的计算属性一样定义成变量属性。 + +> 注意: +> 跟实例的存储属性不同,必须给存储型类型属性指定默认值,因为类型本身无法在初始化过程中使用构造器给类型属性赋值。 + + +###类型属性语法 + +在 C 或 Objective-C 中,静态常量和静态变量的定义是通过特定类型加上`global`关键字。在 Swift 编程语言中,类型属性是作为类型定义的一部分写在类型最外层的花括号内,因此它的作用范围也就在类型支持的范围内。 + +使用关键字`static`来定义值类型的类型属性,关键字`class`来为类(class)定义类型属性。下面的例子演示了存储型和计算型类型属性的语法: + +```swift +struct SomeStructure { + static var storedTypeProperty = "Some value." + static var computedTypeProperty: Int { + // 这里返回一个 Int 值 + } +} +enum SomeEnumeration { + static var storedTypeProperty = "Some value." + static var computedTypeProperty: Int { + // 这里返回一个 Int 值 + } +} +class SomeClass { + class var computedTypeProperty: Int { + // 这里返回一个 Int 值 + } +} +``` + +> 注意: +> 例子中的计算型类型属性是只读的,但也可以定义可读可写的计算型类型属性,跟实例计算属性的语法类似。 + + +###获取和设置类型属性的值 + +跟实例的属性一样,类型属性的访问也是通过点运算符来进行,但是,类型属性是通过类型本身来获取和设置,而不是通过实例。比如: + +```swift +println(SomeClass.computedTypeProperty) +// 输出 "42" + +println(SomeStructure.storedTypeProperty) +// 输出 "Some value." +SomeStructure.storedTypeProperty = "Another value." +println(SomeStructure.storedTypeProperty) +// 输出 "Another value.” +``` + +下面的例子定义了一个结构体,使用两个存储型类型属性来表示多个声道的声音电平值,每个声道有一个 0 到 10 之间的整数表示声音电平值。 + +后面的图表展示了如何联合使用两个声道来表示一个立体声的声音电平值。当声道的电平值是 0,没有一个灯会亮;当声道的电平值是 10,所有灯点亮。本图中,左声道的电平是 9,右声道的电平是 7。 + +Static Properties VUMeter + +上面所描述的声道模型使用`AudioChannel`结构体来表示: + +```swift +struct AudioChannel { + static let thresholdLevel = 10 + static var maxInputLevelForAllChannels = 0 + var currentLevel: Int = 0 { + didSet { + if currentLevel > AudioChannel.thresholdLevel { + // 将新电平值设置为阀值 + currentLevel = AudioChannel.thresholdLevel + } + if currentLevel > AudioChannel.maxInputLevelForAllChannels { + // 存储当前电平值作为新的最大输入电平 + AudioChannel.maxInputLevelForAllChannels = currentLevel + } + } + } +} +``` + +结构`AudioChannel`定义了 2 个存储型类型属性来实现上述功能。第一个是`thresholdLevel`,表示声音电平的最大上限阈值,它是一个取值为 10 的常量,对所有实例都可见,如果声音电平高于 10,则取最大上限值 10(见后面描述)。 + +第二个类型属性是变量存储型属性`maxInputLevelForAllChannels`,它用来表示所有`AudioChannel`实例的电平值的最大值,初始值是 0。 + +`AudioChannel`也定义了一个名为`currentLevel`的实例存储属性,表示当前声道现在的电平值,取值为 0 到 10。 + +属性`currentLevel`包含`didSet`属性监视器来检查每次新设置后的属性值,有如下两个检查: + +- 如果`currentLevel`的新值大于允许的阈值`thresholdLevel`,属性监视器将`currentLevel`的值限定为阈值`thresholdLevel`。 +- 如果修正后的`currentLevel`值大于任何之前任意`AudioChannel`实例中的值,属性监视器将新值保存在静态属性`maxInputLevelForAllChannels`中。 + +> 注意: +> 在第一个检查过程中,`didSet`属性监视器将`currentLevel`设置成了不同的值,但这时不会再次调用属性监视器。 + +可以使用结构体`AudioChannel`来创建表示立体声系统的两个声道`leftChannel`和`rightChannel`: + +```swift +var leftChannel = AudioChannel() +var rightChannel = AudioChannel() +``` + +如果将左声道的电平设置成 7,类型属性`maxInputLevelForAllChannels`也会更新成 7: + +```swift +leftChannel.currentLevel = 7 +println(leftChannel.currentLevel) +// 输出 "7" +println(AudioChannel.maxInputLevelForAllChannels) +// 输出 "7" +``` + +如果试图将右声道的电平设置成 11,则会将右声道的`currentLevel`修正到最大值 10,同时`maxInputLevelForAllChannels`的值也会更新到 10: + +```swift +rightChannel.currentLevel = 11 +println(rightChannel.currentLevel) +// 输出 "10" +println(AudioChannel.maxInputLevelForAllChannels) +// 输出 "10" +``` diff --git a/source/chapter2/11_Methods.md b/source/chapter2/11_Methods.md old mode 100644 new mode 100755 index 46848f82..815f9b9e --- a/source/chapter2/11_Methods.md +++ b/source/chapter2/11_Methods.md @@ -1,296 +1,309 @@ -# 方法(Methods) - -**方法**是与某些特定类型相关联的功能/函数。类、结构体、枚举都可以定义实例方法;实例方法为指定类型的实例封装了特定的任务与功能。类、结构体、枚举也可以定义类(型)方法(type itself);类型方法与类型自身相关联。类型方法与Objective-C中的类方法(class methods)相似。 - -在Swift中,结构体和枚举能够定义方法;事实上这是Swift与C/Objective-C的主要区别之一。在Objective-C中,类是唯一能定义方法的类型。在Swift中,你能够选择是否定义一个类/结构体/枚举,并且你仍然享有在你创建的类型(类/结构体/枚举)上定义方法的灵活性。 - -### 实例方法(Instance Methods) - -**实例方法**是某个特定类、结构体或者枚举类型的实例的方法。实例方法支撑实例的功能: 或者提供方法,以访问和修改实例属性;或者提供与实例的目的相关的功能。实例方法的语法与函数完全一致,参考[函数说明](functions.md "函数说明")。 - -实例方法要写在它所属的类型的前后括号之间。实例方法能够访问他所属类型的所有的其他实例方法和属性。实例方法只能被它所属的类的特定实例调用。实例方法不能被孤立于现存的实例而被调用。 - -下面是定义一个很简单的类`Counter`的例子(`Counter`能被用来对一个动作发生的次数进行计数): - -``` -class Counter { - var count = 0 - func increment() { - count++ - } - func incrementBy(amount: Int) { - count += amount - } - func reset() { - count = 0 - } -} -``` - -`Counter`类定理了三个实例方法: -- `increment`让计数器按一递增; -- `incrementBy(amount: Int)`让计数器按一个指定的整数值递增; -- `reset`将计数器重置为0。 - -`Counter`这个类还声明了一个可变属性`count`,用它来保持对当前计数器值的追踪。 - -和调用属性一样,用点语法(dot syntax)调用实例方法: - -``` - let counter = Counter() - // the initial counter value is 0 - counter.increment() - // the counter's value is now 1 - counter.incrementBy(5) - // the counter's value is now 6 - counter.reset() - // the counter's value is now 0 -``` - -### 方法的局部参数名称和外部参数名称(Local and External Parameter Names for Methods) - -函数参数有一个局部名称(在函数体内部使用)和一个外部名称(在调用函数时使用),参考[External Parameter Names](external_parameter_names.md)。对于方法参数也是这样,因为方法就是函数(只是这个函数与某个类型相关联了)。但是,方法和函数的局部名称和外部名称的默认行为是不一样的。 - -Swift中的方法和Objective-C中的方法极其相似。像在Objective-C中一样,Swift中方法的名称通常用一个介词指向方法的第一个参数,比如:`with`,`for`,`by`等等。前面的`Counter`类的例子中`incrementBy`方法就是这样的。介词的使用让方法在被调用时能像一个句子一样被解读。Swift这种方法命名约定很容易落实,因为它是用不同的默认处理方法参数的方式,而不是用函数参数(来实现的)。 - -具体来说,Swift默认仅给方法的第一个参数名称一个局部参数名称;但是默认同时给第二个和后续的参数名称局部参数名称和外部参数名称。 -这个约定与典型的命名和调用约定相匹配,这与你在写Objective-C的方法时很相似。这个约定还让expressive method调用不需要再检查/限定参数名。 - -看看下面这个`Counter`的替换版本(它定义了一个更复杂的`incrementBy`方法): - -``` -class Counter { - var count: Int = 0 - func incrementBy(amount: Int, numberOfTimes: Int) { - count += amount * numberOfTimes - } -} -``` - -`incrementBy`方法有两个参数: `amount`和`numberOfTimes`。默认地,Swift只把`amount`当作一个局部名称,但是把`numberOfTimes`即看作本地名称又看作外部名称。下面调用这个方法: - -``` -let counter = Counter() -counter.incrementBy(5, numberOfTimes: 3) -// counter value is now 15 -``` - -你不必为第一个参数值再定义一个外部变量名:因为从函数名`incrementBy`已经能很清楚地看出它的目的/作用。但是第二个参数,就要被一个外部参数名称所限定,以便在方法被调用时让他目的/作用明确。 - -这种默认的行为能够有效的检查方法,比如你在参数numberOfTimes前写了个井号( `#` )时: - -``` -func incrementBy(amount: Int, #numberOfTimes: Int) { - count += amount * numberOfTimes -} -``` - -这种默认行为使上面代码意味着:在Swift中定义方法使用了与Objective-C同样的语法风格,并且方法将以自然表达式的方式被调用。 - -### 修改外部参数名称(Modifying External Parameter Name Behavior for Methods) - -有时为方法的第一个参数提供一个外部参数名称是非常有用的,尽管这不是默认的行为。你可以自己添加一个明确的外部名称;你也可以用一个hash符号作为第一个参数的前缀,然后用这个局部名字作为外部名字。 - -相反,如果你不想为方法的第二个及后续的参数提供一个外部名称,你可以通过使用下划线(`_`)作为该参数的显式外部名称来覆盖默认行为。 - -### `self`属性(The self Property) - -类型的每一个实例都有一个隐含属性叫做`self`,它完全等同于这个实力变量本身。你可以在一个实例的实例方法中使用这个隐含的`self`属性来引用当前实例。 - -上面例子中的`increment`方法可以被写成这样: -``` -func increment() { - self.count++ -} -``` - -实际上,你不必在你的代码里面经常写`self`。不论何时,在一个方法中使用一个已知的属性或者方法名称,如果你没有明确的写`self`,Swift假定你是指当前实例的属性或者方法。这种假定在上面的`Counter`中已经示范了:`Counter`中的三个实例方法中都使用的是`count`(而不是`self.count`) - -这条规则的主要例外发生在当实例方法的某个参数名称与实例的某个属性名称相同时。 -在这种情况下,参数名称享有优先权,并且在引用属性时必须使用一种更恰当(被限定更严格)的方式。 -你可以使用隐藏的`self`属性来区分参数名称和属性名称。 - -下面的例子演示了`self`消除方法参数`x`和实例属性`x`之间的歧义: - -``` -struct Point { - var x = 0.0, y = 0.0 - func isToTheRightOfX(x: Double) -> Bool { - return self.x > x - } -} -let somePoint = Point(x: 4.0, y: 5.0) -if somePoint.isToTheRightOfX(1.0) { - println("This point is to the right of the line where x == 1.0") -} -// prints "This point is to the right of the line where x == 1.0" -``` - -如果不使用`self`前缀,Swift就认为两次使用的`x`都指的是名称为`x`的函数参数。 - -### 在实例方法中修改值类型(Modifying Value Types from Within Instance Methods) - -结构体和枚举是**值类型**[Structures and Enumerations Are Value Types]("#")。一般情况下,值类型的属性不能在他的实例方法中被修改。 - -但是,如果你确实需要在某个具体的方法中修改结构体或者枚举的属性,你可以选择`变异(mutating)`这个方法。方法可以从内部变异它的属性;并且它做的任何改变在方法结束时都会回写到原始结构。方法会给它隐含的`self`属性赋值一个全新的实例,这个新实例在方法结束后将替换原来的实例。 - -要`变异`方法, 将关键字`mutating` 放到方法的`func`关键字之前就可以了: - -``` -struct Point { - var x = 0.0, y = 0.0 - mutating func moveByX(deltaX: Double, y deltaY: Double) { - x += deltaX - y += deltaY - } -} -var somePoint = Point(x: 1.0, y: 1.0) -somePoint.moveByX(2.0, y: 3.0) -println("The point is now at (\(somePoint.x), \(somePoint.y))") -// prints "The point is now at (3.0, 4.0)" -``` - -上面的Point结构体定义了一个变异方法(mutating method)`moveByX`,`moveByX`用来移动一个point。`moveByX`方法在被调用时修改了这个point,而不是返回一个新的point。方法定义是加上那个了`mutating`关键字,所以方法可以修改值类型的属性了。 - -注意:不能在结构体类型的常量上调用变异方法,因为常量的属性不能被改变,就算你想改变的是常量的可变属性也不行,参考[Stored Properties of Constant Structure Instances]("#") - -``` -let fixedPoint = Point(x: 3.0, y: 3.0) -fixedPoint.moveByX(2.0, y: 3.0) -// this will report an error -``` -### 在变异方法中给self赋值(Assigning to self Within a Mutating Method) - -变异方法能够赋给隐含属性`self`一个全新的实例。上面`Point`的例子可以用下面的方式改写: - -``` -struct Point { - var x = 0.0, y = 0.0 - mutating func moveByX(deltaX: Double, y deltaY: Double) { - self = Point(x: x + deltaX, y: y + deltaY) - } -} -``` - -新版的变异方法`moveByX`创建了一个新的分支结构(他的x和y的值都被设定为目标值了)。调用这个版本的方法和调用上个版本的最终结果是一样的。 - -枚举的变异方法可以让`self`从相同的枚举设置为不同的成员。 - -``` -enum TriStateSwitch { - case Off, Low, High - mutating func next() { - switch self { - case Off: - self = Low - case Low: - self = High - case High: - self = Off - } - } -} -var ovenLight = TriStateSwitch.Low -ovenLight.next() -// ovenLight is now equal to .High -ovenLight.next() -// ovenLight is now equal to .Off -``` - -上面的例子中定义了一个三态开关的枚举。每次调用`next`方法时,开关在不同的电源状态(`Off`,`Low`,`High`)之前循环切换。 - -### 类型方法(Type Methods) - -实例方法是被类型的某个实例调用的方法。你也可以定义类列本身调用的方法,这种方法就叫做**类型方法**。声明类的类型方法,在方法的`func`关键字之前加上关键字`class`;声明结构体和枚举的类型方法,在方法的`func`关键字之前加上关键字`static`。 - -> 注意: - -> 在Objective-C里面,你只能为Objective-C的类定义类型方法(type-level methods)。在Swift中,你可以为所有的类、结构体和枚举定义类型方法:Each type method is explicitly scoped to the type it supports. - -类型方法和实例方法一样用点语法调用。但是,你是在类型上调用这个方法,而不是在实例上调用。下面是如何在SomeClass类上调用类型方法的例子: - -``` -class SomeClass { - class func someTypeMethod() { - // type method implementation goes here - } -} -SomeClass.someTypeMethod() -``` - -在类型方法的方法体(body)中,`self`指向这个类型本身,而不是类型的某个实例。对于结构体和枚举来说,这意味着你可以用`self`来消除静态属性和静态方法参数之间的二意性(类似于我们在前面处理实例属性和实例方法参数时做的那样)。 - -一般地,在类型方法里面所使用的任何未限定的方法和属性名称,将会指向其他的类型级别的方法和属性。一个类型方法可以用另一个类型方法的名称调用踏,而无需在方法名称前面加上类型名称的前缀。同样,结构体和枚举的类型方法也能够直接通过静态属性的名称访问静态属性,而不需要类型名称前缀。 - -下面的例子定义了一个名为`LevelTracker`结构体。它监测玩家的发展情况(游戏的不同层次或阶段)。这是一个单人游戏,但也可以用作多玩家游戏中单个设备上的信息存储。 - -游戏初始时,所有的游戏等级(除了等级1)都被锁定。每次有玩家完成一个等级,这个等级就对这个设备上的所有玩家解锁。`LevelTracker`结构体用静态属性和方法监测游戏的哪个等级已经被解锁。他还监测每个玩家的当前等级。 - -``` -struct LevelTracker { - static var highestUnlockedLevel = 1 - static func unlockLevel(level: Int) { - if level > highestUnlockedLevel { highestUnlockedLevel = level } - } - static func levelIsUnlocked(level: Int) -> Bool { - return level <= highestUnlockedLevel - } - var currentLevel = 1 - mutating func advanceToLevel(level: Int) -> Bool { - if LevelTracker.levelIsUnlocked(level) { - currentLevel = level - return true - } else { - return false - } - } -} -``` - -`LevelTracker`监测玩家的已解锁的最高等级。这个值被存储在静态属性`highestUnlockedLevel`中。 - -`LevelTracker`还定义了两个类型方法与`highestUnlockedLevel`配合工作。第一个类型方法是`unlockLevel`:一旦新等级被解锁,它会更新`highestUnlockedLevel`的值。第二个类型方法是`levelIsUnlocked`:如果某个给定的等级已经被解锁,他返回`true`。(注意:我们没用使用`LevelTracker.highestUnlockedLevel`,这个类型方法还是能够访问静态属性`highestUnlockedLevel`) - -除了静态属性和类型方法,`LevelTracker`还监测每个玩家的进度。它用实例属性`currentLevel`来监测玩家当前正在进行的等级。 - -为了便于管理`currentLevel`属性,`LevelTracker`定义了实例方法`advanceToLevel`。这个方法会在更新`currentLevel`之前检查所请求的新等级是否已经解锁。`advanceToLevel`方法返回布尔值以指示是否确实能够设置`currentLevel`了。 - -下面,`Player`类使用`LevelTracker`来监测和更新每个玩家的发展进度: - -``` -class Player { - var tracker = LevelTracker() - let playerName: String - func completedLevel(level: Int) { - LevelTracker.unlockLevel(level + 1) - tracker.advanceToLevel(level + 1) - } - init(name: String) { - playerName = name - } -} -``` - -`Player`类创建一个新的`LevelTracker`实例来检测这个用户的发展进度。他提供了`completedLevel`方法:一旦玩家完成某个指定等级就调用它。这个方法为所有玩家解锁下一等级,并且将当前玩家的进度更新为下一等级。(我们忽略了`advanceToLevel`返回的布尔值,因为之前调用`LevelTracker.unlockLevel`时就知道了这个等级已经被解锁了) - -你还可以为一个新的玩家创建一个`Player`的实例,然后看这个玩家完成等级一时发生了什么: - -``` -var player = Player(name: "Argyrios") -player.completedLevel(1) -println("highest unlocked level is now \(LevelTracker.highestUnlockedLevel)") -// prints "highest unlocked level is now 2" -``` - -如果你创建了第二个玩家,并尝试让他开始一个没有被任何玩家解锁的等级,你试图去设置玩家当前等级时会失败的: - -``` -player = Player(name: "Beto") -if player.tracker.advanceToLevel(6) { -println("player is now on level 6") -} else { -println("level 6 has not yet been unlocked") -} -// prints "level 6 has not yet been unlocked" -``` - +> 翻译:[pp-prog](https://github.com/pp-prog) +> 校对:[zqp](https://github.com/zqp) + +# 方法(Methods) +----------------- + +本页包含内容: + +- [实例方法(Instance Methods](#instance_methods) +- [类型方法(Type Methods)](#type_methods) + +**方法**是与某些特定类型相关联的函数。类、结构体、枚举都可以定义实例方法;实例方法为给定类型的实例封装了具体的任务与功能。类、结构体、枚举也可以定义类型方法;类型方法与类型本身相关联。类型方法与 Objective-C 中的类方法(class methods)相似。 + +结构体和枚举能够定义方法是 Swift 与 C/Objective-C 的主要区别之一。在 Objective-C 中,类是唯一能定义方法的类型。但在 Swift 中,你不仅能选择是否要定义一个类/结构体/枚举,还能灵活的在你创建的类型(类/结构体/枚举)上定义方法。 + + +## 实例方法(Instance Methods) + +**实例方法**是属于某个特定类、结构体或者枚举类型实例的方法。实例方法提供访问和修改实例属性的方法或提供与实例目的相关的功能,并以此来支撑实例的功能。实例方法的语法与函数完全一致,详情参见[函数](../charpter2/06_Functions.md)。 + +实例方法要写在它所属的类型的前后大括号之间。实例方法能够隐式访问它所属类型的所有的其他实例方法和属性。实例方法只能被它所属的类的某个特定实例调用。实例方法不能脱离于现存的实例而被调用。 + +下面的例子,定义一个很简单的类`Counter`,`Counter`能被用来对一个动作发生的次数进行计数: + +```swift +class Counter { + var count = 0 + func increment() { + count++ + } + func incrementBy(amount: Int) { + count += amount + } + func reset() { + count = 0 + } +} +``` + +`Counter`类定义了三个实例方法: +- `increment`让计数器按一递增; +- `incrementBy(amount: Int)`让计数器按一个指定的整数值递增; +- `reset`将计数器重置为0。 + +`Counter`这个类还声明了一个可变属性`count`,用它来保持对当前计数器值的追踪。 + +和调用属性一样,用点语法(dot syntax)调用实例方法: + +```swift + let counter = Counter() + // 初始计数值是0 + counter.increment() + // 计数值现在是1 + counter.incrementBy(5) + // 计数值现在是6 + counter.reset() + // 计数值现在是0 +``` + + +### 方法的局部参数名称和外部参数名称(Local and External Parameter Names for Methods) + +函数参数可以同时有一个局部名称(在函数体内部使用)和一个外部名称(在调用函数时使用),详情参见[函数的外部参数名](06_Functions.html)。方法参数也一样(因为方法就是函数,只是这个函数与某个类型相关联了)。但是,方法和函数的局部名称和外部名称的默认行为是不一样的。 + +Swift 中的方法和 Objective-C 中的方法极其相似。像在 Objective-C 中一样,Swift 中方法的名称通常用一个介词指向方法的第一个参数,比如:`with`,`for`,`by`等等。前面的`Counter`类的例子中`incrementBy`方法就是这样的。介词的使用让方法在被调用时能像一个句子一样被解读。和函数参数不同,对于方法的参数,Swift 使用不同的默认处理方式,这可以让方法命名规范更容易写。 + +具体来说,Swift 默认仅给方法的第一个参数名称一个局部参数名称;默认同时给第二个和后续的参数名称局部参数名称和外部参数名称。这个约定与典型的命名和调用约定相适应,与你在写 Objective-C 的方法时很相似。这个约定还让表达式方法在调用时不需要再限定参数名称。 + +看看下面这个`Counter`的另一个版本(它定义了一个更复杂的`incrementBy`方法): + +```swift +class Counter { + var count: Int = 0 + func incrementBy(amount: Int, numberOfTimes: Int) { + count += amount * numberOfTimes + } +} +``` + +`incrementBy`方法有两个参数: `amount`和`numberOfTimes`。默认情况下,Swift 只把`amount`当作一个局部名称,但是把`numberOfTimes`即看作局部名称又看作外部名称。下面调用这个方法: + +```swift +let counter = Counter() +counter.incrementBy(5, numberOfTimes: 3) +// counter value is now 15 +``` + +你不必为第一个参数值再定义一个外部变量名:因为从函数名`incrementBy`已经能很清楚地看出它的作用。但是第二个参数,就要被一个外部参数名称所限定,以便在方法被调用时明确它的作用。 + +这种默认的行为能够有效的处理方法(method),类似于在参数`numberOfTimes`前写一个井号(`#`): + +```swift +func incrementBy(amount: Int, #numberOfTimes: Int) { + count += amount * numberOfTimes +} +``` + +这种默认行为使上面代码意味着:在 Swift 中定义方法使用了与 Objective-C 同样的语法风格,并且方法将以自然表达式的方式被调用。 + + +### 修改方法的外部参数名称(Modifying External Parameter Name Behavior for Methods) + +有时为方法的第一个参数提供一个外部参数名称是非常有用的,尽管这不是默认的行为。你可以自己添加一个显式的外部名称或者用一个井号(`#`)作为第一个参数的前缀来把这个局部名称当作外部名称使用。 + +相反,如果你不想为方法的第二个及后续的参数提供一个外部名称,可以通过使用下划线(`_`)作为该参数的显式外部名称,这样做将覆盖默认行为。 + + +## `self`属性(The self Property) + +类型的每一个实例都有一个隐含属性叫做`self`,`self`完全等同于该实例本身。你可以在一个实例的实例方法中使用这个隐含的`self`属性来引用当前实例。 + +上面例子中的`increment`方法还可以这样写: + +```swift +func increment() { + self.count++ +} +``` + +实际上,你不必在你的代码里面经常写`self`。不论何时,只要在一个方法中使用一个已知的属性或者方法名称,如果你没有明确的写`self`,Swift 假定你是指当前实例的属性或者方法。这种假定在上面的`Counter`中已经示范了:`Counter`中的三个实例方法中都使用的是`count`(而不是`self.count`)。 + +使用这条规则的主要场景是实例方法的某个参数名称与实例的某个属性名称相同的时候。在这种情况下,参数名称享有优先权,并且在引用属性时必须使用一种更严格的方式。这时你可以使用`self`属性来区分参数名称和属性名称。 + +下面的例子中,`self`消除方法参数`x`和实例属性`x`之间的歧义: + +```swift +struct Point { + var x = 0.0, y = 0.0 + func isToTheRightOfX(x: Double) -> Bool { + return self.x > x + } +} +let somePoint = Point(x: 4.0, y: 5.0) +if somePoint.isToTheRightOfX(1.0) { + println("This point is to the right of the line where x == 1.0") +} +// 输出 "This point is to the right of the line where x == 1.0"(这个点在x等于1.0这条线的右边) +``` + +如果不使用`self`前缀,Swift 就认为两次使用的`x`都指的是名称为`x`的函数参数。 + + +### 在实例方法中修改值类型(Modifying Value Types from Within Instance Methods) + +结构体和枚举是**值类型**。一般情况下,值类型的属性不能在它的实例方法中被修改。 + +但是,如果你确实需要在某个具体的方法中修改结构体或者枚举的属性,你可以选择`变异(mutating)`这个方法,然后方法就可以从方法内部改变它的属性;并且它做的任何改变在方法结束时还会保留在原始结构中。方法还可以给它隐含的`self`属性赋值一个全新的实例,这个新实例在方法结束后将替换原来的实例。 + +要使用`变异`方法, 将关键字`mutating` 放到方法的`func`关键字之前就可以了: + +```swift +struct Point { + var x = 0.0, y = 0.0 + mutating func moveByX(deltaX: Double, y deltaY: Double) { + x += deltaX + y += deltaY + } +} +var somePoint = Point(x: 1.0, y: 1.0) +somePoint.moveByX(2.0, y: 3.0) +println("The point is now at (\(somePoint.x), \(somePoint.y))") +// 输出 "The point is now at (3.0, 4.0)" +``` + +上面的`Point`结构体定义了一个变异方法(mutating method)`moveByX`,`moveByX`用来移动点。`moveByX`方法在被调用时修改了这个点,而不是返回一个新的点。方法定义时加上`mutating`关键字,这才让方法可以修改值类型的属性。 + +注意:不能在结构体类型常量上调用变异方法,因为常量的属性不能被改变,即使想改变的是常量的变量属性也不行,详情参见[存储属性和实例变量]("10_Properties.html") + +```swift +let fixedPoint = Point(x: 3.0, y: 3.0) +fixedPoint.moveByX(2.0, y: 3.0) +// this will report an error +``` + + +### 在变异方法中给self赋值(Assigning to self Within a Mutating Method) + +变异方法能够赋给隐含属性`self`一个全新的实例。上面`Point`的例子可以用下面的方式改写: + +```swift +struct Point { + var x = 0.0, y = 0.0 + mutating func moveByX(deltaX: Double, y deltaY: Double) { + self = Point(x: x + deltaX, y: y + deltaY) + } +} +``` + +新版的变异方法`moveByX`创建了一个新的结构(它的 x 和 y 的值都被设定为目标值)。调用这个版本的方法和调用上个版本的最终结果是一样的。 + +枚举的变异方法可以把`self`设置为相同的枚举类型中不同的成员: + +```swift +enum TriStateSwitch { + case Off, Low, High + mutating func next() { + switch self { + case Off: + self = Low + case Low: + self = High + case High: + self = Off + } + } +} +var ovenLight = TriStateSwitch.Low +ovenLight.next() +// ovenLight 现在等于 .High +ovenLight.next() +// ovenLight 现在等于 .Off +``` + +上面的例子中定义了一个三态开关的枚举。每次调用`next`方法时,开关在不同的电源状态(`Off`,`Low`,`High`)之前循环切换。 + + +## 类型方法(Type Methods) + +实例方法是被类型的某个实例调用的方法。你也可以定义类型本身调用的方法,这种方法就叫做**类型方法**。声明类的类型方法,在方法的`func`关键字之前加上关键字`class`;声明结构体和枚举的类型方法,在方法的`func`关键字之前加上关键字`static`。 + +> 注意: +> 在 Objective-C 里面,你只能为 Objective-C 的类定义类型方法(type-level methods)。在 Swift 中,你可以为所有的类、结构体和枚举定义类型方法:每一个类型方法都被它所支持的类型显式包含。 + +类型方法和实例方法一样用点语法调用。但是,你是在类型层面上调用这个方法,而不是在实例层面上调用。下面是如何在`SomeClass`类上调用类型方法的例子: + +```swift +class SomeClass { + class func someTypeMethod() { + // type method implementation goes here + } +} +SomeClass.someTypeMethod() +``` + +在类型方法的方法体(body)中,`self`指向这个类型本身,而不是类型的某个实例。对于结构体和枚举来说,这意味着你可以用`self`来消除静态属性和静态方法参数之间的歧义(类似于我们在前面处理实例属性和实例方法参数时做的那样)。 + +一般来说,任何未限定的方法和属性名称,将会来自于本类中另外的类型级别的方法和属性。一个类型方法可以调用本类中另一个类型方法的名称,而无需在方法名称前面加上类型名称的前缀。同样,结构体和枚举的类型方法也能够直接通过静态属性的名称访问静态属性,而不需要类型名称前缀。 + +下面的例子定义了一个名为`LevelTracker`结构体。它监测玩家的游戏发展情况(游戏的不同层次或阶段)。这是一个单人游戏,但也可以存储多个玩家在同一设备上的游戏信息。 + +游戏初始时,所有的游戏等级(除了等级 1)都被锁定。每次有玩家完成一个等级,这个等级就对这个设备上的所有玩家解锁。`LevelTracker`结构体用静态属性和方法监测游戏的哪个等级已经被解锁。它还监测每个玩家的当前等级。 + +```swift +struct LevelTracker { + static var highestUnlockedLevel = 1 + static func unlockLevel(level: Int) { + if level > highestUnlockedLevel { highestUnlockedLevel = level } + } + static func levelIsUnlocked(level: Int) -> Bool { + return level <= highestUnlockedLevel + } + var currentLevel = 1 + mutating func advanceToLevel(level: Int) -> Bool { + if LevelTracker.levelIsUnlocked(level) { + currentLevel = level + return true + } else { + return false + } + } +} +``` + +`LevelTracker`监测玩家的已解锁的最高等级。这个值被存储在静态属性`highestUnlockedLevel`中。 + +`LevelTracker`还定义了两个类型方法与`highestUnlockedLevel`配合工作。第一个类型方法是`unlockLevel`:一旦新等级被解锁,它会更新`highestUnlockedLevel`的值。第二个类型方法是`levelIsUnlocked`:如果某个给定的等级已经被解锁,它将返回`true`。(注意:尽管我们没有使用类似`LevelTracker.highestUnlockedLevel`的写法,这个类型方法还是能够访问静态属性`highestUnlockedLevel`) + +除了静态属性和类型方法,`LevelTracker`还监测每个玩家的进度。它用实例属性`currentLevel`来监测玩家当前的等级。 + +为了便于管理`currentLevel`属性,`LevelTracker`定义了实例方法`advanceToLevel`。这个方法会在更新`currentLevel`之前检查所请求的新等级是否已经解锁。`advanceToLevel`方法返回布尔值以指示是否能够设置`currentLevel`。 + +下面,`Player`类使用`LevelTracker`来监测和更新每个玩家的发展进度: + +```swift +class Player { + var tracker = LevelTracker() + let playerName: String + func completedLevel(level: Int) { + LevelTracker.unlockLevel(level + 1) + tracker.advanceToLevel(level + 1) + } + init(name: String) { + playerName = name + } +} +``` + +`Player`类创建一个新的`LevelTracker`实例来监测这个用户的发展进度。它提供了`completedLevel`方法:一旦玩家完成某个指定等级就调用它。这个方法为所有玩家解锁下一等级,并且将当前玩家的进度更新为下一等级。(我们忽略了`advanceToLevel`返回的布尔值,因为之前调用`LevelTracker.unlockLevel`时就知道了这个等级已经被解锁了)。 + +你还可以为一个新的玩家创建一个`Player`的实例,然后看这个玩家完成等级一时发生了什么: + +```swift +var player = Player(name: "Argyrios") +player.completedLevel(1) +println("highest unlocked level is now \(LevelTracker.highestUnlockedLevel)") +// 输出 "highest unlocked level is now 2"(最高等级现在是2) +``` + +如果你创建了第二个玩家,并尝试让它开始一个没有被任何玩家解锁的等级,那么这次设置玩家当前等级的尝试将会失败: + +```swift +player = Player(name: "Beto") +if player.tracker.advanceToLevel(6) { + println("player is now on level 6") +} else { + println("level 6 has not yet been unlocked") +} +// 输出 "level 6 has not yet been unlocked"(等级6还没被解锁) +``` diff --git a/source/chapter2/12_Subscripts.md b/source/chapter2/12_Subscripts.md old mode 100644 new mode 100755 index 078d7e0b..c699a500 --- a/source/chapter2/12_Subscripts.md +++ b/source/chapter2/12_Subscripts.md @@ -1,161 +1,167 @@ -# 下标 (Subscripts) - -下标可以定义在类(Class)、结构体(structures)和枚举(enumerations)这些目标中,可以认为是访问对象、集合或序列的快捷方式。举例来说,用下标访问一个数组(Array)实例中的元素可以这样写 `someArray[index]` ,访问字典(Dictionary)实例中的元素可以这样写 `someDictionary[key]`,而不需要再调用实例的某个方法来获得元素的值。 - -对于同一个目标可以定义多个下标,通过索引值类型的不同来进行重载,而且索引值的个数可以是多个。 - -> 译者:这里下标重载在本小节中原文并没有任何演示 - - -## 下标语法 - -下标允许你通过在实例后面的方括号中传入一个或者多个的索引值来对实例进行访问和赋值。语法类似于实例方法和实例属性的混合。与定义实例方法类似,定义下标使用`subscript`关键字,显式声明入参(一个或多个)和返回类型。与实例方法不同的是下标可以设定为读写或只读。这种方式又有点像实例属性的getter和setter: - -``` -subscript(index: Int) -> Int { - get { - // 返回与入参匹配的Int类型的值 - } - - set(newValue) { - // 执行赋值操作 - } -} -``` - -`newValue`的类型必须和下标定义的返回类型相同。与实例属性相同的是set的入参声明`newValue`就算不写,在set代码块中依然可以使用`newValue`这个变量来访问新赋的值。 - -与只读实例属性一样,可以直接将原本应该写在get代码块中的代码写在subscript中即可: - -``` -subscript(index: Int) -> Int { - // 返回与入参匹配的Int类型的值 -} -``` - -下面代码演示了一个在TimesTable结构体中使用只读下标的用法,该结构体用来展示传入整数的N倍。 - -``` -struct TimesTable { - let multiplier: Int - subscript(index: Int) -> Int { - return multiplier * index - } -} -let threeTimesTable = TimesTable(multiplier: 3) -println("3的6倍是\(threeTimesTable[6])") -// 输出 "3的6倍是18" -``` - -在上例中,通过TimesTable结构体创建了一个用来表示索引值三倍的实例。数值3作为结构体构造函数入参表示这个值将成为实例成员multiplier的值。 - -你可以通过下标来来得到结果,比如`threeTimesTable[6]`。这句话访问了threeTimesTable的第六个元素,返回18或者6的3倍。 - -> 提示 -> -> TimesTable例子是基于一个固定的数学公式。它并不适合开放写权限来对threeTimesTable[someIndex]进行赋值操作,这也是为什么下标只定义为只读的原因。 - - -## 下标用法 - -下标根据使用场景不同也具有不同的含义。通常下标是用来访问集合(collection),列表(list)或序列(sequence)中元素的快捷方式。你可以为特定的类或结构体中自由的实现下标来提供合适的功能。 - -例如,Swift的字典(Dictionary)实现了通过下标来对其实例中存放的值进行存取操作。在字典中设值可以通过给字典提供一个符合字典索引类型的索引值的表达式赋一个与字典存放值类型匹配的值来做到: - -``` -var numberOfLegs = ["spider": 8, "ant": 6, "cat": 4] -numberOfLegs["bird"] = 2 -``` - -上例定义一个名为numberOfLegs的变量并用一个字典表达式初始化出了包含三对键值的字典实例。numberOfLegs的字典存放值类型推断为`Dictionary`。字典实例创建完成之后通过下标的方式将整型值`2`赋值到字典实例的索引为`bird`的位置中。 - -更多关于字典(Dictionary)下标的信息请参考[字典的访问与修改](#) - -> 提示 -> -> Swift中Dictionary的下标实现中,在get部分返回值是`Int?`,也就是说不是每个字典的索引都能得到一个整型值,对于没有设过值的索引的访问返回的结果就是`nil`;同样想要从字典实例中删除某个索引下的值也只需要给这个索引赋值为`nil`即可。 - - -## 下标选项 - -下标允许任意数量的入参索引,并且每个入参类型也没有限制。下标的返回值也可以是任何类型。下标可以使用变量参数和可变参数,但使用in-out参数或给参数设置默认值都是不允许的。 - -一个类或结构体可以根据自身需要提供多个下标实现,在定义下标时通过入参个类型进行区分,使用下标时会自动匹配合适的下标实现运行,这就是下标的重载。 - -一个下标入参是最常见的情况,但只要有合适的场景也可以定义多个下标入参。如下例定义了一个Matrix结构体,将呈现一个Double类型的二维数组。Matrix结构体的下标需要两个整型参数: - -``` -struct Matrix { - let rows: Int, columns: Int - var grid: Double[] - init(rows: Int, columns: Int) { - self.rows = rows - self.columns = columns - grid = Array(count: rows * columns, repeatedValue: 0.0) - } - func indexIsValidForRow(row: Int, column: Int) -> Bool { - return row >= 0 && row < rows && column >= 0 && column < columns - } - subscript(row: Int, column: Int) -> Double { - get { - assert(indexIsValidForRow(row, column: column), "Index out of range") - return grid[(row * columns) + column] - } - set { - assert(indexIsValidForRow(row, column: column), "Index out of range") - grid[(row * columns) + columns] = newValue - } - } -} -``` - -Matrix提供了一个两个入参的构造方法,入参分别是`rows`和`columns`,创建了一个足够容纳rows * columns个数的Double类型数组。为了存储,将数组的大小和数组每个元素初始值0.0,都传入数组的构造方法中来创建一个正确大小的新数组。关于数组的构造方法和析构方法请参考[Creating and Initializing an Array](#)。 - -你可以通过传入合适的row和column的数量来构造一个新的Matrix实例: - -``` -var matrix = Matrix(rows: 2, columns: 2) -``` - -上例中创建了一个新的两行两列的Matrix实例。在阅读顺序从左上到右下的Matrix实例中的数组实例grid是矩阵二维数组的扁平化存储: - -``` -// 示意图 -grid = [0.0, 0.0, 0.0, 0.0] - - col0 col1 -row0 [0.0, 0.0, -row1 0.0, 0.0] -``` - -将值赋给带有row和column下标的matrix实例表达式可以完成赋值操作,下标入参使用逗号分割 - -``` -matrix[0, 1] = 1.5 -matrix[1, 0] = 3.2 -``` - -上面两句话分别让matrix的右上值为1.5,坐下值为3.2: - -``` -[0.0, 1.5, - 3.2, 0.0] -``` - -Matrix下标的getter和setter中同时调用了下标入参的row和column是否有效的判断。为了方便进行断言,Matrix包含了一个名为indexIsValid的成员方法,用来确认入参的row或column值是否会造成数组越界: - -``` -func indexIsValidForRow(row: Int, column: Int) -> Bool { - return row >= 0 && row < rows && column >= 0 && column < columns -} -``` - -断言在下标越界时触发: - -``` -let someValue = matrix[2, 2] -// 断言将会触发,因为 [2, 2] 已经超过了matrix的最大长度 -``` - -> 译者:这里有个词Computed Properties 这里统一翻译为实例属性了 微软术语引擎里没有这个词 - +> 翻译:[siemenliu](https://github.com/siemenliu) +> 校对:[zq54zquan](https://github.com/zq54zquan) + + +# 下标脚本(Subscripts) +----------------- + +本页包含内容: + +- [下标脚本语法](#subscript_syntax) +- [下标脚本用法](#subscript_usage) +- [下标脚本选项](#subscript_options) + +*下标脚本* 可以定义在类(Class)、结构体(structure)和枚举(enumeration)这些目标中,可以认为是访问对象、集合或序列的快捷方式,不需要再调用实例的特定的赋值和访问方法。举例来说,用下标脚本访问一个数组(Array)实例中的元素可以这样写 `someArray[index]` ,访问字典(Dictionary)实例中的元素可以这样写 `someDictionary[key]`。 + +对于同一个目标可以定义多个下标脚本,通过索引值类型的不同来进行重载,而且索引值的个数可以是多个。 + +> 译者:这里附属脚本重载在本小节中原文并没有任何演示 + + +## 下标脚本语法 + +下标脚本允许你通过在实例后面的方括号中传入一个或者多个的索引值来对实例进行访问和赋值。语法类似于实例方法和计算型属性的混合。与定义实例方法类似,定义下标脚本使用`subscript`关键字,显式声明入参(一个或多个)和返回类型。与实例方法不同的是下标脚本可以设定为读写或只读。这种方式又有点像计算型属性的getter和setter: + +```swift +subscript(index: Int) -> Int { + get { + // 返回与入参匹配的Int类型的值 + } + + set(newValue) { + // 执行赋值操作 + } +} +``` + +`newValue`的类型必须和下标脚本定义的返回类型相同。与计算型属性相同的是set的入参声明`newValue`就算不写,在set代码块中依然可以使用默认的`newValue`这个变量来访问新赋的值。 + +与只读计算型属性一样,可以直接将原本应该写在`get`代码块中的代码写在`subscript`中: + +```swift +subscript(index: Int) -> Int { + // 返回与入参匹配的Int类型的值 +} +``` + +下面代码演示了一个在`TimesTable`结构体中使用只读下标脚本的用法,该结构体用来展示传入整数的*n*倍。 + +```swift +struct TimesTable { + let multiplier: Int + subscript(index: Int) -> Int { + return multiplier * index + } +} +let threeTimesTable = TimesTable(multiplier: 3) +println("3的6倍是\(threeTimesTable[6])") +// 输出 "3的6倍是18" +``` + +在上例中,通过`TimesTable`结构体创建了一个用来表示索引值三倍的实例。数值`3`作为结构体`构造函数`入参初始化实例成员`multiplier`。 + +你可以通过下标脚本来得到结果,比如`threeTimesTable[6]`。这条语句访问了`threeTimesTable`的第六个元素,返回`6`的`3`倍即`18`。 + +>注意: +> `TimesTable`例子是基于一个固定的数学公式。它并不适合开放写权限来对`threeTimesTable[someIndex]`进行赋值操作,这也是为什么附属脚本只定义为只读的原因。 + + +## 下标脚本用法 + +根据使用场景不同下标脚本也具有不同的含义。通常下标脚本是用来访问集合(collection),列表(list)或序列(sequence)中元素的快捷方式。你可以在你自己特定的类或结构体中自由的实现下标脚本来提供合适的功能。 + +例如,Swift 的字典(Dictionary)实现了通过下标脚本来对其实例中存放的值进行存取操作。在下标脚本中使用和字典索引相同类型的值,并且把一个字典值类型的值赋值给这个下标脚本来为字典设值: + +```swift +var numberOfLegs = ["spider": 8, "ant": 6, "cat": 4] +numberOfLegs["bird"] = 2 +``` + +上例定义一个名为`numberOfLegs`的变量并用一个字典字面量初始化出了包含三对键值的字典实例。`numberOfLegs`的字典存放值类型推断为`Dictionary`。字典实例创建完成之后通过下标脚本的方式将整型值`2`赋值到字典实例的索引为`bird`的位置中。 + +更多关于字典(Dictionary)下标脚本的信息请参考[读取和修改字典](../chapter2/04_Collection_Types.html) + +> 注意: +> Swift 中字典的附属脚本实现中,在`get`部分返回值是`Int?`,上例中的`numberOfLegs`字典通过附属脚本返回的是一个`Int?`或者说“可选的int”,不是每个字典的索引都能得到一个整型值,对于没有设过值的索引的访问返回的结果就是`nil`;同样想要从字典实例中删除某个索引下的值也只需要给这个索引赋值为`nil`即可。 + + +## 下标脚本选项 + +下标脚本允许任意数量的入参索引,并且每个入参类型也没有限制。下标脚本的返回值也可以是任何类型。下标脚本可以使用变量参数和可变参数,但使用写入读出(in-out)参数或给参数设置默认值都是不允许的。 + +一个类或结构体可以根据自身需要提供多个下标脚本实现,在定义下标脚本时通过入参个类型进行区分,使用下标脚本时会自动匹配合适的下标脚本实现运行,这就是*下标脚本的重载*。 + +一个下标脚本入参是最常见的情况,但只要有合适的场景也可以定义多个下标脚本入参。如下例定义了一个`Matrix`结构体,将呈现一个`Double`类型的二维矩阵。`Matrix`结构体的下标脚本需要两个整型参数: + +```swift +struct Matrix { + let rows: Int, columns: Int + var grid: Double[] + init(rows: Int, columns: Int) { + self.rows = rows + self.columns = columns + grid = Array(count: rows * columns, repeatedValue: 0.0) + } + func indexIsValidForRow(row: Int, column: Int) -> Bool { + return row >= 0 && row < rows && column >= 0 && column < columns + } + subscript(row: Int, column: Int) -> Double { + get { + assert(indexIsValidForRow(row, column: column), "Index out of range") + return grid[(row * columns) + column] + } + set { + assert(indexIsValidForRow(row, column: column), "Index out of range") + grid[(row * columns) + columns] = newValue + } + } +} +``` + +`Matrix`提供了一个两个入参的构造方法,入参分别是`rows`和`columns`,创建了一个足够容纳`rows * columns`个数的`Double`类型数组。为了存储,将数组的大小和数组每个元素初始值0.0,都传入数组的构造方法中来创建一个正确大小的新数组。关于数组的构造方法和析构方法请参考[创建并且构造一个数组](../chapter2/04_Collection_Types.html)。 + +你可以通过传入合适的`row`和`column`的数量来构造一个新的`Matrix`实例: + +```swift +var matrix = Matrix(rows: 2, columns: 2) +``` + +上例中创建了一个新的两行两列的`Matrix`实例。在阅读顺序从左上到右下的`Matrix`实例中的数组实例`grid`是矩阵二维数组的扁平化存储: + +```swift +// 示意图 +grid = [0.0, 0.0, 0.0, 0.0] + + col0 col1 +row0 [0.0, 0.0, +row1 0.0, 0.0] +``` + +将值赋给带有`row`和`column`下标脚本的`matrix`实例表达式可以完成赋值操作,下标脚本入参使用逗号分割 + +```swift +matrix[0, 1] = 1.5 +matrix[1, 0] = 3.2 +``` + +上面两条语句分别`让matrix`的右上值为 1.5,坐下值为 3.2: + +```swift +[0.0, 1.5, + 3.2, 0.0] +``` + +`Matrix`下标脚本的`getter`和`setter`中同时调用了下标脚本入参的`row`和`column`是否有效的判断。为了方便进行断言,`Matrix`包含了一个名为`indexIsValid`的成员方法,用来确认入参的`row`或`column`值是否会造成数组越界: + +```swift +func indexIsValidForRow(row: Int, column: Int) -> Bool { + return row >= 0 && row < rows && column >= 0 && column < columns +} +``` + +断言在下标脚本越界时触发: + +```swift +let someValue = matrix[2, 2] +// 断言将会触发,因为 [2, 2] 已经超过了matrix的最大长度 +``` diff --git a/source/chapter2/13_Inheritance.md b/source/chapter2/13_Inheritance.md old mode 100644 new mode 100755 index 7532056f..460918b8 --- a/source/chapter2/13_Inheritance.md +++ b/source/chapter2/13_Inheritance.md @@ -1,247 +1,270 @@ -# 继承 - -一个类可以继承另一个类的方法,属性和其它特性。当一个类继承其它类,继承类叫子类,被继承类叫超类(或父类)。在Swift中,继承是区分「类」与其它类型的一个基本特征。 - -在Swift中,类可以调用和访问超类的方法,属性和下标,并且可以重写(override)这些方法,属性和下标来优化或修改它们的行为。Swift会检查你的重写定义在超类中是否有匹配的定义,以此确保你的重写行为是正确的。 - -可以为类中继承来的属性添加属性观察器(property observer),这样一来,当属性值改变时,类就会被通知到。可以为任何属性添加属性观察器,无论它原本被定义为存储型属性(stored property)还是计算型属性(computed property)。 - -## 定义一个基类 - -不继承于其它类的类,称之为基类。 - -> 注意:Swift中的类并不是从一个通用的基类继承而来。如果你不为你定义的类指定一个超类的话,这个类就自动成为基类。 - -下面的例子定义了一个叫`Vehicle`的基类。这个基类声明了两个对所有车辆都通用的属性(`numberOfWheels`和`maxPassengers`)。这些属性在`description`方法中使用,这个方法返回一个`String`类型的,对车辆特征的描述: - -``` -class Vehicle { - var numberOfWheels: Int - var maxPassengers: Int - func description() -> String { - return "\(numberOfWheels) wheels; up to \(maxPassengers) passengers" - } - init() { - numberOfWheels = 0 - maxPassengers = 1 - } -} -``` - -`Vehicle`类定义了初始化器(initializer)来设置属性的值。初始化器会在[构造函数]()一节中详细介绍,这里我们做一下简单介绍,以便于讲解子类中继承来的属性可以如何被修改。 - -初始化器用于创建某个类型的一个新实例。尽管初始化器并不是方法,但在语法上,两者很相似。初始化器的工作是准备新实例以供使用,并确保实例中的所有属性都拥有有效的初始化值。 - -初始化器的最简单形式就像一个没有参数的实例方法,使用`init`关键字: - -``` -init() { - // perform some initialization here -} -``` - -如果要创建一个`Vehicle`类的新实例,使用初始化器语法调用上面的初始化器,即类名后面跟一个空的小括号: - -``` -let someVehicle = Vehicle() -``` - -这个`Vehicle`类的初始化器为任意的一辆车设置一些初始化属性值(`numberOfWheels = 0 `和`maxPassengers = 1`)。 - -`Vehicle`类定义了车辆的共同特性,但这个类本身并没太大用处。为了使它更为实用,你需要进一步细化它来描述更具体的车辆。 - -## Subclassing(子类化?待定) - -subclassing指的是在一个已有类的基础上创建一个新的类。子类继承超类的特性,并且你可以优化或改变它。你还可以为子类添加新的特性。 - -为了指明某个类的超类,将超类名写在子类名的后面,用冒号分隔: - -``` -class SomeClass: SomeSuperclass { - // class definition goes here -} -``` -下一个例子,定义一个更具体的车辆类叫`Bicycle`。这个新类是在`Vehicle`类的基础上创建起来。因此你需要将`Vehicle`类放在`Bicycle`类后面,用冒号分隔。 - -我们可以将这读作: - -“定义一个新的类叫`Bicycle`,它继承了`Vehicle`的特性”; - -``` -class Bicycle: Vehicle { - init() { - super.init() - numberOfWheels = 2 - } -} -``` -`Bicycle`是`Vehicle`的子类,`Vehicle`是`Bicycle`的超类。新的`Bicycle`类自动获得`Vehicle`类的特性,比如`maxPassengers`和`numberOfWheels`属性。你可以在子类中定制这些特性,或添加新的特性来更好地描述`Bicycle`类。 - -`Bicycle`类定义了一个初始化器来设置它定制的特性(自行车只有2个轮子)。`Bicycle`的初始化器调用了它父类`Vehicle`的初始化器`super.init()`,以此确保在`Bicycle`类试图修改那些继承来的属性前,`Vehicle`类已经初始化过它们了。 - -> 注意:不像Objective-C,在Swift中,初始化器默认是不继承的,见[初始化器的继承与重写]() - -`Vehicle`类中`maxPassengers`的默认值对自行车来说已经是正确的,因此在`Bicycle`的初始化器中并没有改变它。而`numberOfWheels`原来的值对自行车来说是不正确的,因此在初始化器中将它更改为2。 - -`Bicycle`不仅可以继承`Vehicle`的属性,还可以继承它的方法。如果你创建了一个`Bicycle`类的实例,你就可以调用它继承来的`description`方法,并且可以看到,它输出的属性值已经发生了变化: - -``` -let bicycle = Bicycle() -println("Bicycle: \(bicycle.description())") -// Bicycle: 2 wheels; up to 1 passengers -``` - -子类还可以继续被其它类继承: - -``` -class Tandem: Bicycle { - init() { - super.init() - maxPassengers = 2 - } -} -``` - -上面的例子创建了`Bicycle`的一个子类:双人自行车(tandem)。`Tandem`从`Bicycle`继承了两个属性,而这两个属性是`Bicycle`从`Vehicle`继承而来的。`Tandem`并不修改轮子的数量,因为它仍是一辆自行车,有2个轮子。但它需要修改`maxPassengers`的值,因为双人自行车可以坐两个人。 - -> 注意:子类只允许修改从超类继承来的变量属性,而不能修改继承来的常量属性。 - -创建一个`Tandem`类的实例,打印它的描述,即可看到它的属性已被更新: - -``` -let tandem = Tandem() -println("Tandem: \(tandem.description())") -// Tandem: 2 wheels; up to 2 passengers -``` - -注意,`Tandem`类也继承了`description`方法。一个类的实例方法会被这个类的所有子类继承。 - -## 重写(Overriding) - -子类可以为继承来的实例方法(instance method),类方法(class method),实例属性(instance property),或下标(subscript)提供自己定制的实现(implementation)。我们把这种行为叫重写(overriding)。 - -如果要重写某个特性,你需要在重写定义的前面加上`override`关键字。这么做,你就表明了你是想提供一个重写版本,而非错误地提供了一个相同的定义。意外的重写行为可能会导致不可预知的错误,任何缺少`override`关键字的重写都会在编译时被诊断为错误。 - -`override`关键字会提醒Swift编译器去检查该类的超类(或其中一个父类)是否有匹配重写版本的声明。这个检查可以确保你的重写定义是正确的。 - -### 访问超类的方法,属性及下标 - -当你在子类中重写超类的方法,属性或下标时,有时在你的重写版本中使用已经存在的超类实现会大有裨益。比如,你可以优化已有实现的行为,或在一个继承来的变量中存储一个修改过的值。 - -在合适的地方,你可以通过使用`super`前缀来访问超类版本的方法,属性或下标: - -* 在方法`someMethod`的重写实现中,可以通过`super.someMethod()`来调用超类版本的`someMethod`方法。 -* 在属性`someProperty`的getter或setter的重写实现中,可以通过`super.someProperty`来访问超类版本的`someProperty`属性。 -* 在下标的重写实现中,可以通过`super[someIndex]`来访问超类版本中的相同下标。 - -### 重写方法 - -在子类中,你可以重写继承来的实例方法或类方法,提供一个定制或替代的方法实现。 - -下面的例子定义了`Vehicle`的一个新的子类,叫`Car`,它重写了从`Vehicle`类继承来的'description'方法: - -``` -class Car: Vehicle { - var speed: Double = 0.0 - init() { - super.init() - maxPassengers = 5 - numberOfWheels = 4 - } - override func description() -> String { - return super.description() + "; " - + "traveling at \(speed) mph" - } -} -``` - -`Car`声明了一个新的存储型属性`speed`,它是`Double`类型的,默认值是`0.0`,表示“时速是0英里”。'Car'有自己的初始化器,它将乘客的最大数量设为5,轮子数量设为4。 - -`Car`重写了继承来的`description`方法,它的声明与`Vehicle`中的`description`方法一致,声明前面加上了`override`关键字。 - -`Car`中的`description`方法并非完全自定义,而是通过`super.description`使用了超类`Vehicle`中的`description`方法,然后再追加一些额外的信息,比如汽车的当前速度。 - -如果你创建一个`Car`的新实例,并打印`description`方法的输出,你就会发现描述信息已经发生了改变: - -``` -let car = Car() -println("Car: \(car.description())") -// Car: 4 wheels; up to 5 passengers; traveling at 0.0 mph -``` - -### 重写属性 - -你可以重写继承来的实例属性或类属性,提供自己定制的getter和setter,或添加属性观察器使重写的属性观察属性值什么时候发生改变。 - -#### 重写属性的Getters和Setters - -你可以提供定制的getter(或setter)来重写任意继承来的属性,无论继承来的属性是存储型的还是计算型的属性。子类并不知道继承来的属性是存储型的还是计算型的,它只知道继承来的属性会有一个名字和类型。你在重写一个属性时,必需将它的名字和类型都写出来。这样才能使编译器去检查你重写的属性是与超类中同名同类型的属性相匹配的。 - -你可以将一个继承来的只读属性重写为一个读写属性,只需要你在重写版本的属性里提供getter和setter即可。但是,你不可以将一个继承来的读写属性重写为一个只读属性。 - -> 注意:如果你在重写属性中提供了setter,那么你也一定要提供getter。如果你不想在重写版本中的getter里修改继承来的属性值,你可以直接返回`super.someProperty`来返回继承来的值。正如下面的`SpeedLimitedCar`的例子所示。 - -以下的例子定义了一个新类,叫`SpeedLimitedCar`,它是`Car`的子类。类`SpeedLimitedCar`表示安装了限速装置的车,它的最高速度只能达到40mph。你可以通过重写继承来的`speed`属性来实现这个速度限制: - -``` -class SpeedLimitedCar: Car { - override var speed: Double { - get { - return super.speed - } - set { - super.speed = min(newValue, 40.0) - } - } -} -``` - -当你设置一个`SpeedLimitedCar`实例的`speed`属性时,属性setter的实现会去检查新值与限制值40mph的大小,它会将超类的`speed`设置为`newValue`和`40.0`中较小的那个。这两个值哪个较小由`min`函数决定,它是Swift标准库中的一个全局函数。`min`函数接收两个或更多的数,返回其中最小的那个。 - -如果你尝试将`SpeedLimitedCar`实例的`speed`属性设置为一个大于40mph的数,然后打印`description`函数的输出,你会发现速度被限制在40mph: - -``` -let limitedCar = SpeedLimitedCar() -limitedCar.speed = 60.0 -println("SpeedLimitedCar: \(limitedCar.description())") -// SpeedLimitedCar: 4 wheels; up to 5 passengers; traveling at 40.0 mph -``` - -#### 重写属性观察器(Property Observer) - -你可以在属性重写中为一个继承来的属性添加属性观察器。这样一来,当继承来的属性值发生改变时,你就会被通知到,无论那个属性原本是如何实现的。关于属性观察器的更多内容,请看[属性观察器]()。 - -> 注意:你不可以为继承来的常量存储型属性或继承来的只读计算型属性添加属性观察器。这些属性的值是不可以被设置的,所以,为它们提供willSet或didSet实现是不恰当。此外还要注意,你不可以同时提供重写的setter和重写的属性观察器。如果你想观察属性值的变化,并且你已经为那个属性提供了定制的setter,那么你在setter中就可以观察到任何值变化了。 - -下面的例子定义了一个新类叫`AutomaticCar`,它是`Car`的子类。`AutomaticCar`表示自动挡汽车,它可以根据当前的速度自动选择合适的挡位。`AutomaticCar`也提供了定制的`description`方法,可以输出当前挡位。 - -``` -class AutomaticCar: Car { - var gear = 1 - override var speed: Double { - didSet { - gear = Int(speed / 10.0) + 1 - } - } - override func description() -> String { - return super.description() + " in gear \(gear)" - } -} -``` - -当你设置`AutomaticCar`的`speed`属性,属性的didSet观察器就会自动地设置`gear`属性,为新的速度选择一个合适的挡位。具体来说就是,属性观察器将新的速度值除以10,然后向下取得最接近的整数值,最后加1来得到档位`gear`的值。例如,速度为10.0时,挡位为1;速度为35.0时,挡位为4: - -``` -let automatic = AutomaticCar() -automatic.speed = 35.0 -println("AutomaticCar: \(automatic.description())") -// AutomaticCar: 4 wheels; up to 5 passengers; traveling at 35.0 mph in gear 4 -``` - -## 防止重写 - -你可以通过把方法,属性或下标标记为`final`来防止它们被重写,只需要在声明关键字前加上`@final`特性即可。(例如:`@final var`, `@final func`, `@final class func`, 以及 `@final subscript`) - -如果你重写了final方法,属性或下标,在编译时会报错。在扩展中,你添加到类里的方法,属性或下标也可以在扩展的定义里标记为final。 - -你可以通过在关键字`class`前添加`@final`特性(`@final class`)来将整个类标记为final的,这样的类是不可被继承的,否则会报编译错误。 +> 翻译:[Hawstein](https://github.com/Hawstein) +> 校对:[menlongsheng](https://github.com/menlongsheng) + +# 继承(Inheritance) +------------------- + +本页包含内容: + +- [定义一个基类(Base class)](#defining_a_base_class) +- [子类生成(Subclassing)](#subclassing) +- [重写(Overriding)](#overriding) +- [防止重写](#preventing_overrides) + +一个类可以*继承(inherit)*另一个类的方法(methods),属性(property)和其它特性。当一个类继承其它类时,继承类叫*子类(subclass)*,被继承类叫*超类(或父类,superclass)*。在 Swift 中,继承是区分「类」与其它类型的一个基本特征。 + +在 Swift 中,类可以调用和访问超类的方法,属性和下标脚本(subscripts),并且可以重写(override)这些方法,属性和下标脚本来优化或修改它们的行为。Swift 会检查你的重写定义在超类中是否有匹配的定义,以此确保你的重写行为是正确的。 + +可以为类中继承来的属性添加属性观察器(property observer),这样一来,当属性值改变时,类就会被通知到。可以为任何属性添加属性观察器,无论它原本被定义为存储型属性(stored property)还是计算型属性(computed property)。 + + +## 定义一个基类(Base class) + +不继承于其它类的类,称之为*基类(base calss)*。 + +> 注意: +Swift 中的类并不是从一个通用的基类继承而来。如果你不为你定义的类指定一个超类的话,这个类就自动成为基类。 + +下面的例子定义了一个叫`Vehicle`的基类。这个基类声明了两个对所有车辆都通用的属性(`numberOfWheels`和`maxPassengers`)。这些属性在`description`方法中使用,这个方法返回一个`String`类型的,对车辆特征的描述: + +```swift +class Vehicle { + var numberOfWheels: Int + var maxPassengers: Int + func description() -> String { + return "\(numberOfWheels) wheels; up to \(maxPassengers) passengers" + } + init() { + numberOfWheels = 0 + maxPassengers = 1 + } +} +``` + +`Vehicle`类定义了*构造器(initializer)*来设置属性的值。构造器会在[构造过程](../chapter2/_14Initialization.html)一节中详细介绍,这里我们做一下简单介绍,以便于讲解子类中继承来的属性如何被修改。 + +构造器用于创建某个类型的一个新实例。尽管构造器并不是方法,但在语法上,两者很相似。构造器的工作是准备新实例以供使用,并确保实例中的所有属性都拥有有效的初始化值。 + +构造器的最简单形式就像一个没有参数的实例方法,使用`init`关键字: + +```swift +init() { + // 执行构造过程 +} +``` + +如果要创建一个`Vehicle`类的新实例,使用*构造器*语法调用上面的初始化器,即类名后面跟一个空的小括号: + +```swift +let someVehicle = Vehicle() +``` + +这个`Vehicle`类的构造器为任意的一辆车设置一些初始化属性值(`numberOfWheels = 0 `和`maxPassengers = 1`)。 + +`Vehicle`类定义了车辆的共同特性,但这个类本身并没太大用处。为了使它更为实用,你需要进一步细化它来描述更具体的车辆。 + + +## 子类生成(Subclassing) + +*子类生成(Subclassing)*指的是在一个已有类的基础上创建一个新的类。子类继承超类的特性,并且可以优化或改变它。你还可以为子类添加新的特性。 + +为了指明某个类的超类,将超类名写在子类名的后面,用冒号分隔: + +```swift +class SomeClass: SomeSuperclass { + // 类的定义 +} +``` + +下一个例子,定义一个更具体的车辆类叫`Bicycle`。这个新类是在 `Vehicle`类的基础上创建起来。因此你需要将`Vehicle`类放在 `Bicycle`类后面,用冒号分隔。 + +我们可以将这读作: + +“定义一个新的类叫`Bicycle `,它继承了`Vehicle`的特性”; + +```swift +class Bicycle: Vehicle { + init() { + super.init() + numberOfWheels = 2 + } +} +``` +preview + `Bicycle`是`Vehicle`的子类,`Vehicle`是`Bicycle`的超类。新的`Bicycle`类自动获得`Vehicle`类的特性,比如 `maxPassengers`和`numberOfWheels`属性。你可以在子类中定制这些特性,或添加新的特性来更好地描述`Bicycle`类。 + +`Bicycle`类定义了一个构造器来设置它定制的特性(自行车只有2个轮子)。`Bicycle`的构造器调用了它父类`Vehicle`的构造器 `super.init()`,以此确保在`Bicycle`类试图修改那些继承来的属性前`Vehicle`类已经初始化过它们了。 + +> 注意: +不像 Objective-C,在 Swift 中,初始化器默认是不继承的,见[初始化器的继承与重写](../chapter2/_14Initialization.html#initializer_inheritance_and_ overriding) + +`Vehicle`类中`maxPassengers`的默认值对自行车来说已经是正确的,因此在`Bicycle`的构造器中并没有改变它。而`numberOfWheels`原来的值对自行车来说是不正确的,因此在初始化器中将它更改为 2。 + +`Bicycle`不仅可以继承`Vehicle`的属性,还可以继承它的方法。如果你创建了一个`Bicycle`类的实例,你就可以调用它继承来的`description`方法,并且可以看到,它输出的属性值已经发生了变化: + +```swift +let bicycle = Bicycle() +println("Bicycle: \(bicycle.description())") +// Bicycle: 2 wheels; up to 1 passengers +``` + +子类还可以继续被其它类继承: + +```swift +class Tandem: Bicycle { + init() { + super.init() + maxPassengers = 2 + } +} +``` + +上面的例子创建了`Bicycle`的一个子类:双人自行车(tandem)。`Tandem`从`Bicycle`继承了两个属性,而这两个属性是`Bicycle`从`Vehicle`继承而来的。`Tandem`并不修改轮子的数量,因为它仍是一辆自行车,有 2 个轮子。但它需要修改`maxPassengers`的值,因为双人自行车可以坐两个人。 + +> 注意: +子类只允许修改从超类继承来的变量属性,而不能修改继承来的常量属性。 + +创建一个`Tandem`类的实例,打印它的描述,即可看到它的属性已被更新: + +```swift +let tandem = Tandem() +println("Tandem: \(tandem.description())") +// Tandem: 2 wheels; up to 2 passengers +``` + +注意,`Tandem`类也继承了`description`方法。一个类的实例方法会被这个类的所有子类继承。 + + +## 重写(Overriding) + +子类可以为继承来的实例方法(instance method),类方法(class method),实例属性(instance property),或下标脚本(subscript)提供自己定制的实现(implementation)。我们把这种行为叫*重写(overriding)*。 + +如果要重写某个特性,你需要在重写定义的前面加上`override`关键字。这么做,你就表明了你是想提供一个重写版本,而非错误地提供了一个相同的定义。意外的重写行为可能会导致不可预知的错误,任何缺少`override`关键字的重写都会在编译时被诊断为错误。 + +`override`关键字会提醒 Swift 编译器去检查该类的超类(或其中一个父类)是否有匹配重写版本的声明。这个检查可以确保你的重写定义是正确的。 + +### 访问超类的方法,属性及下标脚本 + +当你在子类中重写超类的方法,属性或下标脚本时,有时在你的重写版本中使用已经存在的超类实现会大有裨益。比如,你可以优化已有实现的行为,或在一个继承来的变量中存储一个修改过的值。 + +在合适的地方,你可以通过使用`super`前缀来访问超类版本的方法,属性或下标脚本: + +* 在方法`someMethod`的重写实现中,可以通过`super.someMethod()`来调用超类版本的`someMethod`方法。 +* 在属性`someProperty`的 getter 或 setter 的重写实现中,可以通过`super.someProperty`来访问超类版本的`someProperty`属性。 +* 在下标脚本的重写实现中,可以通过`super[someIndex]`来访问超类版本中的相同下标脚本。 + +### 重写方法 + +在子类中,你可以重写继承来的实例方法或类方法,提供一个定制或替代的方法实现。 + +下面的例子定义了`Vehicle`的一个新的子类,叫`Car`,它重写了从`Vehicle`类继承来的`description`方法: + +```swift +class Car: Vehicle { + var speed: Double = 0.0 + init() { + super.init() + maxPassengers = 5 + numberOfWheels = 4 + } + override func description() -> String { + return super.description() + "; " + + "traveling at \(speed) mph" + } +} +``` + +`Car`声明了一个新的存储型属性`speed`,它是`Double`类型的,默认值是`0.0`,表示“时速是0英里”。`Car`有自己的初始化器,它将乘客的最大数量设为5,轮子数量设为4。 + +`Car`重写了继承来的`description`方法,它的声明与`Vehicle`中的`description`方法一致,声明前面加上了`override`关键字。 + +`Car`中的`description`方法并非完全自定义,而是通过`super.description`使用了超类`Vehicle`中的`description`方法,然后再追加一些额外的信息,比如汽车的当前速度。 + +如果你创建一个`Car`的新实例,并打印`description`方法的输出,你就会发现描述信息已经发生了改变: + +```swift +let car = Car() +println("Car: \(car.description())") +// Car: 4 wheels; up to 5 passengers; traveling at 0.0 mph +``` + +### 重写属性 + +你可以重写继承来的实例属性或类属性,提供自己定制的getter和setter,或添加属性观察器使重写的属性观察属性值什么时候发生改变。 + +#### 重写属性的Getters和Setters + +你可以提供定制的 getter(或 setter)来重写任意继承来的属性,无论继承来的属性是存储型的还是计算型的属性。子类并不知道继承来的属性是存储型的还是计算型的,它只知道继承来的属性会有一个名字和类型。你在重写一个属性时,必需将它的名字和类型都写出来。这样才能使编译器去检查你重写的属性是与超类中同名同类型的属性相匹配的。 + +你可以将一个继承来的只读属性重写为一个读写属性,只需要你在重写版本的属性里提供 getter 和 setter 即可。但是,你不可以将一个继承来的读写属性重写为一个只读属性。 + +> 注意: +如果你在重写属性中提供了 setter,那么你也一定要提供 getter。如果你不想在重写版本中的 getter 里修改继承来的属性值,你可以直接返回`super.someProperty`来返回继承来的值。正如下面的`SpeedLimitedCar`的例子所示。 + +以下的例子定义了一个新类,叫`SpeedLimitedCar`,它是`Car`的子类。类`SpeedLimitedCar`表示安装了限速装置的车,它的最高速度只能达到40mph。你可以通过重写继承来的`speed`属性来实现这个速度限制: + +```swift +class SpeedLimitedCar: Car { + override var speed: Double { + get { + return super.speed + } + set { + super.speed = min(newValue, 40.0) + } + } +} +``` + +当你设置一个`SpeedLimitedCar`实例的`speed`属性时,属性setter的实现会去检查新值与限制值40mph的大小,它会将超类的`speed`设置为`newValue`和`40.0`中较小的那个。这两个值哪个较小由`min`函数决定,它是Swift标准库中的一个全局函数。`min`函数接收两个或更多的数,返回其中最小的那个。 + +如果你尝试将`SpeedLimitedCar`实例的`speed`属性设置为一个大于40mph的数,然后打印`description`函数的输出,你会发现速度被限制在40mph: + +```swift +let limitedCar = SpeedLimitedCar() +limitedCar.speed = 60.0 +println("SpeedLimitedCar: \(limitedCar.description())") +// SpeedLimitedCar: 4 wheels; up to 5 passengers; traveling at 40.0 mph +``` + +#### 重写属性观察器(Property Observer) + +你可以在属性重写中为一个继承来的属性添加属性观察器。这样一来,当继承来的属性值发生改变时,你就会被通知到,无论那个属性原本是如何实现的。关于属性观察器的更多内容,请看[属性观察器](../chapter2/_10Properties.html#property_observer)。 + +> 注意: +你不可以为继承来的常量存储型属性或继承来的只读计算型属性添加属性观察器。这些属性的值是不可以被设置的,所以,为它们提供`willSet`或`didSet`实现是不恰当。此外还要注意,你不可以同时提供重写的 setter 和重写的属性观察器。如果你想观察属性值的变化,并且你已经为那个属性提供了定制的 setter,那么你在 setter 中就可以观察到任何值变化了。 + +下面的例子定义了一个新类叫`AutomaticCar`,它是`Car`的子类。`AutomaticCar`表示自动挡汽车,它可以根据当前的速度自动选择合适的挡位。`AutomaticCar`也提供了定制的`description`方法,可以输出当前挡位。 + +```swift +class AutomaticCar: Car { + var gear = 1 + override var speed: Double { + didSet { + gear = Int(speed / 10.0) + 1 + } + } + override func description() -> String { + return super.description() + " in gear \(gear)" + } +} +``` + +当你设置`AutomaticCar`的`speed`属性,属性的`didSet`观察器就会自动地设置`gear`属性,为新的速度选择一个合适的挡位。具体来说就是,属性观察器将新的速度值除以10,然后向下取得最接近的整数值,最后加1来得到档位`gear`的值。例如,速度为10.0时,挡位为1;速度为35.0时,挡位为4: + +```swift +let automatic = AutomaticCar() +automatic.speed = 35.0 +println("AutomaticCar: \(automatic.description())") +// AutomaticCar: 4 wheels; up to 5 passengers; traveling at 35.0 mph in gear 4 +``` + + +## 防止重写 + +你可以通过把方法,属性或下标脚本标记为*`final`*来防止它们被重写,只需要在声明关键字前加上`@final`特性即可。(例如:`@final var`, `@final func`, `@final class func`, 以及 `@final subscript`) + +如果你重写了`final`方法,属性或下标脚本,在编译时会报错。在扩展中,你添加到类里的方法,属性或下标脚本也可以在扩展的定义里标记为 final。 + +你可以通过在关键字`class`前添加`@final`特性(`@final class`)来将整个类标记为 final 的,这样的类是不可被继承的,否则会报编译错误。 + diff --git a/source/chapter2/14_Initialization.md b/source/chapter2/14_Initialization.md old mode 100644 new mode 100755 index e69de29b..aa99b433 --- a/source/chapter2/14_Initialization.md +++ b/source/chapter2/14_Initialization.md @@ -0,0 +1,646 @@ +> 翻译:[lifedim](https://github.com/lifedim) +> 校对:[lifedim](https://github.com/lifedim) + +# 构造过程(Initialization) + +----------------- + +本页包含内容: + +- [存储型属性的初始赋值](#setting_initial_values_for_stored_properties) +- [定制化构造过程](#customizing_initialization) +- [默认构造器](#default_initializers) +- [值类型的构造器代理](#initializer_delegation_for_value_types) +- [类的继承和构造过程](#class_inheritance_and_initialization) +- [通过闭包和函数来设置属性的默认值](#setting_a_default_property_value_with_a_closure_or_function) + + +构造过程是为了使用某个类、结构体或枚举类型的实例而进行的准备过程。这个过程包含了为实例中的每个属性设置初始值和为其执行必要的准备和初始化任务。 + +构造过程是通过定义构造器(`Initializers`)来实现的,这些构造器可以看做是用来创建特定类型实例的特殊方法。与 Objective-C 中的构造器不同,Swift 的构造器无需返回值,它们的主要任务是保证新实例在第一次使用前完成正确的初始化。 + +类实例也可以通过定义析构器(`deinitializer`)在类实例释放之前执行特定的清除工作。想了解更多关于析构器的内容,请参考[析构过程](../chapter2/15_Deinitialization.html)。 + + +## 存储型属性的初始赋值 + +类和结构体在实例创建时,必须为所有存储型属性设置合适的初始值。存储型属性的值不能处于一个未知的状态。 + +你可以在构造器中为存储型属性赋初值,也可以在定义属性时为其设置默认值。以下章节将详细介绍这两种方法。 + +>注意: +当你为存储型属性设置默认值或者在构造器中为其赋值时,它们的值是被直接设置的,不会触发任何属性观测器(`property observers`)。 + +### 构造器 + +构造器在创建某特定类型的新实例时调用。它的最简形式类似于一个不带任何参数的实例方法,以关键字`init`命名。 + +下面例子中定义了一个用来保存华氏温度的结构体`Fahrenheit`,它拥有一个`Double`类型的存储型属性`temperature`: + +```swift +struct Fahrenheit { + var temperature: Double + init() { + temperature = 32.0 + } +} +``` + +```swift +var f = Fahrenheit() +println("The default temperature is \(f.temperature)° Fahrenheit") +// 输出 "The default temperature is 32.0° Fahrenheit” +``` + +这个结构体定义了一个不带参数的构造器`init`,并在里面将存储型属性`temperature`的值初始化为`32.0`(华摄氏度下水的冰点)。 + +### 默认属性值 + +如前所述,你可以在构造器中为存储型属性设置初始值;同样,你也可以在属性声明时为其设置默认值。 + +>注意: +如果一个属性总是使用同一个初始值,可以为其设置一个默认值。无论定义默认值还是在构造器中赋值,最终它们实现的效果是一样的,只不过默认值跟属性构造过程结合的更紧密。使用默认值能让你的构造器更简洁、更清晰,且能通过默认值自动推导出属性的类型;同时,它也能让你充分利用默认构造器、构造器继承(后续章节将讲到)等特性。 + +你可以使用更简单的方式在定义结构体`Fahrenheit`时为属性`temperature`设置默认值: + +```swift +struct Fahrenheit { + var temperature = 32.0 +} +``` + + +## 定制化构造过程 + +你可以通过输入参数和可选属性类型来定制构造过程,也可以在构造过程中修改常量属性。这些都将在后面章节中提到。 + +### 构造参数 + +你可以在定义构造器时提供构造参数,为其提供定制化构造所需值的类型和名字。构造器参数的功能和语法跟函数和方法参数相同。 + +下面例子中定义了一个包含摄氏度温度的结构体`Celsius`。它定义了两个不同的构造器:`init(fromFahrenheit:)`和`init(fromKelvin:)`,二者分别通过接受不同刻度表示的温度值来创建新的实例: + +```swift +struct Celsius { + var temperatureInCelsius: Double = 0.0 + init(fromFahrenheit fahrenheit: Double) { + temperatureInCelsius = (fahrenheit - 32.0) / 1.8 + } + init(fromKelvin kelvin: Double) { + temperatureInCelsius = kelvin - 273.15 + } +} +``` + +```swift +let boilingPointOfWater = Celsius(fromFahrenheit: 212.0) +// boilingPointOfWater.temperatureInCelsius 是 100.0 +let freezingPointOfWater = Celsius(fromKelvin: 273.15) +// freezingPointOfWater.temperatureInCelsius 是 0.0” +``` + +第一个构造器拥有一个构造参数,其外部名字为`fromFahrenheit`,内部名字为`fahrenheit`;第二个构造器也拥有一个构造参数,其外部名字为`fromKelvin`,内部名字为`kelvin`。这两个构造器都将唯一的参数值转换成摄氏温度值,并保存在属性`temperatureInCelsius`中。 + +### 内部和外部参数名 + +跟函数和方法参数相同,构造参数也存在一个在构造器内部使用的参数名字和一个在调用构造器时使用的外部参数名字。 + +然而,构造器并不像函数和方法那样在括号前有一个可辨别的名字。所以在调用构造器时,主要通过构造器中的参数名和类型来确定需要调用的构造器。正因为参数如此重要,如果你在定义构造器时没有提供参数的外部名字,Swift 会为每个构造器的参数自动生成一个跟内部名字相同的外部名,就相当于在每个构造参数之前加了一个哈希符号。 + +> 注意: +如果你不希望为构造器的某个参数提供外部名字,你可以使用下划线`_`来显示描述它的外部名,以此覆盖上面所说的默认行为。 + +以下例子中定义了一个结构体`Color`,它包含了三个常量:`red`、`green`和`blue`。这些属性可以存储0.0到1.0之间的值,用来指示颜色中红、绿、蓝成分的含量。 + +`Color`提供了一个构造器,其中包含三个`Double`类型的构造参数: + +```swift +struct Color { + let red = 0.0, green = 0.0, blue = 0.0 + init(red: Double, green: Double, blue: Double) { + self.red = red + self.green = green + self.blue = blue + } +} +``` + +每当你创建一个新的`Color`实例,你都需要通过三种颜色的外部参数名来传值,并调用构造器。 + +```swift +let magenta = Color(red: 1.0, green: 0.0, blue: 1.0) +``` + +注意,如果不通过外部参数名字传值,你是没法调用这个构造器的。只要构造器定义了某个外部参数名,你就必须使用它,忽略它将导致编译错误: + +```swift +let veryGreen = Color(0.0, 1.0, 0.0) +// 报编译时错误,需要外部名称 +``` + +### 可选属性类型 + +如果你定制的类型包含一个逻辑上允许取值为空的存储型属性--不管是因为它无法在初始化时赋值,还是因为它可以在之后某个时间点可以赋值为空--你都需要将它定义为可选类型`optional type`。可选类型的属性将自动初始化为空`nil`,表示这个属性是故意在初始化时设置为空的。 + +下面例子中定义了类`SurveyQuestion`,它包含一个可选字符串属性`response`: + +```swift +class SurveyQuestion { + var text: String + var response: String? + init(text: String) { + self.text = text + } + func ask() { + println(text) + } +} +let cheeseQuestion = SurveyQuestion(text: "Do you like cheese?") +cheeseQuestion.ask() +// 输出 "Do you like cheese?" +cheeseQuestion.response = "Yes, I do like cheese. +``` + +调查问题在问题提出之后,我们才能得到回答。所以我们将属性回答`response`声明为`String?`类型,或者说是可选字符串类型`optional String`。当`SurveyQuestion`实例化时,它将自动赋值为空`nil`,表明暂时还不存在此字符串。 + +### 构造过程中常量属性的修改 + +只要在构造过程结束前常量的值能确定,你可以在构造过程中的任意时间点修改常量属性的值。 + +>注意: +对某个类实例来说,它的常量属性只能在定义它的类的构造过程中修改;不能在子类中修改。 + +你可以修改上面的`SurveyQuestion`示例,用常量属性替代变量属性`text`,指明问题内容`text`在其创建之后不会再被修改。尽管`text`属性现在是常量,我们仍然可以在其类的构造器中修改它的值: + +```swift +class SurveyQuestion { + let text: String + var response: String? + init(text: String) { + self.text = text + } + func ask() { + println(text) + } +} +let beetsQuestion = SurveyQuestion(text: "How about beets?") +beetsQuestion.ask() +// 输出 "How about beets?" +beetsQuestion.response = "I also like beets. (But not with cheese.) +``` + + +## 默认构造器 + +Swift 将为所有属性已提供默认值的且自身没有定义任何构造器的结构体或基类,提供一个默认的构造器。这个默认构造器将简单的创建一个所有属性值都设置为默认值的实例。 + +下面例子中创建了一个类`ShoppingListItem`,它封装了购物清单中的某一项的属性:名字(`name`)、数量(`quantity`)和购买状态 `purchase state`。 + +```swift +class ShoppingListItem { + var name: String? + var quantity = 1 + var purchased = false +} +var item = ShoppingListItem() +``` + +由于`ShoppingListItem`类中的所有属性都有默认值,且它是没有父类的基类,它将自动获得一个可以为所有属性设置默认值的默认构造器(尽管代码中没有显式为`name`属性设置默认值,但由于`name`是可选字符串类型,它将默认设置为`nil`)。上面例子中使用默认构造器创造了一个`ShoppingListItem`类的实例(使用`ShoppingListItem()`形式的构造器语法),并将其赋值给变量`item`。 + +### 结构体的逐一成员构造器 + +除上面提到的默认构造器,如果结构体对所有存储型属性提供了默认值且自身没有提供定制的构造器,它们能自动获得一个逐一成员构造器。 + +逐一成员构造器是用来初始化结构体新实例里成员属性的快捷方法。我们在调用逐一成员构造器时,通过与成员属性名相同的参数名进行传值来完成对成员属性的初始赋值。 + +下面例子中定义了一个结构体`Size`,它包含两个属性`width`和`height`。Swift 可以根据这两个属性的初始赋值`0.0`自动推导出它们的类型`Double`。 + +由于这两个存储型属性都有默认值,结构体`Size`自动获得了一个逐一成员构造器 `init(width:height:)`。 你可以用它来为`Size`创建新的实例: + +```swift +struct Size { + var width = 0.0, height = 0.0 +} +let twoByTwo = Size(width: 2.0, height: 2.0) +``` + + +## 值类型的构造器代理 + +构造器可以通过调用其它构造器来完成实例的部分构造过程。这一过程称为构造器代理,它能减少多个构造器间的代码重复。 + +构造器代理的实现规则和形式在值类型和类类型中有所不同。值类型(结构体和枚举类型)不支持继承,所以构造器代理的过程相对简单,因为它们只能代理任务给本身提供的其它构造器。类则不同,它可以继承自其它类(请参考[继承](../chapter2/13_Inheritance.html)),这意味着类有责任保证其所有继承的存储型属性在构造时也能正确的初始化。这些责任将在后续章节[类的继承和构造过程](#class_inheritance_and_initialization)中介绍。 + +对于值类型,你可以使用`self.init`在自定义的构造器中引用其它的属于相同值类型的构造器。并且你只能在构造器内部调用`self.init`。 + +注意,如果你为某个值类型定义了一个定制的构造器,你将无法访问到默认构造器(如果是结构体,则无法访问逐一对象构造器)。这个限制可以防止你在为值类型定义了一个更复杂的,完成了重要准备构造器之后,别人还是错误的使用了那个自动生成的构造器。 + +>注意: +假如你想通过默认构造器、逐一对象构造器以及你自己定制的构造器为值类型创建实例,我们建议你将自己定制的构造器写到扩展(`extension`)中,而不是跟值类型定义混在一起。想查看更多内容,请查看[扩展](../chapter2/20_Extensions.html)章节。 + +下面例子将定义一个结构体`Rect`,用来展现几何矩形。这个例子需要两个辅助的结构体`Size`和`Point`,它们各自为其所有的属性提供了初始值`0.0`。 + +```swift +struct Size { + var width = 0.0, height = 0.0 +} +struct Point { + var x = 0.0, y = 0.0 +} +``` + +你可以通过以下三种方式为`Rect`创建实例--使用默认的0值来初始化`origin`和`size`属性;使用特定的`origin`和`size`实例来初始化;使用特定的`center`和`size`来初始化。在下面`Rect`结构体定义中,我们为着三种方式提供了三个自定义的构造器: + +```swift +struct Rect { + var origin = Point() + var size = Size() + init() {} + init(origin: Point, size: Size) { + self.origin = origin + self.size = size + } + init(center: Point, size: Size) { + let originX = center.x - (size.width / 2) + let originY = center.y - (size.height / 2) + self.init(origin: Point(x: originX, y: originY), size: size) + } +} +``` + +第一个`Rect`构造器`init()`,在功能上跟没有自定义构造器时自动获得的默认构造器是一样的。这个构造器是一个空函数,使用一对大括号`{}`来描述,它没有执行任何定制的构造过程。调用这个构造器将返回一个`Rect`实例,它的`origin`和`size`属性都使用定义时的默认值`Point(x: 0.0, y: 0.0)`和`Size(width: 0.0, height: 0.0)`: + +```swift +let basicRect = Rect() +// basicRect 的原点是 (0.0, 0.0),尺寸是 (0.0, 0.0) +``` + +第二个`Rect`构造器`init(origin:size:)`,在功能上跟结构体在没有自定义构造器时获得的逐一成员构造器是一样的。这个构造器只是简单的将`origin`和`size`的参数值赋给对应的存储型属性: + +```swift +let originRect = Rect(origin: Point(x: 2.0, y: 2.0), + size: Size(width: 5.0, height: 5.0)) +// originRect 的原点是 (2.0, 2.0),尺寸是 (5.0, 5.0) +``` + +第三个`Rect`构造器`init(center:size:)`稍微复杂一点。它先通过`center`和`size`的值计算出`origin`的坐标。然后再调用(或代理给)`init(origin:size:)`构造器来将新的`origin`和`size`值赋值到对应的属性中: + +let centerRect = Rect(center: Point(x: 4.0, y: 4.0), +```swift +size: Size(width: 3.0, height: 3.0)) +``` +// centerRect 的原点是 (2.5, 2.5),尺寸是 (3.0, 3.0) + +构造器`init(center:size:)`可以自己将`origin`和`size`的新值赋值到对应的属性中。然而尽量利用现有的构造器和它所提供的功能来实现`init(center:size:)`的功能,是更方便、更清晰和更直观的方法。 + +>注意: +如果你想用另外一种不需要自己定义`init()`和`init(origin:size:)`的方式来实现这个例子,请参考[扩展](../chapter2/20_Extensions.html)。 + + +## 类的继承和构造过程 + +类里面的所有存储型属性--包括所有继承自父类的属性--都必须在构造过程中设置初始值。 + +Swift 提供了两种类型的类构造器来确保所有类实例中存储型属性都能获得初始值,它们分别是指定构造器和便利构造器。 + +### 指定构造器和便利构造器 + +指定构造器是类中最主要的构造器。一个指定构造器将初始化类中提供的所有属性,并根据父类链往上调用父类的构造器来实现父类的初始化。 + +每一个类都必须拥有至少一个指定构造器。在某些情况下,许多类通过继承了父类中的指定构造器而满足了这个条件。具体内容请参考后续章节[自动构造器的继承](#automatic_initializer_inheritance)。 + +便利构造器是类中比较次要的、辅助型的构造器。你可以定义便利构造器来调用同一个类中的指定构造器,并为其参数提供默认值。你也可以定义便利构造器来创建一个特殊用途或特定输入的实例。 + +你应当只在必要的时候为类提供便利构造器,比方说某种情况下通过使用便利构造器来快捷调用某个指定构造器,能够节省更多开发时间并让类的构造过程更清、晰明。 + + +### 构造器链 + +为了简化指定构造器和便利构造器之间的调用关系,Swift 采用以下三条规则来限制构造器之间的代理调用: + +#### 规则 1 +指定构造器必须调用其直接父类的的指定构造器。 + +#### 规则 2 +便利构造器必须调用同一类中定义的其它构造器。 + +#### 规则 3 +便利构造器必须最终以调用一个指定构造器结束。 + +一个更方便记忆的方法是: + +- 指定构造器必须总是向上代理 +- 便利构造器必须总是横向代理 + +这些规则可以通过下面图例来说明: + +![构造器代理图](https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Art/initializerDelegation01_2x.png) + +如图所示,父类中包含一个指定构造器和两个便利构造器。其中一个便利构造器调用了另外一个便利构造器,而后者又调用了唯一的指定构造器。这满足了上面提到的规则2和3。这个父类没有自己的父类,所以规则1没有用到。 + +子类中包含两个指定构造器和一个便利构造器。便利构造器必须调用两个指定构造器中的任意一个,因为它只能调用同一个类里的其他构造器。这满足了上面提到的规则2和3。而两个指定构造器必须调用父类中唯一的指定构造器,这满足了规则1。 + +> 注意: +这些规则不会影响使用时,如何用类去创建实例。任何上图中展示的构造器都可以用来完整创建对应类的实例。这些规则只在实现类的定义时有影响。 + +下面图例中展示了一种更复杂的类层级结构。它演示了指定构造器是如果在类层级中充当“管道”的作用,在类的构造器链上简化了类之间的内部关系。 + +![复杂构造器代理图](https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Art/initializerDelegation02_2x.png) + + +### 两段式构造过程 + +Swift 中类的构造过程包含两个阶段。第一个阶段,每个存储型属性通过引入它们的类的构造器来设置初始值。当每一个存储型属性值被确定后,第二阶段开始,它给每个类一次机会在新实例准备使用之前进一步定制它们的存储型属性。 + +两段式构造过程的使用让构造过程更安全,同时在整个类层级结构中给予了每个类完全的灵活性。两段式构造过程可以防止属性值在初始化之前被访问;也可以防止属性被另外一个构造器意外地赋予不同的值。 + +> 注意: +Swift的两段式构造过程跟 Objective-C 中的构造过程类似。最主要的区别在于阶段 1,Objective-C 给每一个属性赋值`0`或空值(比如说`0`或`nil`)。Swift 的构造流程则更加灵活,它允许你设置定制的初始值,并自如应对某些属性不能以`0`或`nil`作为合法默认值的情况。 + +Swift 编译器将执行 4 种有效的安全检查,以确保两段式构造过程能顺利完成: + +#### 安全检查 1 + +指定构造器必须保证它所在类引入的所有属性都必须先初始化完成,之后才能将其它构造任务向上代理给父类中的构造器。 + +如上所述,一个对象的内存只有在其所有存储型属性确定之后才能完全初始化。为了满足这一规则,指定构造器必须保证它所在类引入的属性在它往上代理之前先完成初始化。 + +#### 安全检查 2 + +指定构造器必须先向上代理调用父类构造器,然后再为继承的属性设置新值。如果没这么做,指定构造器赋予的新值将被父类中的构造器所覆盖。 + +#### 安全检查 3 + +便利构造器必须先代理调用同一类中的其它构造器,然后再为任意属性赋新值。如果没这么做,便利构造器赋予的新值将被同一类中其它指定构造器所覆盖。 + +#### 安全检查 4 + +构造器在第一阶段构造完成之前,不能调用任何实例方法、不能读取任何实例属性的值,也不能引用`self`的值。 + +以下是两段式构造过程中基于上述安全检查的构造流程展示: + +#### 阶段 1 + +- 某个指定构造器或便利构造器被调用; +- 完成新实例内存的分配,但此时内存还没有被初始化; +- 指定构造器确保其所在类引入的所有存储型属性都已赋初值。存储型属性所属的内存完成初始化; +- 指定构造器将调用父类的构造器,完成父类属性的初始化; +- 这个调用父类构造器的过程沿着构造器链一直往上执行,直到到达构造器链的最顶部; +- 当到达了构造器链最顶部,且已确保所有实例包含的存储型属性都已经赋值,这个实例的内存被认为已经完全初始化。此时阶段1完成。 + +#### 阶段 2 + +- 从顶部构造器链一直往下,每个构造器链中类的指定构造器都有机会进一步定制实例。构造器此时可以访问`self`、修改它的属性并调用实例方法等等。 +- 最终,任意构造器链中的便利构造器可以有机会定制实例和使用`self`。 + +下图展示了在假定的子类和父类之间构造的阶段1: +· +![构造过程阶段1](https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Art/twoPhaseInitialization01_2x.png) + +在这个例子中,构造过程从对子类中一个便利构造器的调用开始。这个便利构造器此时没法修改任何属性,它把构造任务代理给同一类中的指定构造器。 + +如安全检查1所示,指定构造器将确保所有子类的属性都有值。然后它将调用父类的指定构造器,并沿着造器链一直往上完成父类的构建过程。 + +父类中的指定构造器确保所有父类的属性都有值。由于没有更多的父类需要构建,也就无需继续向上做构建代理。 + +一旦父类中所有属性都有了初始值,实例的内存被认为是完全初始化,而阶段1也已完成。 + +以下展示了相同构造过程的阶段2: + +![构建过程阶段2](https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Art/twoPhaseInitialization02_2x.png) + +父类中的指定构造器现在有机会进一步来定制实例(尽管它没有这种必要)。 + +一旦父类中的指定构造器完成调用,子类的构指定构造器可以执行更多的定制操作(同样,它也没有这种必要)。 + +最终,一旦子类的指定构造器完成调用,最开始被调用的便利构造器可以执行更多的定制操作。 + +### 构造器的继承和重载 + +跟 Objective-C 中的子类不同,Swift 中的子类不会默认继承父类的构造器。Swift 的这种机制可以防止一个父类的简单构造器被一个更专业的子类继承,并被错误的用来创建子类的实例。 + +假如你希望自定义的子类中能实现一个或多个跟父类相同的构造器--也许是为了完成一些定制的构造过程--你可以在你定制的子类中提供和重载与父类相同的构造器。 + +如果你重载的构造器是一个指定构造器,你可以在子类里重载它的实现,并在自定义版本的构造器中调用父类版本的构造器。 + +如果你重载的构造器是一个便利构造器,你的重载过程必须通过调用同一类中提供的其它指定构造器来实现。这一规则的详细内容请参考[构造器链](#initialization_chain)。 + +>注意: +与方法、属性和下标不同,在重载构造器时你没有必要使用关键字`override`。 + + +### 自动构造器的继承 + +如上所述,子类不会默认继承父类的构造器。但是如果特定条件可以满足,父类构造器是可以被自动继承的。在实践中,这意味着对于许多常见场景你不必重载父类的构造器,并且在尽可能安全的情况下以最小的代价来继承父类的构造器。 + +假设要为子类中引入的任意新属性提供默认值,请遵守以下2个规则: + +#### 规则 1 + +如果子类没有定义任何指定构造器,它将自动继承所有父类的指定构造器。 + +#### 规则 2 + +如果子类提供了所有父类指定构造器的实现--不管是通过规则1继承过来的,还是通过自定义实现的--它将自动继承所有父类的便利构造器。 + +即使你在子类中添加了更多的便利构造器,这两条规则仍然适用。 + +>注意: +子类可以通过部分满足规则2的方式,使用子类便利构造器来实现父类的指定构造器。 + +### 指定构造器和便利构造器的语法 + +类的指定构造器的写法跟值类型简单构造器一样: + +```swift +init(parameters) { + statements +} +``` + +便利构造器也采用相同样式的写法,但需要在`init`关键字之前放置`convenience`关键字,并使用空格将它们俩分开: + +```swift +convenience init(parameters) { + statements +} +``` + +### 指定构造器和便利构造器实战 + +接下来的例子将在实战中展示指定构造器、便利构造器和自动构造器的继承。它定义了包含三个类`Food`、`RecipeIngredient`以及`ShoppingListItem`的类层次结构,并将演示它们的构造器是如何相互作用的。 + +类层次中的基类是`Food`,它是一个简单的用来封装食物名字的类。`Food`类引入了一个叫做`name`的`String`类型属性,并且提供了两个构造器来创建`Food`实例: + +```swift +class Food { + var name: String + init(name: String) { + self.name = name + } + convenience init() { + self.init(name: "[Unnamed]") + } +} +``` + +下图中展示了`Food`的构造器链: + +![Food构造器链](https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Art/initializersExample01_2x.png) + +类没有提供一个默认的逐一成员构造器,所以`Food`类提供了一个接受单一参数`name`的指定构造器。这个构造器可以使用一个特定的名字来创建新的`Food`实例: + +```swift +let namedMeat = Food(name: "Bacon") +// namedMeat 的名字是 "Bacon” +``` + +`Food`类中的构造器`init(name: String)`被定义为一个指定构造器,因为它能确保所有新`Food`实例的中存储型属性都被初始化。`Food`类没有父类,所以`init(name: String)`构造器不需要调用`super.init()`来完成构造。 + +`Food`类同样提供了一个没有参数的便利构造器 `init()`。这个`init()`构造器为新食物提供了一个默认的占位名字,通过代理调用同一类中定义的指定构造器`init(name: String)`并给参数`name`传值`[Unnamed]`来实现: + +```swift +let mysteryMeat = Food() +// mysteryMeat 的名字是 [Unnamed] +``` + +类层级中的第二个类是`Food`的子类`RecipeIngredient`。`RecipeIngredient`类构建了食谱中的一味调味剂。它引入了`Int`类型的数量属性`quantity`(以及从`Food`继承过来的`name`属性),并且定义了两个构造器来创建`RecipeIngredient`实例: + +```swift +class RecipeIngredient: Food { + var quantity: Int + init(name: String, quantity: Int) { + self.quantity = quantity + super.init(name: name) + } + convenience init(name: String) { + self.init(name: name, quantity: 1) + } +} +``` + +下图中展示了`RecipeIngredient`类的构造器链: + +![RecipeIngredient构造器](https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Art/initializersExample02_2x.png) + +`RecipeIngredient`类拥有一个指定构造器`init(name: String, quantity: Int)`,它可以用来产生新`RecipeIngredient`实例的所有属性值。这个构造器一开始先将传入的`quantity`参数赋值给`quantity`属性,这个属性也是唯一在`RecipeIngredient`中新引入的属性。随后,构造器将任务向上代理给父类`Food`的`init(name: String)`。这个过程满足[两段式构造过程](#two_phase_initialization)中的安全检查1。 + +`RecipeIngredient`也定义了一个便利构造器`init(name: String)`,它只通过`name`来创建`RecipeIngredient`的实例。这个便利构造器假设任意`RecipeIngredient`实例的`quantity`为1,所以不需要显示指明数量即可创建出实例。这个便利构造器的定义可以让创建实例更加方便和快捷,并且避免了使用重复的代码来创建多个`quantity`为 1 的`RecipeIngredient`实例。这个便利构造器只是简单的将任务代理给了同一类里提供的指定构造器。 + +注意,`RecipeIngredient`的便利构造器`init(name: String)`使用了跟`Food`中指定构造器`init(name: String)`相同的参数。尽管`RecipeIngredient`这个构造器是便利构造器,`RecipeIngredient`依然提供了对所有父类指定构造器的实现。因此,`RecipeIngredient`也能自动继承了所有父类的便利构造器。 + +在这个例子中,`RecipeIngredient`的父类是`Food`,它有一个便利构造器`init()`。这个构造器因此也被`RecipeIngredient`继承。这个继承的`init()`函数版本跟`Food`提供的版本是一样的,除了它是将任务代理给`RecipeIngredient`版本的`init(name: String)`而不是`Food`提供的版本。 + +所有的这三种构造器都可以用来创建新的`RecipeIngredient`实例: + +```swift +let oneMysteryItem = RecipeIngredient() +let oneBacon = RecipeIngredient(name: "Bacon") +let sixEggs = RecipeIngredient(name: "Eggs", quantity: 6) +``` + +类层级中第三个也是最后一个类是`RecipeIngredient`的子类,叫做`ShoppingListItem`。这个类构建了购物单中出现的某一种调味料。 + +购物单中的每一项总是从`unpurchased`未购买状态开始的。为了展现这一事实,`ShoppingListItem`引入了一个布尔类型的属性`purchased`,它的默认值是`false`。`ShoppingListItem`还添加了一个计算型属性`description`,它提供了关于`ShoppingListItem`实例的一些文字描述: + +```swift +class ShoppingListItem: RecipeIngredient { + var purchased = false + var description: String { + var output = "\(quantity) x \(name.lowercaseString)" + output += purchased ? " ✔" : " ✘" + return output + } +} +``` + +> 注意: +`ShoppingListItem`没有定义构造器来为`purchased`提供初始化值,这是因为任何添加到购物单的项的初始状态总是未购买。 + +由于它为自己引入的所有属性都提供了默认值,并且自己没有定义任何构造器,`ShoppingListItem`将自动继承所有父类中的指定构造器和便利构造器。 + +下图种展示了所有三个类的构造器链: + +![三类构造器图](https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Art/initializersExample03_2x.png) + +你可以使用全部三个继承来的构造器来创建`ShoppingListItem`的新实例: + +```swift +var breakfastList = [ + ShoppingListItem(), + ShoppingListItem(name: "Bacon"), + ShoppingListItem(name: "Eggs", quantity: 6), +] +breakfastList[0].name = "Orange juice" +breakfastList[0].purchased = true +for item in breakfastList { + println(item.description) +} +// 1 x orange juice ✔ +// 1 x bacon ✘ +// 6 x eggs ✘ +``` + +如上所述,例子中通过字面量方式创建了一个新数组`breakfastList`,它包含了三个新的`ShoppingListItem`实例,因此数组的类型也能自动推导为`ShoppingListItem[]`。在数组创建完之后,数组中第一个`ShoppingListItem`实例的名字从`[Unnamed]`修改为`Orange juice`,并标记为已购买。接下来通过遍历数组每个元素并打印它们的描述值,展示了所有项当前的默认状态都已按照预期完成了赋值。 + + +## 通过闭包和函数来设置属性的默认值 + +如果某个存储型属性的默认值需要特别的定制或准备,你就可以使用闭包或全局函数来为其属性提供定制的默认值。每当某个属性所属的新类型实例创建时,对应的闭包或函数会被调用,而它们的返回值会当做默认值赋值给这个属性。 + +这种类型的闭包或函数一般会创建一个跟属性类型相同的临时变量,然后修改它的值以满足预期的初始状态,最后将这个临时变量的值作为属性的默认值进行返回。 + +下面列举了闭包如何提供默认值的代码概要: + +```swift +class SomeClass { + let someProperty: SomeType = { + // 在这个闭包中给 someProperty 创建一个默认值 + // someValue 必须和 SomeType 类型相同 + return someValue + }() +} +``` + +注意闭包结尾的大括号后面接了一对空的小括号。这是用来告诉 Swift 需要立刻执行此闭包。如果你忽略了这对括号,相当于是将闭包本身作为值赋值给了属性,而不是将闭包的返回值赋值给属性。 + +>注意: +如果你使用闭包来初始化属性的值,请记住在闭包执行时,实例的其它部分都还没有初始化。这意味着你不能够在闭包里访问其它的属性,就算这个属性有默认值也不允许。同样,你也不能使用隐式的`self`属性,或者调用其它的实例方法。 + +下面例子中定义了一个结构体`Checkerboard`,它构建了西洋跳棋游戏的棋盘: + +![西洋跳棋棋盘](https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_language/Art/checkersBoard_2x.png) + +西洋跳棋游戏在一副黑白格交替的 10x10 的棋盘中进行。为了呈现这副游戏棋盘,`Checkerboard`结构体定义了一个属性`boardColors`,它是一个包含 100 个布尔值的数组。数组中的某元素布尔值为`true`表示对应的是一个黑格,布尔值为`false`表示对应的是一个白格。数组中第一个元素代表棋盘上左上角的格子,最后一个元素代表棋盘上右下角的格子。 + +`boardColor`数组是通过一个闭包来初始化和组装颜色值的: + +```swift +struct Checkerboard { + let boardColors: Bool[] = { + var temporaryBoard = Bool[]() + var isBlack = false + for i in 1...10 { + for j in 1...10 { + temporaryBoard.append(isBlack) + isBlack = !isBlack + } + isBlack = !isBlack + } + return temporaryBoard + }() + func squareIsBlackAtRow(row: Int, column: Int) -> Bool { + return boardColors[(row * 10) + column] + } +} +``` + +每当一个新的`Checkerboard`实例创建时,对应的赋值闭包会执行,一系列颜色值会被计算出来作为默认值赋值给`boardColors`。上面例子中描述的闭包将计算出棋盘中每个格子合适的颜色,将这些颜色值保存到一个临时数组`temporaryBoard`中,并在构建完成时将此数组作为闭包返回值返回。这个返回的值将保存到`boardColors`中,并可以通`squareIsBlackAtRow`这个工具函数来查询。 + +```swift +let board = Checkerboard() +println(board.squareIsBlackAtRow(0, column: 1)) +// 输出 "true" +println(board.squareIsBlackAtRow(9, column: 9)) +// 输出 "false" +``` \ No newline at end of file diff --git a/source/chapter2/15_Deinitialization.md b/source/chapter2/15_Deinitialization.md old mode 100644 new mode 100755 index 796ea4c9..3bcef867 --- a/source/chapter2/15_Deinitialization.md +++ b/source/chapter2/15_Deinitialization.md @@ -1,88 +1,108 @@ -#析构过程 - -在一个类的实例被释放之前,析构函数被立即调用。用关键字deinit来标示析构函数,类似于初始化函数用init来标示。析构函数只适用于类类型。 - - -##析构过程原理 - -Swift会自动释放不再需要的实例以释放资源。如自动引用计数那一章描述,Swift通过自动引用计数(ARC)处理实例的内存管理。通常当你的实例被释放时不需要手动的去清理。但是,当使用自己的资源时,你可能需要进行一些额外的清理。例如,如果创建了一个自定义的类来打开一个文件,并写入一些数据,你可能需要在类实例被释放之前关闭该文件。 - -在类的定义中,每个类最多只能有一个析构函数。析构函数不带任何参数,在写法上不带括号: - - 1 deinit { - 2 // 执行析构过程 - 3 } - -析构函数是在实例释放发生前一步被自动调用。不允许主动调用自己的析构函数。子类继承了父类的析构函数,并且在子类析构函数实现的最后,父类的析构函数被自动调用。即使子类没有提供自己的析构函数,父类的析构函数也总是被调用。 - -因为直到实例的析构函数被调用时,实例才会被释放,所以析构函数可以访问所有请求实例的属性,并且根据那些属性可以修改它的行为(比如查找一个需要被关闭的文件的名称)。 - -##析构函数操作 - -这里是一个析构函数操作的例子。这个例子是一个简单的游戏,定义了两种新类型,Bank和Player。Bank结构体管理一个虚拟货币的流通,在这个流通中Bank永远不可能拥有超过10,000的硬币。在这个游戏中有且只能有一个Bank存在,因此Bank由带有静态属性和静态方法的结构体实现,从而存储和管理其当前的状态。 - - 1 struct Bank { - 2 static var coinsInBank = 10_000 - 3 static func vendCoins(var numberOfCoinsToVend: Int) -> Int { - 4 numberOfCoinsToVend = min(numberOfCoinsToVend, coinsInBank) - 5 coinsInBank -= numberOfCoinsToVend - 6 return numberOfCoinsToVend - 7 } - 8 static func receiveCoins(coins: Int) { - 9 coinsInBank += coins - 10 } - 11 } - -Bank根据它的coinsInBank属性来跟踪当前它拥有的硬币数量。银行还提供两个方法—vendCoins和receiveCoins,用来处理硬币的分发和收集。 - -vendCoins方法在bank分发硬币之前检查是否有足够的硬币。如果没有足够多的硬币,bank返回一个比请求时小的数字(如果没有硬币留在bank中就返回0)。vendCoins方法声明numberOfCoinsToVend为一个变量参数,这样就可以在方法体的内部修改数字,而不需要定义一个新的变量。vendCoins方法返回一个整型值,表明了提供的硬币的实际数目。 - -receiveCoins方法只是将bank的硬币存储和接收到的硬币数目相加,再保存回bank。 - -Player类描述了游戏中的一个玩家。每一个player在任何时刻都有一定数量的硬币存储在他们的钱包中。这通过player的coinsInPurse属性来体现: - - 1 class Player { - 2 var coinsInPurse: Int - 3 init(coins: Int) { - 4 coinsInPurse = Bank.vendCoins(coins) - 5 } - 6 func winCoins(coins: Int) { - 7 coinsInPurse += Bank.vendCoins(coins) - 8 } - 9 deinit { - 10 Bank.receiveCoins(coinsInPurse) - 11 } - 12 } - - -每个Player实例都由一个指定数目硬币组成的启动额度初始化,这些硬币在bank初始化的过程中得到。如果没有足够的硬币可用,Player实例可能收到比指定数目少的硬币。 - -Player类定义了一个winCoins方法,该方法从bank获取一定数量的硬币,并把它们添加到player的钱包。Player类还实现了一个析构函数,这个析构函数在Player实例释放前一步被调用。这里析构函数只是将player的所有硬币都返回给bank: - - 1 var playerOne: Player? = Player(coins: 100) - 2 println("A new player has joined the game with \ (playerOne!.coinsInPurse) coins") - 3 // 输出 "A new player has joined the game with 100 coins" - 4 println("There are now \(Bank.coinsInBank) coins left in the bank") - 5 // 输出 "There are now 9900 coins left in the bank" - -一个新的Player实例随着一个100个硬币(如果有)的请求而被创建。这个Player实例存储在一个名为playerOne的可选Player变量中。这里使用一个可选变量,是因为players可以随时离开游戏。设置为可选使得你可以跟踪当前是否有player在游戏中。 - -因为playerOne是可选的,所以由一个感叹号(!)来修饰,每当其winCoins方法被调用时,coinsInPurse属性被访问并打印出它的默认硬币数目。 - - 1 playerOne!.winCoins(2_000) - 2 println("PlayerOne won 2000 coins & now has \ (playerOne!.coinsInPurse) coins") - 3 // 输出 "PlayerOne won 2000 coins & now has 2100 coins" - 4 println("The bank now only has \(Bank.coinsInBank) coins left") - 5 // 输出 "The bank now only has 7900 coins left" - -这里,player已经赢得了2,000硬币。player的钱包现在有2,100硬币,bank只剩余7,900硬币。 - - 1 playerOne = nil - 2 println("PlayerOne has left the game") - 3 // 输出 "PlayerOne has left the game" - 4 println("The bank now has \(Bank.coinsInBank) coins") - 5 // 输出 "The bank now has 10000 coins" - -player现在已经离开了游戏。这表明是要将可选的playerOne变量设置为nil,意思是"没有Player实例"。当这种情况发生的时候,playerOne变量对Player实例的引用被破坏了。没有其它属性或者变量引用Player实例,因此为了清空它占用的内存从而释放它。在这发生前一步,其析构函数被自动调用,其硬币被返回到bank。 - - +> 翻译:[bruce0505](https://github.com/bruce0505) +> 校对:[fd5788](https://github.com/fd5788) + +# 析构过程(Deinitialization) +--------------------------- + +本页包含内容: + +- [析构过程原理](#how_deinitialization_works) +- [析构函数操作](#deinitializers_in_action) + +在一个类的实例被释放之前,析构函数被立即调用。用关键字`deinit`来标示析构函数,类似于初始化函数用`init`来标示。析构函数只适用于类类型。 + + +##析构过程原理 + +Swift 会自动释放不再需要的实例以释放资源。如[自动引用计数](16_Automatic_Reference_Counting.html)那一章描述,Swift 通过_自动引用计数_(ARC)处理实例的内存管理。通常当你的实例被释放时不需要手动地去清理。但是,当使用自己的资源时,你可能需要进行一些额外的清理。例如,如果创建了一个自定义的类来打开一个文件,并写入一些数据,你可能需要在类实例被释放之前关闭该文件。 + +在类的定义中,每个类最多只能有一个析构函数。析构函数不带任何参数,在写法上不带括号: + +```swift +deinit { + // 执行析构过程 +} +``` + +析构函数是在实例释放发生前一步被自动调用。不允许主动调用自己的析构函数。子类继承了父类的析构函数,并且在子类析构函数实现的最后,父类的析构函数被自动调用。即使子类没有提供自己的析构函数,父类的析构函数也总是被调用。 + +因为直到实例的析构函数被调用时,实例才会被释放,所以析构函数可以访问所有请求实例的属性,并且根据那些属性可以修改它的行为(比如查找一个需要被关闭的文件的名称)。 + + +##析构函数操作 + +这里是一个析构函数操作的例子。这个例子是一个简单的游戏,定义了两种新类型,`Bank`和`Player`。`Bank`结构体管理一个虚拟货币的流通,在这个流通中`Bank`永远不可能拥有超过 10,000 的硬币。在这个游戏中有且只能有一个`Bank`存在,因此`Bank`由带有静态属性和静态方法的结构体实现,从而存储和管理其当前的状态。 + +```swift +struct Bank { + static var coinsInBank = 10_000 + static func vendCoins(var numberOfCoinsToVend: Int) -> Int { + numberOfCoinsToVend = min(numberOfCoinsToVend, coinsInBank) + coinsInBank -= numberOfCoinsToVend + return numberOfCoinsToVend + } + static func receiveCoins(coins: Int) { + coinsInBank += coins + } +} +``` + +`Bank`根据它的`coinsInBank`属性来跟踪当前它拥有的硬币数量。银行还提供两个方法——`vendCoins`和`receiveCoins`——用来处理硬币的分发和收集。 + +`vendCoins`方法在 bank 分发硬币之前检查是否有足够的硬币。如果没有足够多的硬币,`Bank`返回一个比请求时小的数字(如果没有硬币留在 bank 中就返回 0)。`vendCoins`方法声明`numberOfCoinsToVend`为一个变量参数,这样就可以在方法体的内部修改数字,而不需要定义一个新的变量。`vendCoins`方法返回一个整型值,表明了提供的硬币的实际数目。 + +`receiveCoins`方法只是将 bank 的硬币存储和接收到的硬币数目相加,再保存回 bank。 + +`Player`类描述了游戏中的一个玩家。每一个 player 在任何时刻都有一定数量的硬币存储在他们的钱包中。这通过 player 的`coinsInPurse`属性来体现: + +```swift +class Player { + var coinsInPurse: Int + init(coins: Int) { + coinsInPurse = Bank.vendCoins(coins) + } + func winCoins(coins: Int) { + coinsInPurse += Bank.vendCoins(coins) + } + deinit { + Bank.receiveCoins(coinsInPurse) + } +} +``` + + +每个`Player`实例都由一个指定数目硬币组成的启动额度初始化,这些硬币在 bank 初始化的过程中得到。如果没有足够的硬币可用,`Player`实例可能收到比指定数目少的硬币。 + +`Player`类定义了一个`winCoins`方法,该方法从银行获取一定数量的硬币,并把它们添加到玩家的钱包。`Player`类还实现了一个析构函数,这个析构函数在`Player`实例释放前一步被调用。这里析构函数只是将玩家的所有硬币都返回给银行: + +```swift +var playerOne: Player? = Player(coins: 100) +println("A new player has joined the game with \(playerOne!.coinsInPurse) coins") +// 输出 "A new player has joined the game with 100 coins" +println("There are now \(Bank.coinsInBank) coins left in the bank") +// 输出 "There are now 9900 coins left in the bank" +``` + +一个新的`Player`实例随着一个 100 个硬币(如果有)的请求而被创建。这`个Player`实例存储在一个名为`playerOne`的可选`Player`变量中。这里使用一个可选变量,是因为玩家可以随时离开游戏。设置为可选使得你可以跟踪当前是否有玩家在游戏中。 + +因为`playerOne`是可选的,所以由一个感叹号(`!`)来修饰,每当其`winCoins`方法被调用时,`coinsInPurse`属性被访问并打印出它的默认硬币数目。 + +```swift +playerOne!.winCoins(2_000) +println("PlayerOne won 2000 coins & now has \ (playerOne!.coinsInPurse) coins") +// 输出 "PlayerOne won 2000 coins & now has 2100 coins" +println("The bank now only has \(Bank.coinsInBank) coins left") +// 输出 "The bank now only has 7900 coins left" +``` + +这里,player 已经赢得了 2,000 硬币。player 的钱包现在有 2,100 硬币,bank 只剩余 7,900 硬币。 + +```swift +playerOne = nil +println("PlayerOne has left the game") +// 输出 "PlayerOne has left the game" +println("The bank now has \(Bank.coinsInBank) coins") +// 输出 "The bank now has 10000 coins" +``` + +玩家现在已经离开了游戏。这表明是要将可选的`playerOne`变量设置为`nil`,意思是“没有`Player`实例”。当这种情况发生的时候,`playerOne`变量对`Player`实例的引用被破坏了。没有其它属性或者变量引用`Player`实例,因此为了清空它占用的内存从而释放它。在这发生前一步,其析构函数被自动调用,其硬币被返回到银行。 diff --git a/source/chapter2/16_Automatic_Reference_Counting.md b/source/chapter2/16_Automatic_Reference_Counting.md old mode 100644 new mode 100755 index 9611913c..789ff5a0 --- a/source/chapter2/16_Automatic_Reference_Counting.md +++ b/source/chapter2/16_Automatic_Reference_Counting.md @@ -1,472 +1,555 @@ -# 自动引用计数 - -本页包含内容: - -- 自动引用计数的工作机制 -- 自动引用计数实践 -- 类实例间的强引用环 -- 类实例间的强引用环分解 -- 闭包的强引用环 -- 闭包的强引用环分解 - -Swift使用自动引用计数(ARC)这一机制来跟踪和管理你的应用程序的内存。通常情况下,Swift的内存管理机制会一直起着作用,你无须自己来考虑内存的管理。ARC会在类的实例不再被使用时,自动释放其占用的内存。 - -然而,在少数情况下,ARC为了能帮助你管理内存,需要更多的关于你的代码之间关系的信息。本章描述了这些情况,并且为你示范怎样启用ARC来管理你的应用程序的内存。 - -> 注意: 引用计数仅仅应用于类的实例。结构体和枚举类型是值类型,不是引用类型,也不是通过引用的方式存储和传递。 - -## 自动引用计数的工作机制 - -当你每次创建一个类的新的实例的时候,ARC会分配一大块内存用来储存实例的信息。内存中会包含实例的类型信息,以及这个实例所有相关属性的值。此外,当实例不再被使用时,ARC释放实例所占用的内存,并让释放的内存能挪作他用。这确保了不再被使用的实例,不会一直占用内存空间。 - -然而,当ARC收回和释放了正在被使用中的实例,该实例的属性和方法将不能再被访问和调用。实际上,如果你试图访问这个实例,你的应用程序很可能会崩溃。 - -为了确保使用中的实例不会被销毁,ARC会跟踪和计算每一个实例正在被多少属性,常量和变量所引用。哪怕实例的引用数为一,ARC都不会销毁这个实例。 - -为了使之成为可能,无论你将实例赋值给属性,常量或者是变量,属性,常量或者变量,都会对此实例创建强引用。之所以称之为强引用,是因为它会将实例牢牢的保持住,只要强引用还在,实例是不允许被销毁的。 - -## 自动引用计数实战 - -下面的例子展示了自动引用计数的工作机制。例子以一个简单的Person类开始,并定义了一个叫name的常量属性: - - class Person { - let name: String - - init(name: String) { - self.name = name - println("\(name) is being initialized") - } - - deinit { - println("\(name) is being deinitialized") - } - } - -Person类有一个构造函数,此构造函数为实例的name属性赋值并打印出信息,以表明初始化过程生效。Person类同时也拥有析构函数,同样会在实例被销毁的时候打印出信息。 - -接下来的代码片段定义了三个类型为Person?的变量,用来按照代码片段中的顺序,为新的Person实例建立多个引用。由于这些变量是被定义为可选类型(Person?,而不是Person),它们的值会被自动初始化为nil,目前还不会引用到Person类的实例。 - - var reference1: Person? - var reference2: Person? - var reference3: Person? - -现在你可以创建Person类的新实例,并且将它赋值给三个变量其中的一个: - - reference1 = Person(name: "John Appleseed") - // prints "John Appleseed is being initialized” - -应当注意到当你调用Person类的构造函数的时候,"John Appleseed is being initialized”会被打印出来。由此可以确定构造函数被执行。 - -由于Person类的新实例被赋值给了reference1变量,所以reference1到Person类的新实例之间建立了一个强引用。正是因为这个强引用,ARC会保证Person实例被保持在内存中不被销毁。 - -如果你将同样的Person实例也赋值给其他两个变量,该实例又会多出两个强引用: - - reference2 = reference1 - reference3 = reference1 - -现在这个Person实例已经有三个强引用了。 - -如果你通过给两个变量赋值nil的方式断开两个强引用(包括最先的那个强引用),只留下一个强引用,Person实例不会被销毁: - - reference2 = reference1 - reference3 = reference1 - -ARC会在第三个,也即最后一个强引用被断开的时候,销毁Person实例,这也意味着你不再使用这个Person实例: - - reference3 = nil - // prints "John Appleseed is being deinitialized" - -## 类实例之间的循环强引用 - -在上面的例子中,ARC会跟踪你所新创建的Person实例的引用数量,并且会在Person实例不再被需要时销毁它。 - -然而,我们可能会写出这样的代码,一个类永远不会有0个强引用。这种情况发生在两个类实例互相保持对方的强引用,并让对方不被销毁。这就是所谓的循环强引用。 - -你可以通过定义类之间的关系为弱引用或者无主引用,以此替代强引用,从而解决循环强引用的问题。具体的过程在[解决类实例之间的循环强引用](http://numbbbbb.github.io/the-swift-programming-language-in-chinese/chapter2/16_Automatic_Reference_Counting.html#1)中有描述。不管怎样,在你学习怎样解决循环强引用之前,很有必要了解一下它是怎样产生的。 - -下面展示了一个不经意产生循环强引用的例子。例子定义了两个类:Person和Apartment,用来建模公寓和它其中的居民: - - class Person { - let name: String - init(name: String) { self.name = name } - var apartment: Apartment? - deinit { println("\(name) is being deinitialized") } - } - - class Apartment { - let number: Int - init(number: Int) { self.number = number } - var tenant: Person? - deinit { println("Apartment #\(number) is being deinitialized") } - } - -每一个Person实例有一个类型为String,名字为name的属性,并有一个可选的初始化为nil的apartment属性。apartment属性是可选的,因为一个人并不总是拥有公寓。 - -类似的,每个Apartment实例有一个叫number,类型为Int的属性,并有一个可选的初始化为nil的tenant属性。tenant属性是可选的,因为一栋公寓并不总是有居民。 - -这两个类都定义了析构函数,用以在类实例被析构的时候输出信息。这让你能够知晓Person和Apartment的实例是否像预期的那样被销毁。 - -接下来的代码片段定义了两个可选类型的变量john和number73,并分别被设定为下面的Apartment和Person的实例。这两个变量都被初始化为nil,并为可选的: - - var john: Person? - var number73: Apartment? - -现在你可以创建特定的Person和Apartment实例并将类实例赋值给john和number73变量: - - john = Person(name: "John Appleseed") - number73 = Apartment(number: 73) - -在两个实例被创建和赋值后,下图表面了强引用的关系。变量john现在有一个指向Person实例的强引用,而变量number73有一个指向Apartment实例的强引用: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/referenceCycle01_2x.png) - -现在你能够将这两个实例关联在一起,这样人就能有公寓住了,而公寓也有了房客。注意感叹号是用来展开和访问可选变量john和number73中的实例,这样实例的属性才能被赋值: - - john!.apartment = number73 - number73!.tenant = john - -在将两个实例联系在一起之后,强引用的关系如图所示: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/referenceCycle02_2x.png) - -不幸的是,将这两个实例关联在一起之后,一个循环强引用被创建了。Person实例现在有了一个指向Apartment实例的强引用,而Apartment实例也有了一个指向Person实例的强引用。因此,当你断开john和number73变量所持有的强引用时,引用计数并不会降为0,实例也不会被ARC销毁: - - john = nil - number73 = nil - -注意,当你把这两个变量设为nil时,没有任何一个析构函数被调用。强引用循环阻止了Person和Apartment类实例的销毁,并在你的应用程序中造成了内存泄漏。 - -在你将john和number73赋值为nil后,强引用关系如下图: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/referenceCycle03_2x.png) - -Person和Apartment实例之间的强引用关系保留了下来并且不会被断开。 - -##解决实例之间的循环强引用 - -Swift提供了两种办法用来解决你在使用类的属性时所遇到的循环强引用问题:弱引用(weak reference)和无主引用(unowned reference)。 - -弱引用和无主引用允许循环引用中的一个实例引用另外一个实例而不保持强引用。这样实例能够互相引用而不产生循环强引用。 - -对于生命周期中会变为nil的实例使用弱引用。相反的,对于初始化赋值后再也不会被赋值为nil的实例,使用无主引用。 - -## 弱引用 - -弱引用不会牢牢保持住引用的实例,并且不会阻止ARC销毁被引用的实例。这种行为阻止了引用变为循环强引用。声明属性或者变量时,在前面加上weak关键字表明这是一个弱引用。 - -在实例的生命周期中,如果某些时候引用没有值,那么弱引用可以阻止循环强引用。如果引用总是有值,则可以使用无主引用,在[无主引用](http://numbbbbb.github.io/the-swift-programming-language-in-chinese/chapter2/16_Automatic_Reference_Counting.html#2)中有描述。在上面Apartment的例子中,一个公寓的生命周期中,有时是没有“居民”的,因此适合使用弱引用来解决循环强引用。 - -> 注意: 弱引用必须被声明为变量,表明其值能在运行时被修改。弱引用不能被声明为常量。 - -因为弱引用可以没有值,你必须将每一个弱引用声明为可选类型。可选类型是在Swift语言中推荐的用来表示可能没有值的类型。 - -因为弱引用不会保持所引用的实例,即使引用存在,实例也有可能被销毁。因此,ARC会在引用的实例被销毁后自动将其赋值为nil。你可以像其他可选值一样,检查弱引用的值是否存在,你永远也不会遇到被销毁了而不存在的实例。 - -下面的例子跟上面Person和Apartment的例子一致,但是有一个重要的区别。这一次,Apartment的tenant属性被声明为弱引用: - - class Person { - let name: String - init(name: String) { self.name = name } - var apartment: Apartment? - deinit { println("\(name) is being deinitialized") } - } - - class Apartment { - let number: Int - init(number: Int) { self.number = number } - weak var tenant: Person? - deinit { println("Apartment #\(number) is being deinitialized") } - } - -然后跟之前一样,建立两个变量(john和number73)之间的强引用,并关联两个实例: - - var john: Person? - var number73: Apartment? - - john = Person(name: "John Appleseed") - number73 = Apartment(number: 73) - - john!.apartment = number73 - number73!.tenant = john - -现在,两个关联在一起的实例的引用关系如下图所示: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/weakReference01_2x.png) - -Person实例依然保持对Apartment实例的强引用,但是Apartment实例只是对Person实例的弱引用。这意味着当你断开john变量所保持的强引用时,再也没有指向Person实例的强引用了: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/weakReference02_2x.png) - -由于再也没有指向Person实例的强引用,该实例会被销毁: - - john = nil - // prints "John Appleseed is being deinitialized" - -唯一剩下的指向Apartment实例的强引用来自于变量number73。如果你断开这个强引用,再也没有指向Apartment实例的强引用了: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/weakReference03_2x.png) - -由于再也没有指向Apartment实例的强引用,该实例也会被销毁: - - number73 = nil - // prints "Apartment #73 is being deinitialized" - -上面的两段代码展示了变量john和number73在被赋值为nil后,Person实例和Apartment实例的析构函数都打印出“销毁”的信息。这证明了引用循环被打破了。 - -##无主引用 - -和弱引用类似,无主引用不会牢牢保持住引用的实例。和弱引用不同的是,无主引用是永远有值的。因此,无主引用总是被定义为非可选类型(non-optional type)。你可以在声明属性或者变量时,在前面加上关键字unowned表示这是一个无主引用。 - -由于无主引用是非可选类型,你不需要在使用它的时候将它展开。无主引用总是可以被直接访问。不过ARC无法在实例被销毁后将无主引用设为nil,因为非可选类型的变量不允许被赋值为nil。 - -> 注意: 如果你试图在实例被销毁后,访问该实例的无主引用,会触发运行时错误。使用无主引用,你必须确保引用始终指向一个未销毁的实例。 - -> 还需要注意的是如果你试图访问实例已经被销毁的无主引用,程序会直接崩溃,而不会发生无法预期的行为。所以你应当避免这样的事情发生。 - -下面的例子定义了两个类,Customer和CreditCard,模拟了银行客户和客户的信用卡。这两个类中,每一个都将另外一个类的实例作为自身的属性。这种关系会潜在的创造循环强引用。 - -Customer和CreditCard之间的关系与前面弱引用例子中Apartment和Person的关系截然不同。在这个数据模型中,一个客户可能有或者没有信用卡,但是一张信用卡总是关联着一个客户。为了表示这种关系,Customer类有一个可选类型的card属性,但是CreditCard类有一个非可选类型的customer属性。 - -此外,只能通过将一个number值和customer实例传递给CreditCard构造函数的方式来创建CreditCard实例。这样可以确保当创建CreditCard实例时总是有一个customer实例与之关联。 - -由于信用卡总是关联着一个客户,因此将customer属性定义为无主引用,用以避免循环强引用: - - class Customer { - let name: String - var card: CreditCard? - init(name: String) { - self.name = name - } - deinit { println("\(name) is being deinitialized") } - } - - class CreditCard { - let number: Int - unowned let customer: Customer - init(number: Int, customer: Customer) { - self.number = number - self.customer = customer - } - deinit { println("Card #\(number) is being deinitialized") } - } - -下面的代码片段定义了一个叫john的可选类型Customer变量,用来保存某个特定客户的引用。由于是可选类型,所以变量被初始化为nil。 - - var john: Customer? - -现在你可以创建Customer类的实例,用它初始化CreditCard实例,并将新创建的CreditCard实例赋值为客户的card属性。 - - john = Customer(name: "John Appleseed") - john!.card = CreditCard(number: 1234_5678_9012_3456, customer: john!) - -在你关联两个实例后,他们的引用关系如下图所示: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/unownedReference01_2x.png) - -Customer实例持有对CreditCard实例的强引用,而CreditCard实例持有对Customer实例的无主引用。 - -由于customer的无主引用,当你断开john变量持有的强引用时,再也没有指向Customer实例的强引用了: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/unownedReference02_2x.png) - -由于再也没有指向Customer实例的强引用,该实例被销毁了。其后,再也没有指向CreditCard实例的强引用,该实例也随之被销毁了: - - john = nil - // prints "John Appleseed is being deinitialized" - // prints "Card #1234567890123456 is being deinitialized" - -最后的代码展示了在john变量被设为nil后Customer实例和CreditCard实例的构造函数都打印出了“销毁”的信息。 - -##无主引用以及显式展开的可选属性 - -上面弱引用和无主引用的例子涵盖了两种常用的需要打破循环强引用的场景。 - -Person和Apartment的例子展示了两个属性的值都允许为nil,并会潜在的产生循环强引用。这种场景最适合用弱引用来解决。 - -Customer和CreditCard的例子展示了一个属性的值允许为nil,而另一个属性的值不允许为nil,并会潜在的产生循环强引用。这种场景最适合通过无主引用来解决。 - -然而,存在着第三种场景,在这种场景中,两个属性都必须有值,并且初始化完成后不能为nil。在这种场景中,需要一个类使用无主属性,而另外一个类使用显示展开的可选属性。 - -这使两个属性在初始化完成后能被直接访问(不需要可选展开),同事避免了循环引用。这一节将为你展示如何建立这种关系。 - -下面的例子定义了两个类,Country和City,每个类将另外一个类的实例保存为属性。在这个模型中,每个国家必须有首都,而每一个城市必须属于一个国家。为了实现这种关系,Country类拥有一个capitalCity属性,而City类有一个country属性: - - class Country { - let name: String - let capitalCity: City! - init(name: String, capitalName: String) { - self.name = name - self.capitalCity = City(name: capitalName, country: self) - } - } - - class City { - let name: String - unowned let country: Country - init(name: String, country: Country) { - self.name = name - self.country = country - } - } - -为了建立两个类的依赖关系,City的构造函数有一个Country实例的参数,并且将实例保存为country属性。 - -Country的构造函数调用了City的构造函数。然而,只有Country的实例完全初始化完后,Country的构造函数才能把self传给City的构造函数。([在两阶段构造函数中有具体描述](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Initialization.html#//apple_ref/doc/uid/TP40014097-CH18-XID_288)) - -为了满足这种需求,通过在类型结尾处加上感叹号(City!)的方式,将Country的capitalCity属性声明为显示展开的可选类型属性。这表示像其他可选类型一样,capitalCity属性的默认值为nil,但是不需要展开他的值就能访问它。([在显示展开的可选类型中有描述](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-XID_436)) - -由于capitalCity默认值为nil,一旦Country的实例在构造函数中给name属性赋值后,整个初始化过程就完成了。这代表一旦name属性被后,Country的构造函数就能引用并传递显式的self。Country的构造函数在赋值capitalCity时,就能将self作为参数传递给City的构造函数。 - -以上的意义在于你可以通过一条语句同时创建Country和City的实例,而不产生循环强引用,并且capitalCity的属性能被直接访问,而不需要通过感叹号来展开它的可选值: - - var country = Country(name: "Canada", capitalName: "Ottawa") - println("\(country.name)'s capital city is called \(country.capitalCity.name)") - // prints "Canada's capital city is called Ottawa" - -在上面的例子中,使用显示展开可选值的意义在于满足了两个类构造函数的需求。capitalCity属性在初始化完成后,能作为非可选值使用同事还避免了循环强引用。 - -##闭包引起的循环强引用 - -前面我们看到了循环强引用环是在两个类实例属性互相保持对方的强引用时产生的,还知道了如何用弱引用和无主引用来打破循环强引用。 - -循环强引用还会发生在当你将一个闭包赋值给类实例的某个属性,并且这个闭包体中又使用了实例。这个闭包体中可能访问了实例的某个属性,例如self.someProperty,或者闭包中调用了实例的某个方法,例如self.someMethod。这两种情况都导致了闭包 “捕获" self,从而产生了循环强引用。 - -循环强引用的产生,是因为闭包和类相似,都是引用类型。当你把一个闭包赋值给某个属性时,你也把一个引用赋值给了这个闭包。实质上,这跟之前的问题是一样的-两个强引用让彼此一直有效。但是,和两个类实例不同,这次一个是类实例,另一个是闭包。 - -Swift提供了一种优雅的方法来解决这个问题,称之为闭包占用列表(closuer capture list)。同样的,在学习如何用闭包占用列表破坏循环强引用之前,先来了解一下循环强引用是如何产生的,这对我们是很有帮助的。 - -下面的例子为你展示了当一个闭包引用了self后是如何产生一个循环强引用的。例子中定义了一个叫HTMLElement的类,用一种简单的模型表示HTML中的一个单独的元素: - - class HTMLElement { - - let name: String - let text: String? - - @lazy var asHTML: () -> String = { - if let text = self.text { - return "<\(self.name)>\(text)" - } else { - return "<\(self.name) />" - } - } - - init(name: String, text: String? = nil) { - self.name = name - self.text = text - } - - deinit { - println("\(name) is being deinitialized") - } - - } - -HTMLElement类定义了一个name属性来表示这个元素的名称,例如代表段落的"p",或者代表换行的"br"。HTMLElement还定义了一个可选属性text,用来设置和展现HTML元素的文本。 - -除了上面的两个属性,HTMLElement还定义了一个lazy属性asHTML。这个属性引用了一个闭包,将name和text组合成HTML字符串片段。该属性是() -> String类型,或者可以理解为“一个没有参数,返回String的函数”。 - -默认情况下,闭包赋值给了asHTML属性,这个闭包返回一个代表HTML标签的字符串。如果text值存在,该标签就包含可选值text;如果text不存在,该标签就不包含文本。对于段落元素,根据text是"some text"还是nil,闭包会返回"`

    some text

    `"或者"`

    `"。 - -可以像实例方法那样去命名、使用asHTML属性。然而,由于asHTML是闭包而不是实例方法,如果你想改变特定元素的HTML处理的话,可以用自定义的闭包来取代默认值。 - -> 注意: asHTML声明为lazy属性,因为只有当元素确实需要处理为HTML输出的字符串时,才需要使用asHTML。也就是说,在默认的闭包中可以使用self,因为只有当初始化完成以及self确实存在后,才能访问lazy属性。 - -HTMLElement类只提供一个构造函数,通过name和text(如果有的话)参数来初始化一个元素。该类也定义了一个析构函数,当HTMLElement实例被销毁时,打印一条消息。 - -下面的代码展示了如何用HTMLElement类创建实例并打印消息。 - - var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world") - println(paragraph!.asHTML()) - // prints"hello, world" - ->注意: 上面的paragraph变量定义为可选HTMLElement,因此我们可以赋值nil给它来演示循环强引用。 - -不幸的是,上面写的HTMLElement类产生了类实例和asHTML默认值的闭包之间的循环强引用。循环强引用如下图所示: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/closureReferenceCycle01_2x.png) - -实例的asHTML属性持有闭包的强引用。但是,闭包在其闭包体内使用了self(引用了self.name和self.text),因此闭包占有了self,这意味着闭包又反过来持有了HTMLElement实例的强引用。这样两个对象就产生了循环强引用。(更多关于闭包占有值的信息,请参考[Capturing Values](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Closures.html#//apple_ref/doc/uid/TP40014097-CH11-XID_129))。 - ->注意: 虽然闭包多次使用了self,它只占有HTMLElement实例的一个强引用。 - -如果设置paragraph变量为nil,打破它持有的HTMLElement实例的强引用,HTMLElement实例和它的闭包都不会被销毁,也是因为循环强引用: - - paragraph = nil - -注意HTMLElementdeinitializer中的消息并没有别打印,证明了HTMLElement实例并没有被销毁。 - -##解决闭包引起的循环强引用 - -在定义闭包时同时定义占有列表作为闭包的一部分,通过这种方式可以解决闭包和类实例之间的循环强引用。占有列表定义了闭包体内占有一个或者多个引用类型的规则。跟解决两个类实例间的循环强引用一样,声明每个占有的引用为弱引用或无主引用,而不是强引用。应当根据代码关系来决定使用弱引用还是无主引用。 - ->注意: Swift有如下要求:只要在闭包内使用self的成员,就要用self.someProperty或者self.someMethod(而不只是someProperty或someMethod)。这提醒你可能会不小心就占有了self。 - -##定义占有列表 - -占有列表中的每个元素都是由weak或者unowned关键字和实例的引用(如self或someInstance)成对组成。每一对都在花括号中,通过逗号分开。 - -占有列表放置在闭包参数列表和返回类型之前: - - @lazy var someClosure: (Int, String) -> String = { - [unowned self] (index: Int, stringToProcess: String) -> String in - // closure body goes here - } - -如果闭包没有指定参数列表或者返回类型,则可以通过上下文推断,那么可以占有列表放在闭包开始的地方,跟着是关键字in: - - @lazy var someClosure: () -> String = { - [unowned self] in - // closure body goes here - } - -##弱引用和无主引用 - -当闭包和占有的实例总是互相引用时并且总是同时销毁时,将闭包内的占有定义为无主引用。 - -相反的,当占有引用有时可能会是nil时,将闭包内的占有定义为弱引用。弱引用总是可选类型,并且当引用的实例被销毁后,弱引用的值会自动置为nil。这使我们可以在闭包内检查他们是否存在。 - ->注意: 如果占有的引用绝对不会置为nil,应该用无主引用,而不是弱引用。 - -前面的HTMLElement例子中,无主引用是正确的解决循环强引用的方法。这样这样编写HTMLElement类来避免循环强引用: - - class HTMLElement { - - let name: String - let text: String? - - @lazy var asHTML: () -> String = { - [unowned self] in - if let text = self.text { - return "<\(self.name)>\(text)" - } else { - return "<\(self.name) />" - } - } - - init(name: String, text: String? = nil) { - self.name = name - self.text = text - } - - deinit { - println("\(name) is being deinitialized") - } - - } - -上面的HTMLElement实现和之前的实现一致,只是在asHTML闭包中多了一个占有列表。这里,占有列表是[unowned self],表示“用无主引用而不是强引用来占有self”。 - -和之前一样,我们可以创建并打印HTMLElement实例: - - var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world") - println(paragraph!.asHTML()) - // prints "

    hello, world

    " - -使用占有列表后引用关系如下图所示: - -![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/closureReferenceCycle02_2x.png) - -这一次,闭包以无主引用的形式占有self,并不会持有HTMLElement实例的强引用。如果将paragraph赋值为nil,HTMLElement实例将会被销毁,并能看到它的析构函数打印出的消息。 - - paragraph = nil - // prints "p is being deinitialized" +> 翻译:[TimothyYe](https://github.com/TimothyYe) +> 校对:[Hawstein](https://github.com/Hawstein) + +# 自动引用计数 +----------------- + +本页包含内容: + +- [自动引用计数的工作机制](#how_arc_works) +- [自动引用计数实践](#arc_in_action) +- [类实例之间的循环强引用](#strong_reference_cycles_between_class_instances) +- [解决实例之间的循环强引用](#resolving_strong_reference_cycles_between_class_instances) +- [闭包引起的循环强引用](#strong_reference_cycles_for_closures) +- [解决闭包引起的循环强引用](#resolving_strong_reference_cycles_for_closures) + +Swift 使用自动引用计数(ARC)这一机制来跟踪和管理你的应用程序的内存。通常情况下,Swift 的内存管理机制会一直起着作用,你无须自己来考虑内存的管理。ARC 会在类的实例不再被使用时,自动释放其占用的内存。 + +然而,在少数情况下,ARC 为了能帮助你管理内存,需要更多的关于你的代码之间关系的信息。本章描述了这些情况,并且为你示范怎样启用 ARC 来管理你的应用程序的内存。 + +> 注意: +引用计数仅仅应用于类的实例。结构体和枚举类型是值类型,不是引用类型,也不是通过引用的方式存储和传递。 + + +## 自动引用计数的工作机制 + +当你每次创建一个类的新的实例的时候,ARC 会分配一大块内存用来储存实例的信息。内存中会包含实例的类型信息,以及这个实例所有相关属性的值。此外,当实例不再被使用时,ARC 释放实例所占用的内存,并让释放的内存能挪作他用。这确保了不再被使用的实例,不会一直占用内存空间。 + +然而,当 ARC 收回和释放了正在被使用中的实例,该实例的属性和方法将不能再被访问和调用。实际上,如果你试图访问这个实例,你的应用程序很可能会崩溃。 + +为了确保使用中的实例不会被销毁,ARC 会跟踪和计算每一个实例正在被多少属性,常量和变量所引用。哪怕实例的引用数为一,ARC都不会销毁这个实例。 + +为了使之成为可能,无论你将实例赋值给属性,常量或者是变量,属性,常量或者变量,都会对此实例创建强引用。之所以称之为强引用,是因为它会将实例牢牢的保持住,只要强引用还在,实例是不允许被销毁的。 + + +## 自动引用计数实践 + +下面的例子展示了自动引用计数的工作机制。例子以一个简单的`Person`类开始,并定义了一个叫`name`的常量属性: + +```swift +class Person { + let name: String + init(name: String) { + self.name = name + println("\(name) is being initialized") + } + deinit { + println("\(name) is being deinitialized") + } +} +``` + +`Person`类有一个构造函数,此构造函数为实例的`name`属性赋值并打印出信息,以表明初始化过程生效。`Person`类同时也拥有析构函数,同样会在实例被销毁的时候打印出信息。 + +接下来的代码片段定义了三个类型为`Person?`的变量,用来按照代码片段中的顺序,为新的`Person`实例建立多个引用。由于这些变量是被定义为可选类型(Person?,而不是Person),它们的值会被自动初始化为`nil`,目前还不会引用到`Person`类的实例。 + +```swift +var reference1: Person? +var reference2: Person? +var reference3: Person? +``` + +现在你可以创建`Person`类的新实例,并且将它赋值给三个变量其中的一个: + +```swift +reference1 = Person(name: "John Appleseed") +// prints "John Appleseed is being initialized” +``` + +应当注意到当你调用`Person`类的构造函数的时候,"John Appleseed is being initialized”会被打印出来。由此可以确定构造函数被执行。 + +由于`Person`类的新实例被赋值给了`reference1`变量,所以`reference1`到`Person`类的新实例之间建立了一个强引用。正是因为这个强引用,ARC 会保证`Person`实例被保持在内存中不被销毁。 + +如果你将同样的`Person`实例也赋值给其他两个变量,该实例又会多出两个强引用: + +```swift +reference2 = reference1 +reference3 = reference1 +``` + +现在这个`Person`实例已经有三个强引用了。 + +如果你通过给两个变量赋值`nil`的方式断开两个强引用()包括最先的那个强引用),只留下一个强引用,`Person`实例不会被销毁: + +```swift +reference2 = nil +reference3 = nil +``` + +ARC 会在第三个,也即最后一个强引用被断开的时候,销毁`Person`实例,这也意味着你不再使用这个`Person`实例: + +```swift +reference3 = nil +// prints "John Appleseed is being deinitialized" +``` + + +## 类实例之间的循环强引用 + +在上面的例子中,ARC 会跟踪你所新创建的`Person`实例的引用数量,并且会在`Person`实例不再被需要时销毁它。 + +然而,我们可能会写出这样的代码,一个类永远不会有0个强引用。这种情况发生在两个类实例互相保持对方的强引用,并让对方不被销毁。这就是所谓的循环强引用。 + +你可以通过定义类之间的关系为弱引用或者无主引用,以此替代强引用,从而解决循环强引用的问题。具体的过程在[解决类实例之间的循环强引用](#resolving_strong_reference_cycles_between_class_instances)中有描述。不管怎样,在你学习怎样解决循环强引用之前,很有必要了解一下它是怎样产生的。 + +下面展示了一个不经意产生循环强引用的例子。例子定义了两个类:`Person`和`Apartment`,用来建模公寓和它其中的居民: + +```swift +class Person { + let name: String + init(name: String) { self.name = name } + var apartment: Apartment? + deinit { println("\(name) is being deinitialized") } +} +``` + +```swift +class Apartment { + let number: Int + init(number: Int) { self.number = number } + var tenant: Person? + deinit { println("Apartment #\(number) is being deinitialized") } +} +``` + +每一个`Person`实例有一个类型为`String`,名字为`name`的属性,并有一个可选的初始化为`nil`的`apartment`属性。`apartment`属性是可选的,因为一个人并不总是拥有公寓。 + +类似的,每个`Apartment`实例有一个叫`number`,类型为`Int`的属性,并有一个可选的初始化为`nil`的`tenant`属性。`tenant`属性是可选的,因为一栋公寓并不总是有居民。 + +这两个类都定义了析构函数,用以在类实例被析构的时候输出信息。这让你能够知晓`Person`和`Apartment`的实例是否像预期的那样被销毁。 + +接下来的代码片段定义了两个可选类型的变量`john`和`number73`,并分别被设定为下面的`Apartment`和`Person`的实例。这两个变量都被初始化为`nil`,并为可选的: + +```swift +var john: Person? +var number73: Apartment? +``` + +现在你可以创建特定的`Person`和`Apartment`实例并将类实例赋值给`john`和`number73`变量: + +```swift +john = Person(name: "John Appleseed") +number73 = Apartment(number: 73) +``` + +在两个实例被创建和赋值后,下图表现了强引用的关系。变量`john`现在有一个指向`Person`实例的强引用,而变量`number73`有一个指向`Apartment`实例的强引用: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/referenceCycle01_2x.png) + +现在你能够将这两个实例关联在一起,这样人就能有公寓住了,而公寓也有了房客。注意感叹号是用来展开和访问可选变量`john`和`number73`中的实例,这样实例的属性才能被赋值: + +```swift +john!.apartment = number73 +number73!.tenant = john +``` + +在将两个实例联系在一起之后,强引用的关系如图所示: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/referenceCycle02_2x.png) + +不幸的是,将这两个实例关联在一起之后,一个循环强引用被创建了。`Person`实例现在有了一个指向`Apartment`实例的强引用,而`Apartment`实例也有了一个指向`Person`实例的强引用。因此,当你断开`john`和`number73`变量所持有的强引用时,引用计数并不会降为 0,实例也不会被 ARC 销毁: + +```swift +john = nil +number73 = nil +``` + +注意,当你把这两个变量设为`nil`时,没有任何一个析构函数被调用。强引用循环阻止了`Person`和`Apartment`类实例的销毁,并在你的应用程序中造成了内存泄漏。 + +在你将`john`和`number73`赋值为`nil`后,强引用关系如下图: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/referenceCycle03_2x.png) + +`Person`和`Apartment`实例之间的强引用关系保留了下来并且不会被断开。 + + +## 解决实例之间的循环强引用 + +Swift 提供了两种办法用来解决你在使用类的属性时所遇到的循环强引用问题:弱引用(weak reference)和无主引用(unowned reference)。 + +弱引用和无主引用允许循环引用中的一个实例引用另外一个实例而不保持强引用。这样实例能够互相引用而不产生循环强引用。 + +对于生命周期中会变为`nil`的实例使用弱引用。相反的,对于初始化赋值后再也不会被赋值为`nil`的实例,使用无主引用。 + +### 弱引用 + +弱引用不会牢牢保持住引用的实例,并且不会阻止 ARC 销毁被引用的实例。这种行为阻止了引用变为循环强引用。声明属性或者变量时,在前面加上`weak`关键字表明这是一个弱引用。 + +在实例的生命周期中,如果某些时候引用没有值,那么弱引用可以阻止循环强引用。如果引用总是有值,则可以使用无主引用,在[无主引用](#2)中有描述。在上面`Apartment`的例子中,一个公寓的生命周期中,有时是没有“居民”的,因此适合使用弱引用来解决循环强引用。 + +> 注意: +> 弱引用必须被声明为变量,表明其值能在运行时被修改。弱引用不能被声明为常量。 + +因为弱引用可以没有值,你必须将每一个弱引用声明为可选类型。可选类型是在 Swift 语言中推荐的用来表示可能没有值的类型。 + +因为弱引用不会保持所引用的实例,即使引用存在,实例也有可能被销毁。因此,ARC 会在引用的实例被销毁后自动将其赋值为`nil`。你可以像其他可选值一样,检查弱引用的值是否存在,你永远也不会遇到被销毁了而不存在的实例。 + +下面的例子跟上面`Person`和`Apartment`的例子一致,但是有一个重要的区别。这一次,`Apartment`的`tenant`属性被声明为弱引用: + +```swift +class Person { + let name: String + init(name: String) { self.name = name } + var apartment: Apartment? + deinit { println("\(name) is being deinitialized") } +} +``` + +```swift +class Apartment { + let number: Int + init(number: Int) { self.number = number } + weak var tenant: Person? + deinit { println("Apartment #\(number) is being deinitialized") } +} +``` + +然后跟之前一样,建立两个变量(john和number73)之间的强引用,并关联两个实例: + +```swift +var john: Person? +var number73: Apartment? + +john = Person(name: "John Appleseed") +number73 = Apartment(number: 73) + +john!.apartment = number73 +number73!.tenant = john +``` + +现在,两个关联在一起的实例的引用关系如下图所示: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/weakReference01_2x.png) + +`Person`实例依然保持对`Apartment`实例的强引用,但是`Apartment`实例只是对`Person`实例的弱引用。这意味着当你断开`john`变量所保持的强引用时,再也没有指向`Person`实例的强引用了: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/weakReference02_2x.png) + +由于再也没有指向`Person`实例的强引用,该实例会被销毁: + +```swift +john = nil +// prints "John Appleseed is being deinitialized" +``` + +唯一剩下的指向`Apartment`实例的强引用来自于变量`number73`。如果你断开这个强引用,再也没有指向`Apartment`实例的强引用了: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/weakReference03_2x.png) + +由于再也没有指向`Apartment`实例的强引用,该实例也会被销毁: + +```swift +number73 = nil +// prints "Apartment #73 is being deinitialized" +``` + +上面的两段代码展示了变量`john`和`number73`在被赋值为`nil`后,`Person`实例和`Apartment`实例的析构函数都打印出“销毁”的信息。这证明了引用循环被打破了。 + + +### 无主引用 + +和弱引用类似,无主引用不会牢牢保持住引用的实例。和弱引用不同的是,无主引用是永远有值的。因此,无主引用总是被定义为非可选类型(non-optional type)。你可以在声明属性或者变量时,在前面加上关键字`unowned`表示这是一个无主引用。 + +由于无主引用是非可选类型,你不需要在使用它的时候将它展开。无主引用总是可以被直接访问。不过 ARC 无法在实例被销毁后将无主引用设为`nil`,因为非可选类型的变量不允许被赋值为`nil`。 + +> 注意: +>如果你试图在实例被销毁后,访问该实例的无主引用,会触发运行时错误。使用无主引用,你必须确保引用始终指向一个未销毁的实例。 +> 还需要注意的是如果你试图访问实例已经被销毁的无主引用,程序会直接崩溃,而不会发生无法预期的行为。所以你应当避免这样的事情发生。 + +下面的例子定义了两个类,`Customer`和`CreditCard`,模拟了银行客户和客户的信用卡。这两个类中,每一个都将另外一个类的实例作为自身的属性。这种关系会潜在的创造循环强引用。 + +`Customer`和`CreditCard`之间的关系与前面弱引用例子中`Apartment`和`Person`的关系截然不同。在这个数据模型中,一个客户可能有或者没有信用卡,但是一张信用卡总是关联着一个客户。为了表示这种关系,`Customer`类有一个可选类型的`card`属性,但是`CreditCard`类有一个非可选类型的`customer`属性。 + +此外,只能通过将一个`number`值和`customer`实例传递给`CreditCard`构造函数的方式来创建`CreditCard`实例。这样可以确保当创建`CreditCard`实例时总是有一个`customer`实例与之关联。 + +由于信用卡总是关联着一个客户,因此将`customer`属性定义为无主引用,用以避免循环强引用: + +```swift +class Customer { + let name: String + var card: CreditCard? + init(name: String) { + self.name = name + } + deinit { println("\(name) is being deinitialized") } +} +``` + +```swift +class CreditCard { + let number: Int + unowned let customer: Customer + init(number: Int, customer: Customer) { + self.number = number + self.customer = customer + } + deinit { println("Card #\(number) is being deinitialized") } +} +``` + +下面的代码片段定义了一个叫`john`的可选类型`Customer`变量,用来保存某个特定客户的引用。由于是可选类型,所以变量被初始化为`nil`。 + +```swift +var john: Customer? +``` + +现在你可以创建`Customer`类的实例,用它初始化`CreditCard`实例,并将新创建的`CreditCard`实例赋值为客户的`card`属性。 + +```swift +john = Customer(name: "John Appleseed") +john!.card = CreditCard(number: 1234_5678_9012_3456, customer: john!) +``` + +在你关联两个实例后,它们的引用关系如下图所示: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/unownedReference01_2x.png) + +`Customer`实例持有对`CreditCard`实例的强引用,而`CreditCard`实例持有对`Customer`实例的无主引用。 + +由于`customer`的无主引用,当你断开`john`变量持有的强引用时,再也没有指向`Customer`实例的强引用了: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/unownedReference02_2x.png) + +由于再也没有指向`Customer`实例的强引用,该实例被销毁了。其后,再也没有指向`CreditCard`实例的强引用,该实例也随之被销毁了: + +```swift +john = nil +// prints "John Appleseed is being deinitialized" +// prints "Card #1234567890123456 is being deinitialized" +``` + +最后的代码展示了在`john`变量被设为`nil`后`Customer`实例和`CreditCard`实例的构造函数都打印出了“销毁”的信息。 + +###无主引用以及隐式解析可选属性 + +上面弱引用和无主引用的例子涵盖了两种常用的需要打破循环强引用的场景。 + +`Person`和`Apartment`的例子展示了两个属性的值都允许为`nil`,并会潜在的产生循环强引用。这种场景最适合用弱引用来解决。 + +`Customer`和`CreditCard`的例子展示了一个属性的值允许为`nil`,而另一个属性的值不允许为`nil`,并会潜在的产生循环强引用。这种场景最适合通过无主引用来解决。 + +然而,存在着第三种场景,在这种场景中,两个属性都必须有值,并且初始化完成后不能为`nil`。在这种场景中,需要一个类使用无主属性,而另外一个类使用隐式解析可选属性。 + +这使两个属性在初始化完成后能被直接访问(不需要可选展开),同时避免了循环引用。这一节将为你展示如何建立这种关系。 + +下面的例子定义了两个类,`Country`和`City`,每个类将另外一个类的实例保存为属性。在这个模型中,每个国家必须有首都,而每一个城市必须属于一个国家。为了实现这种关系,`Country`类拥有一个`capitalCity`属性,而`City`类有一个`country`属性: + +```swift +class Country { + let name: String + let capitalCity: City! + init(name: String, capitalName: String) { + self.name = name + self.capitalCity = City(name: capitalName, country: self) + } +} +``` + +```swift +class City { + let name: String + unowned let country: Country + init(name: String, country: Country) { + self.name = name + self.country = country + } +} +``` + +为了建立两个类的依赖关系,`City`的构造函数有一个`Country`实例的参数,并且将实例保存为`country`属性。 + +`Country`的构造函数调用了`City`的构造函数。然而,只有`Country`的实例完全初始化完后,`Country`的构造函数才能把`self`传给`City`的构造函数。([在两段式构造过程中有具体描述](14_Initialization.html)) + +为了满足这种需求,通过在类型结尾处加上感叹号(City!)的方式,将`Country`的`capitalCity`属性声明为隐式解析可选类型的属性。这表示像其他可选类型一样,`capitalCity`属性的默认值为`nil`,但是不需要展开它的值就能访问它。([在隐式解析可选类型中有描述](01_The_Basics.html)) + +由于`capitalCity`默认值为`nil`,一旦`Country`的实例在构造函数中给`name`属性赋值后,整个初始化过程就完成了。这代表一旦`name`属性被赋值后,`Country`的构造函数就能引用并传递隐式的`self`。`Country`的构造函数在赋值`capitalCity`时,就能将`self`作为参数传递给`City`的构造函数。 + +以上的意义在于你可以通过一条语句同时创建`Country`和`City`的实例,而不产生循环强引用,并且`capitalCity`的属性能被直接访问,而不需要通过感叹号来展开它的可选值: + +```swift +var country = Country(name: "Canada", capitalName: "Ottawa") +println("\(country.name)'s capital city is called \(country.capitalCity.name)") +// prints "Canada's capital city is called Ottawa" +``` + +在上面的例子中,使用隐式解析可选值的意义在于满足了两个类构造函数的需求。`capitalCity`属性在初始化完成后,能像非可选值一样使用和存取同时还避免了循环强引用。 + + +##闭包引起的循环强引用 + +前面我们看到了循环强引用环是在两个类实例属性互相保持对方的强引用时产生的,还知道了如何用弱引用和无主引用来打破循环强引用。 + +循环强引用还会发生在当你将一个闭包赋值给类实例的某个属性,并且这个闭包体中又使用了实例。这个闭包体中可能访问了实例的某个属性,例如`self.someProperty`,或者闭包中调用了实例的某个方法,例如`self.someMethod`。这两种情况都导致了闭包 “捕获" `self`,从而产生了循环强引用。 + +循环强引用的产生,是因为闭包和类相似,都是引用类型。当你把一个闭包赋值给某个属性时,你也把一个引用赋值给了这个闭包。实质上,这跟之前的问题是一样的-两个强引用让彼此一直有效。但是,和两个类实例不同,这次一个是类实例,另一个是闭包。 + +Swift 提供了一种优雅的方法来解决这个问题,称之为闭包占用列表(closuer capture list)。同样的,在学习如何用闭包占用列表破坏循环强引用之前,先来了解一下循环强引用是如何产生的,这对我们是很有帮助的。 + +下面的例子为你展示了当一个闭包引用了`self`后是如何产生一个循环强引用的。例子中定义了一个叫`HTMLElement`的类,用一种简单的模型表示 HTML 中的一个单独的元素: + +```swift +class HTMLElement { + + let name: String + let text: String? + + @lazy var asHTML: () -> String = { + if let text = self.text { + return "<\(self.name)>\(text)" + } else { + return "<\(self.name) />" + } + } + + init(name: String, text: String? = nil) { + self.name = name + self.text = text + } + + deinit { + println("\(name) is being deinitialized") + } + +} +``` + +`HTMLElement`类定义了一个`name`属性来表示这个元素的名称,例如代表段落的"p",或者代表换行的"br"。`HTMLElement`还定义了一个可选属性`text`,用来设置和展现 HTML 元素的文本。 + +除了上面的两个属性,`HTMLElement`还定义了一个`lazy`属性`asHTML`。这个属性引用了一个闭包,将`name`和`text`组合成 HTML 字符串片段。该属性是`() -> String`类型,或者可以理解为“一个没有参数,返回`String`的函数”。 + +默认情况下,闭包赋值给了`asHTML`属性,这个闭包返回一个代表 HTML 标签的字符串。如果`text`值存在,该标签就包含可选值`text`;如果`text`不存在,该标签就不包含文本。对于段落元素,根据`text`是"some text"还是`nil`,闭包会返回"`

    some text

    `"或者"`

    `"。 + +可以像实例方法那样去命名、使用`asHTML`属性。然而,由于`asHTML`是闭包而不是实例方法,如果你想改变特定元素的 HTML 处理的话,可以用自定义的闭包来取代默认值。 + +> 注意: +`asHTML`声明为`lazy`属性,因为只有当元素确实需要处理为HTML输出的字符串时,才需要使用`asHTML`。也就是说,在默认的闭包中可以使用`self`,因为只有当初始化完成以及`self`确实存在后,才能访问`lazy`属性。 + +`HTMLElement`类只提供一个构造函数,通过`name`和`text`(如果有的话)参数来初始化一个元素。该类也定义了一个析构函数,当`HTMLElement`实例被销毁时,打印一条消息。 + +下面的代码展示了如何用`HTMLElement`类创建实例并打印消息。 + +```swift +var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world") +println(paragraph!.asHTML()) +// prints"hello, world" +``` + +>注意: +上面的`paragraph`变量定义为`可选HTMLElement`,因此我们可以赋值`nil`给它来演示循环强引用。 + +不幸的是,上面写的`HTMLElement`类产生了类实例和`asHTML`默认值的闭包之间的循环强引用。循环强引用如下图所示: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/closureReferenceCycle01_2x.png) + +实例的`asHTML`属性持有闭包的强引用。但是,闭包在其闭包体内使用了`self`(引用了`self.name`和`self.text`),因此闭包捕获了`self`,这意味着闭包又反过来持有了`HTMLElement`实例的强引用。这样两个对象就产生了循环强引用。(更多关于闭包捕获值的信息,请参考[值捕获](07_Closures.html))。 + +>注意: +虽然闭包多次使用了`self`,它只捕获`HTMLElement`实例的一个强引用。 + +如果设置`paragraph`变量为`nil`,打破它持有的`HTMLElement`实例的强引用,`HTMLElement`实例和它的闭包都不会被销毁,也是因为循环强引用: + +```swift +paragraph = nil +``` + +注意`HTMLElementdeinitializer`中的消息并没有别打印,证明了`HTMLElement`实例并没有被销毁。 + + +##解决闭包引起的循环强引用 + +在定义闭包时同时定义捕获列表作为闭包的一部分,通过这种方式可以解决闭包和类实例之间的循环强引用。捕获列表定义了闭包体内捕获一个或者多个引用类型的规则。跟解决两个类实例间的循环强引用一样,声明每个捕获的引用为弱引用或无主引用,而不是强引用。应当根据代码关系来决定使用弱引用还是无主引用。 + +>注意: +Swift 有如下要求:只要在闭包内使用`self`的成员,就要用`self.someProperty`或者`self.someMethod`(而不只是`someProperty`或`someMethod`)。这提醒你可能会不小心就捕获了`self`。 + +###定义捕获列表 + +捕获列表中的每个元素都是由`weak`或者`unowned`关键字和实例的引用(如`self`或`someInstance`)成对组成。每一对都在方括号中,通过逗号分开。 + +捕获列表放置在闭包参数列表和返回类型之前: + +```swift +@lazy var someClosure: (Int, String) -> String = { + [unowned self] (index: Int, stringToProcess: String) -> String in + // closure body goes here +} +``` + +如果闭包没有指定参数列表或者返回类型,则可以通过上下文推断,那么可以捕获列表放在闭包开始的地方,跟着是关键字`in`: + +```swift +@lazy var someClosure: () -> String = { + [unowned self] in + // closure body goes here +} +``` + +###弱引用和无主引用 + +当闭包和捕获的实例总是互相引用时并且总是同时销毁时,将闭包内的捕获定义为无主引用。 + +相反的,当捕获引用有时可能会是`nil`时,将闭包内的捕获定义为弱引用。弱引用总是可选类型,并且当引用的实例被销毁后,弱引用的值会自动置为`nil`。这使我们可以在闭包内检查它们是否存在。 + +>注意: +如果捕获的引用绝对不会置为`nil`,应该用无主引用,而不是弱引用。 + +前面的`HTMLElement`例子中,无主引用是正确的解决循环强引用的方法。这样编写`HTMLElement`类来避免循环强引用: + +```swift +class HTMLElement { + + let name: String + let text: String? + + @lazy var asHTML: () -> String = { + [unowned self] in + if let text = self.text { + return "<\(self.name)>\(text)" + } else { + return "<\(self.name) />" + } + } + + init(name: String, text: String? = nil) { + self.name = name + self.text = text + } + + deinit { + println("\(name) is being deinitialized") + } + +} +``` + +上面的`HTMLElement`实现和之前的实现一致,只是在`asHTML`闭包中多了一个捕获列表。这里,捕获列表是`[unowned self]`,表示“用无主引用而不是强引用来捕获`self`”。 + +和之前一样,我们可以创建并打印`HTMLElement`实例: + +```swift +var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world") +println(paragraph!.asHTML()) +// prints "

    hello, world

    " +``` + +使用捕获列表后引用关系如下图所示: + +![](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/closureReferenceCycle02_2x.png) + +这一次,闭包以无主引用的形式捕获`self`,并不会持有`HTMLElement`实例的强引用。如果将`paragraph`赋值为`nil`,`HTMLElement`实例将会被销毁,并能看到它的析构函数打印出的消息。 + +```swift +paragraph = nil +// prints "p is being deinitialized" +``` + diff --git a/source/chapter2/17_Optional_Chaining.md b/source/chapter2/17_Optional_Chaining.md old mode 100644 new mode 100755 index 1fc7100b..2e6f1cfe --- a/source/chapter2/17_Optional_Chaining.md +++ b/source/chapter2/17_Optional_Chaining.md @@ -1,270 +1,321 @@ -#Optional Chaining - -可选链(Optional Chaining)是一种可以请求和调用属性、方法及子脚本的过程,它的自判断性体现于请求或调用的目标当前可能为空(`nil`)。如果自判断的目标有值,那么调用就会成功;相反,如果选择的目标为空(`nil`),则这种调用将返回空(`nil`)。多次请求或调用可以被链接在一起形成一个链,如果任何一个节点为空(`nil`)将导致整个链失效。 - -> 笔记: -`Swift`的自判断链和Objective-C中的消息为空有些相像,但是`Swift`可以使用在任意类型中,并且失败与否可以被检测到。 - -## 可选链可替代强制解析 - -通过在想调用的属性、方法、或子脚本的自判断值(`optional value`)(非空)后面放一个问号,可以定义一个可选链。这一点很像在自判断值后面放一个声明符号来强制拆得其封包内的值。他们的主要的区别在于当自判断值为空时可选链即刻失败,然而一般的强制解析将会引发运行时错误。 - -为了反映可选链可以调用空(`nil`),不论你调用的属性、方法、子脚本等返回的值是不是自判断值,它的返回结果都是一个自判断值。你可以利用这个返回值来检测你的可选链是否调用成功,有返回值即成功,返回nil则失败。 - -调用可选链的返回结果与原本的返回结果具有相同的类型,但是原本的返回结果被包装成了一个自判断值,当可选链调用成功时,一个应该返回`Int`的属性将会返回`Int?`。 - -下面几段代码将解释可选链和强制解析的不同。 - -首先定义两个类`Person`和`Residence`。 - - class Person { - var residence: Residence? - } - - class Residence { - var numberOfRooms = 1 - } - -`Residence`具有一个`Int`类型的`numberOfRooms`,其值为1。`Person`具有一个自判断`residence`属性,它的类型是`Residence?`。 - -如果你创建一个新的Person实例,它的residence属性由于是被定义为自判断型的,此属性将默认初始化为空: - - let john = Person() - -如果你想使用声明符!强制解析获得这个人`residence`属性`numberOfRooms`属性值,将会引发运行时错误,因为这时没有可以供解析的`residence`值。 - - let roomCount = john.residence!.numberOfRooms - // this triggers a runtime error” - //将导致运行时错误 -当`john.residence`不是`nil`时,会运行通过,且会将`roomCount` 设置为一个`int`类型的合理值。然而,如上所述,当`residence`为空时,这个代码将会导致运行时错误。 - -可选链提供了一种另一种获得numberOfRooms的方法。利用可选链,使用问号来代替原来`!`的位置: - - if let roomCount = john.residence?.numberOfRooms { - println("John's residence has \(roomCount) room(s).") - } else { - println("Unable to retrieve the number of rooms.") - } - // 打印 "Unable to retrieve the number of rooms. - - -这告诉Swift来链接自判断`residence?`属性,如果`residence`存在则取回`numberOfRooms`的值。 - -因为这种尝试获得`numberOfRooms`的操作有可能失败,可选链会返回`Int?`类型值,或者称作“自判断`Int`”。当`residence`是空的时候(上例),选择`Int`将会为空,因此会出先无法访问`numberOfRooms`的情况。 - -要注意的是,即使numberOfRooms是非自判断`Int`(`Int?`)时这一点也成立。只要是通过可选链的请求就意味着最后`numberOfRooms`总是返回一个`Int?`而不是`Int`。 - -你可以自己定义一个`Residence`实例给`john.residence`,这样它就不再为空了: - - john.residence = Residence() - -`john.residence` 现在有了实际存在的实例而不是nil了。如果你想使用和前面一样的可选链来获得`numberOfRoooms`,它将返回一个包含默认值1的`Int?`: - - if let roomCount = john.residence?.numberOfRooms { - println("John's residence has \(roomCount) room(s).") - } else { - println("Unable to retrieve the number of rooms.") - } - // 打印 "John's residence has 1 room(s)"。 - - -##为可选链定义模型类 - -你可以使用可选链来多层调用属性,方法,和子脚本。这让你可以利用它们之间的复杂模型来获取更底层的属性,并检查是否可以成功获取此类底层属性。 - -后面的代码定义了四个将在后面使用的模型类,其中包括多层可选链。这些类是由上面的`Person`和`Residence`模型通过添加一个`Room`和一个`Address`类拓展来。 - -`Person`类定义与之前相同。 - - class Person { - var residence: Residence? - } - -`Residence`类比之前复杂些。这次,它定义了一个变量 `rooms`,它被初始化为一个`Room[]`类型的空数组: - - class Residence { - var rooms = Room[]() - var numberOfRooms: Int { - return rooms.count - } - subscript(i: Int) -> Room { - return rooms[i] - } - func printNumberOfRooms() { - println("The number of rooms is \(numberOfRooms)") - } - var address: Address? - } - -因为`Residence`存储了一个`Room`实例的数组,它的`numberOfRooms`属性值不是一个固定的存储值,而是通过计算而来的。`numberOfRooms`属性值是由返回`rooms`数组的`count`属性值得到的。 - -为了能快速访问`rooms`数组,`Residence`定义了一个只读的子脚本,通过插入数组的元素角标就可以成功调用。如果该角标存在,子脚本则将该元素返回。 - -`Residence`中也提供了一个`printNumberOfRooms`的方法,即简单的打印房间个数。 - -最后,`Residence`定义了一个自判断属性叫`address`(`address?`)。`Address`类的属性将在后面定义。 -用于`rooms`数组的`Room`类是一个很简单的类,它只有一个`name`属性和一个设定`room`名的初始化器。 - - class Room { - let name: String - init(name: String) { self.name = name } - } - - -这个模型中的最终类叫做`Address`。它有三个自判断属性他们额类型是`String?`。前面两个自判断属性`buildingName`和 `buildingNumber`作为地址的一部分,是定义某个建筑物的两种方式。第三个属性`street`,用于命名地址的街道名: - - class Address { - var buildingName: String? - var buildingNumber: String? - var street: String? - func buildingIdentifier() -> String? { - if buildingName { - return buildingName - } else if buildingNumber { - return buildingNumber - } else { - return nil - } - } - } - -`Address`类还提供了一个`buildingIdentifier`的方法,它的返回值类型为`String?`。这个方法检查`buildingName`和`buildingNumber`的属性,如果`buildingName`有值则将其返回,或者如果`buildingNumber`有值则将其返回,再或如果没有一个属性有值,返回空。 - -##通过可选链调用属性 - -正如上面“ [可选链可替代强制解析]()”中所述,你可以利用可选链的自判断值获取属性,并且检查属性是否获取成功。然而,你不能使用可选链为属性赋值。 - -使用上述定义的类来创建一个人实例,并再次尝试后去它的`numberOfRooms`属性: - - let john = Person() - if let roomCount = john.residence?.numberOfRooms { - println("John's residence has \(roomCount) room(s).") - } else { - println("Unable to retrieve the number of rooms.") - } - // 打印 "Unable to retrieve the number of rooms。 - -由于`john.residence`是空,所以这个可选链和之前一样失败了,但是没有运行时错误。 - -##通过可选链调用方法 - -你可以使用可选链的来调用自判断值的方法并检查方法调用是否成功。即使这个方法没有返回值,你依然可以使用可选链来达成这一目的。 - -Residence的printNumberOfRooms方法会打印numberOfRooms的当前值。方法如下: - - func printNumberOfRooms(){ - println(“The number of rooms is \(numberOfRooms)”) - } - -这个方法没有返回值。但是,没有返回值类型的函数和方法有一个隐式的返回值类型`Void`(参见Function Without Return Values)。 - -如果你利用可选链调用此方法,这个方法的返回值类型将是`Void?`,而不是`Void`,因为当通过可选链调用方法时返回值总是自判断类型(optional type)。,即使是这个方法本是没有定义返回值,你也可以使用`if`语句来检查是否能成功调用`printNumberOfRooms`方法:如果方法通过可选链调用成功,`printNumberOfRooms`的隐式返回值将会是`Void`,如果没有成功,将返回`nil`: - - if john.residence?.printNumberOfRooms() { - println("It was possible to print the number of rooms.") - } else { - println("It was not possible to print the number of rooms.") - } - // 打印 "It was not possible to print the number of rooms."。 - -##使用可选链调用子脚本 - -你可以使用可选链来尝试从子脚本获取值并检查子脚本的调用是否成功,然而,你不能通过可选链来设置子代码。 - -> 注意: -当你使用可选链来获取子脚本的时候,你应该将问号放在子脚本括号的前面而不是后面。可选链的问号一般直接跟在自判断表达语句的后面。 - -下面这个例子用在`Residence`类中定义的子脚本来获取`john.residence`数组中第一个房间的名字。因为`john.residence`现在是`nil`,子脚本的调用失败了。 - - if let firstRoomName = john.residence?[0].name { - println("The first room name is \(firstRoomName).") - } else { - println("Unable to retrieve the first room name.") - } - // 打印 "Unable to retrieve the first room name."。 - -在子代码调用中可选链的问号直接跟在`john.residence`的后面,在子脚本括号的前面,因为`john.residence`是可选链试图获得的自判断值。 - -如果你创建一个`Residence`实例给`john.residence`,且在他的`rooms`数组中有一个或多个`Room`实例,那么你可以使用可选链通过`Residence`子脚本来获取在`rooms`数组中的实例了: - - let johnsHouse = Residence() - johnsHouse.rooms += Room(name: "Living Room") - johnsHouse.rooms += Room(name: "Kitchen") - john.residence = johnsHouse - - if let firstRoomName = john.residence?[0].name { - println("The first room name is \(firstRoomName).") - } else { - println("Unable to retrieve the first room name.") - } - // 打印 "The first room name is Living Room."。 - -##连接多层链接 - -你可以将多层可选链连接在一起,可以掘取模型内更下层的属性方法和子脚本。然而多层可选链不能再添加比已经返回的自判断值更多的层。 -也就是说: - -如果你试图获得的类型不是自判断类型,由于使用了可选链它将变成自判断类型。 -如果你试图获得的类型已经是自判断类型,由于可选链它也不会提高自判断性。 - -因此: - -如果你试图通过可选链获得`Int`值,不论使用了多少层链接返回的总是`Int?`。 -相似的,如果你试图通过可选链获得`Int?`值,不论使用了多少层链接返回的总是`Int?`。 - -下面的例子试图获取`john`的`residence`属性里的`address`的`street`属性。这里使用了两层可选链来联系`residence`和`address`属性,他们两者都是自判断类型: - - if let johnsStreet = john.residence?.address?.street { - println("John's street name is \(johnsStreet).") - } else { - println("Unable to retrieve the address.") - } - // 打印 "Unable to retrieve the address.”。 - -`john.residence`的值现在包含一个`Residence`实例,然而`john.residence.address`现在是`nil`,因此`john.residence?.address?.street`调用失败。 - -从上面的例子发现,你试图获得`street`属性值。这个属性的类型是`String?`。因此尽管在自判断类型属性前使用了两层可选链,`john.residence?.address?.street`的返回值类型也是`String?`。 - -如果你为`Address`设定一个实例来作为`john.residence.address`的值,并为`address`的`street`属性设定一个实际值,你可以通过多层可选链来得到这个属性值。 - - let johnsAddress = Address() - johnsAddress.buildingName = "The Larches" - johnsAddress.street = "Laurel Street" - john.residence!.address = johnsAddress - - if let johnsStreet = john.residence?.address?.street { - println("John's street name is \(johnsStreet).") - } else { - println("Unable to retrieve the address.") - } - // 打印 "John's street name is Laurel Street."。 - -值得注意的是,“`!`”符的在定义`address`实例时的使用(`john.residence.address`)。`john.residence`属性是一个自判断类型,因此你需要在它获取`address`属性之前使用`!`解析以获得它的实际值。 - -##链接自判断返回值的方法 - -前面的例子解释了如何通过可选链来获得自判断类型属性值。你也可以通过调用返回自判断类型值的方法并按需链接方法的返回值。 - -下面的例子通过可选链调用了`Address`类中的`buildingIdentifier` 方法。这个方法的返回值类型是`String?`。如上所述,这个方法在可选链调用后最终的返回值类型依然是`String?`: - - if let buildingIdentifier = john.residence?.address?.buildingIdentifier() { - println("John's building identifier is \(buildingIdentifier).") - } - // 打印 "John's building identifier is The Larches."。 - -如果你还想进一步对方法返回值执行可选链,将可选链问号符放在方法括号的后面: - - if let upper = john.residence?.address?.buildingIdentifier()?.uppercaseString { - println("John's uppercase building identifier is \(upper).") - } - // 打印 "John's uppercase building identifier is THE LARCHES."。 - -> 注意: -在上面的例子中,你将可选链问号符放在括号后面是因为你想要链接的自判断值是`buildingIdentifier`方法的返回值,不是`buildingIdentifier`方法本身。 - - - - - - - +> 翻译:[Jasonbroker](https://github.com/Jasonbroker) +> 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + +# Optional Chaining +----------------- + +本页包含内容: + +- [可选链可替代强制解析](#optional_chaining_as_an_alternative_to_forced_unwrapping) +- [为可选链定义模型类](#defining_model_classes_for_optional_chaining) +- [通过可选链调用属性](#calling_properties_through_optional_chaining) +- [通过可选链调用方法](#calling_methods_through_optional_chaining) +- [使用可选链调用子脚本](#calling_subscripts_through_optional_chaining) +- [连接多层链接](#linking_multiple_levels_of_chaining) +- [链接可选返回值的方法](#chaining_on_methods_with_optional_return_values) + +可选链(Optional Chaining)是一种可以请求和调用属性、方法及子脚本的过程,它的可选性体现于请求或调用的目标当前可能为空(`nil`)。如果可选的目标有值,那么调用就会成功;相反,如果选择的目标为空(`nil`),则这种调用将返回空(`nil`)。多次请求或调用可以被链接在一起形成一个链,如果任何一个节点为空(`nil`)将导致整个链失效。 + +> 注意: +Swift 的可选链和 Objective-C 中的消息为空有些相像,但是 Swift 可以使用在任意类型中,并且失败与否可以被检测到。 + + +## 可选链可替代强制解析 + +通过在想调用的属性、方法、或子脚本的可选值(`optional value`)(非空)后面放一个问号,可以定义一个可选链。这一点很像在可选值后面放一个叹号来强制拆得其封包内的值。它们的主要的区别在于当可选值为空时可选链即刻失败,然而一般的强制解析将会引发运行时错误。 + +为了反映可选链可以调用空(`nil`),不论你调用的属性、方法、子脚本等返回的值是不是可选值,它的返回结果都是一个可选值。你可以利用这个返回值来检测你的可选链是否调用成功,有返回值即成功,返回nil则失败。 + +调用可选链的返回结果与原本的返回结果具有相同的类型,但是原本的返回结果被包装成了一个可选值,当可选链调用成功时,一个应该返回`Int`的属性将会返回`Int?`。 + +下面几段代码将解释可选链和强制解析的不同。 + +首先定义两个类`Person`和`Residence`。 + +```swift +class Person { + var residence: Residence? +} + +class Residence { + var numberOfRooms = 1 +} +``` + +`Residence`具有一个`Int`类型的`numberOfRooms`,其值为 1。`Person`具有一个可选`residence`属性,它的类型是`Residence?`。 + +如果你创建一个新的`Person`实例,它的`residence`属性由于是被定义为可选型的,此属性将默认初始化为空: + +```swift +let john = Person() +``` + +如果你想使用感叹号(`!`)强制解析获得这个人`residence`属性`numberOfRooms`属性值,将会引发运行时错误,因为这时没有可以供解析的`residence`值。 + +```swift +let roomCount = john.residence!.numberOfRooms +//将导致运行时错误 +``` +当`john.residence`不是`nil`时,会运行通过,且会将`roomCount` 设置为一个`int`类型的合理值。然而,如上所述,当`residence`为空时,这个代码将会导致运行时错误。 + +可选链提供了一种另一种获得`numberOfRooms`的方法。利用可选链,使用问号来代替原来`!`的位置: + +```swift +if let roomCount = john.residence?.numberOfRooms { + println("John's residence has \(roomCount) room(s).") +} else { + println("Unable to retrieve the number of rooms.") +} +// 打印 "Unable to retrieve the number of rooms. +``` + +这告诉 Swift 来链接可选`residence?`属性,如果`residence`存在则取回`numberOfRooms`的值。 + +因为这种尝试获得`numberOfRooms`的操作有可能失败,可选链会返回`Int?`类型值,或者称作“可选`Int`”。当`residence`是空的时候(上例),选择`Int`将会为空,因此会出先无法访问`numberOfRooms`的情况。 + +要注意的是,即使numberOfRooms是非可选`Int`(`Int?`)时这一点也成立。只要是通过可选链的请求就意味着最后`numberOfRooms`总是返回一个`Int?`而不是`Int`。 + +你可以自己定义一个`Residence`实例给`john.residence`,这样它就不再为空了: + +```swift +john.residence = Residence() +``` + +`john.residence` 现在有了实际存在的实例而不是nil了。如果你想使用和前面一样的可选链来获得`numberOfRoooms`,它将返回一个包含默认值 1 的`Int?`: + +```swift +if let roomCount = john.residence?.numberOfRooms { + println("John's residence has \(roomCount) room(s).") +} else { + println("Unable to retrieve the number of rooms.") +} +// 打印 "John's residence has 1 room(s)"。 +``` + + +##为可选链定义模型类 + +你可以使用可选链来多层调用属性,方法,和子脚本。这让你可以利用它们之间的复杂模型来获取更底层的属性,并检查是否可以成功获取此类底层属性。 + +后面的代码定义了四个将在后面使用的模型类,其中包括多层可选链。这些类是由上面的`Person`和`Residence`模型通过添加一个`Room`和一个`Address`类拓展来。 + +`Person`类定义与之前相同。 + +```swift +class Person { + var residence: Residence? +} +``` + +`Residence`类比之前复杂些。这次,它定义了一个变量 `rooms`,它被初始化为一个`Room[]`类型的空数组: + +```swift +class Residence { + var rooms = Room[]() + var numberOfRooms: Int { + return rooms.count + } + subscript(i: Int) -> Room { + return rooms[i] + } + func printNumberOfRooms() { + println("The number of rooms is \(numberOfRooms)") + } + var address: Address? +} +``` + +因为`Residence`存储了一个`Room`实例的数组,它的`numberOfRooms`属性值不是一个固定的存储值,而是通过计算而来的。`numberOfRooms`属性值是由返回`rooms`数组的`count`属性值得到的。 + +为了能快速访问`rooms`数组,`Residence`定义了一个只读的子脚本,通过插入数组的元素角标就可以成功调用。如果该角标存在,子脚本则将该元素返回。 + +`Residence`中也提供了一个`printNumberOfRooms`的方法,即简单的打印房间个数。 + +最后,`Residence`定义了一个可选属性叫`address`(`address?`)。`Address`类的属性将在后面定义。 +用于`rooms`数组的`Room`类是一个很简单的类,它只有一个`name`属性和一个设定`room`名的初始化器。 + +```swift +class Room { + let name: String + init(name: String) { self.name = name } +} +``` + + +这个模型中的最终类叫做`Address`。它有三个类型是`String?`的可选属性。前面两个可选属性`buildingName`和 `buildingNumber`作为地址的一部分,是定义某个建筑物的两种方式。第三个属性`street`,用于命名地址的街道名: + +```swift +class Address { + var buildingName: String? + var buildingNumber: String? + var street: String? + func buildingIdentifier() -> String? { + if buildingName { + return buildingName + } else if buildingNumber { + return buildingNumber + } else { + return nil + } + } +} +``` + +`Address`类还提供了一个`buildingIdentifier`的方法,它的返回值类型为`String?`。这个方法检查`buildingName`和`buildingNumber`的属性,如果`buildingName`有值则将其返回,或者如果`buildingNumber`有值则将其返回,再或如果没有一个属性有值,返回空。 + + +##通过可选链调用属性 + +正如上面“ [可选链可替代强制解析](#optional_chaining_as_an_alternative_to_forced_unwrapping)”中所述,你可以利用可选链的可选值获取属性,并且检查属性是否获取成功。然而,你不能使用可选链为属性赋值。 + +使用上述定义的类来创建一个人实例,并再次尝试后去它的`numberOfRooms`属性: + +```swift +let john = Person() +if let roomCount = john.residence?.numberOfRooms { + println("John's residence has \(roomCount) room(s).") +} else { + println("Unable to retrieve the number of rooms.") +} +// 打印 "Unable to retrieve the number of rooms。 +``` + +由于`john.residence`是空,所以这个可选链和之前一样失败了,但是没有运行时错误。 + + +##通过可选链调用方法 + +你可以使用可选链的来调用可选值的方法并检查方法调用是否成功。即使这个方法没有返回值,你依然可以使用可选链来达成这一目的。 + +`Residence`的`printNumberOfRooms`方法会打印`numberOfRooms`的当前值。方法如下: + +```swift +func printNumberOfRooms(){ + println(“The number of rooms is \(numberOfRooms)”) +} +``` + +这个方法没有返回值。但是,没有返回值类型的函数和方法有一个隐式的返回值类型`Void`(参见Function Without Return Values)。 + +如果你利用可选链调用此方法,这个方法的返回值类型将是`Void?`,而不是`Void`,因为当通过可选链调用方法时返回值总是可选类型(optional type)。即使这个方法本身没有定义返回值,你也可以使用`if`语句来检查是否能成功调用`printNumberOfRooms`方法:如果方法通过可选链调用成功,`printNumberOfRooms`的隐式返回值将会是`Void`,如果没有成功,将返回`nil`: + +```swift +if john.residence?.printNumberOfRooms() { + println("It was possible to print the number of rooms.") +} else { + println("It was not possible to print the number of rooms.") +} +// 打印 "It was not possible to print the number of rooms."。 +``` + + +##使用可选链调用子脚本 + +你可以使用可选链来尝试从子脚本获取值并检查子脚本的调用是否成功,然而,你不能通过可选链来设置子代码。 + +> 注意: +当你使用可选链来获取子脚本的时候,你应该将问号放在子脚本括号的前面而不是后面。可选链的问号一般直接跟在表达语句的后面。 + +下面这个例子用在`Residence`类中定义的子脚本来获取`john.residence`数组中第一个房间的名字。因为`john.residence`现在是`nil`,子脚本的调用失败了。 + +```swift +if let firstRoomName = john.residence?[0].name { + println("The first room name is \(firstRoomName).") +} else { + println("Unable to retrieve the first room name.") +} +// 打印 "Unable to retrieve the first room name."。 +``` + +在子代码调用中可选链的问号直接跟在`john.residence`的后面,在子脚本括号的前面,因为`john.residence`是可选链试图获得的可选值。 + +如果你创建一个`Residence`实例给`john.residence`,且在他的`rooms`数组中有一个或多个`Room`实例,那么你可以使用可选链通过`Residence`子脚本来获取在`rooms`数组中的实例了: + +```swift +let johnsHouse = Residence() +johnsHouse.rooms += Room(name: "Living Room") +johnsHouse.rooms += Room(name: "Kitchen") +john.residence = johnsHouse + +if let firstRoomName = john.residence?[0].name { + println("The first room name is \(firstRoomName).") +} else { + println("Unable to retrieve the first room name.") +} +// 打印 "The first room name is Living Room."。 +``` + + +##连接多层链接 + +你可以将多层可选链连接在一起,可以掘取模型内更下层的属性方法和子脚本。然而多层可选链不能再添加比已经返回的可选值更多的层。 +也就是说: + +如果你试图获得的类型不是可选类型,由于使用了可选链它将变成可选类型。 +如果你试图获得的类型已经是可选类型,由于可选链它也不会提高可选性。 + +因此: + +如果你试图通过可选链获得`Int`值,不论使用了多少层链接返回的总是`Int?`。 +相似的,如果你试图通过可选链获得`Int?`值,不论使用了多少层链接返回的总是`Int?`。 + +下面的例子试图获取`john`的`residence`属性里的`address`的`street`属性。这里使用了两层可选链来联系`residence`和`address`属性,它们两者都是可选类型: + +```swift +if let johnsStreet = john.residence?.address?.street { + println("John's street name is \(johnsStreet).") +} else { + println("Unable to retrieve the address.") +} +// 打印 "Unable to retrieve the address.”。 +``` + +`john.residence`的值现在包含一个`Residence`实例,然而`john.residence.address`现在是`nil`,因此`john.residence?.address?.street`调用失败。 + +从上面的例子发现,你试图获得`street`属性值。这个属性的类型是`String?`。因此尽管在可选类型属性前使用了两层可选链,`john.residence?.address?.street`的返回值类型也是`String?`。 + +如果你为`Address`设定一个实例来作为`john.residence.address`的值,并为`address`的`street`属性设定一个实际值,你可以通过多层可选链来得到这个属性值。 + +```swift +let johnsAddress = Address() +johnsAddress.buildingName = "The Larches" +johnsAddress.street = "Laurel Street" +john.residence!.address = johnsAddress +``` + +```swift +if let johnsStreet = john.residence?.address?.street { + println("John's street name is \(johnsStreet).") +} else { + println("Unable to retrieve the address.") +} +// 打印 "John's street name is Laurel Street."。 +``` + +值得注意的是,“`!`”符号在给`john.residence.address`分配`address`实例时的使用。`john.residence`属性是一个可选类型,因此你需要在它获取`address`属性之前使用`!`解析以获得它的实际值。 + + +##链接可选返回值的方法 + +前面的例子解释了如何通过可选链来获得可选类型属性值。你也可以通过可选链调用一个返回可选类型值的方法并按需链接该方法的返回值。 + +下面的例子通过可选链调用了`Address`类中的`buildingIdentifier` 方法。这个方法的返回值类型是`String?`。如上所述,这个方法在可选链调用后最终的返回值类型依然是`String?`: + +```swift +if let buildingIdentifier = john.residence?.address?.buildingIdentifier() { + println("John's building identifier is \(buildingIdentifier).") +} +// 打印 "John's building identifier is The Larches."。 +``` + +如果你还想进一步对方法返回值执行可选链,将可选链问号符放在方法括号的后面: + +```swift +if let upper = john.residence?.address?.buildingIdentifier()?.uppercaseString { + println("John's uppercase building identifier is \(upper).") +} +// 打印 "John's uppercase building identifier is THE LARCHES."。 +``` + +> 注意: +在上面的例子中,你将可选链问号符放在括号后面是因为你想要链接的可选值是`buildingIdentifier`方法的返回值,不是`buildingIdentifier`方法本身。 diff --git a/source/chapter2/18_Type_Casting.md b/source/chapter2/18_Type_Casting.md old mode 100644 new mode 100755 index b93c45fe..8e1f465e --- a/source/chapter2/18_Type_Casting.md +++ b/source/chapter2/18_Type_Casting.md @@ -1,293 +1,252 @@ -#类型检查(Type Casting) - -(ps:为了方便各位检验所以保留了英文,可删。) - _类型检查_是一种检查类实例的方式,并且哦或者也是让实例作为它的父类或者子类的一种方式。 - - _Type casting_ is a way to check the type of an instance, and/or to treat that instance as if it is a different superclass or subclass from somewhere else in its own class hierarchy. - - 类型检查在Swift中使用`is` 和 `as`操作符实现。这两个操作符提供了一种简单达意的方式去检查值的类型或者转换它的类型。 - - Type casting in Swift is implemented with the `is` and `as` operators. These two operators provide a simple and expressive way to check the type of a value or cast a value to a different type. - - 你也可以用来检查一个类是否实现了某个协议,就像在 [Protocols》Checking for Protocol Conformance](Protocols.html#//apple_ref/doc/uid/TP40014097-CH25-XID_363)部分讲述的一样。 - - You can also use type casting to check whether a type conforms to a protocol, as described in [Checking for Protocol Conformance](Protocols.html#//apple_ref/doc/uid/TP40014097-CH25-XID_363). -### 定义一个类层次作为例子Defining a Class Hierarchy for Type Casting - - 你可以将它用在类和子类的层次结构上,检查特定类实例的类型并且转换这个类实例的类型成为这个层次结构中的其他类型。这下面的三个代码段定义了一个类层次和一个array包含了几个这些类的实例,作为类型检查的例子。 - - You can use type casting with a hierarchy of classes and subclasses to check the type of a particular class instance and to cast that instance to another class within the same hierarchy. The three code snippets below define a hierarchy of classes and an array containing instances of those classes, for use in an example of type casting. - - 第一个代码片段定义了一个新的基础类`MediaItem`。这个类为任何出现在数字媒体库的项提供基础功能。特别的,它声明了一个 `String` 类型的 `name` 属性,和一个`init name`初始化器。(它假定所有的媒体项都有个名称。) - - The first snippet defines a new base class called `MediaItem`. This class provides basic functionality for any kind of item that appears in a digital media library. Specifically, it declares a `name` property of type `String`, and an `init name` initializer. (It is assumed that all media items, including all movies and songs, will have a name.) - - class MediaItem { - var name: String - init(name: String) { - self.name = name - } - } - - 下一个代码段定义了 `MediaItem` 的两个子类。第一个子类`Movie`,在父类(或者说基类)的基础上增加了一个 `director`(导演) 属性,和相应的初始化器。第二个类在父类的基础上增加了一个 `artist`(艺术家) 属性,和相应的初始化器: - - The next snippet defines two subclasses of `MediaItem`. The first subclass, `Movie`, encapsulates additional information about a movie or film. It adds a `director` property on top of the base `MediaItem` class, with a corresponding initializer. The second subclass, `Song`, adds an `artist` property and initializer on top of the base class: - - class Movie: MediaItem { - var director: String - init(name: String, director: String) { - self.director = director - super.init(name: name) - } - } - - class Song: MediaItem { - var artist: String - init(name: String, artist: String) { - self.artist = artist - super.init(name: name) - } - } - - 最后一个代码段创建了一个array常量 `library` ,包含两个`Movie`实例和三个`Song`实例。`library`的类型是在它被初始化时根据它的array标记符和里面的内容(ps: literal: 标记符其实就是指“[”和“]”,虽然苹果官方的翻译里翻译为字面当总感觉不好理解,有点奇怪。不如翻译为标记符)推断来的。Swift的类型检测器能够演绎出`Movie` 和 `Song` 有共同的父类 `MediaItem` ,所以它推断出 `MediaItem[]` 类作为 `library` 的类型。 - - The final snippet creates a constant array called `library`, which contains two `Movie` instances and three `Song` instances. The type of the `library` array is inferred by initializing it with the contents of an array literal. Swift’s type checker is able to deduce that `Movie` and `Song` have a common superclass of `MediaItem`, and so it infers a type of `MediaItem[]` for the `library` array: - - let library = [ - Movie(name: "Casablanca", director: "Michael Curtiz"), - Song(name: "Blue Suede Shoes", artist: "Elvis Presley"), - Movie(name: "Citizen Kane", director: "Orson Welles"), - Song(name: "The One And Only", artist: "Chesney Hawkes"), - Song(name: "Never Gonna Give You Up", artist: "Rick Astley") - ] - // the type of "library" is inferred to be MediaItem[] - - 在幕后`library` 里存储的项依然是 `Movie` 和 `Song` 类型的,但是,若你迭代它,取出的实例会是 `MediaItem` 类型的,而不是 `Movie` 和 `Song` 类型的。为了让它们作为它们本来的类型工作,你需要检查它们的类型或者向下转换它们的类型到其它类型,就像下面描述的一样。 - - The items stored in `library` are still `Movie` and `Song` instances behind the scenes. However, if you iterate over the contents of this array, the items you receive back are typed as `MediaItem`, and not as `Movie` or `Song`. In order to work with them as their native type, you need to _check_ their type, or _downcast_ them to a different type, as described below. - -### 检查类型 Checking Type - - 用类型检查操作符(`is`)来检查一个实例是否属于特定子类型。类型检查操作符返回 `true` 若实例属于那个子类型,若不属于返回 `false` 。 - - Use the _type check operator_ (`is`) to check whether an instance is of a certain subclass type. The type check operator returns `true` if the instance is of that subclass type and `false` if it is not. - - 下面的例子定义了连个变量,`movieCount` 和 `songCount`,用来计算数组`library` 中 `Movie` 和 `Song` 类型的实例数量。 - - The example below defines two variables, `movieCount` and `songCount`, which count the number of `Movie` and `Song` instances in the `library` array: - - var movieCount = 0 - var songCount = 0 - - for item in library { - if item is Movie { - ++movieCount - } else if item is Song { - ++songCount - } - } - - println("Media library contains \(movieCount) movies and \(songCount) songs") - // prints "Media library contains 2 movies and 3 songs" - - 示例迭代了数组 `library` 中的所有项。每一次, `for`-`in` 循环设置 - `item` 常量的值为数组中的下一个 `MediaItem`。 - - This example iterates through all items in the `library` array. On each pass, the `for`-`in` loop sets the `item` constant to the next `MediaItem` in the array. - - 若当前 `MediaItem` 是一个 `Movie` 类型的实例, `item is Movie` 返回 `true`,相反返回 `false`。同样的,`item is Song`检查item是否为`Song`类型的实例。在循环末尾,`movieCount` 和 `songCount`的值就是被找到属于各自的类型的实例数量。 - - `item is Movie` returns `true` if the current `MediaItem` is a `Movie` instance and `false` if it is not. Similarly, `item is Song` checks whether the item is a `Song` instance. At the end of the `for`-`in` loop, the values of `movieCount` and `songCount` contain a count of how many `MediaItem` instances were found of each type. - -### 向下转型(简称下转) Downcasting - - 某类型的一个常量或变量可能在幕后实际上属于一个子类。你可以相信,上面就是这种情况。你可以尝试向下转到它的子类型,用类型检查操作符(`as`) - - A constant or variable of a certain class type may actually refer to an instance of a subclass behind the scenes. Where you believe this is the case, you can try to _downcast_ to the subclass type with the _type cast operator_ (`as`). - - 因为向下转型可能会失败,类型检查操作符带有两种不同形式。可选形式( optional form) `as?` 返回一个你试图下转成的类型的可选值(optional value)。强制形式 `as` 把试图向下转型和强制解包(force-unwraps)结果作为一个混合动作。 - - Because downcasting can fail, the type cast operator comes in two different forms. The optional form, `as?`, returns an optional value of the type you are trying to downcast to. The forced form, `as`, attempts the downcast and force-unwraps the result as a single compound action. - - 当你不确定下转可以成功时,用类型检查的可选形式(`as?`)。可选形式的类型检查总是返回一个可选值(optional value),并且若下转是不可能的,可选值将是 `nil` 。这使你能够检查下转是否成功。 - - Use the optional form of the type cast operator (`as?`) when you are not sure if the downcast will succeed. This form of the operator will always return an optional value, and the value will be `nil` if the downcast was not possible. This enables you to check for a successful downcast. - - 只有你可以确定下转一定会成功时,才使用强制形式。当你试图下转为一个不正确的类型时,强制形式的类型检查会触发一个runtime error。 - - Use the forced form of the type cast operator (`as`) only when you are sure that the downcast will always succeed. This form of the operator will trigger a runtime error if you try to downcast to an incorrect class type. - - 下面的例子,迭代了`library`里的每一个 `MediaItem` ,并打印出适当的描述。要这样做,item需要真正作为`Movie` 或 `Song`的类型来使用。不仅仅是作为 `MediaItem`。为了能够使用`Movie` 或 `Song`的 `director` 或 `artist`属性,这是必要的。 - - The example below iterates over each `MediaItem` in `library`, and prints an appropriate description for each item. To do this, it needs to access each item as a true `Movie` or `Song`, and not just as a `MediaItem`. This is necessary in order for it to be able to access the `director` or `artist` property of a `Movie` or `Song` for use in the description. - - 在这个示例中,数组中的每一个item可能是 `Movie` 或 `Song`。 事前你不知道每个item的真实类型,所以这里使用可选形式的类型检查 (`as?`)去检查循环里的每次下转。 - - In this example, each item in the array might be a `Movie`, or it might be a `Song`. You don’t know in advance which actual class to use for each item, and so it is appropriate to use the optional form of the type cast operator (`as?`) to check the downcast each time through the loop: - - for item in library { - if let movie = item as? Movie { - println("Movie: '\(movie.name)', dir. \(movie.director)") - } else if let song = item as? Song { - println("Song: '\(song.name)', by \(song.artist)") - } - } - - // Movie: 'Casablanca', dir. Michael Curtiz - // Song: 'Blue Suede Shoes', by Elvis Presley - // Movie: 'Citizen Kane', dir. Orson Welles - // Song: 'The One And Only', by Chesney Hawkes - // Song: 'Never Gonna Give You Up', by Rick Astley - - 示例首先试图将 `item` 下转为 `Movie`。因为 `item` 是一个 `MediaItem` 类型的实例,它可能是一个`Movie`;同样,它可能是一个 `Song`,或者仅仅是基类 `MediaItem`。因为不确定,`as?`形式试图下转时返还一个可选值。 `item as Movie` 的返回值是`Movie?`类型或 “optional `Movie`”。 - - The example starts by trying to downcast the current `item` as a `Movie`. Because `item` is a `MediaItem` instance, it’s possible that it _might_ be a `Movie`; equally, it’s also possible that it might a `Song`, or even just a base `MediaItem`. Because of this uncertainty, the `as?` form of the type cast operator returns an _optional_ value when attempting to downcast to a subclass type. The result of `item as Movie` is of type `Movie?`, or “optional `Movie`”. - - 当应用在两个`Song`实例时,下转为 `Movie` 失败。为了处理这种情况,上面的实例使用了可选绑定(optional binding)来检查optional `Movie`真的包含一个值(这个是为了判断下转是否成功。)可选绑定是这样写的“`if let movie = item as? Movie`”,可以这样解读: - - Downcasting to `Movie` fails when applied to the two `Song` instances in the library array. To cope with this, the example above uses optional binding to check whether the optional `Movie` actually contains a value (that is, to find out whether the downcast succeeded.) This optional binding is written “`if let movie = item as? Movie`”, which can be read as: - - “尝试将 `item` 转为 `Movie`类型。若成功,设置一个新的临时常量 `movie` 来存储返回的optional `Movie`” - - “Try to access `item` as a `Movie`. If this is successful, set a new temporary constant called `movie` to the value stored in the returned optional `Movie`.” - - 若下转成功,然后`movie`的属性将用于打印一个`Movie`实例的描述,包括它的导演的名字`director`。当`Song`被找到时,一个相近的原理被用来检测 `Song` 实例和打印它的描述。 - - If the downcasting succeeds, the properties of `movie` are then used to print a description for that `Movie` instance, including the name of its `director`. A similar principle is used to check for `Song` instances, and to print an appropriate description (including `artist` name) whenever a `Song` is found in the library. - - 注意 - - 转换没有真的改变实例或它的值。潜在的根本的实例保持不变;只是简单地把它作为它被转换成的类来使用。 - - NOTE - - Casting does not actually modify the instance or change its values. The underlying instance remains the same; it is simply treated and accessed as an instance of the type to which it has been cast. - -### Any和AnyObject的转换 Type Casting for Any and AnyObject - - Swift为不确定类型提供了两种特殊类型别名: - - * `AnyObject`可以代表任何class类型的实例。 - - * `Any`可以表示任何类型,除了方法类型(function types)。 - - Swift provides two special type aliases for working with non-specific types: - -* `AnyObject` can represent an instance of any class type. -* `Any` can represent an instance of any type at all, apart from function types. - - 注意 - - 只有当你明确的需要它的行为和功能时才使用Any和AnyObject。在你的代码里使用你期望的明确的类型总是更好的。 - - NOTE - - Use Any and AnyObject only when you explicitly need the behavior and capabilities they provide. It is always better to be specific about the types you expect to work with in your code. - - -### AnyObject类型 - - 当需要在工作中使用Cocoa APIs,它一般接收一个`AnyObject[]`类型的数组,或者说“一个任何对象类型的数组”。这是因为OC没有明确的类型化数组。但是,你常常可以确定包含在仅从你知道的API信息提供的这样一个数组中的对象的类型。 - - When working with Cocoa APIs, it is common to receive an array with a type of `AnyObject[]`, or “an array of values of any object type”. This is because Objective-C does not have explicitly typed arrays. However, you can often be confident about the type of objects contained in such an array just from the information you know about the API that provided the array. - - 在这些情况下,你可以使用强制形式的类型检查(`as`)来下转在数组中的每一项到比 `AnyObject` 更明确的类型,不需要可选解包(optional unwrapping)。 - - In these situations, you can use the forced version of the type cast operator (`as`) to downcast each item in the array to a more specific class type than `AnyObject`, without the need for optional unwrapping. - - 下面的示例定义了一个 `AnyObject[]` 类型的数组并填入三个`Movie`类型的实例: - - The example below defines an array of type `AnyObject[]` and populates this array with three instances of the `Movie` class: - - let someObjects: AnyObject[] = [ - Movie(name: "2001: A Space Odyssey", director: "Stanley Kubrick"), - Movie(name: "Moon", director: "Duncan Jones"), - Movie(name: "Alien", director: "Ridley Scott") - ] - - 因为知道这个数组只包含 `Movie` 实例,你可以直接用(`as`)下转并解包到不可选的`Movie`类型(ps:其实就是我们常用的正常类型,这里是为了和可选类型相对比)。 - - Because this array is known to contain only `Movie` instances, you can downcast and unwrap directly to a non-optional `Movie` with the forced version of the type cast operator (`as`): - - for object in someObjects { - let movie = object as Movie - println("Movie: '\(movie.name)', dir. \(movie.director)") - } - // Movie: '2001: A Space Odyssey', dir. Stanley Kubrick - // Movie: 'Moon', dir. Duncan Jones - // Movie: 'Alien', dir. Ridley Scott - - 为了变为一个更短的形式,下转`someObjects`类型成功 `Movie[]` 类型代替下转每一项。 - - For an even shorter form of this loop, downcast the `someObjects` array to a type of `Movie[]` instead of downcasting each item: - - for movie in someObjects as Movie[] { - println("Movie: '\(movie.name)', dir. \(movie.director)") - } - // Movie: '2001: A Space Odyssey', dir. Stanley Kubrick - // Movie: 'Moon', dir. Duncan Jones - // Movie: 'Alien', dir. Ridley Scott - -### Any类型 - - 这里有个示例,使用 `Any` 类型来和混合的不同类型一起工作,包括非class类型。它创建了一个可以存储`Any`类型的数组 `things`。 - - Here’s an example of using `Any` to work with a mix of different types, including non-class types. The example creates an array called `things`, which can store values of type `Any`: - - var things = Any[]() - - things.append(0) - things.append(0.0) - things.append(42) - things.append(3.14159) - things.append("hello") - things.append((3.0, 5.0)) - things.append(Movie(name: "Ghostbusters", director: "Ivan Reitman")) - - `things` 数组包含两个 `Int` 值,2个 `Double` 值,1个 `String` 值,一个元组 `(Double, Double)` ,Ivan Reitman导演的电影“Ghostbusters”。 - - The `things` array contains two `Int` values, two `Double` values, a `String` value, a tuple of type `(Double, Double)`, and the movie “Ghostbusters”, directed by Ivan Reitman. - - 你可以在 `switch` `cases`里用`is` 和 `as` 操作符来发觉只知道是 `Any` 或 `AnyObject`的常量或变量的类型。 下面的示例迭代 `things`数组中的每一项的并用`switch`语句查找每一项的类型。这几种`switch`语句的情形绑定它们匹配的值到一个规定类型的常量,让它们可以打印它们的值: - - You can use the `is` and `as` operators in a `switch` statement’s cases to discover the specific type of a constant or variable that is known only to be of type `Any` or `AnyObject`. The example below iterates over the items in the `things` array and queries the type of each item with a `switch` statement. Several of the `switch` statement’s cases bind their matched value to a constant of the specified type to enable its value to be printed: - - for thing in things { - switch thing { - case 0 as Int: - println("zero as an Int") - case 0 as Double: - println("zero as a Double") - case let someInt as Int: - println("an integer value of \(someInt)") - case let someDouble as Double where someDouble > 0: - println("a positive double value of \(someDouble)") - case is Double: - println("some other double value that I don't want to print") - case let someString as String: - println("a string value of \"\(someString)\"") - case let (x, y) as (Double, Double): - println("an (x, y) point at \(x), \(y)") - case let movie as Movie: - println("a movie called '\(movie.name)', dir. \(movie.director)") - default: - println("something else") - } - } - - // zero as an Int - // zero as a Double - // an integer value of 42 - // a positive double value of 3.14159 - // a string value of "hello" - // an (x, y) point at 3.0, 5.0 - // a movie called 'Ghostbusters', dir. Ivan Reitman -。 - - 注意 - - 在一个switch语句的case中使用强制形式的类型检查操作符(as, 而不是 as?) 来检查和转换到一个规定的类型。在switch case 语句的内容中这种检查总是安全的。 - - NOTE - - The cases of a switch statement use the forced version of the type cast operator (as, not as?) to check and cast to a specific type. This check is always safe within the context of a switch case statement. +> 翻译:[xiehurricane](https://github.com/xiehurricane) +> 校对:[happyming](https://github.com/happyming) + +# 类型转换(Type Casting) +----------------- + +本页包含内容: + +- [定义一个类层次作为例子](#defining_a_class_hierarchy_for_type_casting) +- [检查类型](#checking_type) +- [向下转型(Downcasting)](#downcasting) +- [`Any`和`AnyObject`的类型转换](#type_casting_for_any_and_anyobject) + + +_类型转换_是一种检查类实例的方式,并且或者也是让实例作为它的父类或者子类的一种方式。 + +类型转换在 Swift 中使用`is` 和 `as`操作符实现。这两个操作符提供了一种简单达意的方式去检查值的类型或者转换它的类型。 + +你也可以用来检查一个类是否实现了某个协议,就像在 [Checking for Protocol Conformance](Protocols.html#//apple_ref/doc/uid/TP40014097-CH25-XID_363)部分讲述的一样。 + + +## 定义一个类层次作为例子 + +你可以将它用在类和子类的层次结构上,检查特定类实例的类型并且转换这个类实例的类型成为这个层次结构中的其他类型。这下面的三个代码段定义了一个类层次和一个包含了几个这些类实例的数组,作为类型转换的例子。 + +第一个代码片段定义了一个新的基础类`MediaItem`。这个类为任何出现在数字媒体库的媒体项提供基础功能。特别的,它声明了一个 `String` 类型的 `name` 属性,和一个`init name`初始化器。(它假定所有的媒体项都有个名称。) + +```swift +class MediaItem { + var name: String + init(name: String) { + self.name = name + } +} +``` + +下一个代码段定义了 `MediaItem` 的两个子类。第一个子类`Movie`,在父类(或者说基类)的基础上增加了一个 `director`(导演) 属性,和相应的初始化器。第二个类在父类的基础上增加了一个 `artist`(艺术家) 属性,和相应的初始化器: + +```swift +class Movie: MediaItem { + var director: String + init(name: String, director: String) { + self.director = director + super.init(name: name) + } +} + +class Song: MediaItem { + var artist: String + init(name: String, artist: String) { + self.artist = artist + super.init(name: name) + } +} +``` + +最后一个代码段创建了一个数组常量 `library`,包含两个`Movie`实例和三个`Song`实例。`library`的类型是在它被初始化时根据它数组中所包含的内容推断来的。Swift 的类型检测器能够演绎出`Movie` 和 `Song` 有共同的父类 `MediaItem` ,所以它推断出 `MediaItem[]` 类作为 `library` 的类型。 + +```swift +let library = [ + Movie(name: "Casablanca", director: "Michael Curtiz"), + Song(name: "Blue Suede Shoes", artist: "Elvis Presley"), + Movie(name: "Citizen Kane", director: "Orson Welles"), + Song(name: "The One And Only", artist: "Chesney Hawkes"), + Song(name: "Never Gonna Give You Up", artist: "Rick Astley") +] +// the type of "library" is inferred to be MediaItem[] +``` + +在幕后`library` 里存储的媒体项依然是 `Movie` 和 `Song` 类型的,但是,若你迭代它,取出的实例会是 `MediaItem` 类型的,而不是 `Movie` 和 `Song` 类型的。为了让它们作为它们本来的类型工作,你需要检查它们的类型或者向下转换它们的类型到其它类型,就像下面描述的一样。 + + +## 检查类型(Checking Type) + +用类型检查操作符(`is`)来检查一个实例是否属于特定子类型。若实例属于那个子类型,类型检查操作符返回 `true` ,否则返回 `false` 。 + +下面的例子定义了两个变量,`movieCount` 和 `songCount`,用来计算数组`library` 中 `Movie` 和 `Song` 类型的实例数量。 + +```swift +var movieCount = 0 +var songCount = 0 + +for item in library { + if item is Movie { + ++movieCount + } else if item is Song { + ++songCount + } +} + +println("Media library contains \(movieCount) movies and \(songCount) songs") +// prints "Media library contains 2 movies and 3 songs" +``` + +示例迭代了数组 `library` 中的所有项。每一次, `for`-`in` 循环设置 +`item` 为数组中的下一个 `MediaItem`。 + +若当前 `MediaItem` 是一个 `Movie` 类型的实例, `item is Movie` 返回 +`true`,相反返回 `false`。同样的,`item is +Song`检查item是否为`Song`类型的实例。在循环结束后,`movieCount` 和 `songCount`的值就是被找到属于各自的类型的实例数量。 + + +## 向下转型(Downcasting) + +某类型的一个常量或变量可能在幕后实际上属于一个子类。你可以相信,上面就是这种情况。你可以尝试向下转到它的子类型,用类型转换操作符(`as`) + +因为向下转型可能会失败,类型转型操作符带有两种不同形式。可选形式( optional form) `as?` 返回一个你试图下转成的类型的可选值(optional value)。强制形式 `as` 把试图向下转型和强制解包(force-unwraps)结果作为一个混合动作。 + +当你不确定向下转型可以成功时,用类型转换的可选形式(`as?`)。可选形式的类型转换总是返回一个可选值(optional value),并且若下转是不可能的,可选值将是 `nil` 。这使你能够检查向下转型是否成功。 + +只有你可以确定向下转型一定会成功时,才使用强制形式。当你试图向下转型为一个不正确的类型时,强制形式的类型转换会触发一个运行时错误。 + +下面的例子,迭代了`library`里的每一个 `MediaItem` ,并打印出适当的描述。要这样做,`item`需要真正作为`Movie` 或 `Song`的类型来使用。不仅仅是作为 `MediaItem`。为了能够使用`Movie` 或 `Song`的 `director` 或 `artist`属性,这是必要的。 + +在这个示例中,数组中的每一个`item`可能是 `Movie` 或 `Song`。 事前你不知道每个`item`的真实类型,所以这里使用可选形式的类型转换 (`as?`)去检查循环里的每次下转。 + +```swift +for item in library { + if let movie = item as? Movie { + println("Movie: '\(movie.name)', dir. \(movie.director)") + } else if let song = item as? Song { + println("Song: '\(song.name)', by \(song.artist)") + } +} + +// Movie: 'Casablanca', dir. Michael Curtiz +// Song: 'Blue Suede Shoes', by Elvis Presley +// Movie: 'Citizen Kane', dir. Orson Welles +// Song: 'The One And Only', by Chesney Hawkes +// Song: 'Never Gonna Give You Up', by Rick Astley +``` + +示例首先试图将 `item` 下转为 `Movie`。因为 `item` 是一个 `MediaItem` +类型的实例,它可能是一个`Movie`;同样,它可能是一个 `Song`,或者仅仅是基类 +`MediaItem`。因为不确定,`as?`形式在试图下转时将返还一个可选值。 `item as Movie` 的返回值是`Movie?`类型或 “optional `Movie`”。 + +当向下转型为 `Movie` 应用在两个 `Song` +实例时将会失败。为了处理这种情况,上面的例子使用了可选绑定(optional binding)来检查可选 `Movie`真的包含一个值(这个是为了判断下转是否成功。)可选绑定是这样写的“`if let movie = item as? Movie`”,可以这样解读: + +“尝试将 `item` 转为 `Movie`类型。若成功,设置一个新的临时常量 `movie` 来存储返回的可选`Movie`” + +若向下转型成功,然后`movie`的属性将用于打印一个`Movie`实例的描述,包括它的导演的名字`director`。当`Song`被找到时,一个相近的原理被用来检测 `Song` 实例和打印它的描述。 + +> 注意: +转换没有真的改变实例或它的值。潜在的根本的实例保持不变;只是简单地把它作为它被转换成的类来使用。 + + +## `Any`和`AnyObject`的类型转换 + +Swift为不确定类型提供了两种特殊类型别名: + +* `AnyObject`可以代表任何class类型的实例。 +* `Any`可以表示任何类型,除了方法类型(function types)。 + +> 注意: +只有当你明确的需要它的行为和功能时才使用`Any`和`AnyObject`。在你的代码里使用你期望的明确的类型总是更好的。 + +### `AnyObject`类型 + +当需要在工作中使用 Cocoa APIs,它一般接收一个`AnyObject[]`类型的数组,或者说“一个任何对象类型的数组”。这是因为 Objective-C 没有明确的类型化数组。但是,你常常可以确定包含在仅从你知道的 API 信息提供的这样一个数组中的对象的类型。 + +在这些情况下,你可以使用强制形式的类型转换(`as`)来下转在数组中的每一项到比 `AnyObject` 更明确的类型,不需要可选解析(optional unwrapping)。 + +下面的示例定义了一个 `AnyObject[]` 类型的数组并填入三个`Movie`类型的实例: + +```swift +let someObjects: AnyObject[] = [ + Movie(name: "2001: A Space Odyssey", director: "Stanley Kubrick"), + Movie(name: "Moon", director: "Duncan Jones"), + Movie(name: "Alien", director: "Ridley Scott") +] +``` + +因为知道这个数组只包含 `Movie` 实例,你可以直接用(`as`)下转并解包到不可选的`Movie`类型(ps:其实就是我们常用的正常类型,这里是为了和可选类型相对比)。 + +```swift +for object in someObjects { + let movie = object as Movie + println("Movie: '\(movie.name)', dir. \(movie.director)") +} +// Movie: '2001: A Space Odyssey', dir. Stanley Kubrick +// Movie: 'Moon', dir. Duncan Jones +// Movie: 'Alien', dir. Ridley Scott +``` + +为了变为一个更短的形式,下转`someObjects`数组为`Movie[]`类型来代替下转每一项方式。 + +```swift +for movie in someObjects as Movie[] { + println("Movie: '\(movie.name)', dir. \(movie.director)") +} +// Movie: '2001: A Space Odyssey', dir. Stanley Kubrick +// Movie: 'Moon', dir. Duncan Jones +// Movie: 'Alien', dir. Ridley Scott +``` + +### `Any`类型 + +这里有个示例,使用 `Any` 类型来和混合的不同类型一起工作,包括非`class`类型。它创建了一个可以存储`Any`类型的数组 `things`。 + +```swift +var things = Any[]() + +things.append(0) +things.append(0.0) +things.append(42) +things.append(3.14159) +things.append("hello") +things.append((3.0, 5.0)) +things.append(Movie(name: "Ghostbusters", director: "Ivan Reitman")) +``` + +`things` 数组包含两个 `Int` 值,2个 `Double` 值,1个 `String` 值,一个元组 `(Double, Double)` ,Ivan Reitman 导演的电影“Ghostbusters”。 + +你可以在 `switch` `cases`里用`is` 和 `as` 操作符来发觉只知道是 `Any` 或 `AnyObject`的常量或变量的类型。 下面的示例迭代 `things`数组中的每一项的并用`switch`语句查找每一项的类型。这几种`switch`语句的情形绑定它们匹配的值到一个规定类型的常量,让它们可以打印它们的值: + +```swift +for thing in things { + switch thing { + case 0 as Int: + println("zero as an Int") + case 0 as Double: + println("zero as a Double") + case let someInt as Int: + println("an integer value of \(someInt)") + case let someDouble as Double where someDouble > 0: + println("a positive double value of \(someDouble)") + case is Double: + println("some other double value that I don't want to print") + case let someString as String: + println("a string value of \"\(someString)\"") + case let (x, y) as (Double, Double): + println("an (x, y) point at \(x), \(y)") + case let movie as Movie: + println("a movie called '\(movie.name)', dir. \(movie.director)") + default: + println("something else") + } +} + +// zero as an Int +// zero as a Double +// an integer value of 42 +// a positive double value of 3.14159 +// a string value of "hello" +// an (x, y) point at 3.0, 5.0 +// a movie called 'Ghostbusters', dir. Ivan Reitman +``` + + +> 注意: +在一个switch语句的case中使用强制形式的类型转换操作符(as, 而不是 as?)来检查和转换到一个明确的类型。在 switch case 语句的内容中这种检查总是安全的。 diff --git a/source/chapter2/19_Nested_Types.md b/source/chapter2/19_Nested_Types.md old mode 100644 new mode 100755 index 900bc940..8a6b08f4 --- a/source/chapter2/19_Nested_Types.md +++ b/source/chapter2/19_Nested_Types.md @@ -1,81 +1,97 @@ -#类型嵌套 - -本页包含内容: - -- 类型嵌套实例 -- 类型嵌套的引用 - -枚举类型常被用于实现特定类或结构体的功能。也能够在有多种变量类型的环境中,方便地定义通用类或结构体来使用,为了实现这种功能,Swift允许你定义类型嵌套,可以在枚举类型、类和结构体中定义支持嵌套的类型。 - -要在一个类型中嵌套另一个类型,将需要嵌套的类型的定义写在被嵌套类型的区域{}内,而且可以根据需要定义多级嵌套。 - -##类型嵌套实例 - -下面这个例子定义了一个结构体`BlackjackCard`(二十一点),用来模拟`BlackjackCard`中的扑克牌点数。`BlackjackCard`结构体包含2个嵌套定义的枚举类型`Suit` 和 `Rank`。 - -在`BlackjackCard`规则中,`Ace`牌可以表示1或者11,`Ace`牌的这一特征用一个嵌套在枚举型`Rank`的结构体`Values`来表示。 - - struct BlackjackCard { - // 嵌套定义枚举型Suit - enum Suit: Character { - case Spades = "♠", Hearts = "♡", Diamonds = "♢", Clubs = "♣" - } - // 嵌套定义枚举型Rank - enum Rank: Int { - case Two = 2, Three, Four, Five, Six, Seven, Eight, Nine, Ten - case Jack, Queen, King, Ace - struct Values { - let first: Int, second: Int? - } - var values: Values { - switch self { - case .Ace: - return Values(first: 1, second: 11) - case .Jack, .Queen, .King: - return Values(first: 10, second: nil) - default: - return Values(first: self.toRaw(), second: nil) - } - } - } - // BlackjackCard 的属性和方法 - let rank: Rank, suit: Suit - var description: String { - var output = "suit is \(suit.toRaw())," - output += " value is \(rank.values.first)" - if let second = rank.values.second { - output += " or \(second)" - } - return output - } - } - -枚举型的`Suit`用来描述扑克牌的四种花色,并分别用一个`Character`类型的值代表花色符号。 - -枚举型的`Rank`用来描述扑克牌从`Ace`~10,`J`,`Q`,`K`,13张牌,并分别用一个`Int`类型的值表示牌的面值。(这个`Int`类型的值不适用于`Ace`,`J`,`Q`,`K`的牌)。 - -如上文所提到的,枚举型`Rank`在自己内部定义了一个嵌套结构体`Values`。这个结构体包含两个变量,只有`Ace`有两个数值,其余牌都只有一个数值。结构体`Values`中定义的两个属性: - -`first`, 为` Int` -`second`, 为 `Int?`, 或 “optional `Int`” - -`Rank`定义了一个计算属性`values`,这个计算属性会根据牌的面值,用适当的数值去初始化`Values`实例,并赋值给`values`。对于`J`,`Q`,`K`,`Ace`会使用特殊数值,对于数字面值的牌使用`Int`类型的值。 - -`BlackjackCard`结构体自身有两个属性—`rank`与`suit`,也同样定义了一个计算属性`description`,`description`属性用`rank`和`suit`的中内容来构建对这张扑克牌名字和数值的描述,并用可选类型`second`来检查是否存在第二个值,若存在,则在原有的描述中增加对第二数值的描述。 - -因为`BlackjackCard`是一个没有自定义构造函数的结构体,在[Memberwise Initializers for Structure Types](https://github.com/CocoaChina-editors/Welcome-to-Swift/blob/master/The%20Swift%20Programming%20Language/02Language%20Guide/14Initialization.md)中知道结构体有默认的成员构造函数,所以你可以用默认的`initializer`去初始化新的常量`theAceOfSpades`: - - let theAceOfSpades = BlackjackCard(rank: .Ace, suit: .Spades) - println("theAceOfSpades: \(theAceOfSpades.description)") - // 打印出 "theAceOfSpades: suit is ♠, value is 1 or 11" - -尽管`Rank`和`Suit`嵌套在`BlackjackCard`中,但仍可被引用,所以在初始化实例时能够通过枚举类型中的成员名称单独引用。在上面的例子中`description`属性能正确得输出对`Ace`牌有1和11两个值。 - -##类型嵌套的引用 - -在外部对嵌套类型的引用,以被嵌套类型的名字为前缀,加上所要引用的属性名: - - let heartsSymbol = BlackjackCard.Suit.Hearts.toRaw() - // 红心的符号 为 "♡" - -对于上面这个例子,这样可以使`Suit`, `Rank`, 和 `Values`的名字尽可能的短,因为它们的名字会自然的由被定义的上下文来限定。 \ No newline at end of file +> 翻译:[Lin-H](https://github.com/Lin-H) +> 校对:[shinyzhu](https://github.com/shinyzhu) + +# 嵌套类型 +----------------- + +本页包含内容: + +- [嵌套类型实例](#nested_types_in_action) +- [嵌套类型的引用](#referring_to_nested_types) + +枚举类型常被用于实现特定类或结构体的功能。也能够在有多种变量类型的环境中,方便地定义通用类或结构体来使用,为了实现这种功能,Swift允许你定义嵌套类型,可以在枚举类型、类和结构体中定义支持嵌套的类型。 + +要在一个类型中嵌套另一个类型,将需要嵌套的类型的定义写在被嵌套类型的区域{}内,而且可以根据需要定义多级嵌套。 + + +##嵌套类型实例 + +下面这个例子定义了一个结构体`BlackjackCard`(二十一点),用来模拟`BlackjackCard`中的扑克牌点数。`BlackjackCard`结构体包含2个嵌套定义的枚举类型`Suit` 和 `Rank`。 + +在`BlackjackCard`规则中,`Ace`牌可以表示1或者11,`Ace`牌的这一特征用一个嵌套在枚举型`Rank`的结构体`Values`来表示。 + +```swift +struct BlackjackCard { + // 嵌套定义枚举型Suit + enum Suit: Character { + case Spades = "♠", Hearts = "♡", Diamonds = "♢", Clubs = "♣" + } + + // 嵌套定义枚举型Rank + enum Rank: Int { + case Two = 2, Three, Four, Five, Six, Seven, Eight, Nine, Ten + case Jack, Queen, King, Ace + struct Values { + let first: Int, second: Int? + } + var values: Values { + switch self { + case .Ace: + return Values(first: 1, second: 11) + case .Jack, .Queen, .King: + return Values(first: 10, second: nil) + default: + return Values(first: self.toRaw(), second: nil) + } + } + } + + // BlackjackCard 的属性和方法 + let rank: Rank, suit: Suit + var description: String { + var output = "suit is \(suit.toRaw())," + output += " value is \(rank.values.first)" + if let second = rank.values.second { + output += " or \(second)" + } + return output + } +} +``` + +枚举型的`Suit`用来描述扑克牌的四种花色,并分别用一个`Character`类型的值代表花色符号。 + +枚举型的`Rank`用来描述扑克牌从`Ace`~10,`J`,`Q`,`K`,13张牌,并分别用一个`Int`类型的值表示牌的面值。(这个`Int`类型的值不适用于`Ace`,`J`,`Q`,`K`的牌)。 + +如上文所提到的,枚举型`Rank`在自己内部定义了一个嵌套结构体`Values`。这个结构体包含两个变量,只有`Ace`有两个数值,其余牌都只有一个数值。结构体`Values`中定义的两个属性: + +`first`, 为` Int` +`second`, 为 `Int?`, 或 “optional `Int`” + +`Rank`定义了一个计算属性`values`,这个计算属性会根据牌的面值,用适当的数值去初始化`Values`实例,并赋值给`values`。对于`J`,`Q`,`K`,`Ace`会使用特殊数值,对于数字面值的牌使用`Int`类型的值。 + +`BlackjackCard`结构体自身有两个属性—`rank`与`suit`,也同样定义了一个计算属性`description`,`description`属性用`rank`和`suit`的中内容来构建对这张扑克牌名字和数值的描述,并用可选类型`second`来检查是否存在第二个值,若存在,则在原有的描述中增加对第二数值的描述。 + +因为`BlackjackCard`是一个没有自定义构造函数的结构体,在[Memberwise Initializers for Structure Types](https://github.com/CocoaChina-editors/Welcome-to-Swift/blob/master/The%20Swift%20Programming%20Language/02Language%20Guide/14Initialization.md)中知道结构体有默认的成员构造函数,所以你可以用默认的`initializer`去初始化新的常量`theAceOfSpades`: + +```swift +let theAceOfSpades = BlackjackCard(rank: .Ace, suit: .Spades) +println("theAceOfSpades: \(theAceOfSpades.description)") +// 打印出 "theAceOfSpades: suit is ♠, value is 1 or 11" +``` + +尽管`Rank`和`Suit`嵌套在`BlackjackCard`中,但仍可被引用,所以在初始化实例时能够通过枚举类型中的成员名称单独引用。在上面的例子中`description`属性能正确得输出对`Ace`牌有1和11两个值。 + + +##嵌套类型的引用 + +在外部对嵌套类型的引用,以被嵌套类型的名字为前缀,加上所要引用的属性名: + +```swift +let heartsSymbol = BlackjackCard.Suit.Hearts.toRaw() +// 红心的符号 为 "♡" +``` + +对于上面这个例子,这样可以使`Suit`, `Rank`, 和 `Values`的名字尽可能的短,因为它们的名字会自然的由被定义的上下文来限定。 + +preview diff --git a/source/chapter2/20_Extensions.md b/source/chapter2/20_Extensions.md old mode 100644 new mode 100755 index 1999b308..d009ab77 --- a/source/chapter2/20_Extensions.md +++ b/source/chapter2/20_Extensions.md @@ -1,279 +1,298 @@ -#扩展(Extensions) - ----- - -本页包含内容: - -- 扩展语法(Extension Syntax) -- 计算属性(Computed Properties) -- 构造器(Initializers) -- 方法(Methods) -- 下标(Subscripts) -- 嵌套类型(Nested Types) - -*扩展*就是向一个已有的类、结构体或枚举类型添加新功能(functionality)。这包括在没有权限获取原始源代码的情况下扩展类型的能力(即*逆向建模*)。扩展和Objective-C中的分类(categories)类似。(不过与Objective-C不同的是,Swift的扩展没有名字。) - -Swift中的扩展可以: - -- 添加计算属性和计算静态属性 -- 定义实例方法和类型方法 -- 提供新的构造器 -- 定义下标 -- 定义和使用新的嵌套类型 -- 使一个已有类型符合某个接口 - - ->注意 -如果你定义了一个扩展向一个已有类型添加新功能,那么这个新功能对该类型的所有已有实例中都是可用的,即使它们是在你的这个扩展的前面定义的。 - - -##扩展语法 - -声明一个扩展使用关键字`extension`: - -```javascript -extension SomeType{ - // new functionality to add to SomeType goes here -} -``` - -一个扩展可以扩展一个已有类型,使其能够适配一个或多个接口。当这种情况发生时,接口的名字应该完全按照类或结构体的名字的方式进行书写: - -```javascript -extension SomeType: SomeProtocol, AnotherProctocol{ - // implementation of protocol requirments goes here -} -``` - -按照这种方式添加的接口一致性被称之为**给扩展添加接口一致性(Protocal Conformance)** - - -##计算属性 - -扩展可以向已有类型添加计算实例属性和计算类型属性。下面的例子向Swift的内建`Double`类型添加了5个计算实例属性,从而提供与距离单位协作的基本支持。 - -```javascript -extension Double{ - var km: Double { return self * 1_000.0 } - var m : Double { return self } - var cm: Double { return self / 100.0 } - var mm: Double { return self / 1_000.0 } - var ft: Double { return self / 3.28084 } -} -let oneInch = 25.4.mm -println("One inch is \(oneInch) meters") -// prints "One inch is 0.0254 meters" -let threeFeet = 3.ft -println("Three feet is \(threeFeet) meters") -// prints "Three feet is 0.914399970739201 meters" -``` - -这些计算属性表达的含义是把一个`Double`型的值看作是某单位下的长度值。即使它们被实现为计算属性,但这些属性仍可以接一个带有dot语法的浮点型字面值,而这恰恰是使用这些浮点型字面量实现距离转换的方式。 - -在上述例子中,一个`Double`型的值`1.0`被用来表示“1米”。这就是为什么`m`计算属性返回`self`——表达式`1.m`被认为是计算`1.0`的`Double`值。 - -其它单位则需要一些转换来表示在米下测量的值。1千米等于1,000米,所以`km`计算属性要把值乘以`1_000.00`来转化成单位米下的数值。类似地,1米有3.28024英尺,所以`ft`计算属性要把对应的`Double`值除以`3.28024`来实现英尺到米的单位换算。 - -这些属性是只读的计算属性,所有从简考虑它们不用`get`关键字表示。它们的返回值是`Double`型,而且可以用于所有接受`Double`的数学计算中: - -```javascript -let aMarathon = 42.km + 195.m -println("A marathon is \(aMarathon) meters long") -// prints "A marathon is 42495.0 meters long" -``` - - ->注意 -扩展可以添加新的计算属性,但是不可以添加存储属性,也不可以向已有属性添加属性观测器(property observers)。 - -##构造器 - -扩展可以向已有类型添加新的构造器。这可以让你扩展其它类型,将你自己的定制类型作为构造器参数,或者提供该类型的原始实现中没有包含的额外初始化选项。 - - ->注意 -如果你使用扩展向一个值类型添加一个构造器,该构造器向所有的存储属性提供默认值,而且没有定义任何定制构造器(custom initializers),那么对于来自你的扩展构造器中的值类型,你可以调用默认构造器(default initializers)和成员级构造器(memberwise initializers)。 -正如在值类型的构造器授权中描述的,如果你已经把构造器写成值类型原始实现的一部分,上述规则不再适用。 - -下面的例子定义了一个用于描述几何矩形的定制结构体`Rect`。这个例子同时定义了两个辅助结构体`Size`和`Point`,它们都把`0.0`作为所有属性的默认值: -```javascript -struct Size{ - var width = 0.0, height = 0.0 -} -struct Point{ - var x = 0.0, y = 0.0 -} -struct Rect{ - var origin = Point() - var size = Size() -} -``` - -因为结构体`Rect`提供了其所有属性的默认值,所以正如默认构造器中描述的,它可以自动接受一个默认的构造器和一个成员级构造器。这些构造器可以用于构造新的`Rect`实例: - -```javascript -let defaultRect = Rect() -let memberwiseRect = Rect(origin: Point(x: 2.0, y: 2.0), - size: Size(width: 5.0, height: 5.0)) -``` - -你可以提供一个额外的使用特殊中心点和大小的构造器来扩展`Rect`结构体: -```javascript -extension Rect{ - init(center: Point, size: Size){ - let originX = center.x - (size.width / 2) - let originY = center.y - (size.height / 2) - self.init(origin: Point(x: originX, y: originY), size: size) - } -} -``` - -这个新的构造器首先根据提供的`center`和`size`值计算一个合适的原点。然后调用该结构体自动的成员构造器`init(origin:size:)`,该构造器将新的原点和大小存到了合适的属性中: -```javascript -let centerRect = Rect(center: Point(x: 4.0, y: 4.0), - size: Size(width: 3.0, height: 3.0)) -// centerRect's origin is (2.5, 2.5) and its size is (3.0, 3.0) -``` - - ->注意 -如果你使用扩展提供了一个新的构造器,你依旧有责任保证构造过程能够让所有实例完全初始化。 - -##方法 - -扩展可以向已有类型添加新的实例方法和类型方法。下面的例子向`Int`类型添加一个名为`repetitions`的新实例方法: -```javascript -extension Int{ - func repetitions(task: () -> ()){ - for i in 0..self{ - task() - } - } -} -``` - -这个`repetitions`方法使用了一个`() -> ()`类型的单参数(single argument),表明函数没有参数而且没有返回值。 - -定义该扩展之后,你就可以对任意整数调用`repetitions`方法,实现的功能则是多次执行某任务: -```javascript -3.repetitions({ - println("Hello!") - }) -// Hello! -// Hello! -// Hello! -``` - -可以使用trailing闭包使调用更加简洁: -```javascript -3.repetitions{ - println("Goodbye!") -} -// Goodbye! -// Goodbye! -// Goodbye! -``` - -###修改实例方法 - -通过扩展添加的实例方法也可以修改该实例本身。结构体和枚举类型中修改`self`或其属性的方法必须将该实例方法标注为`mutating`,正如来自原始实现的修改方法一样。 - -下面的例子向Swift的`Int`类型添加了一个新的名为`square`的修改方法,来实现一个原始值的平方计算: -```javascript -extension Int{ - mutating func square(){ - self = self * self - } -} -var someInt = 3 -someInt.square() -// someInt is now 9 -``` - -##下标 - -扩展可以向一个已有类型添加新下标。这个例子向Swift内建类型`Int`添加了一个整型下标。该下标`[n]`返回十进制数字从右向左数的第n个数字 - -- 123456789[0]返回9 -- 123456789[1]返回8 - -等等 - -```javascript -extension Int{ - subscript(digitIndex: Int) -> Int { - var decimalBase = 1 - for _ in 1...digitIndex{ - decimalBase *= 10 - } - return (self / decimalBase) % 10 - } -} -746381295[0] -// returns 5 -746381295[1] -// returns 9 -746381295[2] -// returns 2 -746381295[8] -// returns 7 -``` - -如果该`Int`值没有足够的位数,即下标越界,那么上述实现的下标会返回0,因为它会在数字左边自动补0: -```javascript -746381295[9] -//returns 0, 即等同于: -0746381295[9] -``` - -##嵌套类型 - -扩展可以向已有的类、结构体和枚举添加新的嵌套类型: -```javascript -extension Character { - enum Kind { - case Vowel, Consonant, Other - } - var kind: Kind { - switch String(self).lowercaseString { - case "a", "e", "i", "o", "u": - return .Vowel - case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", - "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z": - return .Consonant - default: - return .Other - } - } -} -``` - -该例子向`Character`添加了新的嵌套枚举。这个名为`Kind`的枚举表示特定字符的类型。具体来说,就是表示一个标准的拉丁脚本中的字符是元音还是辅音(不考虑口语和地方变种),或者是其它类型。 - -这个类子还向`Character`添加了一个新的计算实例属性,即`kind`,用来返回合适的`Kind`枚举成员。 - -现在,这个嵌套枚举可以和一个`Character`值联合使用了: -```javascript -func printLetterKinds(word: String) { - println("'\\(word)' is made up of the following kinds of letters:") - for character in word { - switch character.kind { - case .Vowel: - print("vowel ") - case .Consonant: - print("consonant ") - case .Other: - print("other ") - } - } - print("\n") -} -printLetterKinds("Hello") -// 'Hello' is made up of the following kinds of letters: -// consonant vowel consonant consonant vowel -``` - -函数`printLetterKinds`的输入是一个`String`值并对其字符进行迭代。在每次迭代过程中,考虑当前字符的`kind`计算属性,并打印出合适的类别描述。所以`printLetterKinds`就可以用来打印一个完整单词中所有字母的类型,正如上述单词`"hello"`所展示的。 - ->注意 -由于已知`character.kind`是`Character.Kind`型,所以`Character.Kind`中的所有成员值都可以使用`switch`语句里的形式简写,比如使用 `.Vowel`代替`Character.Kind.Vowel` +> 翻译:[lyuka](https://github.com/lyuka) +> 校对:[Hawstein](https://github.com/Hawstein) + +#扩展(Extensions) +---- + +本页包含内容: + +- [扩展语法](#extension_syntax) +- [计算型属性](#computed_properties) +- [构造器](#initializers) +- [方法](#methods) +- [下标](#subscripts) +- [嵌套类型](#nested_types) + +*扩展*就是向一个已有的类、结构体或枚举类型添加新功能(functionality)。这包括在没有权限获取原始源代码的情况下扩展类型的能力(即*逆向建模*)。扩展和 Objective-C 中的分类(categories)类似。(不过与Objective-C不同的是,Swift 的扩展没有名字。) + +Swift 中的扩展可以: + +- 添加计算型属性和计算静态属性 +- 定义实例方法和类型方法 +- 提供新的构造器 +- 定义下标 +- 定义和使用新的嵌套类型 +- 使一个已有类型符合某个协议 + + +>注意: +如果你定义了一个扩展向一个已有类型添加新功能,那么这个新功能对该类型的所有已有实例中都是可用的,即使它们是在你的这个扩展的前面定义的。 + + +## 扩展语法(Extension Syntax) + +声明一个扩展使用关键字`extension`: + +```swift +extension SomeType { + // 加到SomeType的新功能写到这里 +} +``` + +一个扩展可以扩展一个已有类型,使其能够适配一个或多个协议(protocol)。当这种情况发生时,协议的名字应该完全按照类或结构体的名字的方式进行书写: + +```swift +extension SomeType: SomeProtocol, AnotherProctocol { + // 协议实现写到这里 +} +``` + +按照这种方式添加的协议遵循者(protocol conformance)被称之为[在扩展中添加协议遵循者](21_Protocols.html#adding_protocol_conformance_with_an_extension) + + +## 计算型属性(Computed Properties) + +扩展可以向已有类型添加计算型实例属性和计算型类型属性。下面的例子向 Swift 的内建`Double`类型添加了5个计算型实例属性,从而提供与距离单位协作的基本支持。 + +```swift +extension Double { + var km: Double { return self * 1_000.0 } + var m : Double { return self } + var cm: Double { return self / 100.0 } + var mm: Double { return self / 1_000.0 } + var ft: Double { return self / 3.28084 } +} +let oneInch = 25.4.mm +println("One inch is \(oneInch) meters") +// 打印输出:"One inch is 0.0254 meters" +let threeFeet = 3.ft +println("Three feet is \(threeFeet) meters") +// 打印输出:"Three feet is 0.914399970739201 meters" +``` + +这些计算属性表达的含义是把一个`Double`型的值看作是某单位下的长度值。即使它们被实现为计算型属性,但这些属性仍可以接一个带有dot语法的浮点型字面值,而这恰恰是使用这些浮点型字面量实现距离转换的方式。 + +在上述例子中,一个`Double`型的值`1.0`被用来表示“1米”。这就是为什么`m`计算型属性返回`self`——表达式`1.m`被认为是计算`1.0`的`Double`值。 + +其它单位则需要一些转换来表示在米下测量的值。1千米等于1,000米,所以`km`计算型属性要把值乘以`1_000.00`来转化成单位米下的数值。类似地,1米有3.28024英尺,所以`ft`计算型属性要把对应的`Double`值除以`3.28024`来实现英尺到米的单位换算。 + +这些属性是只读的计算型属性,所有从简考虑它们不用`get`关键字表示。它们的返回值是`Double`型,而且可以用于所有接受`Double`的数学计算中: + +```swift +let aMarathon = 42.km + 195.m +println("A marathon is \(aMarathon) meters long") +// 打印输出:"A marathon is 42495.0 meters long" +``` + + +>注意: +扩展可以添加新的计算属性,但是不可以添加存储属性,也不可以向已有属性添加属性观测器(property observers)。 + + +## 构造器(Initializers) + +扩展可以向已有类型添加新的构造器。这可以让你扩展其它类型,将你自己的定制类型作为构造器参数,或者提供该类型的原始实现中没有包含的额外初始化选项。 + +扩展能向类中添加新的便利构造器,但是它们不能向类中添加新的指定构造器或析构函数。指定构造器和析构函数必须总是由原始的类实现来提供。 + +> 注意: +如果你使用扩展向一个值类型添加一个构造器,该构造器向所有的存储属性提供默认值,而且没有定义任何定制构造器(custom initializers),那么对于来自你的扩展构造器中的值类型,你可以调用默认构造器(default initializers)和逐一成员构造器(memberwise initializers)。 +正如在值类型的构造器授权中描述的,如果你已经把构造器写成值类型原始实现的一部分,上述规则不再适用。 + +下面的例子定义了一个用于描述几何矩形的定制结构体`Rect`。这个例子同时定义了两个辅助结构体`Size`和`Point`,它们都把`0.0`作为所有属性的默认值: + +```swift +struct Size { + var width = 0.0, height = 0.0 +} +struct Point { + var x = 0.0, y = 0.0 +} +struct Rect { + var origin = Point() + var size = Size() +} +``` + +因为结构体`Rect`提供了其所有属性的默认值,所以正如默认构造器中描述的,它可以自动接受一个默认的构造器和一个成员级构造器。这些构造器可以用于构造新的`Rect`实例: + +```swift +let defaultRect = Rect() +let memberwiseRect = Rect(origin: Point(x: 2.0, y: 2.0), + size: Size(width: 5.0, height: 5.0)) +``` + +你可以提供一个额外的使用特殊中心点和大小的构造器来扩展`Rect`结构体: + +```swift +extension Rect { + init(center: Point, size: Size) { + let originX = center.x - (size.width / 2) + let originY = center.y - (size.height / 2) + self.init(origin: Point(x: originX, y: originY), size: size) + } +} +``` + +这个新的构造器首先根据提供的`center`和`size`值计算一个合适的原点。然后调用该结构体自动的成员构造器`init(origin:size:)`,该构造器将新的原点和大小存到了合适的属性中: + +```swift +let centerRect = Rect(center: Point(x: 4.0, y: 4.0), + size: Size(width: 3.0, height: 3.0)) +// centerRect的原点是 (2.5, 2.5),大小是 (3.0, 3.0) +``` + + +>注意: +如果你使用扩展提供了一个新的构造器,你依旧有责任保证构造过程能够让所有实例完全初始化。 + + +## 方法(Methods) + +扩展可以向已有类型添加新的实例方法和类型方法。下面的例子向`Int`类型添加一个名为`repetitions`的新实例方法: + +```swift +extension Int { + func repetitions(task: () -> ()) { + for i in 0..self { + task() + } + } +} +``` + +这个`repetitions`方法使用了一个`() -> ()`类型的单参数(single argument),表明函数没有参数而且没有返回值。 + +定义该扩展之后,你就可以对任意整数调用`repetitions`方法,实现的功能则是多次执行某任务: + +```swift +3.repetitions({ + println("Hello!") + }) +// Hello! +// Hello! +// Hello! +``` + +可以使用 trailing 闭包使调用更加简洁: + +```swift +3.repetitions{ + println("Goodbye!") +} +// Goodbye! +// Goodbye! +// Goodbye! +``` + + +### 修改实例方法(Mutating Instance Methods) + +通过扩展添加的实例方法也可以修改该实例本身。结构体和枚举类型中修改`self`或其属性的方法必须将该实例方法标注为`mutating`,正如来自原始实现的修改方法一样。 + +下面的例子向Swift的`Int`类型添加了一个新的名为`square`的修改方法,来实现一个原始值的平方计算: + +```swift +extension Int { + mutating func square() { + self = self * self + } +} +var someInt = 3 +someInt.square() +// someInt 现在值是 9 +``` + + +## 下标(Subscripts) + +扩展可以向一个已有类型添加新下标。这个例子向Swift内建类型`Int`添加了一个整型下标。该下标`[n]`返回十进制数字从右向左数的第n个数字 + +- 123456789[0]返回9 +- 123456789[1]返回8 + +...等等 + +```swift +extension Int { + subscript(digitIndex: Int) -> Int { + var decimalBase = 1 + for _ in 1...digitIndex { + decimalBase *= 10 + } + return (self / decimalBase) % 10 + } +} +746381295[0] +// returns 5 +746381295[1] +// returns 9 +746381295[2] +// returns 2 +746381295[8] +// returns 7 +``` + +如果该`Int`值没有足够的位数,即下标越界,那么上述实现的下标会返回0,因为它会在数字左边自动补0: + +```swift +746381295[9] +//returns 0, 即等同于: +0746381295[9] +``` + + +## 嵌套类型(Nested Types) + +扩展可以向已有的类、结构体和枚举添加新的嵌套类型: + +```swift +extension Character { + enum Kind { + case Vowel, Consonant, Other + } + var kind: Kind { + switch String(self).lowercaseString { + case "a", "e", "i", "o", "u": + return .Vowel + case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", + "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z": + return .Consonant + default: + return .Other + } + } +} +``` + +该例子向`Character`添加了新的嵌套枚举。这个名为`Kind`的枚举表示特定字符的类型。具体来说,就是表示一个标准的拉丁脚本中的字符是元音还是辅音(不考虑口语和地方变种),或者是其它类型。 + +这个类子还向`Character`添加了一个新的计算实例属性,即`kind`,用来返回合适的`Kind`枚举成员。 + +现在,这个嵌套枚举可以和一个`Character`值联合使用了: + +```swift +func printLetterKinds(word: String) { + println("'\\(word)' is made up of the following kinds of letters:") + for character in word { + switch character.kind { + case .Vowel: + print("vowel ") + case .Consonant: + print("consonant ") + case .Other: + print("other ") + } + } + print("\n") +} +printLetterKinds("Hello") +// 'Hello' is made up of the following kinds of letters: +// consonant vowel consonant consonant vowel +``` + +函数`printLetterKinds`的输入是一个`String`值并对其字符进行迭代。在每次迭代过程中,考虑当前字符的`kind`计算属性,并打印出合适的类别描述。所以`printLetterKinds`就可以用来打印一个完整单词中所有字母的类型,正如上述单词`"hello"`所展示的。 + +>注意: +由于已知`character.kind`是`Character.Kind`型,所以`Character.Kind`中的所有成员值都可以使用`switch`语句里的形式简写,比如使用 `.Vowel`代替`Character.Kind.Vowel` + diff --git a/source/chapter2/21_Protocols.md b/source/chapter2/21_Protocols.md old mode 100644 new mode 100755 index e4226a2b..f9d0d5c0 --- a/source/chapter2/21_Protocols.md +++ b/source/chapter2/21_Protocols.md @@ -1,573 +1,683 @@ +> 翻译:[geek5nan](https://github.com/geek5nan) +> 校对:[dabing1022](https://github.com/dabing1022) + # 协议 +----------------- -`协议(Protocol)`定义了用于完成某些特定任务或功能的方法,属性等的蓝图.协议实际上并不提供这些功能或任务的具体`实现(Implementation)`--而只用来描述这些实现应该做什么.类,结构体,枚举通过提供协议所要求的方法,属性的具体实现来`采用(adopt)`协议.任意能够满足协议要求的类型被称为协议的`遵循者`. +本页包含内容: -`协议`可以要求其`遵循者`提供特定的实例属性,实例方法,类方法,操作符或`下标(subscripts)`. +- [协议的语法(Protocol Syntax)](#protocol_syntax) +- [属性要求(Property Requirements)](#property_requirements) +- [方法要求(Method Requirements)](#method_requirements) +- [突变方法要求(Mutating Method Requirements)](#mutating_method_requirements) +- [协议类型(Protocols as Types)](#protocols_as_types) +- [委托(代理)模式(Delegation)](#delegation) +- [在扩展中添加协议成员(Adding Protocol Conformance with an Extension)](#adding_protocol_conformance_with_an_extension) +- [通过扩展补充协议声明(Declaring Protocol Adoption with an Extension)](#declaring_protocol_adoption_with_an_extension) +- [集合中的协议类型(Collections of Protocol Types)](#collections_of_protocol_types) +- [协议的继承(Protocol Inheritance)](#protocol_inheritance) +- [协议合成(Protocol Composition)](#protocol_composition) +- [检验协议的一致性(Checking for Protocol Conformance)](#checking_for_protocol_conformance) +- [可选协议要求(Optional Protocol Requirements)](#optional_protocol_requirements) +`协议(Protocol)`定义了用于完成某些特定任务或功能的方法,属性等的蓝图。协议实际上并不提供这些功能或任务的具体`实现(Implementation)`--而只用来描述这些实现应该做什么。类,结构体,枚举通过提供协议所要求的方法,属性的具体实现来`采用(adopt)`协议。任意能够满足协议要求的类型被称为协议的`遵循者`。 + +`协议`可以要求其`遵循者`提供特定的实例属性,实例方法,类方法,操作符或`下标(subscripts)`。 + + ## 协议的语法 -`协议`的定义方式与`类,结构体,枚举`的定义都非常相似,如下所示: +`协议`的定义方式与`类,结构体,枚举`的定义都非常相似,如下所示: - protocol SomeProtocol { - // 协议内容 - } - -在类型名称后加上`协议名称`,中间以冒号`:`分隔即可实现协议;实现多个协议时,各协议之间用逗号`,`分隔,如下所示: +```swift +protocol SomeProtocol { + // 协议内容 +} +``` - struct SomeStructure: FirstProtocol, AnotherProtocol { - // 结构体内容 - } - -如果一个类在含有`父类`的同时也采用了协议,应当把`父类`放在所有的`协议`之前,如下所示: +在类型名称后加上`协议名称`,中间以冒号`:`分隔即可实现协议;实现多个协议时,各协议之间用逗号`,`分隔,如下所示: - class SomeClass: SomeSuperClass, FirstProtocol, AnotherProtocol { - // 类的内容 - } - +```swift +struct SomeStructure: FirstProtocol, AnotherProtocol { + // 结构体内容 +} +``` + +如果一个类在含有`父类`的同时也采用了协议,应当把`父类`放在所有的`协议`之前,如下所示: + +```swift +class SomeClass: SomeSuperClass, FirstProtocol, AnotherProtocol { + // 类的内容 +} +``` + + ## 对属性的规定 -协议可以要求其`遵循者`提供特定名称与类型的`实例属性(instance property)`或`类属性(type property)`,而不管其是`存储型属性(stored property)`还是`计算型属性(calculate property)`.此外也可以指定属性是只读的还是可读写的. +协议可以规定其`遵循者`提供特定名称与类型的`实例属性(instance property)`或`类属性(type property)`,而不管其是`存储型属性(stored property)`还是`计算型属性(calculate property)`。此外也可以指定属性是只读的还是可读写的。 -如果协议要求属性是可读写的,那么这个属性不能是常量`存储型属性`或只读`计算型属性`;如果协议要求属性是只读的(gettable),那么`计算型属性`或`存储型属性`都能满足协议对属性的规定,在你的代码中,即使为只读属性实现了写方法(settable)也依然有效. +如果协议要求属性是可读写的,那么这个属性不能是常量`存储型属性`或只读`计算型属性`;如果协议要求属性是只读的(gettable),那么`计算型属性`或`存储型属性`都能满足协议对属性的规定,在你的代码中,即使为只读属性实现了写方法(settable)也依然有效。 -协议中的属性经常被加以`var`前缀声明其为变量属性,在声明后加上`{ set get }`来表示属性是可读写的,只读的属性则写作`{ get }`,如下所示: +协议中的属性经常被加以`var`前缀声明其为变量属性,在声明后加上`{ set get }`来表示属性是可读写的,只读的属性则写作`{ get }`,如下所示: - protocol SomeProtocol { - var musBeSettable : Int { get set } - var doesNotNeedToBeSettable: Int { get } +```swift +protocol SomeProtocol { + var musBeSettable : Int { get set } + var doesNotNeedToBeSettable: Int { get } +} +``` + +如下所示,通常在协议的定义中使用`class`前缀表示该属性为类成员。在枚举和结构体实现协议时中,需要使用`static`关键字作为前缀。 + +```swift +protocol AnotherProtocol { + class var someTypeProperty: Int { get set } +} + +如下所示,这是一个含有一个实例属性要求的协议: + +protocol FullyNamed { + var fullName: String { get } +} +``` + +`FullyNamed`协议定义了任何拥有全名的事物。它并不指定具体事物,而只是要求事物必须提供一个全名。任何`FullyNamed`类型都得有一个只读的`fullName`属性,类型为`String`。 + +如下所示,这是一个实现了`FullyNamed`协议的简单结构体: + +```swift +struct Person: FullyNamed{ + var fullName: String +} +let john = Person(fullName: "John Appleseed") +//john.fullName 为 "John Appleseed" +``` + +这个例子中定义了一个叫做`Person`的结构体,用来表示具有指定名字的人。在第一行代码中可以看出,它采用了`FullyNamed`协议作为定义的一部分。 + +`Person`结构体的每一个实例都有一个叫做`fullName`,`String`类型的存储型属性,这正好匹配了`FullyNamed`协议的要求,也就意味着,`Person`结构体完整的`遵循`了协议。(如果协议要求未被完全满足,在编译时会报错) + +这有一个更为复杂的类,它采用并实现了`FullyNamed`协议,如下所示: + +```swift +class Starship: FullyNamed { + var prefix: String? + var name: String + init(name: String, prefix: String? = nil ) { + self.anme = name + self.prefix = prefix } - -如下所示,通常在协议的定义中使用`class`前缀表示该属性为类成员.在枚举和结构体实现协议时中,需要使用`static`关键字作为前缀 - - protocol AnotherProtocol { - class var someTypeProperty: Int { get set } + var fullName: String { + return (prefix ? prefix ! + " " : " ") + name } - -如下所示,这是一个含有一个实例属性要求的协议: +} +var ncc1701 = Starship(name: "Enterprise", prefix: "USS") +// ncc1701.fullName == "USS Enterprise" +``` - protocol FullyNamed { - var fullName: String { get } - } - -`FullyNamed`协议定义了任何拥有全名的事物.它并不指定具体事物,而只是要求事物必须提供一个全名.任何`FullyNamed`类型都得有一个只读的`fullName`属性,类型为`String` - -如下所示,这是一个实现了`FullyNamed`协议的简单结构体: - - struct Person: FullyNamed{ - var fullName: String - } - let john = Person(fullName: "John Appleseed") - //john.fullName 为 "John Appleseed" - -这个例子中定义了一个叫做`Person`的结构体,用来表示具有指定名字的人.在第一行代码中可以看出,它采用了`FullyNamed`协议作为定义的一部分. - -`Person`结构体的每一个实例都含有一个叫做`fullName`,`String`类型的存储型属性,这正好匹配了`FullyNamed`协议的要求,也就意味着,`Person`结构体完整的`遵循`了协议.(如果协议要求未被完全满足,在编译时会报错) - -这有一个更为复杂的类,它采用并实现了`FullyNamed`协议,如下所示: - - class Starship: FullyNamed { - var prefix: String? - var name: String - init(name: String, prefix: Stirng? = nil ) { - self.anme = name - self.prefix = prefix - } - var fullName: String { - return (prefix ? prefix ! + " " : " ") + name - } - } - var ncc1701 = Starship(name: "Enterprise", prefix: "USS") - // ncc1701.fullName == "USS Enterprise" - -`Starship`类把`fullName`属性实现为只读的`计算型属性`.每一个`Starship`类的实例都有一个名为`name`的必备属性和一个名为`prefix`的可选属性. 当`prefix`存在时,将`prefix`插入到`name`之前来为`Starship`构建`fullName`,`prefix`不存在时,则将直接用`name`构建`fullName` +`Starship`类把`fullName`属性实现为只读的`计算型属性`。每一个`Starship`类的实例都有一个名为`name`的必备属性和一个名为`prefix`的可选属性。 当`prefix`存在时,将`prefix`插入到`name`之前来为`Starship`构建`fullName`,`prefix`不存在时,则将直接用`name`构建`fullName` + ## 对方法的规定 -`协议`可以要求其`遵循者`实现某些指定的`实例方法`或`类方法`.这些方法作为协议的一部分,像普通的方法一样清晰的放在协议的定义中,而不需要大括号和方法体. +`协议`可以要求其`遵循者`实现某些指定的`实例方法`或`类方法`。这些方法作为协议的一部分,像普通的方法一样清晰的放在协议的定义中,而不需要大括号和方法体。 ->笔记: ->协议中的方法支持`变长参数(variadic parameter)`,不支持`参数默认值(default value)`. +>注意: +>协议中的方法支持`变长参数(variadic parameter)`,不支持`参数默认值(default value)`。 -如下所示,协议中类方法的定义与类属性的定义相似,在协议定义的方法前置`class`关键字来表示.当在`枚举`或`结构体`实现类方法时,需要使用`static`关键字作为前缀. +如下所示,协议中类方法的定义与类属性的定义相似,在协议定义的方法前置`class`关键字来表示。当在`枚举`或`结构体`实现类方法时,需要使用`static`关键字作为前缀。 - protocol SomeProtocol { - class func someTypeMethod() +```swift +protocol SomeProtocol { + class func someTypeMethod() +} +``` + +如下所示,定义了含有一个实例方法的的协议。 + +``` +protocol RandomNumberGenerator { + func random() -> Double +} +``` + +`RandomNumberGenerator`协议要求其`遵循者`必须拥有一个名为`random`, 返回值类型为`Double`的实例方法。 (尽管这里并未指明,但是我们假设返回值在[0,1]区间内)。 + +`RandomNumberGenerator`协议并不在意每一个随机数是怎样生成的,它只强调这里有一个随机数生成器。 + +如下所示,下边的是一个遵循了`RandomNumberGenerator`协议的类。该类实现了一个叫做*线性同余生成器(linear congruential generator)*的伪随机数算法。 + + +```swift +class LinearCongruentialGenerator: RandomNumberGenerator { + var lastRandom = 42.0 + let m = 139968.0 + let a = 3877.0 + let c = 29573.0 + func random() -> Double { + lastRandom = ((lastRandom * a + c) % m) + return lastRandom / m } +} +let generator = LinearCongruentialGenerator() +println("Here's a random number: \(generator.random())") +// 输出 : "Here's a random number: 0.37464991998171" +println("And another one: \(generator.random())") +// 输出 : "And another one: 0.729023776863283" +``` -如下所示,定义了含有一个实例方法的的协议. - - protocol RandomNumberGenerator { - func random() -> Double - } - -`RandomNumberGenerator`协议要求其`遵循者`必须拥有一个名为`random`, 返回值类型为`Double`的实例方法. (尽管这里并未指明,但是我们假设返回值在[0,1]区间内). - -`RandomNumberGenerator`协议并不在意每一个随机数是怎样生成的,它只强调这里有一个随机数生成器. - -如下所示,下边的是一个遵循了`RandomNumberGenerator`协议的类.该类实现了一个叫做*线性同余生成器(linear congruential generator)*的伪随机数算法. - - class LinearCongruentialGenerator: RandomNumberGenerator { - var lastRandom = 42.0 - let m = 139968.0 - let a = 3877.0 - let c = 29573.0 - func random() -> Double { - lastRandom = ((lastRandom * a + c) % m) - return lastRandom / m - } - } - let generator = LinearCongruentialGenerator() - println("Here's a random number: \(generator.random())") - // 输出 "Here's a random number: 0.37464991998171" - println("And another one: \(generator.random())") - // 输出 "And another one: 0.729023776863283" - + ## 对突变方法的规定 -有时不得不在方法中更改实例的所属类型.在基于`值类型(value types)`(结构体,枚举)的实例方法中,将`mutating`关键字作为函数的前缀,写在`func`之前,表示可以在该方法中修改实例及其属性的所属类型.这一过程在[Modifyting Value Types from Within Instance Methods](1)章节中有详细描述. +有时不得不在方法中更改实例的所属类型。在基于`值类型(value types)`(结构体,枚举)的实例方法中,将`mutating`关键字作为函数的前缀,写在`func`之前,表示可以在该方法中修改实例及其属性的所属类型。这一过程在[Modifyting Value Types from Within Instance Methods](1)章节中有详细描述。 -如果协议中的实例方法打算改变其`遵循者`实例的类型,那么在协议定义时需要在方法前加`mutating`关键字,才能使`结构体,枚举`来采用并满足协议中对方法的规定. +如果协议中的实例方法打算改变其`遵循者`实例的类型,那么在协议定义时需要在方法前加`mutating`关键字,才能使`结构体,枚举`来采用并满足协议中对方法的规定。 -> 注意: 用`类`实现协议中的`mutating`方法时,不用写`mutating`关键字;用`结构体`,`枚举`实现协议中的`mutating`方法时,必须写`mutating`关键字. -如下所示,`Togglable`协议含有名为`toggle`的突变实例方法.根据名称推测,`toggle`方法应该是用于切换或恢复其`遵循者`实例或其属性的类型. +>注意: +>用`类`实现协议中的`mutating`方法时,不用写`mutating`关键字;用`结构体`,`枚举`实现协议中的`mutating`方法时,必须写`mutating`关键字。 - protocol Togglable { - mutating func toggle() - } - -当使用`枚举`或`结构体`来实现`Togglabl`协议时,需要提供一个带有`mutating`前缀的`toggle`方法. +如下所示,`Togglable`协议含有名为`toggle`的突变实例方法。根据名称推测,`toggle`方法应该是用于切换或恢复其`遵循者`实例或其属性的类型。 -如下所示,`OnOffSwitch`枚举`遵循`了`Togglable`协议,`On`,`Off`两个成员用于表示当前状态.枚举的`toggle`方法被标记为`mutating`,用以匹配`Togglabel`协议的规定. +```swift +protocol Togglable { + mutating func toggle() +} +``` - enum OnOffSwitch: Togglable { - case Off, On - mutating func toggle() { - switch self { - case Off: - self = On - case On: - self = Off - } +当使用`枚举`或`结构体`来实现`Togglabl`协议时,需要提供一个带有`mutating`前缀的`toggle`方法。 + +如下所示,`OnOffSwitch`枚举`遵循`了`Togglable`协议,`On`,`Off`两个成员用于表示当前状态。枚举的`toggle`方法被标记为`mutating`,用以匹配`Togglabel`协议的规定。 + +```swift +enum OnOffSwitch: Togglable { + case Off, On + mutating func toggle() { + switch self { + case Off: + self = On + case On: + self = Off } } - var lightSwitch = OnOffSwitch.Off - lightSwitch.toggle() - //lightSwitch 现在的值为 .On - +} +var lightSwitch = OnOffSwitch.Off +lightSwitch.toggle() +//lightSwitch 现在的值为 .On +``` + ## 协议类型 -尽管`协议`本身并不实现任何功能,但是`协议`可以被当做类型来使用. +尽管`协议`本身并不实现任何功能,但是`协议`可以被当做类型来使用。 使用场景: -* `协议类型`作为函数,方法或构造器中的参数类型或返回值类型 -* `协议类型`作为常量,变量或属性的类型 -* `协议类型`作为数组,字典或其他容器中的元素类型 +* `协议类型`作为函数,方法或构造器中的参数类型或返回值类型 +* `协议类型`作为常量,变量或属性的类型 +* `协议类型`作为数组,字典或其他容器中的元素类型 -> 注意: 协议是一种类型,因此协议类型的名称应与其他类型(Int,Double,String)的写法相同,使用驼峰式写法 +> 注意: 协议是一种类型,因此协议类型的名称应与其他类型(Int,Double,String)的写法相同,使用驼峰式写法 -如下所示,这个示例中将协议当做类型来使用 +如下所示,这个示例中将协议当做类型来使用 - class Dice { - let sides: Int - let generator: RandomNumberGenerator - init(sides: Int, generator: RandomNumberGenerator) { - self.sides = sides - self.generator = generator - } +```swift +class Dice { + let sides: Int + let generator: RandomNumberGenerator + init(sides: Int, generator: RandomNumberGenerator) { + self.sides = sides + self.generator = generator + } func roll() -> Int { - return Int(generator.random() * Double(sides)) + 1 - } + return Int(generator.random() * Double(sides)) +1 } +} +``` - 例子中又一个`Dice`类,用来代表桌游中的拥有N个面的骰子.`Dice`的实例含有`sides`和`generator`两个属性,前者是整型,用来表示骰子有几个面,后者为骰子提供一个随机数生成器. +例子中又一个`Dice`类,用来代表桌游中的拥有N个面的骰子。`Dice`的实例含有`sides`和`generator`两个属性,前者是整型,用来表示骰子有几个面,后者为骰子提供一个随机数生成器。 - `generator`属性的类型为`RandomNumberGenerator`,因此任何遵循了`RandomNumberGenerator`协议的类型的实例都可以赋值给`generator`,除此之外,无其他要求. + `generator`属性的类型为`RandomNumberGenerator`,因此任何遵循了`RandomNumberGenerator`协议的类型的实例都可以赋值给`generator`,除此之外,无其他要求。 -`Dice`类中也有一个`构造器(initializer)`,用来进行初始化操作.构造器中含有一个名为`generator`,类型为`RandomNumberGenerator`的形参.在调用构造方法时创建`Dice`的实例时,可以传入任何遵循`RandomNumberGenerator`协议的实例给generator. +`Dice`类中也有一个`构造器(initializer)`,用来进行初始化操作。构造器中含有一个名为`generator`,类型为`RandomNumberGenerator`的形参。在调用构造方法时创建`Dice`的实例时,可以传入任何遵循`RandomNumberGenerator`协议的实例给generator。 -`Dice`类也提供了一个名为`roll`的实例方法用来模拟骰子的面值.它先使用`generator`的`random`方法来创建一个[0-1]区间内的随机数种子,然后加工这个随机数种子生成骰子的面值.generator被认为是遵循了`RandomNumberGenerator`的类型,因而保证了`random`方法可以被调用. +`Dice`类也提供了一个名为`roll`的实例方法用来模拟骰子的面值。它先使用`generator`的`random`方法来创建一个[0-1]区间内的随机数种子,然后加工这个随机数种子生成骰子的面值。generator被认为是遵循了`RandomNumberGenerator`的类型,因而保证了`random`方法可以被调用。 -如下所示,这里展示了如何使用`LinearCongruentialGenerator`的实例作为随机数生成器创建一个六面骰子: +如下所示,这里展示了如何使用`LinearCongruentialGenerator`的实例作为随机数生成器创建一个六面骰子: - var d6 = Dice(sides: 6, generator: LinearCongruentialGenerator()) - for _ in 1...5 { - println("Random dice roll is \(d6.roll())") - } - //输出结果 - //Random dice roll is 3 - //Random dice roll is 5 - //Random dice roll is 4 - //Random dice roll is 5 - //Random dice roll is 4 - +```swift +var d6 = Dice(sides: 6,generator: LinearCongruentialGenerator()) +for _ in 1...5 { + println("Random dice roll is \(d6.roll())") +} +//输出结果 +//Random dice roll is 3 +//Random dice roll is 5 +//Random dice roll is 4 +//Random dice roll is 5 +//Random dice roll is 4 +``` + + ## 委托(代理)模式 -委托是一种设计模式(*译者注: 想起了那年 UITableViewDelegate 中的奔跑,那是我逝去的Objective-C...*),它允许`类`或`结构体`将一些需要它们负责的功能`交由(委托)`给其他的类型的实例. +委托是一种设计模式(*译者注: 想起了那年 UITableViewDelegate 中的奔跑,那是我逝去的Objective-C。。。*),它允许`类`或`结构体`将一些需要它们负责的功能`交由(委托)`给其他的类型的实例。 -委托模式的实现很简单: 定义`协议`来`封装`那些需要被委托的`函数和方法`, 使其`遵循者`拥有这些被委托的`函数和方法`. +委托模式的实现很简单: 定义`协议`来`封装`那些需要被委托的`函数和方法`, 使其`遵循者`拥有这些被委托的`函数和方法`。 -委托模式可以用来响应特定的动作或接收外部数据源提供的数据,而无需要知道外部数据源的所属类型(*译者注:只要求外部数据源`遵循`某协议*). +委托模式可以用来响应特定的动作或接收外部数据源提供的数据,而无需要知道外部数据源的所属类型(*译者注:只要求外部数据源`遵循`某协议*)。 下文是两个基于骰子游戏的协议: - protocol DiceGame { - var dice: Dice { get } - func play() - } - protocol DiceGameDelegate { - func gameDidStart(game: DiceGame) - func game(game: DiceGame, didStartNewTurnWithDiceRoll diceRoll:Int) - func gameDidEnd(game: DiceGame) - } +```swift +protocol DiceGame { + var dice: Dice { get } + func play() +} + +protocol DiceGameDelegate { + func gameDidStart(game: DiceGame) + func game(game: DiceGame, didStartNewTurnWithDiceRoll diceRoll:Int) + func gameDidEnd(game: DiceGame) +} +``` + +`DiceGame`协议可以在任意含有骰子的游戏中实现,`DiceGameDelegate`协议可以用来追踪`DiceGame`的游戏过程 -`DiceGame`协议可以在任意含有骰子的游戏中实现,`DiceGameDelegate`协议可以用来追踪`DiceGame`的游戏过程 - -如下所示,`SnakesAndLadders`是`Snakes and Ladders`(译者注:[Control Flow](2)章节有该游戏的详细介绍)游戏的新版本.新版本使用`Dice`作为骰子,并且实现了`DiceGame`和`DiceGameDelegate`协议,后者用来记录游戏的过程: +如下所示,`SnakesAndLadders`是`Snakes and Ladders`(译者注:[Control Flow](2)章节有该游戏的详细介绍)游戏的新版本。新版本使用`Dice`作为骰子,并且实现了`DiceGame`和`DiceGameDelegate`协议,后者用来记录游戏的过程: - class SnakesAndLadders: DiceGame { - let finalSquare = 25 - let dice = Dice(sides: 6, generator: LinearCongruentialGenerator()) - var square = 0 - var board: Int[] - init() { - board = Int[](count: finalSquare + 1, repeatedValue: 0) - board[03] = +08; board[06] = +11; board[09] = +09; board[10] = +02 - board[14] = -10; board[19] = -11; board[22] = -02; board[24] = -08 - } - var delegate: DiceGameDelegate? - func play() { - square = 0 - delegate?.gameDidStart(self) - gameLoop: while square != finalSquare { - let diceRoll = dice.roll() - delegate?.game(self, didStartNewTurnWithDiceRoll: diceRoll) - switch square + diceRoll { - case finalSquare: - break gameLoop - case let newSquare where newSquare > finalSquare: - continue gameLoop - default: - square += diceRoll - square += board[square] - } - } - delegate?.gameDidEnd(self) - } +```swift +class SnakesAndLadders: DiceGame { + let finalSquare = 25 + let dic = Dice(sides: 6, generator: LinearCongruentialGenerator()) + var square = 0 + var board: Int[] + init() { + board = Int[](count: finalSquare + 1, repeatedValue: 0) + board[03] = +08; board[06] = +11; borad[09] = +09; board[10] = +02 + borad[14] = -10; board[19] = -11; borad[22] = -02; board[24] = -08 } - -这个版本的游戏封装到了`SnakesAndLadders`类中,该类采用了`DiceGame`协议,并且提供了`dice`属性和`play`实例方法用来`遵循`协议.(`dice`属性在构造之后就不在改变,且协议只要求`dice`为只读的,因此将`dice`声明为常量属性.) + var delegate: DiceGameDelegate? + func play() { + square = 0 + delegate?.gameDidStart(self) + gameLoop: while square != finalSquare { + let diceRoll = dice.roll() + delegate?.game(self,didStartNewTurnWithDiceRoll: diceRoll) + switch square + diceRoll { + case finalSquare: + break gameLoop + case let newSquare where newSquare > finalSquare: + continue gameLoop + default: + square += diceRoll + square += board[square] + } + } + delegate?.gameDIdEnd(self) + } +} +``` -在`SnakesAndLadders`类的`构造器(initializer)`初始化游戏.所有的游戏逻辑被转移到了`play`方法中,`play`方法使用协议规定的`dice`属性提供骰子摇出的值. +这个版本的游戏封装到了`SnakesAndLadders`类中,该类采用了`DiceGame`协议,并且提供了`dice`属性和`play`实例方法用来`遵循`协议。(`dice`属性在构造之后就不在改变,且协议只要求`dice`为只读的,因此将`dice`声明为常量属性。) -> 注意:`delegate`并不是游戏的必备条件,因此`delegate`被定义为遵循`DiceGameDelegate`协议的可选属性,`delegate`使用`nil`作为初始值. +在`SnakesAndLadders`类的`构造器(initializer)`初始化游戏。所有的游戏逻辑被转移到了`play`方法中,`play`方法使用协议规定的`dice`属性提供骰子摇出的值。 -`DicegameDelegate`协议提供了三个方法用来追踪游戏过程.被放置于游戏的逻辑中,即`play()`方法内.分别在游戏开始时,新一轮开始时,游戏结束时被调用. +> 注意:`delegate`并不是游戏的必备条件,因此`delegate`被定义为遵循`DiceGameDelegate`协议的可选属性,`delegate`使用`nil`作为初始值。 -因为`delegate`是一个遵循`DiceGameDelegate`的可选属性,因此在`play()`方法中使用了`可选链`来调用委托方法. 若`delegate`属性为`nil`, 则delegate所调用的方法失效.若`delegate`不为`nil`,则方法能够被调用 +`DicegameDelegate`协议提供了三个方法用来追踪游戏过程。被放置于游戏的逻辑中,即`play()`方法内。分别在游戏开始时,新一轮开始时,游戏结束时被调用。 -如下所示,`DiceGameTracker`遵循了`DiceGameDelegate`协议 +因为`delegate`是一个遵循`DiceGameDelegate`的可选属性,因此在`play()`方法中使用了`可选链`来调用委托方法。 若`delegate`属性为`nil`, 则delegate所调用的方法失效。若`delegate`不为`nil`,则方法能够被调用 - class DiceGameTracker: DiceGameDelegate { - var numberOfTurns = 0 - func gameDidStart(game: DiceGame) { - numberOfTurns = 0 - if game is SnakesAndLadders { - println("Started a new game of Snakes and Ladders") - } - println("The game is using a \(game.dice.sides)-sided dice") - } - func game(game: DiceGame, didStartNewTurnWithDiceRoll diceRoll: Int) { - ++numberOfTurns - println("Rolled a \(diceRoll)") - } - func gameDidEnd(game: DiceGame) { - println("The game lasted for \(numberOfTurns) turns") - } - } +如下所示,`DiceGameTracker`遵循了`DiceGameDelegate`协议 -`DiceGameTracker`实现了`DiceGameDelegate`协议规定的三个方法,用来记录游戏已经进行的轮数. 当游戏开始时,`numberOfTurns`属性被赋值为0; 在每新一轮中递加; 游戏结束后,输出打印游戏的总轮数. +```swift +class DiceGameTracker: DiceGameDelegate { + var numberOfTurns = 0 + func gameDidStart(game: DiceGame) { + numberOfTurns = 0 + if game is SnakesAndLadders { + println("Started a new game of Snakes and Ladders") + } + println("The game is using a \(game.dice.sides)-sided dice") + } + func game(game: DiceGame, didStartNewTurnWithDiceRoll diceRoll: Int) { + ++numberOfTurns + println("Rolled a \(diceRoll)") + } + func gameDidEnd(game: DiceGame) { + println("The game lasted for \(numberOfTurns) turns") + } +} +``` -`gameDidStart`方法从`game`参数获取游戏信息并输出.`game`在方法中被当做`DiceGame`类型而不是`SnakeAndLadders`类型,所以方法中只能访问`DiceGame`协议中的成员. +`DiceGameTracker`实现了`DiceGameDelegate`协议规定的三个方法,用来记录游戏已经进行的轮数。 当游戏开始时,`numberOfTurns`属性被赋值为0; 在每新一轮中递加; 游戏结束后,输出打印游戏的总轮数。 -`DiceGameTracker`的运行情况,如下所示: +`gameDidStart`方法从`game`参数获取游戏信息并输出。`game`在方法中被当做`DiceGame`类型而不是`SnakeAndLadders`类型,所以方法中只能访问`DiceGame`协议中的成员。 - “let tracker = DiceGameTracker() - let game = SnakesAndLadders() - game.delegate = tracker - game.play() - // Started a new game of Snakes and Ladders - // The game is using a 6-sided dice - // Rolled a 3 - // Rolled a 5 - // Rolled a 4 - // Rolled a 5 - // The game lasted for 4 turns” +`DiceGameTracker`的运行情况,如下所示: +```swift +let tracker = DiceGameTracker() +let game = SnakesAndLadders() +game.delegate = tracker +game.play() +// Started a new game of Snakes and Ladders +// The game is using a 6-sided dice +// Rolled a 3 +// Rolled a 5 +// Rolled a 4 +// Rolled a 5 +// The game lasted for 4 turns +``` + + ## 在扩展中添加协议成员 -即便无法修改源代码,依然可以通过`扩展(Extension)`来扩充已存在类型(*译者注: 类,结构体,枚举等*).`扩展`可以为已存在的类型添加`属性`,`方法`,`下标`,`协议`等成员.详情请在[扩展](4)章节中查看. +即便无法修改源代码,依然可以通过`扩展(Extension)`来扩充已存在类型(*译者注: 类,结构体,枚举等*)。`扩展`可以为已存在的类型添加`属性`,`方法`,`下标`,`协议`等成员。详情请在[扩展](4)章节中查看。 -> 注意: 通过`扩展`为已存在的类型`遵循`协议时,该类型的所有实例也会随之添加协议中的方法 +> 注意: 通过`扩展`为已存在的类型`遵循`协议时,该类型的所有实例也会随之添加协议中的方法 -`TextRepresentable`协议含有一个`asText`,如下所示: +`TextRepresentable`协议含有一个`asText`,如下所示: + +```swift +protocol TextRepresentable { + func asText() -> String +} +``` - protocol TextRepresentable { - func asText() -> String - } - 通过`扩展`为上一节中提到的`Dice`类遵循`TextRepresentable`协议 - extension Dice: TextRepresentable { - cun asText() -> String { - return "A \(sides)-sided dice" - } +```swift +extension Dice: TextRepresentable { + cun asText() -> String { + return "A \(sides)-sided dice" } - -从现在起,`Dice`类型的实例可被当作`TextRepresentable`类型: +} +``` - let d12 = Dice(sides: 12,generator: LinearCongruentialGenerator()) - println(d12.asText()) - // 输出 "A 12-sided dice" +从现在起,`Dice`类型的实例可被当作`TextRepresentable`类型: -`SnakesAndLadders`类也可以通过`扩展`的方式来遵循协议: +```swift +let d12 = Dice(sides: 12,generator: LinearCongruentialGenerator()) +println(d12.asText()) +// 输出 "A 12-sided dice" +``` - extension SnakeAndLadders: TextRepresentable { - func asText() -> String { - return "A game of Snakes and Ladders with \(finalSquare) squares" - } +`SnakesAndLadders`类也可以通过`扩展`的方式来遵循协议: + +```swift +extension SnakeAndLadders: TextRepresentable { + func asText() -> String { + return "A game of Snakes and Ladders with \(finalSquare) squares" } - println(game.asText()) - // 输出 "A game of Snakes and Ladders with 25 squares" +} +println(game.asText()) +// 输出 "A game of Snakes and Ladders with 25 squares" +``` -## 通过延展补充协议声明 + +## 通过扩展补充协议声明 -当一个类型已经实现了协议中的所有要求,却没有声明时,可以通过`扩展`来补充协议声明: +当一个类型已经实现了协议中的所有要求,却没有声明时,可以通过`扩展`来补充协议声明: - struct Hamster { - var name: String - func asText() -> String { - return "A hamster named \(name)" - } +```swift +struct Hamster { + var name: String + func asText() -> String { + return "A hamster named \(name)" } - extension Hamster: TextRepresentabl {} +} +extension Hamster: TextRepresentabl {} +``` -从现在起,`Hamster`的实例可以作为`TextRepresentable`类型使用 +从现在起,`Hamster`的实例可以作为`TextRepresentable`类型使用 - let simonTheHamster = Hamster(name: "Simon") - let somethingTextRepresentable: TextRepresentabl = simonTheHamester - println(somethingTextRepresentable.asText()) - // 输出 "A hamster named Simon" +```swift +let simonTheHamster = Hamster(name: "Simon") +let somethingTextRepresentable: TextRepresentabl = simonTheHamester +println(somethingTextRepresentable.asText()) +// 输出 "A hamster named Simon" +``` -> 注意: 即时满足了协议的所有要求,类型也不会自动转变,因此你必须为它做出明显的协议声明 +> 注意: 即时满足了协议的所有要求,类型也不会自动转变,因此你必须为它做出明显的协议声明 + ## 集合中的协议类型 -协议类型可以被集合使用,表示集合中的元素均为协议类型: +协议类型可以被集合使用,表示集合中的元素均为协议类型: - let things: TextRepresentable[] = [game,d12,simoTheHamster] +```swift +let things: TextRepresentable[] = [game,d12,simoTheHamster] +``` -如下所示,`things`数组可以被直接遍历,并调用其中元素的`asText()`函数: +如下所示,`things`数组可以被直接遍历,并调用其中元素的`asText()`函数: - for thing in things { - println(thing.asText()) - } - // A game of Snakes and Ladders with 25 squares - // A 12-sided dice - // A hamster named Simon +```swift +for thing in things { + println(thing.asText()) +} +// A game of Snakes and Ladders with 25 squares +// A 12-sided dice +// A hamster named Simon +``` -`thing`被当做是`TextRepresentable`类型而不是`Dice`,`DiceGame`,`Hamster`等类型.因此能且仅能调用`asText`方法 +`thing`被当做是`TextRepresentable`类型而不是`Dice`,`DiceGame`,`Hamster`等类型。因此能且仅能调用`asText`方法 + ## 协议的继承 -协议能够继承一到多个其他协议.语法与类的继承相似,多个协议间用逗号`,`分隔 +协议能够继承一到多个其他协议。语法与类的继承相似,多个协议间用逗号`,`分隔 - protocol InheritingProtocol: SomeProtocol, AnotherProtocol { - // 协议定义 - } +```swift +protocol InheritingProtocol: SomeProtocol, AnotherProtocol { + // 协议定义 +} +``` -如下所示,`PrettyTextRepresentable`协议继承了`TextRepresentable`协议 +如下所示,`PrettyTextRepresentable`协议继承了`TextRepresentable`协议 - protocol PrettyTextRepresentable: TextRepresentable { - func asPrettyText() -> String - } +```swift +protocol PrettyTextRepresentable: TextRepresentable { + func asPrettyText() -> String +} +``` -`遵循``PrettyTextRepresentable`协议的同时,也需要`遵循`TextRepresentable`协议. +`遵循``PrettyTextRepresentable`协议的同时,也需要`遵循`TextRepresentable`协议。 -如下所示,用`扩展`为`SnakesAndLadders`遵循`PrettyTextRepresentable`协议: +如下所示,用`扩展`为`SnakesAndLadders`遵循`PrettyTextRepresentable`协议: - extension SnakesAndLadders: PrettyTextRepresentable { - func asPrettyText() -> String { - var output = asText() + ":\n" - for index in 1...finalSquare { - switch board[index] { - case let ladder where ladder > 0: - output += "▲ " - case let snake where snake < 0: - output += "▼ " - default: - output += "○ " - } - } - return output - } - } +```swift +extension SnakesAndLadders: PrettyTextRepresentable { + func asPrettyText() -> String { + var output = asText() + ":\n" + for index in 1...finalSquare { + switch board[index] { + case let ladder where ladder > 0: + output += "▲ " + case let snake where snake < 0: + output += "▼ " + default: + output += "○ " + } + } + return output + } +} +``` 在`for in`中迭代出了`board`数组中的每一个元素: -* 当从数组中迭代出的元素的值大于0时,用`▲`表示 -* 当从数组中迭代出的元素的值小于0时,用`▼`表示 -* 当从数组中迭代出的元素的值等于0时,用`○`表示 +* 当从数组中迭代出的元素的值大于0时,用`▲`表示 +* 当从数组中迭代出的元素的值小于0时,用`▼`表示 +* 当从数组中迭代出的元素的值等于0时,用`○`表示 -任意`SankesAndLadders`的实例都可以使用`asPrettyText()`方法. +任意`SankesAndLadders`的实例都可以使用`asPrettyText()`方法。 - println(game.asPrettyText()) - // A game of Snakes and Ladders with 25 squares: - // ○ ○ ▲ ○ ○ ▲ ○ ○ ▲ ▲ ○ ○ ○ ▼ ○ ○ ○ ○ ▼ ○ ○ ▼ ○ ▼ ○ +```swift +println(game.asPrettyText()) +// A game of Snakes and Ladders with 25 squares: +// ○ ○ ▲ ○ ○ ▲ ○ ○ ▲ ▲ ○ ○ ○ ▼ ○ ○ ○ ○ ▼ ○ ○ ▼ ○ ▼ ○ +``` + ## 协议合成 -一个协议可由多个协议采用`protocol`这样的格式进行组合,称为`协议合成(protocol composition)`. +一个协议可由多个协议采用`protocol`这样的格式进行组合,称为`协议合成(protocol composition)`。 -举个栗子: +举个例子: - protocol Named { +```swift +protocol Named { var name: String { get } - } - protocol Aged { - var age: Int { get } - } - struct Person: Named, Aged { - var name: String - var age: Int - } - func wishHappyBirthday(celebrator: protocol) { +} +protocol Aged { + var age: Int { get } +} +struct Person: Named, Aged { + var name: String + var age: Int +} +func wishHappyBirthday(celebrator: protocol) { println("Happy birthday \(celebrator.name) - you're \(celebrator.age)!") - } - let birthdayPerson = Person(name: "Malcolm", age: 21) - wishHappyBirthday(birthdayPerson) - // 输出 "Happy birthday Malcolm - you're 21! +} +let birthdayPerson = Person(name: "Malcolm", age: 21) +wishHappyBirthday(birthdayPerson) +// 输出 "Happy birthday Malcolm - you're 21! +``` -`Named`协议包含`String`类型的`name`属性;`Aged`协议包含`Int`类型的`age`属性.`Person`结构体`遵循`了这两个协议. +`Named`协议包含`String`类型的`name`属性;`Aged`协议包含`Int`类型的`age`属性。`Person`结构体`遵循`了这两个协议。 -`wishHappyBirthday`函数的形参`celebrator`的类型为`protocol`.可以传入任意`遵循`这两个协议的类型的实例 +`wishHappyBirthday`函数的形参`celebrator`的类型为`protocol`。可以传入任意`遵循`这两个协议的类型的实例 -> 注意: `协议合成`并不会生成一个新协议类型,而是将多个协议合成为一个临时的协议,超出范围后立即失效. +> 注意: `协议合成`并不会生成一个新协议类型,而是将多个协议合成为一个临时的协议,超出范围后立即失效。 + ## 检验协议的一致性 -使用`is`和`as`操作符来检查协议的一致性或转化协议类型.检查和转化的语法和之前相同(*详情查看[Typy Casting章节](5)*): +使用`is`和`as`操作符来检查协议的一致性或转化协议类型。检查和转化的语法和之前相同(*详情查看[Typy Casting章节](5)*): -* `is`操作符用来检查实例是否`遵循`了某个`协议`. -* `as?`返回一个可选值,当实例`遵循`协议时,返回该协议类型;否则返回`nil` -* `as`用以强制向下转型. +* `is`操作符用来检查实例是否`遵循`了某个`协议`。 +* `as?`返回一个可选值,当实例`遵循`协议时,返回该协议类型;否则返回`nil` +* `as`用以强制向下转型。 - @objc protocol HasArea { - var area: Double { get } - } +```swift +@objc protocol HasArea { + var area: Double { get } +} +``` +> 注意: `@objc`用来表示协议是可选的,也可以用来表示暴露给`Objective-C`的代码,此外,`@objc`型协议只对`类`有效,因此只能在`类`中检查协议的一致性。详情查看*[Using Siwft with Cocoa and Objectivei-c](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/index.html#//apple_ref/doc/uid/TP40014216)*。 -> 注意: `@objc`用来表示协议是可选的,也可以用来表示暴露给`Objective-C`的代码,此外,`@objc`型协议只对`类`有效,因此只能在`类`中检查协议的一致性.详情查看*[Using Siwft with Cocoa and Objectivei-c](6)*. +如下所示,定义了`Circle`和`Country`类,它们都遵循了`haxArea`协议 -如下所示,定义了`Circle`和`Country`类,它们都遵循了`haxArea`协议 +```swift +class Circle: HasArea { + let pi = 3.1415927 + var radius: Double + var area:≈radius } + init(radius: Double) { self.radius = radius } +} +class Country: HasArea { + var area: Double + init(area: Double) { self.area = area } +} +``` - class Circle: HasArea { - let pi = 3.1415927 - var radius: Double - var area: Double { return pi * radius * radius } - init(radius: Double) { self.radius = radius } - } - class Country: HasArea { - var area: Double - init(area: Double) { self.area = area } - } +`Circle`类把`area`实现为基于`存储型属性`radius的`计算型属性`,`Country`类则把`area`实现为`存储型属性`。这两个类都`遵循`了`haxArea`协议。 -`Circle`类把`area`实现为基于`存储型属性`radius的`计算型属性`,`Country`类则把`area`实现为`存储型属性`.这两个类都`遵循`了`haxArea`协议. +如下所示,Animal是一个没有实现`HasArea`协议的类 -如下所示,Animal是一个没有实现`HasArea`协议的类 +```swift +class Animal { + var legs: Int + init(legs: Int) { self.legs = legs } +} +``` - class Animal { - var legs: Int - init(legs: Int) { self.legs = legs } - } +`Circle,Country,Animal`并没有一个相同的基类,因而采用`AnyObject`类型的数组来装载在他们的实例,如下所示: -`Circle,Country,Animal`并没有一个相同的基类,因而采用`AnyObject`类型的数组来装载在他们的实例,如下所示: +```swift +let objects: AnyObject[] = [ + Circle(radius: 2.0), + Country(area: 243_610), + Animal(legs: 4) +] +``` - let objects: AnyObject[] = [ - Circle(radius: 2.0), - Country(area: 243_610), - Animal(legs: 4) - ] +`objects`数组使用字面量初始化,数组包含一个`radius`为2。0的`Circle`的实例,一个保存了英国面积的`Country`实例和一个`legs`为4的`Animal`实例。 -`objects`数组使用字面量初始化,数组包含一个`radius`为2.0的`Circle`的实例,一个保存了英国面积的`Country`实例和一个`legs`为4的`Animal`实例. +如下所示,`objects`数组可以被迭代,对迭代出的每一个元素进行检查,看它是否遵循`了`HasArea`协议: - -如下所示,`objects`数组可以被迭代,对迭代出的每一个元素进行检查,看它是否遵循`了`HasArea`协议: - - for object in objects { +```swift +for object in objects { if let objectWithArea = object as? HasArea { - println("Area is \(objectWithArea.area)") - } else { - println("Something that doesn't have an area") - } - } - // 输出: Area is 12.5663708 - // 输出: Area is 243610.0 - // 输出: Something that doesn't have an area + println("Area is \(objectWithArea.area)") + } else { + println("Something that doesn't have an area") + } +} +// Area is 12.5663708 +// Area is 243610.0 +// Something that doesn't have an area +``` -当迭代出的元素遵循`HasArea`协议时,通过`as?`操作符将其`可选绑定(optional binding)`到`objectWithArea`常量上.`objectWithArea`是`HasArea`协议类型的实例,因此`area`属性是可以被访问和打印的. +当迭代出的元素遵循`HasArea`协议时,通过`as?`操作符将其`可选绑定(optional binding)`到`objectWithArea`常量上。`objectWithArea`是`HasArea`协议类型的实例,因此`area`属性是可以被访问和打印的。 -`objects`数组中元素的类型并不会因为`向下转型`而改变,它们仍然是`Circle`,`Country`,`Animal`类型.然而,当它们被赋值给`objectWithArea`常量时,则只被视为`HasArea`类型,因此只有`area`属性能够被访问. +`objects`数组中元素的类型并不会因为`向下转型`而改变,它们仍然是`Circle`,`Country`,`Animal`类型。然而,当它们被赋值给`objectWithArea`常量时,则只被视为`HasArea`类型,因此只有`area`属性能够被访问。 -## 可选协议的规定 + +## 可选协议要求 -可选协议含有可选成员,其`遵循者`可以选择是否实现这些成员.在协议中使用`@optional`关键字作为前缀来定义可选成员. +可选协议含有可选成员,其`遵循者`可以选择是否实现这些成员。在协议中使用`@optional`关键字作为前缀来定义可选成员。 -可选协议在调用时使用`可选链`,详细内容在[Optional Chaning](7)章节中查看. +可选协议在调用时使用`可选链`,详细内容在[Optional Chaning](7)章节中查看。 -像`someOptionalMethod?(someArgument)`这样,你可以在可选方法名称后加上`?`来检查该方法是否被实现.`可选方法`和`可选属性`都会返回一个`可选值(optional value)`,当其不可访问时,`?`之后语句不会执行,并整体返回`nil` +像`someOptionalMethod?(someArgument)`这样,你可以在可选方法名称后加上`?`来检查该方法是否被实现。`可选方法`和`可选属性`都会返回一个`可选值(optional value)`,当其不可访问时,`?`之后语句不会执行,并整体返回`nil` -> 注意: 可选协议只能在含有`@objc`前缀的协议中生效.且`@objc`的协议只能被`类`遵循 +> 注意: 可选协议只能在含有`@objc`前缀的协议中生效。且`@objc`的协议只能被`类`遵循 -如下所示,`Counter`类使用含有两个可选成员的`CounterDataSource`协议类型的外部数据源来提供`增量值(increment amount)` +如下所示,`Counter`类使用含有两个可选成员的`CounterDataSource`协议类型的外部数据源来提供`增量值(increment amount)` - @objc protocol CounterDataSource { - @optional func incrementForCount(count: Int) -> Int - @optional var fixedIncrement: Int { get } - } +```swift +@objc protocol CounterDataSource { + @optional func incrementForCount(count: Int) -> Int + @optional var fixedIncrement: Int { get } +} +``` -`CounterDataSource`含有`incrementForCount`的`可选方法`和`fiexdIncrement`的`可选属性`,它们使用了不同的方法来从数据源中获取合适的增量值. +`CounterDataSource`含有`incrementForCount`的`可选方法`和`fiexdIncrement`的`可选属性`,它们使用了不同的方法来从数据源中获取合适的增量值。 -> 注意: `CounterDataSource`中的属性和方法都是可选的,因此可以在类中声明但不实现这些成员,尽管技术上允许这样做,不过最好不要这样写. +> 注意: `CounterDataSource`中的属性和方法都是可选的,因此可以在类中声明但不实现这些成员,尽管技术上允许这样做,不过最好不要这样写。 -`Counter`类含有`CounterDataSource?`类型的可选属性`dataSource`,如下所示: +`Counter`类含有`CounterDataSource?`类型的可选属性`dataSource`,如下所示: - @objc class Counter { - var count = 0 - var dataSource: CounterDataSource? - func increment() { - if let amount = dataSource?.incrementForCount?(count) { - count += amount - } else if let amount = dataSource?.fixedIncrement? { - count += amount - } - } - } +```swift +@objc class Counter { + var count = 0 + var dataSource: CounterDataSource? + func increment() { + if let amount = dataSource?.incrementForCount?(count) { + count += amount + } else if let amount = dataSource?.fixedIncrement? { + count += amount + } + } +} +``` -`count`属性用于存储当前的值,`increment`方法用来为`count`赋值. +`count`属性用于存储当前的值,`increment`方法用来为`count`赋值。 -`increment`方法通过`可选链`,尝试从两种`可选成员`中获取`count`. +`increment`方法通过`可选链`,尝试从两种`可选成员`中获取`count`。 -1. 由于`dataSource`可能为`nil`,因此在`dataSource`后边加上了`?`标记来表明只在`dataSource`非空时才去调用incrementForCount`方法. -2. 即使`dataSource`存在,但是也无法保证其是否实现了`incrementForCount`方法,因此在`incrementForCount`方法后边也加有`?`标记 +1。 由于`dataSource`可能为`nil`,因此在`dataSource`后边加上了`?`标记来表明只在`dataSource`非空时才去调用incrementForCount`方法。 +2。 即使`dataSource`存在,但是也无法保证其是否实现了`incrementForCount`方法,因此在`incrementForCount`方法后边也加有`?`标记 -在调用`incrementForCount`方法后,`Int`型`可选值`通过`可选绑定(optional binding)`自动拆包并赋值给常量`amount`. +在调用`incrementForCount`方法后,`Int`型`可选值`通过`可选绑定(optional binding)`自动拆包并赋值给常量`amount`。 -当`incrementForCount`不能被调用时,尝试使用`可选属性``fixedIncrement`来代替. +当`incrementForCount`不能被调用时,尝试使用`可选属性``fixedIncrement`来代替。 -`ThreeSource`实现了`CounterDataSource`协议,如下所示: +`ThreeSource`实现了`CounterDataSource`协议,如下所示: class ThreeSource: CounterDataSource { let fixedIncrement = 3 @@ -575,52 +685,47 @@ 使用`ThreeSource`作为数据源开实例化一个`Counter`: - var counter = Counter() - counter.dataSource = ThreeSource() - for _ in 1...4 { - counter.increment() - println(counter.count) - } - // 3 - // 6 - // 9 - // 12 +```swift +var counter = Counter() +counter.dataSource = ThreeSource() +for _ in 1...4 { + counter.increment() + println(counter.count) +} +// 3 +// 6 +// 9 +// 12 +``` -`TowardsZeroSource`实现了`CounterDataSource`协议中的`incrementForCount`方法,如下所示: +`TowardsZeroSource`实现了`CounterDataSource`协议中的`incrementForCount`方法,如下所示: - class TowardsZeroSource: CounterDataSource { - func incrementForCount(count: Int) -> Int { - if count == 0 { - return 0 - } else if count < 0 { - return 1 - } else { - return -1 - } - } - } +```swift +class TowardsZeroSource: CounterDataSource { +func incrementForCount(count: Int) -> Int { + if count == 0 { + return 0 + } else if count < 0 { + return 1 + } else { + return -1 + } + } +} +``` -下边是执行的代码: - - counter.count = -4 - counter.dataSource = TowardsZeroSource() - for _ in 1...5 { - counter.increment() - println(counter.count) - } - // -3 - // -2 - // -1 - // 0 - // 0 - - - -[1]:http://baidu.com -[2]:http://baidu.com -[3]:http://baidu.com -[4]:http://baidu.com -[5]:http://baidu.com -[6]:http://baidu.com -[7]:http://baidu.com +下边是执行的代码: +```swift +counter.count = -4 +counter.dataSource = TowardsZeroSource() +for _ in 1...5 { + counter.increment() + println(counter.count) +} +// -3 +// -2 +// -1 +// 0 +// 0 +``` \ No newline at end of file diff --git a/source/chapter2/22_Generics.md b/source/chapter2/22_Generics.md old mode 100644 new mode 100755 index 3b779aac..35b48c32 --- a/source/chapter2/22_Generics.md +++ b/source/chapter2/22_Generics.md @@ -1,485 +1,518 @@ -# 泛型 ------- -本页包含内容: - -- 泛型所解决的问题 -- 泛型函数 -- 类型参数 -- 命名类型参数 -- 泛型类型 -- 类型约束 -- 关联类型 -- Where语句 - -*泛型代码*可以确保你写出灵活的,可重用的函数和定义出任何你所确定好的需求的类型。你的可以写出避免重复的代码,并且用一种清晰的,抽象的方式表达出来。 - -泛型是Swift需要强大特征中的其中一个,许多Swift标准库是通过泛型代码构建出来的。事实上,你已经使用泛型贯穿着整个Language Guide,即便你没有实现它。例如:Swift的Array和Dictionary类型都是泛型集。你可以创建一个Int数组,也可创建一个String数组,或者甚至于可以是任何其他Swift的类型数据数组。同样的,你也可以创建存储任何指定类型的字典(dictionary),而且这些类型可以是没有限制的。 - ------- - -## 泛型所解决的问题 - -这里是一个标准的,非泛型函数swapTwoInts,用来交换两个Int值: - -```C - func swapTwoInts(inout a: Int, inout b: Int) - let temporaryA = a - a = b - b = temporaryA - } -``` -这个函数使用in-out参数交换a和b的值,这两个参数被描述为[In-Out类型参数][1]。 - -`swapTwoInts`函数可以交换b的原始值到a,也可以交换a的原始值到b,你可以调用这个函数交换两个Int变量值: -```C - var someInt = 3 - var anotherInt = 107 - swapTwoInts(&someInt, &anotherInt) - println("someInt is now \(someInt), and anotherInt is now \(anotherInt)") - // prints "someInt is now 107, and anotherInt is now 3" -``` - -`swapTwoInts`函数是非常有用的,但是它只能交换Int值,如果你想要交换两个String或者Double,就不得不写更多的函数,如 `swapTwoStrings`和`swapTwoDoublesfunctions `,如同如下所示: - -```C - func swapTwoStrings(inout a: String, inout b: String) { - let temporaryA = a - a = b - b = temporaryA - } - - func swapTwoDoubles(inout a: Double, inout b: Double) { - let temporaryA = a - a = b - b = temporaryA - } -``` - -你可能注意到 `swapTwoInts`、 `swapTwoStrings`和`swapTwoDoubles`函数主题都是相同的,唯一不同之处就在于传入的变量不同,分别是Int、String和Double。 - -但实际应用中通常需要一个用处更强大并且尽可能的考虑到更多的灵活性单个函数,可以用来交换两个任何类型值,很幸运的是,泛型代码帮你解决了这种问题。(一个这种泛型函数后面已经定义好了。) - ->NOTE - ->In all three functions, it is important that the types of a and b are defined to be the same as each other. If a and b were not of the same type, it would not be possible to swap their values. Swift is a type-safe language, and does not allow (for example) a variable of type String and a variable of type Double to swap values with each other. Attempting to do so would be reported as a compile-time error. - - -## 泛型函数 - -`泛型函数`可以工作于任何类型,这里是一个上面`swapTwoInts`函数的泛型版本,用于交换两个值: -```C - func swapTwoValues(inout a: T, inout b: T) { - let temporaryA = a - a = b - b = temporaryA - } -``` -`swapTwoValues`函数主体和`swapTwoInts`函数是一样,而且,只在第一行稍微有那么一点点不同于`swapTwoInts`,如下所示: -```C - func swapTwoInts(inout a: Int, inout b: Int) - func swapTwoValues(inout a: T, inout b: T) -``` - -这个函数的泛型版本使用了节点类型命名(通常此情况下用字母T来表示)来代替实际类型名(如Int、String或Double)。节点类型名并不是表示T必须是任何类型,但是其规定a和b必须是同一类型的T,而不管T表示任何类型。只有`swapTwoValues`函数在每次调用时所传入的实际类型决定了T所代表的类型。 - -另外一个不同之处在于这个泛型函数名后面跟着的节点类型名(T)是用尖括号括起来的()。这个尖括号告诉Swift那个T是`swapTwoValues`函数所定义的一个节点类型。因为T是一个节点,Swift不会去查找每一个命名为T的实际类型。 - -`swapTwoValues`函数除了只要传入的两个任何类型值是同一类型外,也可以作为`swapTwoInts`函数被调用。每次`swapTwoValues`被调用,T所代表的类型值都会传给函数。 - -在下面的两个例子中,T分别代表Tnt和String: - -```C - var someInt = 3 - var anotherInt = 107 - swapTwoValues(&someInt, &anotherInt) - // someInt is now 107, and anotherInt is now 3 - - var someString = "hello" - var anotherString = "world" - swapTwoValues(&someString, &anotherString) - // someString is now "world", and anotherString is now "hello" - -``` - ->NOTE - ->The swapTwoValues function defined above is inspired by a generic function called swap, which is part of the Swift standard library, and is automatically made available for you to use in your apps. If you need the behavior of the swapTwoValues function in your own code, you can use Swift’s existing swap function rather than providing your own implementation. - -##Type Parameters -## 类型参数 - -在上面的`swapTwoValues`例子中,节点类型T是一种类型参数的示例。类型参数指定并命名为一个节点类型,并且紧随在函数名后面,并用一对尖括号括起来(如)。 - -一旦一个类型参数被指定,那么其可以被使用来定义一个函数的参数类型(如`swapTwoValues`函数中的参数a和b),或作为一个函数返回类型,或用作函数主体中的注释类型。在这种情况下,被类型参数所代表的节点类型不管函数任何时候被调用,都会被实际类型所替换(在上面`swapTwoValues`例子中,当函数第一次被调用时,T被Int替换,第二次调用时,被String替换。)。 - -你可支持多个类型参数,命名在尖括号中,用逗号分开。 - -## 命名类型参数 - -在简单的情况下,泛型函数或泛型类型需要指定一个节点类型(如上面的`swapTwoValues`泛型函数,或一个存储单一类型的泛型集,如Array),通常用一单个字母T来命名类型参数。不过,你可以使用任何有效的标识符来作为类型参数名。 - -如果你使用多个参数定义更复杂的泛型函数或泛型类型,那么使用更多的描述类型参数是非常有用的。例如,Swift字典(Dictionary)类型有两个类型参数,一个是key,另外一个是值。如果你自己写字典,你或许会定义这两个类型参数为KeyType和ValueType,用来记住它们在你的泛型代码中的作用。 - ->NOTE - ->Always give type parameters UpperCamelCase names (such as T and KeyType) to indicate that they are a placeholder for a type, not a value. - -## 泛型类型 - - -通常在泛型函数中,Swift允许你定义你自己的泛型类型。这些自定义类、结构体和枚举作用于任何类型,如同`Array`和`Dictionary`的用法。 - -这部分向你展示如何写一个泛型集类型-`Stack`(栈)。一个栈是一系列值域的集合,和array(数组)相似,但其是一个比Swift的`Array`类型更多限制的集合。一个数组可以允许其里面任何位置的插入/删除操作,而栈,只允许,只允许在集合的末端添加新的项(如同*push*一个新值进栈)。同样的一个栈也只能从末端移除项(如同*pop*一个值出栈)。 - ->NOTE - ->The concept of a stack is used by the UINavigationController class to model the view controllers in its navigation hierarchy. You call the UINavigationController class pushViewController:animated: method to add (or push) a view controller on to the navigation stack, and its popViewControllerAnimated: method to remove (or pop) a view controller from the navigation stack. A stack is a useful collection model whenever you need a strict “last in, first out” approach to managing a collection. - -下图展示了一个栈的压栈(push)/出栈(pop)的行为: - -![此处输入图片的描述][2] - -1. 现在有三个值在栈中; -2. 第四个值“pushed”到栈的顶部; -3. 现在有四个值在栈中,最近的那个在顶部; -4. 栈中最顶部的那个项被移除,或称之为“popped”; -5. 移除掉一个值后,现在栈又重新只有三个值。 - -这里展示了如何写一个非泛型版本的栈,`Int`值型的栈: -```C -struct IntStack { - var items = Int[]() - mutating func push(item: Int) { - items.append(item) - } - mutating func pop() -> Int { - return items.removeLast() - } -} -``` - -这个结构体在栈中使用一个`Array`性质的`items`存储值。`Stack`提供两个方法:`push`和`pop`,从栈中压进一个值和移除一个值。这些方法标记为可变的,因为他们需要修改(或*转换*)结构体的`items`数组。 - -上面所展现的`IntStack`类型只能用于`Int`值,不过,其对于定义一个泛型`Stack`类(可以处理*任何*类型值的栈)是非常有用的。 - -这里是一个相同代码的泛型版本: - -```C -struct Stack { - var items = T[]() - mutating func push(item: T) { - items.append(item) - } - mutating func pop() -> T { - return items.removeLast() - } -} -``` - -注意到`Stack`的泛型版本基本上和非泛型版本相同,但是泛型版本的节点类型参数为T代替了实际`Int`类型。这种类型参数包含在一对尖括号里(``),紧随在结构体名字后面。 - -T定义了一个名为“某种类型T”的节点提供给后来用。这种将来类型可以在结构体的定义里任何地方表示为“T”。在这种情况下,T在如下三个地方被用作节点: - -- 创建一个名为`items`的属性,使用空的T类型值数组对其进行初始化; -- 指定一个包含一个参数名为`item`的`push`方法,该参数必须是T类型; -- 指定一个`pop`方法的返回值,该返回值将是一个T类型值。 - -当创建一个新单例并初始化时, 通过用一对紧随在类型名后的尖括号里写出实际指定栈用到类型,创建一个`Stack`实例,同创建`Array`和`Dictionary`一样: -```c -var stackOfStrings = Stack() -stackOfStrings.push("uno") -stackOfStrings.push("dos") -stackOfStrings.push("tres") -stackOfStrings.push("cuatro") -// 现在栈已经有4个string了 -``` -下图将展示`stackOfStrings`如何push这四个值进栈的过程: - -![此处输入图片的描述][3] - -从栈中pop并移除值"cuatro": - -```C -let fromTheTop = stackOfStrings.pop() -// fromTheTop is equal to "cuatro", and the stack now contains 3 strings -``` -下图展示了如何从栈中pop一个值的过程: -![此处输入图片的描述][4] - -由于`Stack`是泛型类型,所以在Swift中其可以用来创建任何有效类型的栈,这种方式如同`Array`和`Dictionary`。 - -##类型约束 - -`swapTwoValues`函数和`Stack`类型可以作用于任何类型,不过,有的时候对使用在泛型函数和泛型类型上的类型强制约束为某种特定类型是非常有用的。类型约束指定了一个必须继承自指定类的类型参数,或者遵循一个特定的协议或协议构成。 - -例如,Swift的`Dictionary`类型对作用于其keys的类型做了些限制。在[Dictionaries][5]的描述中,字典的keys类型必须是*hashable*,也就是说,必须有一种方法可以使其是唯一的表示。`Dictionary`之所以需要其keys是hashable是为了以便于其检查其是否包含某个特定key的值。如无此需求,`Dictionary`即不会告诉是否插入或者替换了某个特定key的值,也不能查找到已经存储在字典里面的给定key值。 - -这个需求强制加上一个类型约束作用于`Dictionary`的key上,当然其key类型必须遵循`Hashable`协议(Swift标准库中定义的一个特定协议)。所有的Swift基本类型(如`String`,`Int`, `Double`和 `Bool`)默认都是hashable。 - -当你创建自定义泛型类型时,你可以定义你自己的类型约束,当然,这些约束要支持泛型编程的强力特征中的多数。抽象概念如`Hashtable`具有的类型特征是根据他们概念特征来界定的,而不是他们的直接类型特征。 - -### 类型约束语法 - -你可以写一个在一个类型参数名后面的类型约束,通过冒号分割,来作为类型参数链的一部分。这种作用于泛型函数的类型约束的基础语法如下所示(和泛型类型的语法相同): -```c -func someFunction(someT: T, someU: U) { - // function body goes here -} -``` - -上面这个假定函数有两个类型参数。第一个类型参数`T`,有一个需要`T`必须是`SomeClass`子类的类型约束;第二个类型参数`U`,有一个需要`U`必须遵循`SomeProtocol`协议的类型约束。 - -### 类型约束行为 - -这里有个名为`findStringIndex`的非泛型函数,该函数功能是去查找包含一给定`String`值的数组。若查找到匹配的字符串,`findStringIndex`函数返回该字符串在数组中的索引值(`Int`),反之则返回`nil`: -```c -func findStringIndex(array: String[], valueToFind: String) -> Int? { - for (index, value) in enumerate(array) { - if value == valueToFind { - return index - } - } - return nil -} -``` - -`findStringIndex`函数可以作用于查找一字符串数组中的某个字符串: -```c -let strings = ["cat", "dog", "llama", "parakeet", "terrapin"] -if let foundIndex = findStringIndex(strings, "llama") { - println("The index of llama is \(foundIndex)") -} -// prints "The index of llama is 2" -``` - -如果只是针对字符串而言查找在数组中的某个值的索引,用处不是很大,不过,你可以写出相同功能的泛型函数`findIndex`,用某个类型`T`值替换掉提到的字符串。 - -这里展示如何写一个你或许期望的`findStringIndex`的泛型版本`findIndex`。请注意这个函数仍然返回`Int`,是不是有点迷惑呢,而不是泛型类型?那是因为函数返回的是一个可选的索引数,而不是从数组中得到的一个可选值。需要提醒的是,这个函数不会编译,原因在例子后面会说明: - -```c -func findIndex(array: T[], valueToFind: T) -> Int? { - for (index, value) in enumerate(array) { - if value == valueToFind { - return index - } - } - return nil -} -``` - -上面所写的函数不会编译。这个问题的位置在等式的检查上,`“if value == valueToFind”`。不是所有的Swift中的类型都可以用等式符(==)进行比较。例如,如果你创建一个你自己的类或结构体来表示一个复杂的数据模型,那么Swift没法猜到对于这个类或结构体而言“等于”的意思。正因如此,这部分代码不能可能保证工作于每个可能的类型`T`,当你试图编译这部分代码时估计会出现相应的错误。 - -不过,所有的这些并不会让我们无从下手。Swift标准库中定义了一个`Equatable`协议,该协议要求任何遵循的类型实现等式符(==)和不等符(!=)对任何两个该类型进行比较。所有的Swift标准类型自动支持`Equatable`协议。 - -任何`Equatable`类型都可以安全的使用在`findIndex`函数中,因为其保证支持等式操作。为了说明这个事实,当你定义一个函数时,你可以写一个`Equatable`类型约束作为类型参数定义的一部分: -```c -func findIndex(array: T[], valueToFind: T) -> Int? { - for (index, value) in enumerate(array) { - if value == valueToFind { - return index - } - } - return nil -} -``` - -`findIndex`中这个单个类型参数写做:`T: Equatable`,也就意味着“任何T类型都遵循`Equatable`协议”。 - -findIndex函数现在则可以成功的编译过,并且作用于任何遵循Equatable的类型,如Double或String: -```c -let doubleIndex = findIndex([3.14159, 0.1, 0.25], 9.3) -// doubleIndex is an optional Int with no value, because 9.3 is not in the array -let stringIndex = findIndex(["Mike", "Malcolm", "Andrea"], "Andrea") -// stringIndex is an optional Int containing a value of 2 -``` - -##关联类型 - -当定义一个协议时,有的时候声明一个或多个关联类型作为协议定义的一部分是非常有用的。一个关联类型给定作用于协议部分的类型一个节点名(或*别名*)。作用于关联类型上实际类型是不需要指定的,直到该协议接受。关联类型被指定为`typealias`关键字。 - -### 关联类型行为 - -这里是一个`Container`协议的例子,定义了一个ItemType关联类型: -```c -protocol Container { - typealias ItemType - mutating func append(item: ItemType) - var count: Int { get } - subscript(i: Int) -> ItemType { get } -} -``` -`Container`协议定义了三个任何容器必须支持的兼容要求: - -- 必须可能通过`append`方法添加一个新item到容器里; -- 必须可能通过使用`count`属性获取容器里items的数量,并返回一个`Int`值; -- 必须可能通过容器的`Int`索引值下标可以检索到每一个item。 - -这个协议没有指定容器里item是如何存储的或何种类型是允许的。这个协议只指定三个任何遵循`Container`类型所必须支持的功能点。一个遵循的类型也可以提供其他额外的功能,只要满足这三个条件。 - -任何遵循`Container`协议的类型必须指定存储在其里面的值类型,必须保证只有正确类型的items可以加进容器里,必须明确可以通过其下标返回item类型。 - -为了定义这三个条件,`Container`协议需要一个方法指定容器里的元素将会保留,而不需要知道特定容器的类型。`Container`协议需要指定任何通过`append`方法添加到容器里的值和容器里元素是相同类型,并且通过容器下标返回的容器元素类型的值的类型是相同类型。 - -为了达到此目的,`Container`协议声明了一个ItemType的关联类型,写作`typealias ItemType`。The protocol does not define what ItemType is an alias for—that information is left for any conforming type to provide(这个协议不会定义`ItemType`是遵循类型所提供的何种信息的别名)。尽管如此,`ItemType`别名支持一种方法识别在一个容器里的items类型,以及定义一种使用在`append`方法和下标中的类型,以便保证任何期望的`Container`的行为是强制性的。 - -这里是一个早前IntStack类型的非泛型版本,适用于遵循Container协议: -```c -struct IntStack: Container { - // original IntStack implementation - var items = Int[]() - mutating func push(item: Int) { - items.append(item) - } - mutating func pop() -> Int { - return items.removeLast() - } - // conformance to the Container protocol - typealias ItemType = Int - mutating func append(item: Int) { - self.push(item) - } - var count: Int { - return items.count - } - subscript(i: Int) -> Int { - return items[i] - } -} -``` - -`IntStack`类型实现了`Container`协议的所有三个要求,在`IntStack`类型的每个包含部分的功能都满足这些要求。 - -此外,`IntStack`指定了`Container`的实现,适用的ItemType被用作`Int`类型。对于这个`Container`协议实现而言,定义 `typealias ItemType = Int`,将抽象的`ItemType`类型转换为具体的`Int`类型。 - -感谢Swift类型参考,你不用在`IntStack`定义部分声明一个具体的`Int`的`ItemType`。由于`IntStack`遵循`Container`协议的所有要求,只要通过简单的查找`append`方法的item参数类型和下标返回的类型,Swift就可以推断出合适的`ItemType`来使用。确实,如果上面的代码中你删除了 `typealias ItemType = Int`这一行,一切仍旧可以工作,因为它清楚的知道ItemType使用的是何种类型。 - -你也可以生成遵循`Container`协议的泛型`Stack`类型: -```c -struct Stack: Container { - // original Stack implementation - var items = T[]() - mutating func push(item: T) { - items.append(item) - } - mutating func pop() -> T { - return items.removeLast() - } - // conformance to the Container protocol - mutating func append(item: T) { - self.push(item) - } - var count: Int { - return items.count - } - subscript(i: Int) -> T { - return items[i] - } -} -``` -这个时候,节点类型参数`T`被用作`append`方法的item参数和下标的返回类型。Swift因此可以推断出被用作这个特定容器的`ItemType`的`T`的合适类型。 - - -### 扩展一个存在的类型为一指定关联类型 - -在[Adding Protocol Conformance with an Extension][6]中有描述扩展一个存在的类型添加遵循一个协议。这个类型包含一个关联类型的协议。 - -Swift的`Array`已经提供`append`方法,一个`count`属性和通过下标来查找一个自己的元素。这三个功能都达到`Container`协议的要求。也就意味着你可以扩展`Array`去遵循`Container`协议,只要通过简单声明`Array`适用于该协议而已。如何实践这样一个空扩展,在[Declaring Protocol Adoption with an Extension][7]中有描述这样一个实现一个空扩展的行为: -```c -extension Array: Container {} -``` -如同上面的泛型`Stack`类型一样,`Array的append`方法和下标保证`Swift`可以推断出`ItemType`所使用的适用的类型。定义了这个扩展后,你可以将任何`Array`当作`Container`来使用。 - -## Where 语句 - -[Type Constraints][8]中描述的类型约束确保你定义关于类型参数的需求和一泛型函数或类型有关联。 - -对于关联类型的定义需求也是非常有用的。你可以通过这样去定义*where语句*作为一个类型参数队列的一部分。一个where语句使你能够要求一个关联类型遵循一个特定的协议,以及(或)那个特定的类型参数和关联类型可以是相同的。你可写一个where语句,通过紧随放置`where`关键字在类型参数队列后面,其后跟着一个或者多个针对关联类型的约束,以及(或)一个或多个类型和关联类型的等于关系。 - -下面的列子定义了一个名为`allItemsMatch`的泛型函数,用来检查是否两个`Container`单例包含具有相同顺序的相同items。如果匹配到所有的items,那么返回一个为true的Boolean值,反之,则相反。 - -这两个容器可以被检查出是否是相同类型的容器(虽然它们可以是),但他们确实拥有相同类型的items。这个需求通过一个类型约束和where语句结合来表示: -```c -func allItemsMatch< - C1: Container, C2: Container - where C1.ItemType == C2.ItemType, C1.ItemType: Equatable> - (someContainer: C1, anotherContainer: C2) -> Bool { - - // check that both containers contain the same number of items - if someContainer.count != anotherContainer.count { - return false - } - - // check each pair of items to see if they are equivalent - for i in 0..someContainer.count { - if someContainer[i] != anotherContainer[i] { - return false - } - } - - // all items match, so return true - return true - -} -``` - -这个函数用了两个参数:`someContainer`和`anotherContainer`。`someContainer`参数是类型`C1`,`anotherContainer`参数是类型`C2`。`C1`和`C2`是容器的两个节点类型参数,决定了这个函数何时被调用。 - -这个函数的类型参数列紧随在两个类型参数需求的后面: - -- `C1`必须遵循`Container`协议 (写作 `C1: Container`)。 -- `C2`必须遵循`Container`协议 (写作 `C2: Container`)。 -- `C1`的`ItemType`同样是C2的`ItemType`(写作 `C1.ItemType == C2.ItemType`)。 -- `C1`的`ItemType`必须遵循`Equatable`协议 (写作 `C1.ItemType: Equatable`)。 - -第三个和第四个要求被定义为一个where语句的一部分,写在关键字`where`后面,作为函数类型参数链的一部分。 - -这些要求意思是: - -`someContainer`是一个`C1`类型的容器。 -`anotherContainer`是一个`C2`类型的容器。 -`someContainer`和`anotherContainer`包含相同的items类型。 -`someContainer`中的items可以通过不等于操作(`!=`)来检查它们是否彼此不同。 - -第三个和第四个要求结合起来的意思是`anotherContainer`中的items也可以通过 `!=` 操作来检查,因为他们在`someContainer`中items确实是相同的类型。 - -这些要求能够使`allItemsMatch`函数比较两个容器,即便他们是不同的容器类型。 - -`allItemsMatch`首先检查两个容器是否拥有同样数目的items,如果他们的items数目不同,没有办法进行匹配,函数就会`false`。 - -检查完之后,函数通过`for-in`循环和半闭区间操作(..)来迭代`someContainer`中的所有items。对于每个item,函数检查是否`someContainer`中的item不等于对应的`anotherContainer`中的item,如果这两个items不等,则这两个容器不匹配,返回`false`。 - - -如果循环体结束后未发现没有任何的不匹配,那表明两个容器匹配,函数返回true。 - -Here’s how the allItemsMatch function looks in action: -这里演示了allItemsMatch函数运算的过程: -```c -var stackOfStrings = Stack() -stackOfStrings.push("uno") -stackOfStrings.push("dos") -stackOfStrings.push("tres") - -var arrayOfStrings = ["uno", "dos", "tres"] - -if allItemsMatch(stackOfStrings, arrayOfStrings) { - println("All items match.") -} else { - println("Not all items match.") -} -// prints "All items match." -``` - 上面的例子创建一个`Stack`单例来存储`String`,然后压了三个字符串进栈。这个例子也创建了一个`Array`单例,并初始化包含三个同栈里一样的原始字符串。即便栈和数组否是不同的类型,但他们都遵循`Container`协议,而且他们都包含同样的类型值。你因此可以调用`allItemsMatch`函数,用这两个容器作为它的参数。在上面的例子中,`allItemsMatch`函数正确的显示了所有的这两个容器的items匹配。 - - [1]: https://www.zybuluo.com/mdeditor?url=https://www.zybuluo.com/static/editor/md-help.markdown - [2]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPushPop_2x.png - [3]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPushedFourStrings_2x.png - [4]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPoppedOneString_2x.png - [5]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/CollectionTypes.html#//apple_ref/doc/uid/TP40014097-CH8-XID_143 - [6]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Protocols.html#//apple_ref/doc/uid/TP40014097-CH25-XID_355 - [7]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Protocols.html#//apple_ref/doc/uid/TP40014097-CH25-XID_357 - [8]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Generics.html#//apple_ref/doc/uid/TP40014097-CH26-XID_244 - [9]: https://www.zybuluo.com/mdeditor?url=https://www.zybuluo.com/static/editor/md-help.markdown - [10]: https://www.zybuluo.com/mdeditor?url=https://www.zybuluo.com/static/editor/md-help.markdown#cmd-markdown-高阶语法手册 - [11]: http://weibo.com/ghosert - [12]: http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference +> 翻译:[takalard](https://github.com/takalard) +> 校对:[lifedim](https://github.com/lifedim) + +# 泛型 + +------ + +本页包含内容: + +- [泛型所解决的问题](#the_problem_that_generics_solve) +- [泛型函数](#generic_functions) +- [类型参数](#type_parameters) +- [命名类型参数](#naming_type_parameters) +- [泛型类型](#generic_types) +- [类型约束](#type_constraints) +- [关联类型](#associated_types) +- [`Where`语句](#where_clauses) + +*泛型代码*可以让你写出根据自我需求定义、适用于任何类型的,灵活且可重用的函数和类型。它的可以让你避免重复的代码,用一种清晰和抽象的方式来表达代码的意图。 + +泛型是 Swift 强大特征中的其中一个,许多 Swift 标准库是通过泛型代码构建出来的。事实上,泛型的使用贯穿了整本语言手册,只是你没有发现而已。例如,Swift 的数组和字典类型都是泛型集。你可以创建一个`Int`数组,也可创建一个`String`数组,或者甚至于可以是任何其他 Swift 的类型数据数组。同样的,你也可以创建存储任何指定类型的字典(dictionary),而且这些类型可以是没有限制的。 + + +## 泛型所解决的问题 + +这里是一个标准的,非泛型函数`swapTwoInts`,用来交换两个Int值: + +```swift +func swapTwoInts(inout a: Int, inout b: Int) + let temporaryA = a + a = b + b = temporaryA +} +``` + +这个函数使用写入读出(in-out)参数来交换`a`和`b`的值,请参考[写入读出参数](../chapter2/06_Functions.html)。 + +`swapTwoInts`函数可以交换`b`的原始值到`a`,也可以交换a的原始值到`b`,你可以调用这个函数交换两个`Int`变量值: + +```swift +var someInt = 3 +var anotherInt = 107 +swapTwoInts(&someInt, &anotherInt) +println("someInt is now \(someInt), and anotherInt is now \(anotherInt)") +// 输出 "someInt is now 107, and anotherInt is now 3" +``` + + +`swapTwoInts`函数是非常有用的,但是它只能交换`Int`值,如果你想要交换两个`String`或者`Double`,就不得不写更多的函数,如 `swapTwoStrings`和`swapTwoDoublesfunctions `,如同如下所示: + +```swift +func swapTwoStrings(inout a: String, inout b: String) { + let temporaryA = a + a = b + b = temporaryA +} + +func swapTwoDoubles(inout a: Double, inout b: Double) { + let temporaryA = a + a = b + b = temporaryA +} +``` + +你可能注意到 `swapTwoInts`、 `swapTwoStrings`和`swapTwoDoubles`函数功能都是相同的,唯一不同之处就在于传入的变量类型不同,分别是`Int`、`String`和`Double`。 + +但实际应用中通常需要一个用处更强大并且尽可能的考虑到更多的灵活性单个函数,可以用来交换两个任何类型值,很幸运的是,泛型代码帮你解决了这种问题。(一个这种泛型函数后面已经定义好了。) + +>注意: +在所有三个函数中,`a`和`b`的类型是一样的。如果`a`和`b`不是相同的类型,那它们俩就不能互换值。Swift 是类型安全的语言,所以它不允许一个`String`类型的变量和一个`Double`类型的变量互相交换值。如果一定要做,Swift 将报编译错误。 + + +## 泛型函数 + +`泛型函数`可以工作于任何类型,这里是一个上面`swapTwoInts`函数的泛型版本,用于交换两个值: + +```swift +func swapTwoValues(inout a: T, inout b: T) { + let temporaryA = a + a = b + b = temporaryA +} +``` + +`swapTwoValues`函数主体和`swapTwoInts`函数是一样的,它只在第一行稍微有那么一点点不同于`swapTwoInts`,如下所示: + +```swift +func swapTwoInts(inout a: Int, inout b: Int) +func swapTwoValues(inout a: T, inout b: T) +``` + + +这个函数的泛型版本使用了占位类型名字(通常此情况下用字母`T`来表示)来代替实际类型名(如`In`、`String`或`Doubl`)。占位类型名没有提示`T`必须是什么类型,但是它提示了`a`和`b`必须是同一类型`T`,而不管`T`表示什么类型。只有`swapTwoValues`函数在每次调用时所传入的实际类型才能决定`T`所代表的类型。 + +另外一个不同之处在于这个泛型函数名后面跟着的展位类型名字(T)是用尖括号括起来的(``)。这个尖括号告诉 Swift 那个`T`是`swapTwoValues`函数所定义的一个类型。因为`T`是一个占位命名类型,Swift 不会去查找命名为T的实际类型。 + +`swapTwoValues`函数除了要求传入的两个任何类型值是同一类型外,也可以作为`swapTwoInts`函数被调用。每次`swapTwoValues`被调用,T所代表的类型值都会传给函数。 + +在下面的两个例子中,`T`分别代表`Int`和`String`: + +```swift +var someInt = 3 +var anotherInt = 107 +swapTwoValues(&someInt, &anotherInt) +// someInt is now 107, and anotherInt is now 3 +``` + +```swift +var someString = "hello" +var anotherString = "world" +swapTwoValues(&someString, &anotherString) +// someString is now "world", and anotherString is now "hello" +``` + + +>注意 +上面定义的函数`swapTwoValues`是受`swap`函数启发而实现的。`swap`函数存在于 Swift 标准库,并可以在其它类中任意使用。如果你在自己代码中需要类似`swapTwoValues`函数的功能,你可以使用已存在的交换函数`swap`函数。 + + +## 类型参数 + +在上面的`swapTwoValues`例子中,占位类型`T`是一种类型参数的示例。类型参数指定并命名为一个占位类型,并且紧随在函数名后面,使用一对尖括号括起来(如``)。 + +一旦一个类型参数被指定,那么其可以被使用来定义一个函数的参数类型(如`swapTwoValues`函数中的参数`a`和`b`),或作为一个函数返回类型,或用作函数主体中的注释类型。在这种情况下,被类型参数所代表的占位类型不管函数任何时候被调用,都会被实际类型所替换(在上面`swapTwoValues`例子中,当函数第一次被调用时,`T`被`Int`替换,第二次调用时,被`String`替换。)。 + +你可支持多个类型参数,命名在尖括号中,用逗号分开。 + + +## 命名类型参数 + +在简单的情况下,泛型函数或泛型类型需要指定一个占位类型(如上面的`swapTwoValues`泛型函数,或一个存储单一类型的泛型集,如数组),通常用一单个字母`T`来命名类型参数。不过,你可以使用任何有效的标识符来作为类型参数名。 + +如果你使用多个参数定义更复杂的泛型函数或泛型类型,那么使用更多的描述类型参数是非常有用的。例如,Swift 字典(Dictionary)类型有两个类型参数,一个是键,另外一个是值。如果你自己写字典,你或许会定义这两个类型参数为`KeyType`和`ValueType`,用来记住它们在你的泛型代码中的作用。 + +>注意 +请始终使用大写字母开头的驼峰式命名法(例如`T`和`KeyType`)来给类型参数命名,以表明它们是类型的占位符,而非类型值。 + + +## 泛型类型 + + +通常在泛型函数中,Swift 允许你定义你自己的泛型类型。这些自定义类、结构体和枚举作用于任何类型,如同`Array`和`Dictionary`的用法。 + +这部分向你展示如何写一个泛型集类型--`Stack`(栈)。一个栈是一系列值域的集合,和`Array`(数组)类似,但其是一个比 Swift 的`Array`类型更多限制的集合。一个数组可以允许其里面任何位置的插入/删除操作,而栈,只允许在集合的末端添加新的项(如同*push*一个新值进栈)。同样的一个栈也只能从末端移除项(如同*pop*一个值出栈)。 + +>注意 +栈的概念已被`UINavigationController`类使用来模拟试图控制器的导航结构。你通过调用`UINavigationController`的`pushViewController:animated:`方法来为导航栈添加(add)新的试图控制器;而通过`popViewControllerAnimated:`的方法来从导航栈中移除(pop)某个试图控制器。每当你需要一个严格的`后进先出`方式来管理集合,堆栈都是最实用的模型。 + +下图展示了一个栈的压栈(push)/出栈(pop)的行为: + +![此处输入图片的描述](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPushPop_2x.png) + +1. 现在有三个值在栈中; +2. 第四个值“pushed”到栈的顶部; +3. 现在有四个值在栈中,最近的那个在顶部; +4. 栈中最顶部的那个项被移除,或称之为“popped”; +5. 移除掉一个值后,现在栈又重新只有三个值。 + +这里展示了如何写一个非泛型版本的栈,`Int`值型的栈: + +```swift +struct IntStack { + var items = Int[]() + mutating func push(item: Int) { + items.append(item) + } + mutating func pop() -> Int { + return items.removeLast() + } +} +``` + +这个结构体在栈中使用一个`Array`性质的`items`存储值。`Stack`提供两个方法:`push`和`pop`,从栈中压进一个值和移除一个值。这些方法标记为可变的,因为它们需要修改(或*转换*)结构体的`items`数组。 + +上面所展现的`IntStack`类型只能用于`Int`值,不过,其对于定义一个泛型`Stack`类(可以处理*任何*类型值的栈)是非常有用的。 + +这里是一个相同代码的泛型版本: + + +```swift +struct Stack { + var items = T[]() + mutating func push(item: T) { + items.append(item) + } + mutating func pop() -> T { + return items.removeLast() + } +} +``` + + +注意到`Stack`的泛型版本基本上和非泛型版本相同,但是泛型版本的占位类型参数为T代替了实际`Int`类型。这种类型参数包含在一对尖括号里(``),紧随在结构体名字后面。 + +`T`定义了一个名为“某种类型T”的节点提供给后来用。这种将来类型可以在结构体的定义里任何地方表示为“T”。在这种情况下,`T`在如下三个地方被用作节点: + +- 创建一个名为`items`的属性,使用空的T类型值数组对其进行初始化; +- 指定一个包含一个参数名为`item`的`push`方法,该参数必须是T类型; +- 指定一个`pop`方法的返回值,该返回值将是一个T类型值。 + +当创建一个新单例并初始化时, 通过用一对紧随在类型名后的尖括号里写出实际指定栈用到类型,创建一个`Stack`实例,同创建`Array`和`Dictionary`一样: + +```swift +var stackOfStrings = Stack() +stackOfStrings.push("uno") +stackOfStrings.push("dos") +stackOfStrings.push("tres") +stackOfStrings.push("cuatro") +// 现在栈已经有4个string了 +``` + +下图将展示`stackOfStrings`如何`push`这四个值进栈的过程: + +![此处输入图片的描述](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPushedFourStrings_2x.png) + +从栈中`pop`并移除值"cuatro": + +```swift +let fromTheTop = stackOfStrings.pop() +// fromTheTop is equal to "cuatro", and the stack now contains 3 strings +``` + +下图展示了如何从栈中pop一个值的过程: +![此处输入图片的描述](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPoppedOneString_2x.png) + +由于`Stack`是泛型类型,所以在 Swift 中其可以用来创建任何有效类型的栈,这种方式如同`Array`和`Dictionary`。 + + +##类型约束 + +`swapTwoValues`函数和`Stack`类型可以作用于任何类型,不过,有的时候对使用在泛型函数和泛型类型上的类型强制约束为某种特定类型是非常有用的。类型约束指定了一个必须继承自指定类的类型参数,或者遵循一个特定的协议或协议构成。 + +例如,Swift 的`Dictionary`类型对作用于其键的类型做了些限制。在[字典](../chapter2/04_Collection_Types.html)的描述中,字典的键类型必须是*可哈希*,也就是说,必须有一种方法可以使其被唯一的表示。`Dictionary`之所以需要其键是可哈希是为了以便于其检查其是否已经包含某个特定键的值。如无此需求,`Dictionary`既不会告诉是否插入或者替换了某个特定键的值,也不能查找到已经存储在字典里面的给定键值。 + +这个需求强制加上一个类型约束作用于`Dictionary`的键上,当然其键类型必须遵循`Hashable`协议(Swift 标准库中定义的一个特定协议)。所有的 Swift 基本类型(如`String`,`Int`, `Double`和 `Bool`)默认都是可哈希。 + +当你创建自定义泛型类型时,你可以定义你自己的类型约束,当然,这些约束要支持泛型编程的强力特征中的多数。抽象概念如`可哈希`具有的类型特征是根据它们概念特征来界定的,而不是它们的直接类型特征。 + +### 类型约束语法 + +你可以写一个在一个类型参数名后面的类型约束,通过冒号分割,来作为类型参数链的一部分。这种作用于泛型函数的类型约束的基础语法如下所示(和泛型类型的语法相同): + +```swift +func someFunction(someT: T, someU: U) { + // function body goes here +} +``` + +上面这个假定函数有两个类型参数。第一个类型参数`T`,有一个需要`T`必须是`SomeClass`子类的类型约束;第二个类型参数`U`,有一个需要`U`必须遵循`SomeProtocol`协议的类型约束。 + +### 类型约束行为 + +这里有个名为`findStringIndex`的非泛型函数,该函数功能是去查找包含一给定`String`值的数组。若查找到匹配的字符串,`findStringIndex`函数返回该字符串在数组中的索引值(`Int`),反之则返回`nil`: + +```swift +func findStringIndex(array: String[], valueToFind: String) -> Int? { + for (index, value) in enumerate(array) { + if value == valueToFind { + return index + } + } + return nil +} +``` + + +`findStringIndex`函数可以作用于查找一字符串数组中的某个字符串: + +```swift +let strings = ["cat", "dog", "llama", "parakeet", "terrapin"] +if let foundIndex = findStringIndex(strings, "llama") { + println("The index of llama is \(foundIndex)") +} +// 输出 "The index of llama is 2" +``` + +如果只是针对字符串而言查找在数组中的某个值的索引,用处不是很大,不过,你可以写出相同功能的泛型函数`findIndex`,用某个类型`T`值替换掉提到的字符串。 + +这里展示如何写一个你或许期望的`findStringIndex`的泛型版本`findIndex`。请注意这个函数仍然返回`Int`,是不是有点迷惑呢,而不是泛型类型?那是因为函数返回的是一个可选的索引数,而不是从数组中得到的一个可选值。需要提醒的是,这个函数不会编译,原因在例子后面会说明: + +```swift +func findIndex(array: T[], valueToFind: T) -> Int? { + for (index, value) in enumerate(array) { + if value == valueToFind { + return index + } + } + return nil +} +``` + +上面所写的函数不会编译。这个问题的位置在等式的检查上,`“if value == valueToFind”`。不是所有的 Swift 中的类型都可以用等式符(==)进行比较。例如,如果你创建一个你自己的类或结构体来表示一个复杂的数据模型,那么 Swift 没法猜到对于这个类或结构体而言“等于”的意思。正因如此,这部分代码不能可能保证工作于每个可能的类型`T`,当你试图编译这部分代码时估计会出现相应的错误。 + +不过,所有的这些并不会让我们无从下手。Swift 标准库中定义了一个`Equatable`协议,该协议要求任何遵循的类型实现等式符(==)和不等符(!=)对任何两个该类型进行比较。所有的 Swift 标准类型自动支持`Equatable`协议。 + +任何`Equatable`类型都可以安全的使用在`findIndex`函数中,因为其保证支持等式操作。为了说明这个事实,当你定义一个函数时,你可以写一个`Equatable`类型约束作为类型参数定义的一部分: + +```swift +func findIndex(array: T[], valueToFind: T) -> Int? { + for (index, value) in enumerate(array) { + if value == valueToFind { + return index + } + } + return nil +} +``` + + +`findIndex`中这个单个类型参数写做:`T: Equatable`,也就意味着“任何T类型都遵循`Equatable`协议”。 + +`findIndex`函数现在则可以成功的编译过,并且作用于任何遵循`Equatable`的类型,如`Double`或`String`: + +```swift +let doubleIndex = findIndex([3.14159, 0.1, 0.25], 9.3) +// doubleIndex is an optional Int with no value, because 9.3 is not in the array +let stringIndex = findIndex(["Mike", "Malcolm", "Andrea"], "Andrea") +// stringIndex is an optional Int containing a value of 2 +``` + + +##关联类型 + +当定义一个协议时,有的时候声明一个或多个关联类型作为协议定义的一部分是非常有用的。一个关联类型给定作用于协议部分的类型一个节点名(或*别名*)。作用于关联类型上实际类型是不需要指定的,直到该协议接受。关联类型被指定为`typealias`关键字。 + +### 关联类型行为 + +这里是一个`Container`协议的例子,定义了一个ItemType关联类型: + +```swift +protocol Container { + typealias ItemType + mutating func append(item: ItemType) + var count: Int { get } + subscript(i: Int) -> ItemType { get } +} +``` + +`Container`协议定义了三个任何容器必须支持的兼容要求: + +- 必须可能通过`append`方法添加一个新item到容器里; +- 必须可能通过使用`count`属性获取容器里items的数量,并返回一个`Int`值; +- 必须可能通过容器的`Int`索引值下标可以检索到每一个item。 + +这个协议没有指定容器里item是如何存储的或何种类型是允许的。这个协议只指定三个任何遵循`Container`类型所必须支持的功能点。一个遵循的类型也可以提供其他额外的功能,只要满足这三个条件。 + +任何遵循`Container`协议的类型必须指定存储在其里面的值类型,必须保证只有正确类型的items可以加进容器里,必须明确可以通过其下标返回item类型。 + +为了定义这三个条件,`Container`协议需要一个方法指定容器里的元素将会保留,而不需要知道特定容器的类型。`Container`协议需要指定任何通过`append`方法添加到容器里的值和容器里元素是相同类型,并且通过容器下标返回的容器元素类型的值的类型是相同类型。 + +为了达到此目的,`Container`协议声明了一个ItemType的关联类型,写作`typealias ItemType`。这个协议不会定义`ItemType`是什么的别名,这个信息留给了任何遵循协议的类型来提供。尽管如此,`ItemType`别名支持一种方法识别在一个容器里的items类型,以及定义一种使用在`append`方法和下标中的类型,以便保证任何期望的`Container`的行为是强制性的。 + +这里是一个早前IntStack类型的非泛型版本,适用于遵循Container协议: + +```swift +struct IntStack: Container { + // original IntStack implementation + var items = Int[]() + mutating func push(item: Int) { + items.append(item) + } + mutating func pop() -> Int { + return items.removeLast() + } + // conformance to the Container protocol + typealias ItemType = Int + mutating func append(item: Int) { + self.push(item) + } + var count: Int { + return items.count + } + subscript(i: Int) -> Int { + return items[i] + } +} +``` + + +`IntStack`类型实现了`Container`协议的所有三个要求,在`IntStack`类型的每个包含部分的功能都满足这些要求。 + +此外,`IntStack`指定了`Container`的实现,适用的ItemType被用作`Int`类型。对于这个`Container`协议实现而言,定义 `typealias ItemType = Int`,将抽象的`ItemType`类型转换为具体的`Int`类型。 + +感谢Swift类型参考,你不用在`IntStack`定义部分声明一个具体的`Int`的`ItemType`。由于`IntStack`遵循`Container`协议的所有要求,只要通过简单的查找`append`方法的item参数类型和下标返回的类型,Swift就可以推断出合适的`ItemType`来使用。确实,如果上面的代码中你删除了 `typealias ItemType = Int`这一行,一切仍旧可以工作,因为它清楚的知道ItemType使用的是何种类型。 + +你也可以生成遵循`Container`协议的泛型`Stack`类型: + +```swift +struct Stack: Container { + // original Stack implementation + var items = T[]() + mutating func push(item: T) { + items.append(item) + } + mutating func pop() -> T { + return items.removeLast() + } + // conformance to the Container protocol + mutating func append(item: T) { + self.push(item) + } + var count: Int { + return items.count + } + subscript(i: Int) -> T { + return items[i] + } +} +``` + +这个时候,占位类型参数`T`被用作`append`方法的item参数和下标的返回类型。Swift 因此可以推断出被用作这个特定容器的`ItemType`的`T`的合适类型。 + + +### 扩展一个存在的类型为一指定关联类型 + +在[使用扩展来添加协议兼容性](../chapter2/21_Protocols.html)中有描述扩展一个存在的类型添加遵循一个协议。这个类型包含一个关联类型的协议。 + +Swift的`Array`已经提供`append`方法,一个`count`属性和通过下标来查找一个自己的元素。这三个功能都达到`Container`协议的要求。也就意味着你可以扩展`Array`去遵循`Container`协议,只要通过简单声明`Array`适用于该协议而已。如何实践这样一个空扩展,在[使用扩展来声明协议的采纳](../chapter2/21_Protocols.html)中有描述这样一个实现一个空扩展的行为: + +```swift +extension Array: Container {} +``` + +如同上面的泛型`Stack`类型一样,`Array的append`方法和下标保证`Swift`可以推断出`ItemType`所使用的适用的类型。定义了这个扩展后,你可以将任何`Array`当作`Container`来使用。 + + +## Where 语句 + +[类型约束](#type_constraints)中描述的类型约束确保你定义关于类型参数的需求和一泛型函数或类型有关联。 + +对于关联类型的定义需求也是非常有用的。你可以通过这样去定义*where语句*作为一个类型参数队列的一部分。一个`where`语句使你能够要求一个关联类型遵循一个特定的协议,以及(或)那个特定的类型参数和关联类型可以是相同的。你可写一个`where`语句,通过紧随放置`where`关键字在类型参数队列后面,其后跟着一个或者多个针对关联类型的约束,以及(或)一个或多个类型和关联类型的等于关系。 + +下面的列子定义了一个名为`allItemsMatch`的泛型函数,用来检查是否两个`Container`单例包含具有相同顺序的相同元素。如果匹配到所有的元素,那么返回一个为`true`的`Boolean`值,反之,则相反。 + +这两个容器可以被检查出是否是相同类型的容器(虽然它们可以是),但它们确实拥有相同类型的元素。这个需求通过一个类型约束和`where`语句结合来表示: + +```swift +func allItemsMatch< + C1: Container, C2: Container + where C1.ItemType == C2.ItemType, C1.ItemType: Equatable> + (someContainer: C1, anotherContainer: C2) -> Bool { + + // check that both containers contain the same number of items + if someContainer.count != anotherContainer.count { + return false + } + + // check each pair of items to see if they are equivalent + for i in 0..someContainer.count { + if someContainer[i] != anotherContainer[i] { + return false + } + } + + // all items match, so return true + return true + +} +``` + + +这个函数用了两个参数:`someContainer`和`anotherContainer`。`someContainer`参数是类型`C1`,`anotherContainer`参数是类型`C2`。`C1`和`C2`是容器的两个占位类型参数,决定了这个函数何时被调用。 + +这个函数的类型参数列紧随在两个类型参数需求的后面: + +- `C1`必须遵循`Container`协议 (写作 `C1: Container`)。 +- `C2`必须遵循`Container`协议 (写作 `C2: Container`)。 +- `C1`的`ItemType`同样是C2的`ItemType`(写作 `C1.ItemType == C2.ItemType`)。 +- `C1`的`ItemType`必须遵循`Equatable`协议 (写作 `C1.ItemType: Equatable`)。 + +第三个和第四个要求被定义为一个`where`语句的一部分,写在关键字`where`后面,作为函数类型参数链的一部分。 + +这些要求意思是: + +`someContainer`是一个`C1`类型的容器。 +`anotherContainer`是一个`C2`类型的容器。 +`someContainer`和`anotherContainer`包含相同的元素类型。 +`someContainer`中的元素可以通过不等于操作(`!=`)来检查它们是否彼此不同。 + +第三个和第四个要求结合起来的意思是`anotherContainer`中的元素也可以通过 `!=` 操作来检查,因为它们在`someContainer`中元素确实是相同的类型。 + +这些要求能够使`allItemsMatch`函数比较两个容器,即便它们是不同的容器类型。 + +`allItemsMatch`首先检查两个容器是否拥有同样数目的items,如果它们的元素数目不同,没有办法进行匹配,函数就会`false`。 + +检查完之后,函数通过`for-in`循环和半闭区间操作(..)来迭代`someContainer`中的所有元素。对于每个元素,函数检查是否`someContainer`中的元素不等于对应的`anotherContainer`中的元素,如果这两个元素不等,则这两个容器不匹配,返回`false`。 + +如果循环体结束后未发现没有任何的不匹配,那表明两个容器匹配,函数返回`true`。 + +这里演示了allItemsMatch函数运算的过程: + +```swift +var stackOfStrings = Stack() +stackOfStrings.push("uno") +stackOfStrings.push("dos") +stackOfStrings.push("tres") + +var arrayOfStrings = ["uno", "dos", "tres"] + +if allItemsMatch(stackOfStrings, arrayOfStrings) { + println("All items match.") +} else { + println("Not all items match.") +} +// 输出 "All items match." +``` + + 上面的例子创建一个`Stack`单例来存储`String`,然后压了三个字符串进栈。这个例子也创建了一个`Array`单例,并初始化包含三个同栈里一样的原始字符串。即便栈和数组否是不同的类型,但它们都遵循`Container`协议,而且它们都包含同样的类型值。你因此可以调用`allItemsMatch`函数,用这两个容器作为它的参数。在上面的例子中,`allItemsMatch`函数正确的显示了所有的这两个容器的`items`匹配。 + + [1]: ../chapter2/06_Functions.html + [2]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPushPop_2x.png + [3]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPushedFourStrings_2x.png + [4]: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/stackPoppedOneString_2x.png + [5]: ../chapter2/04_Collection_Types.html + [6]: ../chapter2/21_Protocols.html + [7]: ../chapter2/21_Protocols.html + [8]: #type_constraints diff --git a/source/chapter2/23_Advanced_Operators.md b/source/chapter2/23_Advanced_Operators.md old mode 100644 new mode 100755 index e69de29b..42ca8164 --- a/source/chapter2/23_Advanced_Operators.md +++ b/source/chapter2/23_Advanced_Operators.md @@ -0,0 +1,484 @@ +> 翻译:[xielingwang](https://github.com/xielingwang) +> 校对:[numbbbbb](https://github.com/numbbbbb) + +# 高级运算符 +----------------- + +本页内容包括: + +- [位运算符](#bitwise_operators) +- [溢出运算符](#overflow_operators) +- [优先级和结合性(Precedence and Associativity)](#precedence_and_associativity) +- [运算符函数(Operator Functions)](#operator_functions) +- [自定义运算符](#custom_operators) + +除了[基本操作符](02_Basic_Operators.html)中所讲的运算符,Swift还有许多复杂的高级运算符,包括了C语和Objective-C中的位运算符和移位运算。 + +不同于C语言中的数值计算,Swift的数值计算默认是不可溢出的。溢出行为会被捕获并报告为错误。你是故意的?好吧,你可以使用Swift为你准备的另一套默认允许溢出的数值运算符,如可溢出加`&+`。所有允许溢出的运算符都是以`&`开始的。 + +自定义的结构,类和枚举,是否可以使用标准的运算符来定义操作?当然可以!在Swift中,你可以为你创建的所有类型定制运算符的操作。 + +可定制的运算符并不限于那些预设的运算符,自定义有个性的中置,前置,后置及赋值运算符,当然还有优先级和结合性。这些运算符的实现可以运用预设的运算符,也可以运用之前定制的运算符。 + + +## 位运算符 + +位操作符通常在诸如图像处理和创建设备驱动等底层开发中使用,使用它可以单独操作数据结构中原始数据的比特位。在使用一个自定义的协议进行通信的时候,运用位运算符来对原始数据进行编码和解码也是非常有效的。 + +Swift支持如下所有C语言的位运算符: + +### 按位取反运算符 + +按位取反运算符`~`对一个操作数的每一位都取反。 + +![Art/bitwiseNOT_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitwiseNOT_2x.png "Art/bitwiseNOT_2x.png") + +这个运算符是前置的,所以请不加任何空格地写着操作数之前。 + +```swift +let initialBits: UInt8 = 0b00001111 +let invertedBits = ~initialBits // 等于 0b11110000 +``` + +`UInt8`是8位无符整型,可以存储0~255之间的任意数。这个例子初始化一个整型为二进制值`00001111`(前4位为`0`,后4位为`1`),它的十进制值为`15`。 + +使用按位取反运算`~`对`initialBits`操作,然后赋值给`invertedBits`这个新常量。这个新常量的值等于所有位都取反的`initialBits`,即`1`变成`0`,`0`变成`1`,变成了`11110000`,十进制值为`240`。 + +### 按位与运算符 + +按位与运算符对两个数进行操作,然后返回一个新的数,这个数的每个位都需要两个输入数的同一位都为1时才为1。 + +![Art/bitwiseAND_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitwiseAND_2x.png "Art/bitwiseAND_2x.png") + +以下代码,`firstSixBits`和`lastSixBits`中间4个位都为1。对它俩进行按位与运算后,就得到了`00111100`,即十进制的`60`。 + +```swift +let firstSixBits: UInt8 = 0b11111100 +let lastSixBits: UInt8 = 0b00111111 +let middleFourBits = firstSixBits & lastSixBits // 等于 00111100 +``` + +### 按位或运算 + +按位或运算符`|`比较两个数,然后返回一个新的数,这个数的每一位设置1的条件是两个输入数的同一位都不为0(即任意一个为1,或都为1)。 + +![Art/bitwiseOR_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitwiseOR_2x.png "Art/bitwiseOR_2x.png") + +如下代码,`someBits`和`moreBits`在不同位上有`1`。按位或运行的结果是`11111110`,即十进制的`254`。 + +```swift +let someBits: UInt8 = 0b10110010 +let moreBits: UInt8 = 0b01011110 +let combinedbits = someBits | moreBits // 等于 11111110 +``` + +### 按位异或运算符 + +按位异或运算符`^`比较两个数,然后返回一个数,这个数的每个位设为`1`的条件是两个输入数的同一位不同,如果相同就设为`0`。 + +![Art/bitwiseXOR_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitwiseXOR_2x.png "Art/bitwiseXOR_2x.png") + +以下代码,`firstBits`和`otherBits`都有一个`1`跟另一个数不同的。所以按位异或的结果是把它这些位置为`1`,其他都置为`0`。 + +```swift +let firstBits: UInt8 = 0b00010100 +let otherBits: UInt8 = 0b00000101 +let outputBits = firstBits ^ otherBits // 等于 00010001 +``` + +### 按位左移/右移运算符 + +左移运算符`<<`和右移运算符`>>`会把一个数的所有比特位按以下定义的规则向左或向右移动指定位数。 + +按位左移和按位右移的效果相当把一个整数乘于或除于一个因子为`2`的整数。向左移动一个整型的比特位相当于把这个数乘于`2`,向右移一位就是除于`2`。 + +#### 无符整型的移位操作 + +对无符整型的移位的效果如下: + +已经存在的比特位向左或向右移动指定的位数。被移出整型存储边界的的位数直接抛弃,移动留下的空白位用零`0`来填充。这种方法称为逻辑移位。 + +以下这张把展示了 `11111111 << 1`(`11111111`向左移1位),和 `11111111 >> 1`(`11111111`向右移1位)。蓝色的是被移位的,灰色是被抛弃的,橙色的`0`是被填充进来的。 + +![Art/bitshiftUnsigned_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitshiftUnsigned_2x.png "Art/bitshiftUnsigned_2x.png") + +```swift +let shiftBits: UInt8 = 4 // 即二进制的00000100 +shiftBits << 1 // 00001000 +shiftBits << 2 // 00010000 +shiftBits << 5 // 10000000 +shiftBits << 6 // 00000000 +shiftBits >> 2 // 00000001 +``` + +你可以使用移位操作进行其他数据类型的编码和解码。 + +```swift +let pink: UInt32 = 0xCC6699 +let redComponent = (pink & 0xFF0000) >> 16 // redComponent 是 0xCC, 即 204 +let greenComponent = (pink & 0x00FF00) >> 8 // greenComponent 是 0x66, 即 102 +let blueComponent = pink & 0x0000FF // blueComponent 是 0x99, 即 153 +``` + +这个例子使用了一个`UInt32`的命名为`pink`的常量来存储层叠样式表`CSS`中粉色的颜色值,`CSS`颜色`#CC6699`在Swift用十六进制`0xCC6699`来表示。然后使用按位与(&)和按位右移就可以从这个颜色值中解析出红(CC),绿(66),蓝(99)三个部分。 + +对`0xCC6699`和`0xFF0000`进行按位与`&`操作就可以得到红色部分。`0xFF0000`中的`0`了遮盖了`OxCC6699`的第二和第三个字节,这样`6699`被忽略了,只留下`0xCC0000`。 + +然后,按向右移动16位,即 `>> 16`。十六进制中每两个字符是8比特位,所以移动16位的结果是把`0xCC0000`变成`0x0000CC`。这和`0xCC`是相等的,都是十进制的`204`。 + +同样的,绿色部分来自于`0xCC6699`和`0x00FF00`的按位操作得到`0x006600`。然后向右移动8們,得到`0x66`,即十进制的`102`。 + +最后,蓝色部分对`0xCC6699`和`0x0000FF`进行按位与运算,得到`0x000099`,无需向右移位了,所以结果就是`0x99`,即十进制的`153`。 + +#### 有符整型的移位操作 + +有符整型的移位操作相对复杂得多,因为正负号也是用二进制位表示的。(这里举的例子虽然都是8位的,但它的原理是通用的。) + +有符整型通过第1个比特位(称为符号位)来表达这个整数是正数还是负数。`0`代表正数,`1`代表负数。 + +其余的比特位(称为数值位)存储其实值。有符正整数和无符正整数在计算机里的存储结果是一样的,下来我们来看`+4`内部的二进制结构。 + +![Art/bitshiftSignedFour_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitshiftSignedFour_2x.png "Art/bitshiftSignedFour_2x.png") + +符号位为`0`,代表正数,另外7比特位二进制表示的实际值就刚好是`4`。 + +负数呢,跟正数不同。负数存储的是2的n次方减去它的绝对值,n为数值位的位数。一个8比特的数有7个数值位,所以是2的7次方,即128。 + +我们来看`-4`存储的二进制结构。 + +![Art/bitshiftSignedMinusFour_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitshiftSignedMinusFour_2x.png "Art/bitshiftSignedMinusFour_2x.png") + +现在符号位为`1`,代表负数,7个数值位要表达的二进制值是124,即128 - 4。 + +![Art/bitshiftSignedMinusFourValue_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitshiftSignedMinusFourValue_2x.png "Art/bitshiftSignedMinusFourValue_2x.png") + +负数的编码方式称为二进制补码表示。这种表示方式看起来很奇怪,但它有几个优点。 + +首先,只需要对全部8个比特位(包括符号)做标准的二进制加法就可以完成 `-1 + -4` 的操作,忽略加法过程产生的超过8个比特位表达的任何信息。 + +![Art/bitshiftSignedAddition_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitshiftSignedAddition_2x.png "Art/bitshiftSignedAddition_2x.png") + +第二,由于使用二进制补码表示,我们可以和正数一样对负数进行按位左移右移的,同样也是左移1位时乘于`2`,右移1位时除于`2`。要达到此目的,对有符整型的右移有一个特别的要求: + +对有符整型按位右移时,使用符号位(正数为`0`,负数为`1`)填充空白位。 + +![Art/bitshiftSigned_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/bitshiftSigned_2x.png "Art/bitshiftSigned_2x.png") + +这就确保了在右移的过程中,有符整型的符号不会发生变化。这称为算术移位。 + +正因为正数和负数特殊的存储方式,向右移位使它接近于`0`。移位过程中保持符号会不变,负数在接近`0`的过程中一直是负数。 + + +## 溢出运算符 + +默认情况下,当你往一个整型常量或变量赋于一个它不能承载的大数时,Swift不会让你这么干的,它会报错。这样,在操作过大或过小的数的时候就很安全了。 + +例如,`Int16`整型能承载的整数范围是`-32768`到`32767`,如果给它赋上超过这个范围的数,就会报错: + +```swift +var potentialOverflow = Int16.max +// potentialOverflow 等于 32767, 这是 Int16 能承载的最大整数 +potentialOverflow += 1 +// 噢, 出错了 +``` + +对过大或过小的数值进行错误处理让你的数值边界条件更灵活。 + +当然,你有意在溢出时对有效位进行截断,你可采用溢出运算,而非错误处理。Swfit为整型计算提供了5个`&`符号开头的溢出运算符。 + +- 溢出加法 `&+` +- 溢出减法 `&-` +- 溢出乘法 `&*` +- 溢出除法 `&/` +- 溢出求余 `&%` + +### 值的上溢出 + +下面例子使用了溢出加法`&+`来解剖的无符整数的上溢出 + +```swift +var willOverflow = UInt8.max +// willOverflow 等于UInt8的最大整数 255 +willOverflow = willOverflow &+ 1 +// 这时候 willOverflow 等于 0 +``` + +`willOverflow`用`Int8`所能承载的最大值`255`(二进制`11111111`),然后用`&+`加1。然后`UInt8`就无法表达这个新值的二进制了,也就导致了这个新值上溢出了,大家可以看下图。溢出后,新值在`UInt8`的承载范围内的那部分是`00000000`,也就是`0`。 + +![Art/overflowAddition_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/overflowAddition_2x.png "Art/overflowAddition_2x.png") + +### 值的下溢出 + +数值也有可能因为太小而越界。举个例子: + +`UInt8`的最小值是`0`(二进制为`00000000`)。使用`&-`进行溢出减1,就会得到二进制的`11111111`即十进制的`255`。 + +![Art/overflowUnsignedSubtraction_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/overflowUnsignedSubtraction_2x.png "Art/overflowUnsignedSubtraction_2x.png") + +Swift代码是这样的: + +```swift +var willUnderflow = UInt8.min +// willUnderflow 等于UInt8的最小值0 +willUnderflow = willUnderflow &- 1 +// 此时 willUnderflow 等于 255 +``` + +有符整型也有类似的下溢出,有符整型所有的减法也都是对包括在符号位在内的二进制数进行二进制减法的,这在 "按位左移/右移运算符" 一节提到过。最小的有符整数是`-128`,即二进制的`10000000`。用溢出减法减去去1后,变成了`01111111`,即UInt8所能承载的最大整数`127`。 + +![Art/overflowSignedSubtraction_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/overflowSignedSubtraction_2x.png "Art/overflowSignedSubtraction_2x.png") + +来看看Swift代码: + +```swift +var signedUnderflow = Int8.min +// signedUnderflow 等于最小的有符整数 -128 +signedUnderflow = signedUnderflow &- 1 +// 如今 signedUnderflow 等于 127 +``` + +### 除零溢出 + +一个数除于0 `i / 0`,或者对0求余数 `i % 0`,就会产生一个错误。 + +```swift +let x = 1 +let y = x / 0 +``` + +使用它们对应的可溢出的版本的运算符`&/`和`&%`进行除0操作时就会得到`0`值。 + +```swift +let x = 1 +let y = x &/ 0 +// y 等于 0 +``` + + +## 优先级和结合性 + +运算符的优先级使得一些运算符优先于其他运算符,高优先级的运算符会先被计算。 + +结合性定义相同优先级的运算符在一起时是怎么组合或关联的,是和左边的一组呢,还是和右边的一组。意思就是,到底是和左边的表达式结合呢,还是和右边的表达式结合? + +在混合表达式中,运算符的优先级和结合性是非常重要的。举个例子,为什么下列表达式的结果为`4`? + +```swift +2 + 3 * 4 % 5 +// 结果是 4 +``` + +如果严格地从左计算到右,计算过程会是这样: + + +- 2 + 3 = 5 +- 5 * 4 = 20 +- 20 / 5 = 4 余 0 + +但是正确答案是`4`而不是`0`。优先级高的运算符要先计算,在Swift和C语言中,都是先乘除后加减的。所以,执行完乘法和求余运算才能执行加减运算。 + +乘法和求余拥有相同的优先级,在运算过程中,我们还需要结合性,乘法和求余运算都是左结合的。这相当于在表达式中有隐藏的括号让运算从左开始。 + +```swift +2 + ((3 * 4) % 5) +``` + +3 * 4 = 12,所以这相当于: + + +```swift +2 + (12 % 5) +``` + +12 % 5 = 2,所这又相当于 + +```swift +2 + 2 +``` + +计算结果为 4。 + +查阅Swift运算符的优先级和结合性的完整列表,请看[表达式](../chapter3/04_Expressions.html)。 + +> 注意: +Swift的运算符较C语言和Objective-C来得更简单和保守,这意味着跟基于C的语言可能不一样。所以,在移植已有代码到Swift时,注意去确保代码按你想的那样去执行。 + + +## 运算符函数 + +让已有的运算符也可以对自定义的类和结构进行运算,这称为运算符重载。 + +这个例子展示了如何用`+`让一个自定义的结构做加法。算术运算符`+`是一个两目运算符,因为它有两个操作数,而且它必须出现在两个操作数之间。 + +例子中定义了一个名为`Vector2D`的二维坐标向量 `(x,y)` 的结构,然后定义了让两个`Vector2D`的对象相加的运算符函数。 + +```swift +struct Vector2D { + var x = 0.0, y = 0.0 +} +@infix func + (left: Vector2D, right: Vector2D) -> Vector2D { + return Vector2D(x: left.x + right.x, y: left.y + right.y) +} +``` + +该运算符函数定义了一个全局的`+`函数,这个函数需要两个`Vector2D`类型的参数,返回值也是`Vector2D`类型。需要定义和实现一个中置运算的时候,在关键字`func`之前写上属性 `@infix` 就可以了。 + +在这个代码实现中,参数被命名为了`left`和`right`,代表`+`左边和右边的两个`Vector2D`对象。函数返回了一个新的`Vector2D`的对象,这个对象的`x`和`y`分别等于两个参数对象的`x`和`y`的和。 + +这个函数是全局的,而不是`Vector2D`结构的成员方法,所以任意两个`Vector2D`对象都可以使用这个中置运算符。 + +```swift +let vector = Vector2D(x: 3.0, y: 1.0) +let anotherVector = Vector2D(x: 2.0, y: 4.0) +let combinedVector = vector + anotherVector +// combinedVector 是一个新的Vector2D, 值为 (5.0, 5.0) +``` + +这个例子实现两个向量 `(3.0,1.0)` 和 `(2.0,4.0)` 相加,得到向量 `(5.0,5.0)` 的过程。如下图示: + +![Art/vectorAddition_2x.png](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Art/vectorAddition_2x.png "Art/vectorAddition_2x.png") + +### 前置和后置运算符 + +上个例子演示了一个双目中置运算符的自定义实现,同样我们也可以玩标准单目运算符的实现。单目运算符只有一个操作数,在操作数之前就是前置的,如`-a`; 在操作数之后就是后置的,如`i++`。 + +实现一个前置或后置运算符时,在定义该运算符的时候于关键字`func`之前标注 `@prefix` 或 `@postfix` 属性。 + +```swift +@prefix func - (vector: Vector2D) -> Vector2D { + return Vector2D(x: -vector.x, y: -vector.y) +} +``` + +这段代码为`Vector2D`类型提供了单目减运算`-a`,`@prefix`属性表明这是个前置运算符。 + +对于数值,单目减运算符可以把正数变负数,把负数变正数。对于`Vector2D`,单目减运算将其`x`和`y`都进进行单目减运算。 + +```swift +let positive = Vector2D(x: 3.0, y: 4.0) +let negative = -positive +// negative 为 (-3.0, -4.0) +let alsoPositive = -negative +// alsoPositive 为 (3.0, 4.0) +``` + +### 组合赋值运算符 + +组合赋值是其他运算符和赋值运算符一起执行的运算。如`+=`把加运算和赋值运算组合成一个操作。实现一个组合赋值符号需要使用`@assignment`属性,还需要把运算符的左参数设置成`inout`,因为这个参数会在运算符函数内直接修改它的值。 + +```swift +@assignment func += (inout left: Vector2D, right: Vector2D) { + left = left + right +} +``` + +因为加法运算在之前定义过了,这里无需重新定义。所以,加赋运算符函数使用已经存在的高级加法运算符函数来执行左值加右值的运算。 + +```swift +var original = Vector2D(x: 1.0, y: 2.0) +let vectorToAdd = Vector2D(x: 3.0, y: 4.0) +original += vectorToAdd +// original 现在为 (4.0, 6.0) +``` + +你可以将 `@assignment` 属性和 `@prefix` 或 `@postfix` 属性起来组合,实现一个`Vector2D`的前置运算符。 + +```swift +@prefix @assignment func ++ (inout vector: Vector2D) -> Vector2D { + vector += Vector2D(x: 1.0, y: 1.0) + return vector +} +``` + +这个前置使用了已经定义好的高级加赋运算,将自己加上一个值为 `(1.0,1.0)` 的对象然后赋给自己,然后再将自己返回。 + +```swift +var toIncrement = Vector2D(x: 3.0, y: 4.0) +let afterIncrement = ++toIncrement +// toIncrement 现在是 (4.0, 5.0) +// afterIncrement 现在也是 (4.0, 5.0) +``` + +>注意: +默认的赋值符是不可重载的。只有组合赋值符可以重载。三目条件运算符 `a?b:c` 也是不可重载。 + +### 比较运算符 + +Swift无所知道自定义类型是否相等或不等,因为等于或者不等于由你的代码说了算了。所以自定义的类和结构要使用比较符`==`或`!=`就需要重载。 + +定义相等运算符函数跟定义其他中置运算符雷同: + +```swift +@infix func == (left: Vector2D, right: Vector2D) -> Bool { + return (left.x == right.x) && (left.y == right.y) +} + +@infix func != (left: Vector2D, right: Vector2D) -> Bool { + return !(left == right) +} +``` + +上述代码实现了相等运算符`==`来判断两个`Vector2D`对象是否有相等的值,相等的概念就是它们有相同的`x`值和相同的`y`值,我们就用这个逻辑来实现。接着使用`==`的结果实现了不相等运算符`!=`。 + +现在我们可以使用这两个运算符来判断两个`Vector2D`对象是否相等。 + +```swift +let twoThree = Vector2D(x: 2.0, y: 3.0) +let anotherTwoThree = Vector2D(x: 2.0, y: 3.0) +if twoThree == anotherTwoThree { + println("这两个向量是相等的.") +} +// prints "这两个向量是相等的." +``` + +### 自定义运算符 + +标准的运算符不够玩,那你可以声明一些个性的运算符,但个性的运算符只能使用这些字符 `/ = - + * % < >!& | ^。~`。 + +新的运算符声明需在全局域使用`operator`关键字声明,可以声明为前置,中置或后置的。 + +```swift +operator prefix +++ {} +``` + + +这段代码定义了一个新的前置运算符叫`+++`,此前Swift并不存在这个运算符。此处为了演示,我们让`+++`对`Vector2D`对象的操作定义为 `双自增` 这样一个独有的操作,这个操作使用了之前定义的加赋运算实现了自已加上自己然后返回的运算。 + +```swift +@prefix @assignment func +++ (inout vector: Vector2D) -> Vector2D { + vector += vector + return vector +} +``` + +`Vector2D` 的 `+++` 的实现和 `++` 的实现很接近, 唯一不同的前者是加自己, 后者是加值为 `(1.0, 1.0)` 的向量. + +```swift +var toBeDoubled = Vector2D(x: 1.0, y: 4.0) +let afterDoubling = +++toBeDoubled +// toBeDoubled 现在是 (2.0, 8.0) +// afterDoubling 现在也是 (2.0, 8.0) +``` + +### 自定义中置运算符的优先级和结合性 + +可以为自定义的中置运算符指定优先级和结合性。可以回头看看[优先级和结合性](#PrecedenceandAssociativity)解释这两个因素是如何影响多种中置运算符混合的表达式的计算的。 + +结合性(associativity)的值可取的值有`left`,`right`和`none`。左结合运算符跟其他优先级相同的左结合运算符写在一起时,会跟左边的操作数结合。同理,右结合运算符会跟右边的操作数结合。而非结合运算符不能跟其他相同优先级的运算符写在一起。 + +结合性(associativity)的值默认为`none`,优先级(precedence)默认为`100`。 + +以下例子定义了一个新的中置符`+-`,是左结合的`left`,优先级为`140`。 + +```swift +operator infix +- { associativity left precedence 140 } +func +- (left: Vector2D, right: Vector2D) -> Vector2D { + return Vector2D(x: left.x + right.x, y: left.y - right.y) +} +let firstVector = Vector2D(x: 1.0, y: 2.0) +let secondVector = Vector2D(x: 3.0, y: 4.0) +let plusMinusVector = firstVector +- secondVector +// plusMinusVector 此时的值为 (4.0, -2.0) +``` + +这个运算符把两个向量的`x`相加,把向量的`y`相减。因为他实际是属于加减运算,所以让它保持了和加法一样的结合性和优先级(`left`和`140`)。查阅完整的Swift默认结合性和优先级的设置,请移步[表达式](../chapter3/04_Expressions.html); diff --git a/source/chapter2/chapter2.md b/source/chapter2/chapter2.md old mode 100644 new mode 100755 index 384187fd..4ef835e2 --- a/source/chapter2/chapter2.md +++ b/source/chapter2/chapter2.md @@ -1,3 +1,3 @@ -# Swift 教程 - -本章介绍了 Swift 的各种特性及其使用方法,是全书的核心部分。 +# Swift 教程 + +本章介绍了 Swift 的各种特性及其使用方法,是全书的核心部分。 diff --git a/source/chapter3/01_About_the_Language_Reference.md b/source/chapter3/01_About_the_Language_Reference.md old mode 100644 new mode 100755 index f17b2a94..05760072 --- a/source/chapter3/01_About_the_Language_Reference.md +++ b/source/chapter3/01_About_the_Language_Reference.md @@ -1,38 +1,38 @@ +> 翻译:[dabing1022](https://github.com/dabing1022) +> 校对:[numbbbbb](https://github.com/numbbbbb) + + # 关于语言附注 +----------------- + +本页内容包括: + +- [如何阅读语法](#how_to_read_the_grammar) 本书的这一节描述了Swift编程语言的形式语法。这里描述的语法是为了帮助您更详细的了解该语言,而不是让您直接实现一个解析器或编译器。 Swift语言相对小点,这是由于在Swift代码中几乎无处不在的许多常见的的类型,函数以及运算符都由Swift标准库来定义。虽然这些类型,函数和运算符不是Swift语言本身的一部分,但是它们被广泛用于这本书的讨论和代码范例。 -# 如何阅读语法 + +## 如何阅读语法 用来描述Swift编程语言形式语法的记法遵循下面几个约定: -- 箭头(→)用来标记语法产式,可以被理解为“可以包含”。 +-](https://github.com/numbbbbb)箭头(→)用来标记语法产式,可以被理](https://github.com/numbbbbb)解为“可以包含”。 - 句法范畴由*斜体*文字表示,并出现在一个语法产式规则两侧。 - 义词和标点符号由粗体固定宽度的文本显示和只出现在一个语法产式规则的右边。 - 选择性的语法产式由竖线(|)分隔。当可选用的语法产式太多时,为了阅读方便,它们将被拆分为多行语法产式规则。 - 在少数情况下,常规字体文字用来描述语法产式规则的右边。 - 可选的句法范畴和文字用尾标`opt`来标记。 - 举个例子,getter-setter的语法块的定义如下: -> GRAMMAR OF A GETTER-SETTER BLOCK - +> GRAMMAR OF A GETTER-SETTER BLOCK > *getter-setter-block* → {­ [*getter-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/getter-clause) [­*setter-clause*­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/setter-clause)*opt* ­}­ | {­ [*setter-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/setter-clause) [­*getter-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/getter-clause)­}­ 这个定义表明,一个getter-setter方法​​块可以由一个getter子句后跟一个可选的setter子句构成,用大括号括起来,或者由一个setter子句后跟一个getter子句构成,用大括号括起来。上述的文法产生等价于下面的两个产生,明确阐明如何二中择一: -> GRAMMAR OF A GETTER-SETTER BLOCK - -> getter-setter-block → {­ [*getter-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/getter-clause) [*­setter-clause*­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/setter-clause)*opt* ­}­­ - +> GRAMMAR OF A GETTER-SETTER BLOCK +> getter-setter-block → {­ [*getter-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/getter-clause) [*­setter-clause*­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/setter-clause)*opt* ­}­­ > getter-setter-block → {­ [*setter-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/setter-clause) [*­getter-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/getter-clause)­}­ - - -================================================================ -上篇:[高级操作符]() - -下篇:[词法结构]() \ No newline at end of file diff --git a/source/chapter3/02_Lexical_Structure.md b/source/chapter3/02_Lexical_Structure.md old mode 100644 new mode 100755 index 625c0a4a..ca1ac6a9 --- a/source/chapter3/02_Lexical_Structure.md +++ b/source/chapter3/02_Lexical_Structure.md @@ -1,295 +1,238 @@ -# 语法结构 - -本页包含内容: - -- 空白与注释(*Whitespace and Comments*) -- 标识符(*Identifiers*) -- 关键字(*Keywords*) -- 字面量(*Literals*) -- 运算符(*Operators*) - -Swift 的“语法结构(*lexical structure*)”描述了如何在该语言中用字符序列构建合法标记,组成该语言中最底层的代码块,并在之后的章节中用于描述语言的其他部分。 - -通常,标记在随后介绍的语法约束下,由 Swift 源文件的输入文本中提取可能的最长子串生成。这种方法称为“最长匹配项(*longest match*)”,或者“最大适合”(*maximal munch*)。 - -## 空白与注释 - -空白(*whitespace*)有两个用途:分隔源文件中的标记和区分运算符属于前缀还是后缀,(参见 [运算符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-XID_871))在其他情况下则会被忽略。以下的字符会被当作空白:空格(*space*)(U+0020)、换行符(*line feed*)(U+000A)、回车符(*carriage return*)(U+000D)、水平 tab(*horizontal tab*)(U+0009)、垂直 tab(*vertical tab*)(U+000B)、换页符(*form feed*)(U+000C)以及空(*null*)(U+0000)。 - -注释(*comments*)被编译器当作空白处理。单行注释由 `//` 开始直到该行结束。多行注释由 `/*` 开始,以 `*/` 结束。可以嵌套注释,但注意注释标记必须匹配。 - -## 标识符 - -标识符(*identifiers*)可以由以下的字符开始:大写或小写的字母 `A` 到 `Z`、下划线 `_`、基本多语言面(*Basic Multilingual Plane*)中的 Unicode 非组合字符以及基本多语言面以外的非专用区(*Private Use Area*)字符。首字符之后,标识符允许使用数字和 Unicode 字符组合。 - -使用保留字(*reserved word*)作为标识符,需要在其前后增加反引号 \`。例如,class 不是合法的标识符,但可以使用 \`class\`。反引号不属于标识符的一部分,\`x\` 和 `x` 表示同一标识符。 - -闭包(*closure*)中如果没有明确指定参数名称,参数将被隐式命名为 $0$1$2... 这些命名在闭包作用域内是合法的标识符。 - -> 标识符语法 -> -> *identifier* → [identifier-head­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-head) [identifier-characters](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-characters)­ *opt* -> -> *identifier* → \`­ [identifier-head­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-head) [identifier-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-characters) *opt­* \`­ -> -> *identifier* → [implicit-parameter-name­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/implicit-parameter-name) -> -> *identifier-list* → [identifier­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier) | [identifier­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier) , [­identifier-list](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-list)­ -> -> *identifier-head* → A 到 Z 大写或小写字母 -> -> *identifier-head* → U+00A8, U+00AA, U+00AD, U+00AF, U+00B2–U+00B5, 或 U+00B7–U+00BA -> -> *identifier-head* → U+00BC–U+00BE, U+00C0–U+00D6, U+00D8–U+00F6, 或 U+00F8–U+00FF -> -> *identifier-head* → U+0100–U+02FF, U+0370–U+167F, U+1681–U+180D, 或 U+180F–U+1DBF -> -> *identifier-head* → U+1E00–U+1FFF -> -> *identifier-head* → U+200B–U+200D, U+202A–U+202E, U+203F–U+2040, U+2054, 或 U+2060–U+206F -> -> *identifier-head* → U+2070–U+20CF, U+2100–U+218F, U+2460–U+24FF, 或 U+2776–U+2793 -> -> *identifier-head* → U+2C00–U+2DFF 或 U+2E80–U+2FFF -> -> *identifier-head* → U+3004–U+3007, U+3021–U+302F, U+3031–U+303F, 或 U+3040–U+D7FF -> -> *identifier-head* → U+F900–U+FD3D, U+FD40–U+FDCF, U+FDF0–U+FE1F, 或 U+FE30–U+FE44 -> -> *identifier-head* → U+FE47–U+FFFD -> -> *identifier-head* → U+10000–U+1FFFD, U+20000–U+2FFFD, U+30000–U+3FFFD, 或 U+40000–U+4FFFD -> -> *identifier-head* → U+50000–U+5FFFD, U+60000–U+6FFFD, U+70000–U+7FFFD, 或 U+80000–U+8FFFD -> -> *identifier-head* → U+90000–U+9FFFD, U+A0000–U+AFFFD, U+B0000–U+BFFFD, 或 U+C0000–U+CFFFD -> -> *identifier-head* → U+D0000–U+DFFFD 或 U+E0000–U+EFFFD -> -> *identifier-character* → 数字 0 到 9 -> -> *identifier-character* → U+0300–U+036F, U+1DC0–U+1DFF, U+20D0–U+20FF, or U+FE20–U+FE2F -> -> *identifier-character* → [identifier-head­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-head) -> -> *identifier-characters* → [identifier-character](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-character) [­identifier-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier-characters) *opt­* -> -> *implicit-parameter-name* → **$­** [decimal-digits­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-digits) - -## 关键字 - -被保留的关键字(*keywords*)不允许用作标识符,除非被反引号转义,参见 [标识符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-XID_796)。 - -* **用作声明的关键字:** *class*、*deinit*、*enum*、*extension*、*func*、*import*、*init*、*let*、*protocol*、*static*、*struct*、*subscript*、*typealias*、*var* - -* **用作语句的关键字:** *break*、*case*、*continue*、*default*、*do*、*else*、*fallthrough*、*if*、*in*、*for*、*return*、*switch*、*where*、*while* - -* **用作表达和类型的关键字:** *as*、*dynamicType*、*is*、*new*、*super*、*self*、*Self*、*Type*、*\_\_COLUMN\_\_*、*\_\_FILE\_\_*、*\_\_FUNCTION\_\_*、*\_\_LINE\_\_* - -* **特定上下文中被保留的关键字:** *associativity*、*didSet*、*get*、*infix*、*inout*、*left*、*mutating*、*none*、*nonmutating*、*operator*、*override*、*postfix*、*precedence*、*prefix*、*right*、*set*、*unowned*、*unowned(safe)*、*unowned(unsafe)*、*weak*、*willSet*,这些关键字在特定上下文之外可以被用于标识符。 - -## 字面量 - -字面值表示整型、浮点型数字或文本类型的值,举例如下: - - 42 // 整型字面量 - 3.14159 // 浮点型字面量 - "Hello, world!" // 文本型字面量 - -> 字面量语法 -> -> *literal* → [integer-literal­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/integer-literal) | [floating-point-literal](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/floating-point-literal)­ | [string-literal­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/string-literal) - -### 整型字面量 - -整型字面量(*integer literals*)表示未指定精度整型数的值。整型字面量默认用十进制表示,可以加前缀来指定其他的进制,二进制字面量加 `0b`,八进制字面量加 `0o`,十六进制字面量加 `0x`。 - -十进制字面量包含数字 `0` 至 `9`。二进制字面量只包含 `0` 或 `1`,八进制字面量包含数字 `0` 至 `7`,十六进制字面量包含数字 `0` 至 `9` 以及字母 `A` 至 `F` (大小写均可)。 - -负整数的字面量在数字前加减号 `-`,比如 `-42`。 - -允许使用下划线 `_` 来增加数字的可读性,下划线不会影响字面量的值。整型字面量也可以在数字前加 `0`,同样不会影响字面量的值。 - - 1000_000 // 等于 1000000 - 005 // 等于 5 - -除非特殊指定,整型字面量的默认类型为 Swift 标准库类型中的 `Int`。Swift 标准库还定义了其他不同长度以及是否带符号的整数类型,请参考 [整数类型](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-XID_411)。 - -> 整型字面量语法 -> -> *integer-literal* → [binary-literal­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/binary-literal) -> -> *integer-literal* → [octal-literal­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/octal-literal) -> -> *integer-literal* → [decimal-literal­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-literal) -> -> *integer-literal* → [hexadecimal-literal](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-literal)­ -> -> *binary-literal* → **0b**­ [binary-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/binary-digit) ­[binary-literal-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/binary-literal-characters) *opt­* -> -> *binary-digit* → 数字 0 或 1 -> -> *binary-literal-character* → [binary-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/binary-digit)­ | _­ -> -> *binary-literal-characters* → [binary-literal-character](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/binary-literal-character) ­[binary-literal-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/binary-literal-characters) *opt­* -> -> *octal-literal* → **0o**­ [octal-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/octal-digit) ­[octal-literal-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/octal-literal-characters) *opt­* -> -> *octal-digit* → 数字 0 至 7 -> -> *octal-literal-character* → [octal-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/octal-digit)­ | _­ -> -> *octal-literal-characters* → [octal-literal-character](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/octal-literal-character) [­octal-literal-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/octal-literal-characters) *opt­* -> -> *decimal-literal* → [decimal-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-digit) [­decimal-literal-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-literal-characters) *opt­* -> -> *decimal-digit* → 数字 0 至 9 -> -> *decimal-digits* → [decimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-digit) [decimal-digits­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-digits) *opt­* -> -> *decimal-literal-character* → [decimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-digit) | _­ -> -> *decimal-literal-characters* → [decimal-literal-character](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-literal-character) ­[decimal-literal-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-literal-characters) *opt­* -> -> *hexadecimal-literal* → **0x** ­[hexadecimal-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [­hexadecimal-literal-characters­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-literal-characters) *opt­* -> -> *hexadecimal-digit* → 数字 0 到 9, a 到 f, 或 A 到 F -> -> *hexadecimal-literal-character* → [hexadecimal-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit)­ | _­ -> -> *hexadecimal-literal-characters* → [hexadecimal-literal-character­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-literal-character) [hexadecimal-literal-characters](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-literal-characters) ­*opt­* - -### 浮点型字面量 - -浮点型字面量(*floating-point literals*)表示未指定精度浮点数的值。 - -浮点型字面量默认用十进制表示(无前缀),也可以用十六进制表示(加前缀 `0x`)。 - -十进制浮点型字面量(*decimal floating-point literals*)由十进制数字串后跟小数部分或指数部分(或两者皆有)组成。十进制小数部分由小数点 `.` 后跟十进制数字串组成。指数部分由大写或小写字母 `e` 后跟十进制数字串组成,这串数字表示 `e` 之前的数量乘以 10 的几次方。例如:`1.25e2` 表示 `1.25 ⨉ 10^2`,也就是 `125.0`;同样,`1.25e-2` 表示 `1.25 ⨉ 10^-2`,也就是 `0.0125`。 - -十六进制浮点型字面量(*hexadecimal floating-point literals*)由前缀 `0x` 后跟可选的十六进制小数部分以及十六进制指数部分组成。十六进制小数部分由小数点后跟十六进制数字串组成。指数部分由大写或小写字母 `p` 后跟十进制数字串组成,这串数字表示 `p` 之前的数量乘以 2 的几次方。例如:`0xFp2` 表示 `15 ⨉ 2^2`,也就是 `60`;同样,`0xFp-2` 表示 `15 ⨉ 2^-2`,也就是 `3.75`。 - -与整型字面量不同,负的浮点型字面量由一元运算符减号 `-` 和浮点型字面量组成,例如 `-42.0`。这代表一个表达式,而不是一个浮点整型字面量。 - -允许使用下划线 `_` 来增强可读性,下划线不会影响字面量的值。浮点型字面量也可以在数字前加 `0`,同样不会影响字面量的值。 - - 10_000.56 // 等于 10000.56 - 005000.76 // 等于 5000.76 - -除非特殊指定,浮点型字面量的默认类型为 Swift 标准库类型中的 `Double`,表示64位浮点数。Swift 标准库也定义 `Float` 类型,表示32位浮点数。 - -> 浮点型字面量语法 -> -> *floating-point-literal* → [decimal-literal](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-literal) ­[decimal-fraction­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-fraction) *opt* ­[decimal-exponent­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-exponent) *opt­* -> -> *floating-point-literal* → [hexadecimal-literal](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-literal) ­[hexadecimal-fraction](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-fraction) ­*opt­* [hexadecimal-exponent](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-exponent)­ -> -> *decimal-fraction* → . [­decimal-literal­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-literal) -> -> *decimal-exponent* → [floating-point-e](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/floating-point-e) [­sign­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/sign) *opt­* [decimal-literal](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/decimal-literal)­ -> -> *hexadecimal-fraction* → . [­hexadecimal-literal­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-literal) *opt­* -> -> *hexadecimal-exponent* → [floating-point-p­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/floating-point-p) [sign­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/sign) *opt­* [hexadecimal-literal­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-literal) -> -> *floating-point-e* → **e­** | **E**­ -> -> *floating-point-p* → **p**­ | **P**­ -> -> *sign* → **+**­ | **-**­ - - - -### 文本型字面量 - -文本型字面量(*string literal*)由双引号中的字符串组成,形式如下: - - "characters" - -文本型字面量中不能包含未转义的双引号 `"`、未转义的反斜线`\`、回车符(*carriage return*)或换行符(*line feed*)。 - -可以在文本型字面量中使用的转义特殊符号如下: - -* 空字符(Null Character)`\0` -* 反斜线(Backslash)`\\` -* 水平 Tab (Horizontal Tab)`\t` -* 换行符(Line Feed)`\n` -* 回车符(Carriage Return)`\r` -* 双引号(Double Quote)`\"` -* 单引号(Single Quote)`\'` - -字符也可以用以下方式表示: - -* `\x` 后跟两位十六进制数字 -* `\u` 后跟四位十六进制数字 -* `\U` 后跟八位十六进制数字 - -后跟的数字表示一个 Unicode 码点。 - -文本型字面量允许在反斜线小括号 `\()` 中插入表达式的值。插入表达式(*interpolated expression*)不能包含未转义的双引号 `"`、反斜线 `\`、回车符或者换行符。表达式值的类型必须在 *String* 类中有对应的初始化方法。 - -例如,以下所有文本型字面量的值相同: - - "1 2 3" - "1 2 \(3)" - "1 2 \(1 + 2)" - var x = 3; "1 2 \(x)" - -文本型字面量的默认类型为 `String`。组成字符串的字符类型为 `Character`。更多有关 `String` 和 `Character` 的信息请参照 [字符串和字符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html#//apple_ref/doc/uid/TP40014097-CH7-XID_368)。 - -> 文本型字面量语法 -> -> *string-literal* → **"­** [quoted-text](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/quoted-text) **­"­** -> -> *quoted-text* → [quoted-text-item­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/quoted-text-item) [quoted-text](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/quoted-text) ­*opt­* -> -> *quoted-text-item* → [escaped-character­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/escaped-character) -> -> *quoted-text-item* → **\(**­ [expression­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) **)**­ -> -> *quoted-text-item* → 除 `"`、`\`­、`U+000A` 或 `U+000D` 以外的任何 Unicode 扩展字符集 -> -> *escaped-character* → **\0­** | **\\**­ | **\t­** | **\n**­ | **\r­** | **\"­** | **\'**­ -> -> *escaped-character* → **\x­** [hexadecimal-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit)­ [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) -> -> *escaped-character* → **\u** ­[hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [hexadecimal-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [­hexadecimal-digit](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit)­ [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) -> -> *escaped-character* → **\U­** [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) [hexadecimal-digit­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/hexadecimal-digit) - -## 运算符 - -Swift 标准库定义了许多可供使用的运算符,其中大部分在 [基础运算符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/BasicOperators.html#//apple_ref/doc/uid/TP40014097-CH6-XID_70) 和 [高级运算符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-XID_28) 中进行了阐述。这里将描述哪些字符能用作运算符。 - -运算符由一个或多个以下字符组成: -`/`、`=`、`-`、`+`、`!`、`*`、`%`、`<`、`>`、`&`、`|`、`^`、`~`、`.`。也就是说,标记 `=`, `->`、`//`、`/*`、`*/`、`.` 以及一元前缀运算符 `&` 属于保留字,这些标记不能被重写或用于自定义运算符。 - -运算符两侧的空白被用来区分该运算符是否为前缀运算符(*prefix operator*)、后缀运算符(*postfix operator*)或二元运算符(*binary operator*)。规则总结如下: - -* 如果运算符两侧都有空白或两侧都无空白,将被看作二元运算符。例如:`a+b` 和 `a + b` 中的运算符 `+` 被看作二元运算符。 - -* 如果运算符只有左侧空白,将被看作前缀一元运算符。例如 `a ++b` 中的 `++` 被看作前缀一元运算符。 - -* 如果运算符只有右侧空白,将被看作后缀一元运算符。例如 `a++ b` 中的 `++` 被看作后缀一元运算符。 - -* 如果运算符左侧没有空白并紧跟 `.`,将被看作后缀一元运算符。例如 `a++.b` 中的 `++` 被看作后缀一元运算符(同理, `a++ . b` 中的 `++` 是后缀一元运算符而 `a ++ .b` 中的 `++` 不是). - -鉴于这些规则,运算符前的字符 `(`、`[` 和 `{` ;运算符后的字符 `)`、`]` 和 `}` 以及字符 `,`、`;` 和 `:` 都将用于空白检测。 - -以上规则需注意一点,如果运算符 `!` 或 `?` 左侧没有空白,则不管右侧是否有空白都将被看作后缀运算符。如果将 `?` 用作可选类型(*optional type*)修饰,左侧必须无空白。如果用于条件运算符 `? :`,必须两侧都有空白。 - -在特定构成中 ,以 `<` 或 `>` 开头的运算符会被分离成两个或多个标记,剩余部分以同样的方式会被再次分离。因此,在 `Dictionary>` 中没有必要添加空白来消除闭合字符 `>` 的歧义。在这个例子中, 闭合字符 `>` 被看作单字符标记,而不会被误解为移位运算符 `>>`。 - -要学习如何自定义新的运算符,请参考 [自定义操作符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-XID_48) 和 [运算符声明](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/doc/uid/TP40014097-CH34-XID_644)。学习如何重写现有运算符,请参考 [运算符方法](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-XID_43)。 - -> 运算符语法 -> -> *operator* → [operator-character­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/operator-character) [operator­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/operator) *opt­* -> -> *operator-character* → **/­** | **=­** | **-­** | **+­** | **!­** | ***­** | **%­** | **<­** | **>­** | **&­** | **|­** | **^­** | **~­** | **.­** -> -> *binary-operator* → [operator­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/operator) -> -> *prefix-operator* → [operator­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/operator) -> -> *postfix-operator* → [operator­](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/operator) \ No newline at end of file +> 翻译:[superkam](https://github.com/superkam) +> 校对:[numbbbbb](https://github.com/numbbbbb) + +# 词法结构 +----------------- + +本页包含内容: + +- [空白与注释(*Whitespace and Comments*)](#whitespace_and_comments) +- [标识符(*Identifiers*)](#identifiers) +- [关键字(*Keywords*)](#keywords) +- [字面量(*Literals*)](#literals) +- [运算符(*Operators*)](#operators) + +Swift 的“词法结构(*lexical structure*)”描述了如何在该语言中用字符序列构建合法标记,组成该语言中最底层的代码块,并在之后的章节中用于描述语言的其他部分。 + +通常,标记在随后介绍的语法约束下,由 Swift 源文件的输入文本中提取可能的最长子串生成。这种方法称为“最长匹配项(*longest match*)”,或者“最大适合”(*maximal munch*)。 + + +## 空白与注释 + +空白(*whitespace*)有两个用途:分隔源文件中的标记和区分运算符属于前缀还是后缀,(参见 [运算符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-XID_871))在其他情况下则会被忽略。以下的字符会被当作空白:空格(*space*)(U+0020)、换行符(*line feed*)(U+000A)、回车符(*carriage return*)(U+000D)、水平 tab(*horizontal tab*)(U+0009)、垂直 tab(*vertical tab*)(U+000B)、换页符(*form feed*)(U+000C)以及空(*null*)(U+0000)。 + +注释(*comments*)被编译器当作空白处理。单行注释由 `//` 开始直到该行结束。多行注释由 `/*` 开始,以 `*/` 结束。可以嵌套注释,但注意注释标记必须匹配。 + + +## 标识符 + +标识符(*identifiers*)可以由以下的字符开始:大写或小写的字母 `A` 到 `Z`、下划线 `_`、基本多语言面(*Basic Multilingual Plane*)中的 Unicode 非组合字符以及基本多语言面以外的非专用区(*Private Use Area*)字符。首字符之后,标识符允许使用数字和 Unicode 字符组合。 + +使用保留字(*reserved word*)作为标识符,需要在其前后增加反引号 \`。例如,class 不是合法的标识符,但可以使用 \`class\`。反引号不属于标识符的一部分,\`x\` 和 `x` 表示同一标识符。 + +闭包(*closure*)中如果没有明确指定参数名称,参数将被隐式命名为 $0$1$2... 这些命名在闭包作用域内是合法的标识符。 + +> 标识符语法 +> *标识符* → [*标识符头(Head)*](LexicalStructure.html#identifier_head) [*标识符字符列表*](LexicalStructure.html#identifier_characters) _可选_ +> *标识符* → **`** [*标识符头(Head)*](LexicalStructure.html#identifier_head) [*标识符字符列表*](LexicalStructure.html#identifier_characters) _可选_ **`** +> *标识符* → [*隐式参数名*](LexicalStructure.html#implicit_parameter_name) +> *标识符列表* → [*标识符*](LexicalStructure.html#identifier) | [*标识符*](LexicalStructure.html#identifier) **,** [*标识符列表*](LexicalStructure.html#identifier_list) +> *标识符头(Head)* → Upper- or lowercase letter A through Z +> *标识符头(Head)* → U+00A8, U+00AA, U+00AD, U+00AF, U+00B2–U+00B5, or U+00B7–U+00BA +> *标识符头(Head)* → U+00BC–U+00BE, U+00C0–U+00D6, U+00D8–U+00F6, or U+00F8–U+00FF +> *标识符头(Head)* → U+0100–U+02FF, U+0370–U+167F, U+1681–U+180D, or U+180F–U+1DBF +> *标识符头(Head)* → U+1E00–U+1FFF +> *标识符头(Head)* → U+200B–U+200D, U+202A–U+202E, U+203F–U+2040, U+2054, or U+2060–U+206F +> *标识符头(Head)* → U+2070–U+20CF, U+2100–U+218F, U+2460–U+24FF, or U+2776–U+2793 +> *标识符头(Head)* → U+2C00–U+2DFF or U+2E80–U+2FFF +> *标识符头(Head)* → U+3004–U+3007, U+3021–U+302F, U+3031–U+303F, or U+3040–U+D7FF +> *标识符头(Head)* → U+F900–U+FD3D, U+FD40–U+FDCF, U+FDF0–U+FE1F, or U+FE30–U+FE44 +> *标识符头(Head)* → U+FE47–U+FFFD +> *标识符头(Head)* → U+10000–U+1FFFD, U+20000–U+2FFFD, U+30000–U+3FFFD, or U+40000–U+4FFFD +> *标识符头(Head)* → U+50000–U+5FFFD, U+60000–U+6FFFD, U+70000–U+7FFFD, or U+80000–U+8FFFD +> *标识符头(Head)* → U+90000–U+9FFFD, U+A0000–U+AFFFD, U+B0000–U+BFFFD, or U+C0000–U+CFFFD +> *标识符头(Head)* → U+D0000–U+DFFFD or U+E0000–U+EFFFD +> *标识符字符* → 数值 0 到 9 +> *标识符字符* → U+0300–U+036F, U+1DC0–U+1DFF, U+20D0–U+20FF, or U+FE20–U+FE2F +> *标识符字符* → [*标识符头(Head)*](LexicalStructure.html#identifier_head) +> *标识符字符列表* → [*标识符字符*](LexicalStructure.html#identifier_character) [*标识符字符列表*](LexicalStructure.html#identifier_characters) _可选_ +> *隐式参数名* → **$** [*十进制数字列表*](LexicalStructure.html#decimal_digits) + + +## 关键字 + +被保留的关键字(*keywords*)不允许用作标识符,除非被反引号转义,参见 [标识符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-XID_796)。 + +* **用作声明的关键字:** *class*、*deinit*、*enum*、*extension*、*func*、*import*、*init*、*let*、*protocol*、*static*、*struct*、*subscript*、*typealias*、*var* +* **用作语句的关键字:** *break*、*case*、*continue*、*default*、*do*、*else*、*fallthrough*、*if*、*in*、*for*、*return*、*switch*、*where*、*while* +* **用作表达和类型的关键字:** *as*、*dynamicType*、*is*、*new*、*super*、*self*、*Self*、*Type*、*\_\_COLUMN\_\_*、*\_\_FILE\_\_*、*\_\_FUNCTION\_\_*、*\_\_LINE\_\_* +* **特定上下文中被保留的关键字:** *associativity*、*didSet*、*get*、*infix*、*inout*、*left*、*mutating*、*none*、*nonmutating*、*operator*、*override*、*postfix*、 + *precedence*、*prefix*、*right*、*set*、*unowned*、*unowned(safe)*、*unowned(unsafe)*、*weak*、*willSet*,这些关键字在特定上下文之外可以被用于标识符。 + + +## 字面量 + +字面值表示整型、浮点型数字或文本类型的值,举例如下: + +```swift +42 // 整型字面量 +3.14159 // 浮点型字面量 +"Hello, world!" // 文本型字面量 +``` + +> 字面量语法 +> *字面量* → [*整型字面量*](LexicalStructure.html#integer_literal) | [*浮点数字面量*](LexicalStructure.html#floating_point_literal) | [*字符串字面量*](LexicalStructure.html#string_literal) + +### 整型字面量 + +整型字面量(*integer literals*)表示未指定精度整型数的值。整型字面量默认用十进制表示,可以加前缀来指定其他的进制,二进制字面量加 `0b`,八进制字面量加 `0o`,十六进制字面量加 `0x`。 + +十进制字面量包含数字 `0` 至 `9`。二进制字面量只包含 `0` 或 `1`,八进制字面量包含数字 `0` 至 `7`,十六进制字面量包含数字 `0` 至 `9` 以及字母 `A` 至 `F` (大小写均可)。 + +负整数的字面量在数字前加减号 `-`,比如 `-42`。 + +允许使用下划线 `_` 来增加数字的可读性,下划线不会影响字面量的值。整型字面量也可以在数字前加 `0`,同样不会影响字面量的值。 + +```swift +1000_000 // 等于 1000000 +005 // 等于 5 +``` + +除非特殊指定,整型字面量的默认类型为 Swift 标准库类型中的 `Int`。Swift 标准库还定义了其他不同长度以及是否带符号的整数类型,请参考 [整数类型](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-XID_411)。 + +> 整型字面量语法 +> *整型字面量* → [*二进制字面量*](LexicalStructure.html#binary_literal) +> *整型字面量* → [*八进制字面量*](LexicalStructure.html#octal_literal) +> *整型字面量* → [*十进制字面量*](LexicalStructure.html#decimal_literal) +> *整型字面量* → [*十六进制字面量*](LexicalStructure.html#hexadecimal_literal) +> *二进制字面量* → **0b** [*二进制数字*](LexicalStructure.html#binary_digit) [*二进制字面量字符列表*](LexicalStructure.html#binary_literal_characters) _可选_ +> *二进制数字* → 数值 0 到 1 +> *二进制字面量字符* → [*二进制数字*](LexicalStructure.html#binary_digit) | **_** +> *二进制字面量字符列表* → [*二进制字面量字符*](LexicalStructure.html#binary_literal_character) [*二进制字面量字符列表*](LexicalStructure.html#binary_literal_characters) _可选_ +> *八进制字面量* → **0o** [*八进字数字*](LexicalStructure.html#octal_digit) [*八进制字符列表*](LexicalStructure.html#octal_literal_characters) _可选_ +> *八进字数字* → 数值 0 到 7 +> *八进制字符* → [*八进字数字*](LexicalStructure.html#octal_digit) | **_** +> *八进制字符列表* → [*八进制字符*](LexicalStructure.html#octal_literal_character) [*八进制字符列表*](LexicalStructure.html#octal_literal_characters) _可选_ +> *十进制字面量* → [*十进制数字*](LexicalStructure.html#decimal_digit) [*十进制字符列表*](LexicalStructure.html#decimal_literal_characters) _可选_ +> *十进制数字* → 数值 0 到 9 +> *十进制数字列表* → [*十进制数字*](LexicalStructure.html#decimal_digit) [*十进制数字列表*](LexicalStructure.html#decimal_digits) _可选_ +> *十进制字符* → [*十进制数字*](LexicalStructure.html#decimal_digit) | **_** +> *十进制字符列表* → [*十进制字符*](LexicalStructure.html#decimal_literal_character) [*十进制字符列表*](LexicalStructure.html#decimal_literal_characters) _可选_ +> *十六进制字面量* → **0x** [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制字面量字符列表*](LexicalStructure.html#hexadecimal_literal_characters) _可选_ +> *十六进制数字* → 数值 0 到 9, a through f, or A through F +> *十六进制字符* → [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) | **_** +> *十六进制字面量字符列表* → [*十六进制字符*](LexicalStructure.html#hexadecimal_literal_character) [*十六进制字面量字符列表*](LexicalStructure.html#hexadecimal_literal_characters) _可选_ + +### 浮点型字面量 + +浮点型字面量(*floating-point literals*)表示未指定精度浮点数的值。 + +浮点型字面量默认用十进制表示(无前缀),也可以用十六进制表示(加前缀 `0x`)。 + +十进制浮点型字面量(*decimal floating-point literals*)由十进制数字串后跟小数部分或指数部分(或两者皆有)组成。十进制小数部分由小数点 `.` 后跟十进制数字串组成。指数部分由大写或小写字母 `e` 后跟十进制数字串组成,这串数字表示 `e` 之前的数量乘以 10 的几次方。例如:`1.25e2` 表示 `1.25 ⨉ 10^2`,也就是 `125.0`;同样,`1.25e-2` 表示 `1.25 ⨉ 10^-2`,也就是 `0.0125`。 + +十六进制浮点型字面量(*hexadecimal floating-point literals*)由前缀 `0x` 后跟可选的十六进制小数部分以及十六进制指数部分组成。十六进制小数部分由小数点后跟十六进制数字串组成。指数部分由大写或小写字母 `p` 后跟十进制数字串组成,这串数字表示 `p` 之前的数量乘以 2 的几次方。例如:`0xFp2` 表示 `15 ⨉ 2^2`,也就是 `60`;同样,`0xFp-2` 表示 `15 ⨉ 2^-2`,也就是 `3.75`。 + +与整型字面量不同,负的浮点型字面量由一元运算符减号 `-` 和浮点型字面量组成,例如 `-42.0`。这代表一个表达式,而不是一个浮点整型字面量。 + +允许使用下划线 `_` 来增强可读性,下划线不会影响字面量的值。浮点型字面量也可以在数字前加 `0`,同样不会影响字面量的值。 + +```swift +10_000.56 // 等于 10000.56 +005000.76 // 等于 5000.76 +``` + +除非特殊指定,浮点型字面量的默认类型为 Swift 标准库类型中的 `Double`,表示64位浮点数。Swift 标准库也定义 `Float` 类型,表示32位浮点数。 + +> 浮点型字面量语法 +> *浮点数字面量* → [*十进制字面量*](LexicalStructure.html#decimal_literal) [*十进制分数*](LexicalStructure.html#decimal_fraction) _可选_ [*十进制指数*](LexicalStructure.html#decimal_exponent) _可选_ +> *浮点数字面量* → [*十六进制字面量*](LexicalStructure.html#hexadecimal_literal) [*十六进制分数*](LexicalStructure.html#hexadecimal_fraction) _可选_ [*十六进制指数*](LexicalStructure.html#hexadecimal_exponent) +> *十进制分数* → **.** [*十进制字面量*](LexicalStructure.html#decimal_literal) +> *十进制指数* → [*浮点数e*](LexicalStructure.html#floating_point_e) [*正负号*](LexicalStructure.html#sign) _可选_ [*十进制字面量*](LexicalStructure.html#decimal_literal) +> *十六进制分数* → **.** [*十六进制字面量*](LexicalStructure.html#hexadecimal_literal) _可选_ +> *十六进制指数* → [*浮点数p*](LexicalStructure.html#floating_point_p) [*正负号*](LexicalStructure.html#sign) _可选_ [*十六进制字面量*](LexicalStructure.html#hexadecimal_literal) +> *浮点数e* → **e** | **E** +> *浮点数p* → **p** | **P** +> *正负号* → **+** | **-** + +### 文本型字面量 + +文本型字面量(*string literal*)由双引号中的字符串组成,形式如下: + +```swift +"characters" +``` + +文本型字面量中不能包含未转义的双引号 `"`、未转义的反斜线`\`、回车符(*carriage return*)或换行符(*line feed*)。 + +可以在文本型字面量中使用的转义特殊符号如下: + +* 空字符(Null Character)`\0` +* 反斜线(Backslash)`\\` +* 水平 Tab (Horizontal Tab)`\t` +* 换行符(Line Feed)`\n` +* 回车符(Carriage Return)`\r` +* 双引号(Double Quote)`\"` +* 单引号(Single Quote)`\'` + +字符也可以用以下方式表示: + +* `\x` 后跟两位十六进制数字 +* `\u` 后跟四位十六进制数字 +* `\U` 后跟八位十六进制数字 + +后跟的数字表示一个 Unicode 码点。 + +文本型字面量允许在反斜线小括号 `\()` 中插入表达式的值。插入表达式(*interpolated expression*)不能包含未转义的双引号 `"`、反斜线 `\`、回车符或者换行符。表达式值的类型必须在 *String* 类中有对应的初始化方法。 + +例如,以下所有文本型字面量的值相同: + +```swift +"1 2 3" +"1 2 \(3)" +"1 2 \(1 + 2)" +var x = 3; "1 2 \(x)" +``` + +文本型字面量的默认类型为 `String`。组成字符串的字符类型为 `Character`。更多有关 `String` 和 `Character` 的信息请参照 [字符串和字符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html#//apple_ref/doc/uid/TP40014097-CH7-XID_368)。 + +> 字符型字面量语法 +> *字符串字面量* → **"** [*引用文本*](LexicalStructure.html#quoted_text) **"** +> *引用文本* → [*引用文本条目*](LexicalStructure.html#quoted_text_item) [*引用文本*](LexicalStructure.html#quoted_text) _可选_ +> *引用文本条目* → [*转义字符*](LexicalStructure.html#escaped_character) +> *引用文本条目* → **\(** [*表达式*](..\chapter3\04_Expressions.html#expression) **)** +> *引用文本条目* → 除了"­, \­, U+000A, or U+000D的所有Unicode的字符 +> *转义字符* → **\0** | **\\** | **\t** | **\n** | **\r** | **\"** | **\'** +> *转义字符* → **\x** [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) +> *转义字符* → **\u** [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) +> *转义字符* → **\U** [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) + + +## 运算符 + +Swift 标准库定义了许多可供使用的运算符,其中大部分在 [基础运算符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/BasicOperators.html#//apple_ref/doc/uid/TP40014097-CH6-XID_70) 和 [高级运算符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-XID_28) 中进行了阐述。这里将描述哪些字符能用作运算符。 + +运算符由一个或多个以下字符组成: +`/`、`=`、`-`、`+`、`!`、`*`、`%`、`<`、`>`、`&`、`|`、`^`、`~`、`.`。也就是说,标记 `=`, `->`、`//`、`/*`、`*/`、`.` 以及一元前缀运算符 `&` 属于保留字,这些标记不能被重写或用于自定义运算符。 + +运算符两侧的空白被用来区分该运算符是否为前缀运算符(*prefix operator*)、后缀运算符(*postfix operator*)或二元运算符(*binary operator*)。规则总结如下: + +* 如果运算符两侧都有空白或两侧都无空白,将被看作二元运算符。例如:`a+b` 和 `a + b` 中的运算符 `+` 被看作二元运算符。 +* 如果运算符只有左侧空白,将被看作前缀一元运算符。例如 `a ++b` 中的 `++` 被看作前缀一元运算符。 +* 如果运算符只有右侧空白,将被看作后缀一元运算符。例如 `a++ b` 中的 `++` 被看作后缀一元运算符。 +* 如果运算符左侧没有空白并紧跟 `.`,将被看作后缀一元运算符。例如 `a++.b` 中的 `++` 被看作后缀一元运算符(同理, `a++ . b` 中的 `++` 是后缀一元运算符而 `a ++ .b` 中的 `++` 不是). + +鉴于这些规则,运算符前的字符 `(`、`[` 和 `{` ;运算符后的字符 `)`、`]` 和 `}` 以及字符 `,`、`;` 和 `:` 都将用于空白检测。 + +以上规则需注意一点,如果运算符 `!` 或 `?` 左侧没有空白,则不管右侧是否有空白都将被看作后缀运算符。如果将 `?` 用作可选类型(*optional type*)修饰,左侧必须无空白。如果用于条件运算符 `? :`,必须两侧都有空白。 + +在特定构成中 ,以 `<` 或 `>` 开头的运算符会被分离成两个或多个标记,剩余部分以同样的方式会被再次分离。因此,在 `Dictionary>` 中没有必要添加空白来消除闭合字符 `>` 的歧义。在这个例子中, 闭合字符 `>` 被看作单字符标记,而不会被误解为移位运算符 `>>`。 + +要学习如何自定义新的运算符,请参考 [自定义操作符](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-XID_48) 和 [运算符声明](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/doc/uid/TP40014097-CH34-XID_644)。学习如何重写现有运算符,请参考 [运算符方法](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-XID_43)。 + +> 运算符语法语法 +> *运算符* → [*运算符字符*](LexicalStructure.html#operator_character) [*运算符*](LexicalStructure.html#operator) _可选_ +> *运算符字符* → **/** | **=** | **-** | **+** | **!** | ***** | **%** | **<** | **>** | **&** | **|** | **^** | **~** | **.** +> *二元运算符* → [*运算符*](LexicalStructure.html#operator) +> *前置运算符* → [*运算符*](LexicalStructure.html#operator) +> *后置运算符* → [*运算符*](LexicalStructure.html#operator) diff --git a/source/chapter3/03_Types.md b/source/chapter3/03_Types.md old mode 100644 new mode 100755 index b031e17f..c2267554 --- a/source/chapter3/03_Types.md +++ b/source/chapter3/03_Types.md @@ -1,272 +1,300 @@ -# 类型(Types) - ---- - -本页包含内容: - -- 类型标注(Type Annotation) -- 类型标识符(Type Identifier) -- 元组类型(Tuple Type) -- 函数类型(Function Type) -- 数组类型(Array Type) -- 可选类型(Optional Type) -- 隐式解析可选类型(Implicitly Unwrapped Optional Type) -- 协议合成类型(Protocol Composition Type) -- 元类型(Metatype Type) -- 类型继承子句(Type Inheritance Clause) -- 类型推断(Type Inference) - -Swift语言存在两种类型:命名型类型和复合型类型。*命名型类型*是指定义时可以给定名字的类型。命名型类型包括类、结构体、枚举和协议。比如,一个用户定义的类`MyClass`的实例拥有类型`MyClass`。除了用户定义的命名型类型,Swift标准库也定义了很多常用的命名型类型,包括那些表示数组、字典和可选值的类型。 - -那些通常被其它语言认为是基本或初级的数据型类型(Data types)——比如表示数字、字符和字符串——实际上就是命名型类型,Swift标准库是使用结构体定义和实现它们的。因为它们是命名型类型,因此你可以按照“扩展和扩展声明”章节里讨论的那样,声明一个扩展来增加它们的行为以适应你程序的需求。 - -*复合型类型*是没有名字的类型,它由Swift本身定义。Swift存在两种复合型类型:函数类型和元组类型。一个复合型类型可以包含命名型类型和其它复合型类型。例如,元组类型`(Int, (Int, Int))`包含两个元素:第一个是命名型类型`Int`,第二个是另一个复合型类型`(Int, Int)`. - -本节讨论Swift语言本身定义的类型,并描述Swift中的类型推断行为。 - ->类型的语法: -*type* → *array-type* | *function-type* | *type-identifier* | *tuple-type* | *optional-type* | *implicitly-unwrapped-optional-type* | protocol-composition-type | metatype-type - -##类型标注 -类型标注显式地指定一个变量或表达式的值。类型标注始于冒号`:`终于类型,比如下面两个例子: - -```javascript -let someTuple:(Double, Double) = (3.14159, 2.71828) -func someFunction(a: Int){ /* ... */ } -``` -在第一个例子中,表达式`someTuple`的类型被指定为`(Double, Double)`。在第二个例子中,函数`someFunction`的参数`a`的类型被指定为`Int`。 - -类型标注可以在类型之前包含一个类型特性(type attributes)的可选列表。 - ->类型标注的语法: -*type-annotation* → :*attributes*[opt] *type* - -##类型标识符 -类型标识符引用命名型类型或者是命名型/复合型类型的别名。 - -大多数情况下,类型标识符引用的是同名的命名型类型。例如类型标识符`Int`引用命名型类型`Int`,同样,类型标识符`Dictionary`引用命名型类型`Dictionary`。 - -在两种情况下类型标识符引用的不是同名的类型。情况一,类型标识符引用的是命名型/复合型类型的类型别名。比如,在下面的例子中,类型标识符使用`Point`来引用元组`(Int, Int)`: - -```javascript -typealias Point = (Int, Int) -let origin: Point = (0, 0) -``` - -情况二,类型标识符使用dot(`.`)语法来表示在其它模块(modules)或其它类型嵌套内声明的命名型类型。例如,下面例子中的类型标识符引用在`ExampleModule`模块中声明的命名型类型`MyType`: - -```javascript -var someValue: ExampleModule.MyType -``` - ->类型标识符的语法: -*type-identifier* → *type-name generic-argument-clause*[opt] | *type-name generic-argument-clause*[opt].*type-identifier* -*type-name* → *identifier* - -##元组类型 -元组类型使用逗号隔开并使用括号括起来的0个或多个类型组成的列表。 - -你可以使用元组类型作为一个函数的返回类型,这样就可以使函数返回多个值。你也可以命名元组类型中的元素,然后用这些名字来引用每个元素的值。元素的名字由一个标识符和`:`组成。“函数和多返回值”章节里有一个展示上述特性的例子。 - -`void`是空元组类型`()`的别名。如果括号内只有一个元素,那么该类型就是括号内元素的类型。比如,`(Int)`的类型是`Int`而不是`(Int)`。所以,只有当元组类型包含两个元素以上时才可以标记元组元素。 - ->元组类型语法: -*tuple* → (*tuple-type-body*[opt]) -*tuple-type-body* → *tuple-type-element-list* ...[opt] -*tuple-type-element-list* → *tuple-type-element* | *tuple-type-element*, *tuple-type-element-list* -*tuple-type-element* → *attributes*[opt] **inout** [opt] *type* | **inout** [opt] *element-name type-annotation* -*element-name* → *identifier* - -##函数类型 -函数类型表示一个函数、方法或闭包的类型,它由一个参数类型和返回值类型组成,中间用箭头`->`隔开: - -- `parameter type` -> `return type` - -由于 *参数类型* 和 *返回值类型* 可以是元组类型,所以函数类型可以让函数与方法支持多参数与多返回值。 - -你可以对函数类型应用带有参数类型`()`并返回表达式类型的`auto_closure`属性(见类型属性章节)。一个自动闭包函数捕获特定表达式上的隐式闭包而非表达式本身。下面的例子使用`auto_closure`属性来定义一个很简单的assert函数: - -```javascript -func simpleAssert(condition: @auto_closure () -> Bool, message: String){ - if !condition(){ - println(message) - } -} -let testNumber = 5 -simpleAssert(testNumber % 2 == 0, "testNumber isn't an even number.") -// prints "testNumber isn't an even number." -``` -函数类型可以拥有一个可变长参数作为参数类型中的最后一个参数。从语法角度上讲,可变长参数由一个基础类型名字和`...`组成,如`Int...`。可变长参数被认为是一个包含了基础类型元素的数组。即`Int...`就是`Int[]`。关于使用可变长参数的例子,见章节“可变长参数”。 - -为了指定一个`in-out`参数,可以在参数类型前加`inout`前缀。但是你不可以对可变长参数或返回值类型使用`inout`。关于In-Out参数的讨论见章节In-Out参数部分。 - -柯里化函数(curried function)的类型相当于一个嵌套函数类型。例如,下面的柯里化函数`addTwoNumber()()`的类型是`Int -> Int -> Int`: - -```javascript -func addTwoNumbers(a: Int)(b: Int) -> Int{ - return a + b -} -addTwoNumbers(4)(5) // returns 9 -``` -柯里化函数的函数类型从右向左组成一组。例如,函数类型`Int -> Int -> Int`可以被理解为`Int -> (Int -> Int)`——也就是说,一个函数传入一个`Int`然后输出作为另一个函数的输入,然后又返回一个`Int`。例如,你可以使用如下嵌套函数来重写柯里化函数`addTwoNumbers()()`: - -```javascript -func addTwoNumbers(a: Int) -> (Int -> Int){ - func addTheSecondNumber(b: Int) -> Int{ - return a + b - } - return addTheSecondNumber -} -addTwoNumbers(4)(5) // Returns 9 -``` ->函数类型的语法: -*function-type* → *type* **->** *type* - -##数组类型 -Swift语言使用类型名紧接中括号`[]`来简化标准库中定义的命名型类型`Array`。换句话说,下面两个声明是等价的: - -```javascript -let someArray: String[] = ["Alex", "Brian", "Dave"] -let someArray: Array = ["Alex", "Brian", "Dave"] -``` -上面两种情况下,常量`someArray`都被声明为字符串数组。数组的元素也可以通过`[]`获取访问:`someArray[0]`是指第0个元素`“Alex”`。 - -上面的例子同时显示,你可以使用`[]`作为初始值构造数组,空的`[]`则用来来构造指定类型的空数组。 - -```javascript -var emptyArray: Double[] = [] -``` -你也可以使用链接起来的多个`[]`集合来构造多维数组。例如,下例使用三个`[]`集合来构造三维整型数组: - -```javascript -var array3D: Int[][][] = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] -``` -访问一个多维数组的元素时,最左边的下标指向最外层数组的相应位置元素。接下来往右的下标指向第一层嵌入的相应位置元素,依次类推。这就意味着,在上面的例子中,`array3D[0]`是指`[[1, 2], [3, 4]]`,`array3D[0][1]`是指`[3, 4]`,`array3D[0][1][1]`则是指值`4`。 - -关于Swift标准库中`Array`类型的细节讨论,见章节Arrays。 - ->数组类型的语法: -*array-type* → *type*`[ ]` | *array-type*`[ ]` - -##可选类型 -Swift定义后缀`?`来作为标准库中的定义的命名型类型`Optional`的简写。换句话说,下面两个声明是等价的: - -```javascript -var optionalInteger: Int? -var optionalInteger: Optional -``` -在上述两种情况下,变量`optionalInteger`都被声明为可选整型类型。注意在类型和`?`之间没有空格。 - -类型`Optional`是一个枚举,有两种形式,`None`和`Some(T)`,又来代表可能出现或可能不出现的值。任意类型都可以被显式的声明(或隐式的转换)为可选类型。当声明一个可选类型时,确保使用括号给`?`提供合适的作用范围。比如说,声明一个整型的可选数组,应写作`(Int[])?`,写成`Int[]?`的话则会出错。 - -如果你在声明或定义可选变量或特性的时候没有提供初始值,它的值则会自动赋成缺省值`nil`。 - -可选符合`LogicValue`协议,因此可以出现在布尔值环境下。此时,如果一个可选类型`T?`实例包含有类型为`T`的值(也就是说值为`Optional.Some(T)`),那么此可选类型就为`true`,否则为`false`。 - -如果一个可选类型的实例包含一个值,那么你就可以使用后缀操作符`!`来获取该值,正如下面描述的: - -```javascript -optionalInteger = 42 -optionalInteger! // 42 -``` -使用`!`操作符获取值为`nil`的可选项会导致运行错误(runtime error)。 - -你也可以使用可选链和可选绑定来选择性的执行可选表达式上的操作。如果值为`nil`,不会执行任何操作因此也就没有运行错误产生。 - -更多细节以及更多如何使用可选类型的例子,见章节“可选”。 - ->可选类型语法: -*optional-type* → *type*? - -##隐式解析可选类型 -Swift语言定义后缀`!`作为标准库中命名类型`ImplicitlyUnwrappedOptional`的简写。换句话说,下面两个声明等价: - -```javascript -var implicitlyUnwrappedString: String! -var implicitlyUnwrappedString: ImplicitlyUnwrappedOptional -``` -上述两种情况下,变量`implicitlyUnwrappedString`被声明为一个隐式解析可选类型的字符串。注意类型与`!`之间没有空格。 - -你可以在使用可选的地方同样使用隐式解析可选。比如,你可以将隐式解析可选的值赋给变量、常量和可选特性,反之亦然。 - -有了可选,你在声明隐式解析可选变量或特性的时候就不用指定初始值,因为它有缺省值`nil`。 - -由于隐式解析可选的值会在使用时自动解析,所以没必要使用操作符`!`来解析它。也就是说,如果你使用值为`nil`的隐式解析可选,就会导致运行错误。 - -使用可选链会选择性的执行隐式解析可选表达式上的某一个操作。如果值为`nil`,就不会执行任何操作,因此也不会产生运行错误。 - -关于隐式解析可选的更多细节,见章节“隐式解析可选”。 - ->隐式解析可选的语法: -implicitly-unwrapped-optional-type → type! - -##协议合成类型 -协议合成类型是一种符合每个协议的指定协议列表类型。协议合成类型可能会用在类型标注和泛型参数中。 - -协议合成类型的形式如下: -```javascript -protocol -``` -协议合成类型允许你指定一个值,其类型可以适配多个协议的条件,而且不需要定义一个新的命名型协议来继承其它想要适配的各个协议。比如,协议合成类型`protocol`等效于一个从`Protocol A`,`Protocol B`, `Protocol C`继承而来的新协议`Protocol D`,很显然这样做有效率的多,甚至不需引入一个新名字。 - -协议合成列表中的每项必须是协议名或协议合成类型的类型别名。如果列表为空,它就会指定一个空协议合成列表,这样每个类型都能适配。 - ->协议合成类型的语法: -*protocol-composition-type* → **protocol** <*protocol-identifier-list[opt]*> -*protocol-identifier-list* → *protocol-identifier* | *protocol-identifier, protocol-identifier-list* -*protocol-identifier* → *type-identifier* - -##元类型 -元类型是指所有类型的类型,包括类、结构体、枚举和协议。 - -类、结构体或枚举类型的元类型是相应的类型名紧跟`.Type`。协议类型的元类型——并不是运行时适配该协议的具体类型——是该协议名字紧跟`.Protocol`。比如,类`SomeClass`的元类型就是`SomeClass.Type`,协议`SomeProtocol`的元类型就是`SomeProtocal.Protocol`。 - -你可以使用后缀`self`表达式来获取类型。比如,`SomeClass.self`返回`SomeClass`本身,而不是`SomeClass`的一个实例。同样,`SomeProtocol.self`返回`SomeProtocol`本身,而不是运行时适配`SomeProtocol`的某个类型的实例。还可以对类型的实例使用`dynamicType`表达式来获取该实例在运行阶段的类型,如下所示: - -```javascript -class SomeBaseClass { - class func printClassName() { - println("SomeBaseClass") - } -} -class SomeSubClass: SomeBaseClass { - override class func printClassName() { - println("SomeSubClass") - } -} -let someInstance: SomeBaseClass = SomeSubClass() -// someInstance is of type SomeBaseClass at compile time, but -// someInstance is of type SomeSubClass at runtime -someInstance.dynamicType.printClassName() -// prints "SomeSubClass -``` - ->元类型的语法: -*metatype-type* → *type*.**Type** | *type*.**Protocol** - -##类型继承子句 -类型继承子句被用来指定一个命名型类型继承哪个类且适配哪些协议。类型继承子句开始于冒号`:`,紧跟由`,`隔开的类型标识符列表。 - -类可以继承单个超类,适配任意数量的协议。当定义一个类时,超类的名字必须出现在类型标识符列表首位,然后跟上该类需要适配的任意数量的协议。如果一个类不是从其它类继承而来,那么列表可以以协议开头。关于类继承更多的讨论和例子,见章节“继承”。 - -其它命名型类型可能只继承或适配一个协议列表。协议类型可能继承于其它任意数量的协议。当一个协议类型继承于其它协议时,其它协议的条件集合会被集成在一起,然后其它从当前协议继承的任意类型必须适配所有这些条件。 - -枚举定义中的类型继承子句可以是一个协议列表,或是指定原始值的枚举,一个单独的指定原始值类型的命名型类型。使用类型继承子句来指定原始值类型的枚举定义的例子,见章节“原始值”。 - ->类型继承子句的语法: -*type-inheritance-clause* → :*type-inheritance-list* -*type-inheritance-list* → *type-identifier* | *type-identifier*, *type-inheritance-list* - -##类型推断 -Swift广泛的使用类型推断,从而允许你可以忽略很多变量和表达式的类型或部分类型。比如,对于`var x: Int = 0`,你可以完全忽略类型而简写成`var x = 0`——编译器会正确的推断出`x`的类型`Int`。类似的,当完整的类型可以从上下文推断出来时,你也可以忽略类型的一部分。比如,如果你写了`let dict: Dictionary = ["A": 1]`,编译提也能推断出`dict`的类型是`Dictionary`。 - -在上面的两个例子中,类型信息从表达式树(expression tree)的叶子节点传向根节点。也就是说,`var x: Int = 0`中`x`的类型首先根据`0`的类型进行推断,然后将该类型信息传递到根节点(变量`x`)。 - -在Swift中,类型信息也可以反方向流动——从根节点传向叶子节点。在下面的例子中,常量`eFloat`上的显式类型标注(`:Float`)导致数字字面量`2.71828`的类型是`Float`而非`Double`。 - -```javascript -let e = 2.71828 // The type of e is inferred to be Double. -let eFloat: Float = 2.71828 // The type of eFloat is Float. -``` - -Swift中的类型推断在单独的表达式或语句水平上进行。这意味着所有用于推断类型的信息必须可以从表达式或其某个子表达式的类型检查中获取。 \ No newline at end of file +> 翻译:[lyuka](https://github.com/lyuka) +> 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + +# 类型(Types) +----------------- + +本页包含内容: + +- [类型注解(Type Annotation)](#type_annotation) +- [类型标识符(Type Identifier)](#type_identifier) +- [元组类型(Tuple Type)](#tuple_type) +- [函数类型(Function Type)](#function_type) +- [数组类型(Array Type)](#array_type) +- [可选类型(Optional Type)](#optional_type) +- [隐式解析可选类型(Implicitly Unwrapped Optional Type)](#implicitly_unwrapped_optional_type) +- [协议合成类型(Protocol Composition Type)](#protocol_composition_type) +- [元类型(Metatype Type)](#metatype_type) +- [类型继承子句(Type Inheritance Clause)](#type_inheritance_clause) +- [类型推断(Type Inference)](#type_inference) + +Swift 语言存在两种类型:命名型类型和复合型类型。*命名型类型*是指定义时可以给定名字的类型。命名型类型包括类、结构体、枚举和协议。比如,一个用户定义的类`MyClass`的实例拥有类型`MyClass`。除了用户定义的命名型类型,Swift 标准库也定义了很多常用的命名型类型,包括那些表示数组、字典和可选值的类型。 + +那些通常被其它语言认为是基本或初级的数据型类型(Data types)——比如表示数字、字符和字符串——实际上就是命名型类型,Swift 标准库是使用结构体定义和实现它们的。因为它们是命名型类型,因此你可以按照“扩展和扩展声明”章节里讨论的那样,声明一个扩展来增加它们的行为以适应你程序的需求。 + +*复合型类型*是没有名字的类型,它由 Swift 本身定义。Swift 存在两种复合型类型:函数类型和元组类型。一个复合型类型可以包含命名型类型和其它复合型类型。例如,元组类型`(Int, (Int, Int))`包含两个元素:第一个是命名型类型`Int`,第二个是另一个复合型类型`(Int, Int)`. + +本节讨论 Swift 语言本身定义的类型,并描述 Swift 中的类型推断行为。 + +> 类型语法 +> *类型* → [*数组类型*](..\chapter3\03_Types.html#array_type) | [*函数类型*](..\chapter3\03_Types.html#function_type) | [*类型标识*](..\chapter3\03_Types.html#type_identifier) | [*元组类型*](..\chapter3\03_Types.html#tuple_type) | [*可选类型*](..\chapter3\03_Types.html#optional_type) | [*隐式解析可选类型*](..\chapter3\03_Types.html#implicitly_unwrapped_optional_type) | [*协议合成类型*](..\chapter3\03_Types.html#protocol_composition_type) | [*元型类型*](..\chapter3\03_Types.html#metatype_type) + + +##类型注解 + +类型注解显式地指定一个变量或表达式的值。类型注解始于冒号`:`终于类型,比如下面两个例子: + +```swift +let someTuple: (Double, Double) = (3.14159, 2.71828) +func someFunction(a: Int){ /* ... */ } +``` +在第一个例子中,表达式`someTuple`的类型被指定为`(Double, Double)`。在第二个例子中,函数`someFunction`的参数`a`的类型被指定为`Int`。 + +类型注解可以在类型之前包含一个类型特性(type attributes)的可选列表。 + +> 类型注解语法 +> *类型注解* → **:** [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type) + + +##类型标识符 + +类型标识符引用命名型类型或者是命名型/复合型类型的别名。 + +大多数情况下,类型标识符引用的是同名的命名型类型。例如类型标识符`Int`引用命名型类型`Int`,同样,类型标识符`Dictionary`引用命名型类型`Dictionary`。 + +在两种情况下类型标识符引用的不是同名的类型。情况一,类型标识符引用的是命名型/复合型类型的类型别名。比如,在下面的例子中,类型标识符使用`Point`来引用元组`(Int, Int)`: + +```swift +typealias Point = (Int, Int) +let origin: Point = (0, 0) +``` + +情况二,类型标识符使用dot(`.`)语法来表示在其它模块(modules)或其它类型嵌套内声明的命名型类型。例如,下面例子中的类型标识符引用在`ExampleModule`模块中声明的命名型类型`MyType`: + +```swift +var someValue: ExampleModule.MyType +``` + +> 类型标识语法 +> *类型标识* → [*类型名称*](..\chapter3\03_Types.html#type_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ | [*类型名称*](..\chapter3\03_Types.html#type_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ **.** [*类型标识*](..\chapter3\03_Types.html#type_identifier) +> *类名* → [*标识符*](LexicalStructure.html#identifier) + + +##元组类型 + +元组类型使用逗号隔开并使用括号括起来的0个或多个类型组成的列表。 + +你可以使用元组类型作为一个函数的返回类型,这样就可以使函数返回多个值。你也可以命名元组类型中的元素,然后用这些名字来引用每个元素的值。元素的名字由一个标识符和`:`组成。“函数和多返回值”章节里有一个展示上述特性的例子。 + +`void`是空元组类型`()`的别名。如果括号内只有一个元素,那么该类型就是括号内元素的类型。比如,`(Int)`的类型是`Int`而不是`(Int)`。所以,只有当元组类型包含两个元素以上时才可以标记元组元素。 + +> 元组类型语法 +> *元组类型* → **(** [*元组类型主体*](..\chapter3\03_Types.html#tuple_type_body) _可选_ **)** +> *元组类型主体* → [*元组类型的元素列表*](..\chapter3\03_Types.html#tuple_type_element_list) **...** _可选_ +> *元组类型的元素列表* → [*元组类型的元素*](..\chapter3\03_Types.html#tuple_type_element) | [*元组类型的元素*](..\chapter3\03_Types.html#tuple_type_element) **,** [*元组类型的元素列表*](..\chapter3\03_Types.html#tuple_type_element_list) +> *元组类型的元素* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **inout** _可选_ [*类型*](..\chapter3\03_Types.html#type) | **inout** _可选_ [*元素名*](..\chapter3\03_Types.html#element_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) +> *元素名* → [*标识符*](LexicalStructure.html#identifier) + + +##函数类型 + +函数类型表示一个函数、方法或闭包的类型,它由一个参数类型和返回值类型组成,中间用箭头`->`隔开: + +- `parameter type` -> `return type` + +由于 *参数类型* 和 *返回值类型* 可以是元组类型,所以函数类型可以让函数与方法支持多参数与多返回值。 + +你可以对函数类型应用带有参数类型`()`并返回表达式类型的`auto_closure`属性(见类型属性章节)。一个自动闭包函数捕获特定表达式上的隐式闭包而非表达式本身。下面的例子使用`auto_closure`属性来定义一个很简单的assert函数: + +```swift +func simpleAssert(condition: @auto_closure () -> Bool, message: String){ + if !condition(){ + println(message) + } +} +let testNumber = 5 +simpleAssert(testNumber % 2 == 0, "testNumber isn't an even number.") +// prints "testNumber isn't an even number." +``` +函数类型可以拥有一个可变长参数作为参数类型中的最后一个参数。从语法角度上讲,可变长参数由一个基础类型名字和`...`组成,如`Int...`。可变长参数被认为是一个包含了基础类型元素的数组。即`Int...`就是`Int[]`。关于使用可变长参数的例子,见章节“可变长参数”。 + +为了指定一个`in-out`参数,可以在参数类型前加`inout`前缀。但是你不可以对可变长参数或返回值类型使用`inout`。关于In-Out参数的讨论见章节In-Out参数部分。 + +柯里化函数(curried function)的类型相当于一个嵌套函数类型。例如,下面的柯里化函数`addTwoNumber()()`的类型是`Int -> Int -> Int`: + +```swift +func addTwoNumbers(a: Int)(b: Int) -> Int{ + return a + b +} +addTwoNumbers(4)(5) // returns 9 +``` + +柯里化函数的函数类型从右向左组成一组。例如,函数类型`Int -> Int -> Int`可以被理解为`Int -> (Int -> Int)`——也就是说,一个函数传入一个`Int`然后输出作为另一个函数的输入,然后又返回一个`Int`。例如,你可以使用如下嵌套函数来重写柯里化函数`addTwoNumbers()()`: + +```swift +func addTwoNumbers(a: Int) -> (Int -> Int){ + func addTheSecondNumber(b: Int) -> Int{ + return a + b + } + return addTheSecondNumber +} +addTwoNumbers(4)(5) // Returns 9 +``` + +> 函数类型语法 +> *函数类型* → [*类型*](..\chapter3\03_Types.html#type) **->** [*类型*](..\chapter3\03_Types.html#type) + + +##数组类型 + +Swift语言使用类型名紧接中括号`[]`来简化标准库中定义的命名型类型`Array`。换句话说,下面两个声明是等价的: + +```swift +let someArray: String[] = ["Alex", "Brian", "Dave"] +let someArray: Array = ["Alex", "Brian", "Dave"] +``` +上面两种情况下,常量`someArray`都被声明为字符串数组。数组的元素也可以通过`[]`获取访问:`someArray[0]`是指第0个元素`“Alex”`。 + +上面的例子同时显示,你可以使用`[]`作为初始值构造数组,空的`[]`则用来来构造指定类型的空数组。 + +```swift +var emptyArray: Double[] = [] +``` +你也可以使用链接起来的多个`[]`集合来构造多维数组。例如,下例使用三个`[]`集合来构造三维整型数组: + +```swift +var array3D: Int[][][] = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] +``` +访问一个多维数组的元素时,最左边的下标指向最外层数组的相应位置元素。接下来往右的下标指向第一层嵌入的相应位置元素,依次类推。这就意味着,在上面的例子中,`array3D[0]`是指`[[1, 2], [3, 4]]`,`array3D[0][1]`是指`[3, 4]`,`array3D[0][1][1]`则是指值`4`。 + +关于Swift标准库中`Array`类型的细节讨论,见章节Arrays。 + +> 数组类型语法 +> *数组类型* → [*类型*](..\chapter3\03_Types.html#type) **[** **]** | [*数组类型*](..\chapter3\03_Types.html#array_type) **[** **]** + + +##可选类型 + +Swift定义后缀`?`来作为标准库中的定义的命名型类型`Optional`的简写。换句话说,下面两个声明是等价的: + +```swift +var optionalInteger: Int? +var optionalInteger: Optional +``` +在上述两种情况下,变量`optionalInteger`都被声明为可选整型类型。注意在类型和`?`之间没有空格。 + +类型`Optional`是一个枚举,有两种形式,`None`和`Some(T)`,又来代表可能出现或可能不出现的值。任意类型都可以被显式的声明(或隐式的转换)为可选类型。当声明一个可选类型时,确保使用括号给`?`提供合适的作用范围。比如说,声明一个整型的可选数组,应写作`(Int[])?`,写成`Int[]?`的话则会出错。 + +如果你在声明或定义可选变量或特性的时候没有提供初始值,它的值则会自动赋成缺省值`nil`。 + +可选符合`LogicValue`协议,因此可以出现在布尔值环境下。此时,如果一个可选类型`T?`实例包含有类型为`T`的值(也就是说值为`Optional.Some(T)`),那么此可选类型就为`true`,否则为`false`。 + +如果一个可选类型的实例包含一个值,那么你就可以使用后缀操作符`!`来获取该值,正如下面描述的: + +```swift +optionalInteger = 42 +optionalInteger! // 42 +``` +使用`!`操作符获取值为`nil`的可选项会导致运行错误(runtime error)。 + +你也可以使用可选链和可选绑定来选择性的执行可选表达式上的操作。如果值为`nil`,不会执行任何操作因此也就没有运行错误产生。 + +更多细节以及更多如何使用可选类型的例子,见章节“可选”。 + +> 可选类型语法 +> *可选类型* → [*类型*](..\chapter3\03_Types.html#type) **?** + + +##隐式解析可选类型 + +Swift语言定义后缀`!`作为标准库中命名类型`ImplicitlyUnwrappedOptional`的简写。换句话说,下面两个声明等价: + +```swift +var implicitlyUnwrappedString: String! +var implicitlyUnwrappedString: ImplicitlyUnwrappedOptional +``` +上述两种情况下,变量`implicitlyUnwrappedString`被声明为一个隐式解析可选类型的字符串。注意类型与`!`之间没有空格。 + +你可以在使用可选的地方同样使用隐式解析可选。比如,你可以将隐式解析可选的值赋给变量、常量和可选特性,反之亦然。 + +有了可选,你在声明隐式解析可选变量或特性的时候就不用指定初始值,因为它有缺省值`nil`。 + +由于隐式解析可选的值会在使用时自动解析,所以没必要使用操作符`!`来解析它。也就是说,如果你使用值为`nil`的隐式解析可选,就会导致运行错误。 + +使用可选链会选择性的执行隐式解析可选表达式上的某一个操作。如果值为`nil`,就不会执行任何操作,因此也不会产生运行错误。 + +关于隐式解析可选的更多细节,见章节“隐式解析可选”。 + +> 隐式解析可选类型(Implicitly Unwrapped Optional Type)语法 +> *隐式解析可选类型* → [*类型*](..\chapter3\03_Types.html#type) **!** + + +##协议合成类型 + +协议合成类型是一种符合每个协议的指定协议列表类型。协议合成类型可能会用在类型注解和泛型参数中。 + +协议合成类型的形式如下: + +```swift +protocol +``` + +协议合成类型允许你指定一个值,其类型可以适配多个协议的条件,而且不需要定义一个新的命名型协议来继承其它想要适配的各个协议。比如,协议合成类型`protocol`等效于一个从`Protocol A`,`Protocol B`, `Protocol C`继承而来的新协议`Protocol D`,很显然这样做有效率的多,甚至不需引入一个新名字。 + +协议合成列表中的每项必须是协议名或协议合成类型的类型别名。如果列表为空,它就会指定一个空协议合成列表,这样每个类型都能适配。 + +> 协议合成类型语法 +> *协议合成类型* → **protocol** **<** [*协议标识符列表*](..\chapter3\03_Types.html#protocol_identifier_list) _可选_ **>** +> *协议标识符列表* → [*协议标识符*](..\chapter3\03_Types.html#protocol_identifier) | [*协议标识符*](..\chapter3\03_Types.html#protocol_identifier) **,** [*协议标识符列表*](..\chapter3\03_Types.html#protocol_identifier_list) +> *协议标识符* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) + + +##元类型 + +元类型是指所有类型的类型,包括类、结构体、枚举和协议。 + +类、结构体或枚举类型的元类型是相应的类型名紧跟`.Type`。协议类型的元类型——并不是运行时适配该协议的具体类型——是该协议名字紧跟`.Protocol`。比如,类`SomeClass`的元类型就是`SomeClass.Type`,协议`SomeProtocol`的元类型就是`SomeProtocal.Protocol`。 + +你可以使用后缀`self`表达式来获取类型。比如,`SomeClass.self`返回`SomeClass`本身,而不是`SomeClass`的一个实例。同样,`SomeProtocol.self`返回`SomeProtocol`本身,而不是运行时适配`SomeProtocol`的某个类型的实例。还可以对类型的实例使用`dynamicType`表达式来获取该实例在运行阶段的类型,如下所示: + +```swift +class SomeBaseClass { + class func printClassName() { + println("SomeBaseClass") + } +} +class SomeSubClass: SomeBaseClass { + override class func printClassName() { + println("SomeSubClass") + } +} +let someInstance: SomeBaseClass = SomeSubClass() +// someInstance is of type SomeBaseClass at compile time, but +// someInstance is of type SomeSubClass at runtime +someInstance.dynamicType.printClassName() +// prints "SomeSubClass +``` + +> 元(Metatype)类型语法 +> *元类型* → [*类型*](..\chapter3\03_Types.html#type) **.** **Type** | [*类型*](..\chapter3\03_Types.html#type) **.** **Protocol** x + + +##类型继承子句 + +类型继承子句被用来指定一个命名型类型继承哪个类且适配哪些协议。类型继承子句开始于冒号`:`,紧跟由`,`隔开的类型标识符列表。 + +类可以继承单个超类,适配任意数量的协议。当定义一个类时,超类的名字必须出现在类型标识符列表首位,然后跟上该类需要适配的任意数量的协议。如果一个类不是从其它类继承而来,那么列表可以以协议开头。关于类继承更多的讨论和例子,见章节“继承”。 + +其它命名型类型可能只继承或适配一个协议列表。协议类型可能继承于其它任意数量的协议。当一个协议类型继承于其它协议时,其它协议的条件集合会被集成在一起,然后其它从当前协议继承的任意类型必须适配所有这些条件。 + +枚举定义中的类型继承子句可以是一个协议列表,或是指定原始值的枚举,一个单独的指定原始值类型的命名型类型。使用类型继承子句来指定原始值类型的枚举定义的例子,见章节“原始值”。 + +> 类型继承子句语法 +> *类型继承子句* → **:** [*类型继承列表*](..\chapter3\03_Types.html#type_inheritance_list) +> *类型继承列表* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) | [*类型标识*](..\chapter3\03_Types.html#type_identifier) **,** [*类型继承列表*](..\chapter3\03_Types.html#type_inheritance_list) + + +##类型推断 + +Swift广泛的使用类型推断,从而允许你可以忽略很多变量和表达式的类型或部分类型。比如,对于`var x: Int = 0`,你可以完全忽略类型而简写成`var x = 0`——编译器会正确的推断出`x`的类型`Int`。类似的,当完整的类型可以从上下文推断出来时,你也可以忽略类型的一部分。比如,如果你写了`let dict: Dictionary = ["A": 1]`,编译提也能推断出`dict`的类型是`Dictionary`。 + +在上面的两个例子中,类型信息从表达式树(expression tree)的叶子节点传向根节点。也就是说,`var x: Int = 0`中`x`的类型首先根据`0`的类型进行推断,然后将该类型信息传递到根节点(变量`x`)。 + +在Swift中,类型信息也可以反方向流动——从根节点传向叶子节点。在下面的例子中,常量`eFloat`上的显式类型注解(`:Float`)导致数字字面量`2.71828`的类型是`Float`而非`Double`。 + +```swift +let e = 2.71828 // The type of e is inferred to be Double. +let eFloat: Float = 2.71828 // The type of eFloat is Float. +``` + +Swift中的类型推断在单独的表达式或语句水平上进行。这意味着所有用于推断类型的信息必须可以从表达式或其某个子表达式的类型检查中获取。 diff --git a/source/chapter3/04_Expressions.md b/source/chapter3/04_Expressions.md old mode 100644 new mode 100755 index e69de29b..285dc7f0 --- a/source/chapter3/04_Expressions.md +++ b/source/chapter3/04_Expressions.md @@ -0,0 +1,639 @@ +> 翻译:[sg552](https://github.com/sg552) +> 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + +# 表达式(Expressions) +----------------- + +本页包含内容: + +- [前缀表达式(Prefix Expressions)](#prefix_expressions) +- [二元表达式(Binary Expressions)](#binary_expressions) +- [赋值表达式(Assignment Operator)](#assignment_operator) +- [三元条件运算符(Ternary Conditional Operator)](#ternary_conditional_operator) +- [类型转换运算符(Type-Casting Operators)](#type-casting_operators) +- [主要表达式(Primary Expressions)](#primary_expressions) +- [后缀表达式(Postfix Expressions)](#postfix_expressions) + +Swift 中存在四种表达式: 前缀(prefix)表达式,二元(binary)表达式,主要(primary)表达式和后缀(postfix)表达式。表达式可以返回一个值,以及运行某些逻辑(causes a side effect)。 + +前缀表达式和二元表达式就是对某些表达式使用各种运算符(operators)。 主要表达式是最短小的表达式,它提供了获取(变量的)值的一种途径。 后缀表达式则允许你建立复杂的表达式,例如配合函数调用和成员访问。 每种表达式都在下面有详细论述~ + +> 表达式语法 +> *表达式* → [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) [*二元表达式列表*](..\chapter3\04_Expressions.html#binary_expressions) _可选_ +> *表达式列表* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*表达式*](..\chapter3\04_Expressions.html#expression) **,** [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) + + +## 前缀表达式(Prefix Expressions) + +前缀表达式由 前缀符号和表达式组成。(这个前缀符号只能接收一个参数) + +Swift 标准库支持如下的前缀操作符: + +- ++ 自增1 (increment) +- -- 自减1 (decrement) +- ! 逻辑否 (Logical NOT ) +- ~ 按位否 (Bitwise NOT ) +- \+ 加(Unary plus) +- \- 减(Unary minus) + +对于这些操作符的使用,请参见: Basic Operators and Advanced Operators + +作为对上面标准库运算符的补充,你也可以对 某个函数的参数使用 '&'运算符。 更多信息,请参见: "In-Out parameters". + +> 前置表达式语法 +> *前置表达式* → [*前置运算符*](LexicalStructure.html#prefix_operator) _可选_ [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) +> *前置表达式* → [*写入写出(in-out)表达式*](..\chapter3\04_Expressions.html#in_out_expression) +> *写入写出(in-out)表达式* → **&** [*标识符*](LexicalStructure.html#identifier) + + +## 二元表达式(Binary Expressions) + +二元表达式由 "左边参数" + "二元运算符" + "右边参数" 组成, 它有如下的形式: + +> `left-hand argument` `operator` `right-hand argument` + +Swift 标准库提供了如下的二元运算符: + +- 求幂相关(无结合,优先级160) + - << 按位左移(Bitwise left shift) + - >> 按位右移(Bitwise right shift) +- 乘除法相关(左结合,优先级150) + - \* 乘 + - / 除 + - % 求余 + - &* 乘法,忽略溢出( Multiply, ignoring overflow) + - &/ 除法,忽略溢出(Divide, ignoring overflow) + - &% 求余, 忽略溢出( Remainder, ignoring overflow) + - & 位与( Bitwise AND) +- 加减法相关(左结合, 优先级140) + - \+ 加 + - \- 减 + - &+ Add with overflow + - &- Subtract with overflow + - | 按位或(Bitwise OR ) + - ^ 按位异或(Bitwise XOR) +- Range (无结合,优先级 135) + - .. 半闭值域 Half-closed range + - ... 全闭值域 Closed range +- 类型转换 (无结合,优先级 132) + - is 类型检查( type check) + - as 类型转换( type cast) +- Comparative (无结合,优先级 130) + - < 小于 + - <= 小于等于 + - > 大于 + - >= 大于等于 + - == 等于 + - != 不等 + - === 恒等于 + - !== 不恒等 + - ~= 模式匹配( Pattern match) +- 合取( Conjunctive) (左结合,优先级 120) + - && 逻辑与(Logical AND) +- 析取(Disjunctive) (左结合,优先级 110) + - || 逻辑或( Logical OR) +- 三元条件(Ternary Conditional )(右结合,优先级 100) + - ?: 三元条件 Ternary conditional +- 赋值 (Assignment) (右结合, 优先级 90) + - = 赋值(Assign) + - *= Multiply and assign + - /= Divide and assign + - %= Remainder and assign + - += Add and assign + - -= Subtract and assign + - <<= Left bit shift and assign + - >>= Right bit shift and assign + - &= Bitwise AND and assign + - ^= Bitwise XOR and assign + - |= Bitwise OR and assign + - &&= Logical AND and assign + - ||= Logical OR and assign + +关于这些运算符(operators)的更多信息,请参见:Basic Operators and Advanced Operators. + +> 注意 +> 在解析时, 一个二元表达式表示为一个一级数组(a flat list), 这个数组(List)根据运算符的先后顺序,被转换成了一个tree. 例如: 2 + 3 * 5 首先被认为是: 2, + , `` 3``, *, 5. 随后它被转换成 tree (2 + (3 * 5)) + +

    + +> 二元表达式语法 +> *二元表达式* → [*二元运算符*](LexicalStructure.html#binary_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) +> *二元表达式* → [*赋值运算符*](..\chapter3\04_Expressions.html#assignment_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) +> *二元表达式* → [*条件运算符*](..\chapter3\04_Expressions.html#conditional_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) +> *二元表达式* → [*类型转换运算符*](..\chapter3\04_Expressions.html#type_casting_operator) +> *二元表达式列表* → [*二元表达式*](..\chapter3\04_Expressions.html#binary_expression) [*二元表达式列表*](..\chapter3\04_Expressions.html#binary_expressions) _可选_ + + + +## 赋值表达式(Assignment Operator) + +The assigment operator sets a new value for a given expression. It has the following form: +赋值表达式会对某个给定的表达式赋值。 它有如下的形式; + +> `expression` = `value` + +就是把右边的 *value* 赋值给左边的 *expression*. 如果左边的*expression* 需要接收多个参数(是一个tuple ),那么右边必须也是一个具有同样数量参数的tuple. (允许嵌套的tuple) + +```swift +(a, _, (b, c)) = ("test", 9.45, (12, 3)) +// a is "test", b is 12, c is 3, and 9.45 is ignored +``` + +赋值运算符不返回任何值。 + +> 赋值运算符语法 +> *赋值运算符* → **=** + + +## 三元条件运算符(Ternary Conditional Operator) + +三元条件运算符 是根据条件来获取值。 形式如下: + +> `condition` ? `expression used if true` : `expression used if false` + +如果 `condition` 是true, 那么返回 第一个表达式的值(此时不会调用第二个表达式), 否则返回第二个表达式的值(此时不会调用第一个表达式)。 + +想看三元条件运算符的例子,请参见: Ternary Conditional Operator. + +> 三元条件运算符语法 +> *三元条件运算符* → **?** [*表达式*](..\chapter3\04_Expressions.html#expression) **:** + + +## 类型转换运算符(Type-Casting Operators) + +有两种类型转换操作符: as 和 is. 它们有如下的形式: + +> `expression` as `type` +> `expression` as? `type` +> `expression` is `type` + +as 运算符会把`目标表达式`转换成指定的`类型`(specified type),过程如下: + +- 如果类型转换成功, 那么目标表达式就会返回指定类型的实例(instance). 例如:把子类(subclass)变成父类(superclass)时. +- 如果转换失败,则会抛出编译错误( compile-time error)。 +- 如果上述两个情况都不是(也就是说,编译器在编译时期无法确定转换能否成功,) 那么目标表达式就会变成指定的类型的optional. (is an optional of the specified type ) 然后在运行时,如果转换成功, 目标表达式就会作为 optional的一部分来返回, 否则,目标表达式返回nil. 对应的例子是: 把一个 superclass 转换成一个 subclass. + +```swift +class SomeSuperType {} +class SomeType: SomeSuperType {} +class SomeChildType: SomeType {} +let s = SomeType() + +let x = s as SomeSuperType // known to succeed; type is SomeSuperType +let y = s as Int // known to fail; compile-time error +let z = s as SomeChildType // might fail at runtime; type is SomeChildType? +``` + +使用'as'做类型转换跟正常的类型声明,对于编译器来说是一样的。例如: + +```swift +let y1 = x as SomeType // Type information from 'as' +let y2: SomeType = x // Type information from an annotation +``` + +'is' 运算符在“运行时(runtime)”会做检查。 成功会返回true, 否则 false + +The check must not be known to be true or false at compile time. The following are invalid: +上述检查在“编译时(compile time)”不能使用。 例如下面的使用是错误的: + +```swift +"hello" is String +"hello" is Int +``` + +关于类型转换的更多内容和例子,请参见: Type Casting. + +> 类型转换运算符(type-casting-operator)语法 +> *类型转换运算符* → **is** [*类型*](..\chapter3\03_Types.html#type) | **as** **?** _可选_ [*类型*](..\chapter3\03_Types.html#type) + + +## 主表达式(Primary Expressions) + +`主表达式`是最基本的表达式。 它们可以跟 前缀表达式,二元表达式,后缀表达式以及其他主要表达式组合使用。 + +> 主表达式语法 +> *主表达式* → [*标识符*](LexicalStructure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ +> *主表达式* → [*字面量表达式*](..\chapter3\04_Expressions.html#literal_expression) +> *主表达式* → [*self表达式*](..\chapter3\04_Expressions.html#self_expression) +> *主表达式* → [*超类表达式*](..\chapter3\04_Expressions.html#superclass_expression) +> *主表达式* → [*闭包表达式*](..\chapter3\04_Expressions.html#closure_expression) +> *主表达式* → [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression) +> *主表达式* → [*隐式成员表达式*](..\chapter3\04_Expressions.html#implicit_member_expression) +> *主表达式* → [*通配符表达式*](..\chapter3\04_Expressions.html#wildcard_expression) + +### 字符型表达式(Literal Expression) + +由这些内容组成:普通的字符(string, number) , 一个字符的字典或者数组,或者下面列表中的特殊字符。 + +字符(Literal) | 类型(Type) | 值(Value) +------------- | ---------- | ---------- +\__FILE__ | String | 所在的文件名 +\__LINE__ | Int | 所在的行数 +\__COLUMN__ | Int | 所在的列数 +\__FUNCTION__ | String | 所在的function 的名字 + +在某个函数(function)中,`__FUNCTION__` 会返回当前函数的名字。 在某个方法(method)中,它会返回当前方法的名字。 在某个property 的getter/setter中会返回这个属性的名字。 在init/subscript中 只有的特殊成员(member)中会返回这个keyword的名字,在某个文件的顶端(the top level of a file),它返回的是当前module的名字。 + +一个array literal,是一个有序的值的集合。 它的形式是: + +> [`value 1`, `value 2`, `...`] + +数组中的最后一个表达式可以紧跟一个逗号(','). []表示空数组 。 array literal的type是 T[], 这个T就是数组中元素的type. 如果该数组中有多种type, T则是跟这些type的公共supertype最接近的type.(closest common supertype) + +一个`dictionary literal` 是一个包含无序的键值对(key-value pairs)的集合,它的形式是: + +> [`key 1`: `value 1`, `key 2`: `value 2`, `...`] + +dictionary 的最后一个表达式可以是一个逗号(','). [:] 表示一个空的dictionary. 它的type是 Dictionary (这里KeyType表示 key的type, ValueType表示 value的type) 如果这个dictionary 中包含多种 types, 那么KeyType, Value 则对应着它们的公共supertype最接近的type( closest common supertype). + +> 字面量表达式语法 +> *字面量表达式* → [*字面量*](LexicalStructure.html#literal) +> *字面量表达式* → [*数组字面量*](..\chapter3\04_Expressions.html#array_literal) | [*字典字面量*](..\chapter3\04_Expressions.html#dictionary_literal) +> *字面量表达式* → **__FILE__** | **__LINE__** | **__COLUMN__** | **__FUNCTION__** +> *数组字面量* → **[** [*数组字面量项列表*](..\chapter3\04_Expressions.html#array_literal_items) _可选_ **]** +> *数组字面量项列表* → [*数组字面量项*](..\chapter3\04_Expressions.html#array_literal_item) **,** _可选_ | [*数组字面量项*](..\chapter3\04_Expressions.html#array_literal_item) **,** [*数组字面量项列表*](..\chapter3\04_Expressions.html#array_literal_items) +> *数组字面量项* → [*表达式*](..\chapter3\04_Expressions.html#expression) +> *字典字面量* → **[** [*字典字面量项列表*](..\chapter3\04_Expressions.html#dictionary_literal_items) **]** | **[** **:** **]** +> *字典字面量项列表* → [*字典字面量项*](..\chapter3\04_Expressions.html#dictionary_literal_item) **,** _可选_ | [*字典字面量项*](..\chapter3\04_Expressions.html#dictionary_literal_item) **,** [*字典字面量项列表*](..\chapter3\04_Expressions.html#dictionary_literal_items) +> *字典字面量项* → [*表达式*](..\chapter3\04_Expressions.html#expression) **:** [*表达式*](..\chapter3\04_Expressions.html#expression) + +### self表达式(Self Expression) + +self表达式是对 当前type 或者当前instance的引用。它的形式如下: + +> self +> self.`member name` +> self[`subscript index`] +> self(`initializer arguments`) +> self.init(`initializer arguments`) + +如果在 initializer, subscript, instance method中,self等同于当前type的instance. 在一个静态方法(static method), 类方法(class method)中, self等同于当前的type. + +当访问 member(成员变量时), self 用来区分重名变量(例如函数的参数). 例如, +(下面的 self.greeting 指的是 var greeting: String, 而不是 init(greeting: String) ) + +```swift +class SomeClass { + var greeting: String + init(greeting: String) { + self.greeting = greeting + } +} +``` + +在mutating 方法中, 你可以使用self 对 该instance进行赋值。 + +```swift +struct Point { + var x = 0.0, y = 0.0 + mutating func moveByX(deltaX: Double, y deltaY: Double) { + self = Point(x: x + deltaX, y: y + deltaY) + } +} +``` + +> Self 表达式语法 +> *self表达式* → **self** +> *self表达式* → **self** **.** [*标识符*](LexicalStructure.html#identifier) +> *self表达式* → **self** **[** [*表达式*](..\chapter3\04_Expressions.html#expression) **]** +> *self表达式* → **self** **.** **init** + +### 超类表达式(Superclass Expression) + +超类表达式可以使我们在某个class中访问它的超类. 它有如下形式: + +> super.`member name` +> super[`subscript index`] +> super.init(`initializer arguments`) + +形式1 用来访问超类的某个成员(member). 形式2 用来访问该超类的 subscript 实现。 形式3 用来访问该超类的 initializer. + +子类(subclass)可以通过超类(superclass)表达式在它们的 member, subscripting 和 initializers 中来利用它们超类中的某些实现(既有的方法或者逻辑)。 + +> 超类(superclass)表达式语法 +> *超类表达式* → [*超类方法表达式*](..\chapter3\04_Expressions.html#superclass_method_expression) | [*超类下标表达式*](..\chapter3\04_Expressions.html#超类下标表达式) | [*超类构造器表达式*](..\chapter3\04_Expressions.html#superclass_initializer_expression) +> *超类方法表达式* → **super** **.** [*标识符*](LexicalStructure.html#identifier) +> *超类下标表达式* → **super** **[** [*表达式*](..\chapter3\04_Expressions.html#expression) **]** +> *超类构造器表达式* → **super** **.** **init** + +### 闭包表达式(Closure Expression) + +闭包(closure) 表达式可以建立一个闭包(在其他语言中也叫 lambda, 或者 匿名函数(anonymous function)). 跟函数(function)的声明一样, 闭包(closure)包含了可执行的代码(跟方法主体(statement)类似) 以及接收(capture)的参数。 它的形式如下: + +```swift +{ (parameters) -> return type in + statements +} +``` + +闭包的参数声明形式跟方法中的声明一样, 请参见:Function Declaration. + +闭包还有几种特殊的形式, 让使用更加简洁: + +- 闭包可以省略 它的参数的type 和返回值的type. 如果省略了参数和参数类型,就也要省略 'in'关键字。 如果被省略的type 无法被编译器获知(inferred) ,那么就会抛出编译错误。 +- 闭包可以省略参数,转而在方法体(statement)中使用 $0, $1, $2 来引用出现的第一个,第二个,第三个参数。 +- 如果闭包中只包含了一个表达式,那么该表达式就会自动成为该闭包的返回值。 在执行 'type inference '时,该表达式也会返回。 + +下面几个 闭包表达式是 等价的: + +```swift +myFunction { + (x: Int, y: Int) -> Int in + return x + y +} + +myFunction { + (x, y) in + return x + y +} + +myFunction { return $0 + $1 } + +myFunction { $0 + $1 } +``` + +关于 向闭包中传递参数的内容,参见: Function Call Expression. + +闭包表达式可以通过一个参数列表(capture list) 来显式指定它需要的参数。 参数列表 由中括号 [] 括起来,里面的参数由逗号','分隔。一旦使用了参数列表,就必须使用'in'关键字(在任何情况下都得这样做,包括忽略参数的名字,type, 返回值时等等)。 + +在闭包的参数列表( capture list)中, 参数可以声明为 'weak' 或者 'unowned' . + +```swift +myFunction { print(self.title) } // strong capture +myFunction { [weak self] in print(self!.title) } // weak capture +myFunction { [unowned self] in print(self.title) } // unowned capture +``` + +在参数列表中,也可以使用任意表达式来赋值. 该表达式会在 闭包被执行时赋值,然后按照不同的力度来获取(这句话请慎重理解)。(captured with the specified strength. ) 例如: + +```swift +// Weak capture of "self.parent" as "parent" +myFunction { [weak parent = self.parent] in print(parent!.title) } +``` + +关于闭包表达式的更多信息和例子,请参见: Closure Expressions. + +> 闭包表达式语法 +> *闭包表达式* → **{** [*闭包签名(Signational)*](..\chapter3\04_Expressions.html#closure_signature) _可选_ [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) **}** +> *闭包签名(Signational)* → [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in** +> *闭包签名(Signational)* → [*标识符列表*](LexicalStructure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in** +> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in** +> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*标识符列表*](LexicalStructure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in** +> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) **in** +> *捕获(Capature)列表* → **[** [*捕获(Capature)说明符*](..\chapter3\04_Expressions.html#capture_specifier) [*表达式*](..\chapter3\04_Expressions.html#expression) **]** +> *捕获(Capature)说明符* → **weak** | **unowned** | **unowned(safe)** | **unowned(unsafe)** + +### 隐式成员表达式(Implicit Member Expression) + +在可以判断出类型(type)的上下文(context)中,隐式成员表达式是访问某个type的member( 例如 class method, enumeration case) 的简洁方法。 它的形式是: + +> .`member name` + +例子: + +```swift +var x = MyEnumeration.SomeValue +x = .AnotherValue +``` + +> 隐式成员表达式语法 +> *隐式成员表达式* → **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) + +### 圆括号表达式(Parenthesized Expression) + +圆括号表达式由多个子表达式和逗号','组成。 每个子表达式前面可以有 identifier x: 这样的可选前缀。形式如下: + +>(`identifier 1`: `expression 1`, `identifier 2`: `expression 2`, `...`) + +圆括号表达式用来建立tuples , 然后把它做为参数传递给 function. 如果某个圆括号表达式中只有一个 子表达式,那么它的type就是 子表达式的type。例如: (1)的 type是Int, 而不是(Int) + +> 圆括号表达式(Parenthesized Expression)语法 +> *圆括号表达式* → **(** [*表达式元素列表*](..\chapter3\04_Expressions.html#expression_element_list) _可选_ **)** +> *表达式元素列表* → [*表达式元素*](..\chapter3\04_Expressions.html#expression_element) | [*表达式元素*](..\chapter3\04_Expressions.html#expression_element) **,** [*表达式元素列表*](..\chapter3\04_Expressions.html#expression_element_list) +> *表达式元素* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) **:** [*表达式*](..\chapter3\04_Expressions.html#expression) + +### 通配符表达式(Wildcard Expression) + +通配符表达式用来忽略传递进来的某个参数。例如:下面的代码中,10被传递给x, 20被忽略(译注:好奇葩的语法。。。) + +```swift +(x, _) = (10, 20) +// x is 10, 20 is ignored +``` + +> 通配符表达式语法 +> *通配符表达式* → **_** + + +## 后缀表达式(Postfix Expressions) + +后缀表达式就是在某个表达式的后面加上 操作符。 严格的讲,每个主要表达式(primary expression)都是一个后缀表达式 + +Swift 标准库提供了下列后缀表达式: + +- ++ Increment +- -- Decrement + +对于这些操作符的使用,请参见: Basic Operators and Advanced Operators + +> 后置表达式语法 +> *后置表达式* → [*主表达式*](..\chapter3\04_Expressions.html#primary_expression) +> *后置表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*后置运算符*](..\chapter3\02_Lexical_Structure.html#postfix_operator) +> *后置表达式* → [*函数调用表达式*](..\chapter3\04_Expressions.html#function_call_expression) +> *后置表达式* → [*构造器表达式*](..\chapter3\04_Expressions.html#initializer_expression) +> *后置表达式* → [*显示成员表达式*](..\chapter3\04_Expressions.html#explicit_member_expression) +> *后置表达式* → [*后置self表达式*](..\chapter3\04_Expressions.html#postfix_self_expression) +> *后置表达式* → [*动态类型表达式*](..\chapter3\04_Expressions.html#dynamic_type_expression) +> *后置表达式* → [*下标表达式*](..\chapter3\04_Expressions.html#subscript_expression) +> *后置表达式* → [*强制取值(Forced Value)表达式*](..\chapter3\04_Expressions.html#forced_value_expression) +> *后置表达式* → [*可选链(Optional Chaining)表达式*](..\chapter3\04_Expressions.html#optional_chaining_expression) + +### 函数调用表达式(Function Call Expression) + +函数调用表达式由函数名和参数列表组成。它的形式如下: + +> `function name`(`argument value 1`, `argument value 2`) + +The function name can be any expression whose value is of a function type. +(不用翻译了, 太罗嗦) + +如果该function 的声明中指定了参数的名字,那么在调用的时候也必须得写出来. 例如: + +> `function name`(`argument name 1`: `argument value 1`, `argument name 2`: `argument value 2`) + +可以在 函数调用表达式的尾部(最后一个参数之后)加上 一个闭包(closure) , 该闭包会被目标函数理解并执行。它具有如下两种写法: + +```swift +// someFunction takes an integer and a closure as its arguments +someFunction(x, {$0 == 13}) +someFunction(x) {$0 == 13} +``` + +如果闭包是该函数的唯一参数,那么圆括号可以省略。 + +```swift +// someFunction takes a closure as its only argument +myData.someMethod() {$0 == 13} +myData.someMethod {$0 == 13} +``` + +> 函数调用表达式语法 +> *函数调用表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression) +> *函数调用表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression) _可选_ [*后置闭包(Trailing Closure)*](..\chapter3\04_Expressions.html#trailing_closure) +> *后置闭包(Trailing Closure)* → [*闭包表达式*](..\chapter3\04_Expressions.html#closure_expression) + +### 初始化函数表达式(Initializer Expression) + +Initializer表达式用来给某个Type初始化。 它的形式如下: + +> `expression`.init(`initializer arguments`) + +(Initializer表达式用来给某个Type初始化。) 跟函数(function)不同, initializer 不能返回值。 + +```swift +var x = SomeClass.someClassFunction // ok +var y = SomeClass.init // error +``` + +可以通过 initializer 表达式来委托调用(delegate to )到superclass的initializers. + +```swift +class SomeSubClass: SomeSuperClass { + init() { + // subclass initialization goes here + super.init() + } +} +``` + +> 构造器表达式语法 +> *构造器表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **init** + +### 显式成员表达式(Explicit Member Expression) + +显示成员表达式允许我们访问type, tuple, module的成员变量。它的形式如下: + +> `expression`.`member name` + +该member 就是某个type在声明时候所定义(declaration or extension) 的变量, 例如: + +```swift +class SomeClass { + var someProperty = 42 +} +let c = SomeClass() +let y = c.someProperty // Member access +``` + +对于tuple, 要根据它们出现的顺序(0, 1, 2...)来使用: + +```swift +var t = (10, 20, 30) +t.0 = t.1 +// Now t is (20, 20, 30) +``` + +The members of a module access the top-level declarations of that module. +(不确定:对于某个module的member的调用,只能调用在top-level声明中的member.) + +> 显式成员表达式语法 +> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit) +> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ + +### 后缀self表达式(Postfix Self Expression) + +后缀表达式由 某个表达式 + '.self' 组成. 形式如下: + +> `expression`.self +> `type`.self + +形式1 表示会返回 expression 的值。例如: x.self 返回 x + +形式2:返回对应的type。我们可以用它来动态的获取某个instance的type。 + +> 后置Self 表达式语法 +> *后置self表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **self** + +### dynamic表达式(Dynamic Type Expression) + +(因为dynamicType是一个独有的方法,所以这里保留了英文单词,未作翻译, --- 类似与self expression) + +dynamicType 表达式由 某个表达式 + '.dynamicType' 组成。 + +> `expression`.dynamicType + +上面的形式中, expression 不能是某type的名字(当然了,如果我都知道它的名字了还需要动态来获取它吗)。动态类型表达式会返回"运行时"某个instance的type, 具体请看下面的列子: + +```swift +class SomeBaseClass { + class func printClassName() { + println("SomeBaseClass") + } +} +class SomeSubClass: SomeBaseClass { + override class func printClassName() { + println("SomeSubClass") + } +} +let someInstance: SomeBaseClass = SomeSubClass() + +// someInstance is of type SomeBaseClass at compile time, but +// someInstance is of type SomeSubClass at runtime +someInstance.dynamicType.printClassName() +// prints "SomeSubClass" +``` + +> 动态类型表达式语法 +> *动态类型表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **dynamicType** + +### 下标脚本表达式(Subscript Expression) + +下标脚本表达式提供了通过下标脚本访问getter/setter 的方法。它的形式是: + +> `expression`[`index expressions`] + +可以通过下标脚本表达式通过getter获取某个值,或者通过setter赋予某个值. + +关于subscript的声明,请参见: Protocol Subscript Declaration. + +> 附属脚本表达式语法 +> *附属脚本表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **[** [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) **]** + +### 强制取值表达式(Forced-Value Expression) + +强制取值表达式用来获取某个目标表达式的值(该目标表达式的值必须不是nil )。它的形式如下: + +> `expression`! + +如果该表达式的值不是nil, 则返回对应的值。 否则,抛出运行时错误(runtime error)。 + +> 强制取值(Forced Value)语法 +> *强制取值(Forced Value)表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **!** + +### 可选链表达式(Optional-Chaining Expression) + +可选链表达式由目标表达式 + '?' 组成,形式如下: + +> `expression`? + +后缀'?' 返回目标表达式的值,把它做为可选的参数传递给后续的表达式 + +如果某个后缀表达式包含了可选链表达式,那么它的执行过程就比较特殊: 首先先判断该可选链表达式的值,如果是 nil, 整个后缀表达式都返回 nil, 如果该可选链的值不是nil, 则正常返回该后缀表达式的值(依次执行它的各个子表达式)。在这两种情况下,该后缀表达式仍然是一个optional type(In either case, the value of the postfix expression is still of an optional type) + +如果某个"后缀表达式"的"子表达式"中包含了"可选链表达式",那么只有最外层的表达式返回的才是一个optional type. 例如,在下面的例子中, 如果c 不是nil, 那么 c?.property.performAction() 这句代码在执行时,就会先获得c 的property方法,然后调用 performAction()方法。 然后对于 "c?.property.performAction()" 这个整体,它的返回值是一个optional type. + +```swift +var c: SomeClass? +var result: Bool? = c?.property.performAction() +``` + +如果不使用可选链表达式,那么 上面例子的代码跟下面例子等价: + +```swift +if let unwrappedC = c { + result = unwrappedC.property.performAction() +} +``` + +> 可选链表达式语法 +> *可选链表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **?** diff --git a/source/chapter3/05_Declarations.md b/source/chapter3/05_Declarations.md old mode 100644 new mode 100755 index e69de29b..6e4e44bf --- a/source/chapter3/05_Declarations.md +++ b/source/chapter3/05_Declarations.md @@ -0,0 +1,855 @@ +> 翻译:[marsprince](https://github.com/marsprince) +> 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + +# 声明 +----------------- + +本页包含内容: + +- [模块范围](#module_scope) +- [代码块](#code_blocks) +- [引入声明](#import_declaration) +- [常量声明](#constant_declaration) +- [变量声明](#variable_declaration) +- [类型的别名声明](#type_alias_declaration) +- [函数声明](#function_declaration) +- [枚举声明](#enumeration_declaration) +- [结构体声明](#structure_declaration) +- [类声明](#class_declaration) +- [协议声明](#protocol_declaration) +- [构造器声明](#initializer_declaration) +- [析构声明](#deinitializer_declaration) +- [扩展声明](#extension_declaration) +- [下标脚本声明](#subscript_declaration) +- [运算符声明](#operator_declaration) + +一条声明可以在你的程序里引入新的名字和构造。举例来说,你可以使用声明来引入函数和方法,变量和常量,或者来定义 +新的命名好的枚举,结构,类和协议类型。你也可以使用一条声明来延长一个已经存在的命名好的类型的行为。或者在你的 +程序里引入在其他地方声明的符号。 + +在swift中,大多数声明在某种意义上讲也是执行或同事声明它们的初始化定义。这意味着,因为协议和它们的成员不匹配, +大多数协议成员需要单独的声明。为了方便起见,也因为这些区别在swift里不是很重要,声明语句同时包含了声明和定义。 + +> 声明语法 +> *声明* → [*导入声明*](..\chapter3\05_Declarations.html#import_declaration) +> *声明* → [*常量声明*](..\chapter3\05_Declarations.html#constant_declaration) +> *声明* → [*变量声明*](..\chapter3\05_Declarations.html#variable_declaration) +> *声明* → [*类型别名声明*](..\chapter3\05_Declarations.html#typealias_declaration) +> *声明* → [*函数声明*](..\chapter3\05_Declarations.html#function_declaration) +> *声明* → [*枚举声明*](..\chapter3\05_Declarations.html#enum_declaration) +> *声明* → [*结构体声明*](..\chapter3\05_Declarations.html#struct_declaration) +> *声明* → [*类声明*](..\chapter3\05_Declarations.html#class_declaration) +> *声明* → [*协议声明*](..\chapter3\05_Declarations.html#protocol_declaration) +> *声明* → [*构造器声明*](..\chapter3\05_Declarations.html#initializer_declaration) +> *声明* → [*析构器声明*](..\chapter3\05_Declarations.html#deinitializer_declaration) +> *声明* → [*扩展声明*](..\chapter3\05_Declarations.html#extension_declaration) +> *声明* → [*附属脚本声明*](..\chapter3\05_Declarations.html#subscript_declaration) +> *声明* → [*运算符声明*](..\chapter3\05_Declarations.html#operator_declaration) +> *声明(Declarations)列表* → [*声明*](..\chapter3\05_Declarations.html#declaration) [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ +> *声明描述符(Specifiers)列表* → [*声明描述符(Specifier)*](..\chapter3\05_Declarations.html#declaration_specifier) [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ +> *声明描述符(Specifier)* → **class** | **mutating** | **nonmutating** | **override** | **static** | **unowned** | **unowned(safe)** | **unowned(unsafe)** | **weak** + + +##模块范围 + +模块范围定义了对模块中其他源文件可见的代码。(注:待改进)在swift的源文件中,最高级别的代码由零个或多个语句, +声明和表达组成。变量,常量和其他的声明语句在一个源文件的最顶级被声明,使得它们对同一模块中的每个源文件都是可见的。 + +> 顶级(Top Level) 声明语法 +> *顶级声明* → [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) _可选_ + + +##代码块 + +代码块用来将一些声明和控制结构的语句组织在一起。它有如下的形式: + +> { +> `statements` +> } + +代码块中的语句包括声明,表达式和各种其他类型的语句,它们按照在源码中的出现顺序被依次执行。 + +> 代码块语法 +> *代码块* → **{** [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) _可选_ **}** + + +##引入声明 + +引入声明使你可以使用在其他文件中声明的内容。引入语句的基本形式是引入整个代码模块;它由import关键字开始,后面 +紧跟一个模块名: + +> import `module` + +你可以提供更多的细节来限制引入的符号,如声明一个特殊的子模块或者在一个模块或子模块中做特殊的声明。(待改进) +当你使用了这些细节后,在当前的程序汇总只有引入的符号是可用的(并不是声明的整个模块)。 + +> import `import kind` `module`.`symbol name` +> import `module`.`submodule` + +

    + +> 导入(Import)声明语法 +> *导入声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **import** [*导入类型*](..\chapter3\05_Declarations.html#import_kind) _可选_ [*导入路径*](..\chapter3\05_Declarations.html#import_path) +> *导入类型* → **typealias** | **struct** | **class** | **enum** | **protocol** | **var** | **func** +> *导入路径* → [*导入路径标识符*](..\chapter3\05_Declarations.html#import_path_identifier) | [*导入路径标识符*](..\chapter3\05_Declarations.html#import_path_identifier) **.** [*导入路径*](..\chapter3\05_Declarations.html#import_path) +> *导入路径标识符* → [*标识符*](LexicalStructure.html#identifier) | [*运算符*](LexicalStructure.html#operator) + + +##常量声明 + +常量声明可以在你的程序里命名一个常量。常量以关键词let来声明,遵循如下的格式: + +> let `constant name`: `type` = `expression` + +当常量的值被给定后,常量就将常量名称和表达式初始值不变的结合在了一起,而且不能更改。 +这意味着如果常量以类的形式被初始化,类本身的内容是可以改变的,但是常量和类之间的结合关系是不能改变的。 +当一个常量被声明为全局变量,它必须被给定一个初始值。当一个常量在类或者结构体中被声明时,它被认为是一个常量 +属性。常量并不是可计算的属性,因此不包含getters和setters。(译者注:getters和setters不知道怎么翻译,待改进) + +如果常量名是一个元祖形式,元祖中的每一项初始化表达式中都要有对应的值 + +```swift +let (firstNumber, secondNumber) = (10, 42) +``` + +在上例中,firstNumber是一个值为10的常量,secnodeName是一个值为42的常量。所有常量都可以独立的使用: + +```swift +println("The first number is \(firstNumber).") +// prints "The first number is 10." +println("The second number is \(secondNumber).") +// prints "The second number is 42." +``` + +类型注释(:type)在常量声明中是一个可选项,它可以用来描述在类型推断(type inference)中找到的类型。 + +声明一个静态常量要使用关键字static。静态属性在类型属性(type propetries)中有介绍。 + +如果还想获得更多关于常量的信息或者想在使用中获得帮助,请查看常量和变量(constants and variables), +存储属性(stored properties)等节。 + +> 常数声明语法 +> *常量声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ **let** [*模式构造器列表*](..\chapter3\05_Declarations.html#pattern_initializer_list) +> *模式构造器列表* → [*模式构造器*](..\chapter3\05_Declarations.html#pattern_initializer) | [*模式构造器*](..\chapter3\05_Declarations.html#pattern_initializer) **,** [*模式构造器列表*](..\chapter3\05_Declarations.html#pattern_initializer_list) +> *模式构造器* → [*模式*](..\chapter3\07_Patterns.html#pattern) [*构造器*](..\chapter3\05_Declarations.html#initializer) _可选_ +> *构造器* → **=** [*表达式*](..\chapter3\04_Expressions.html#expression) + + +##变量声明 + +变量声明可以在你的程序里声明一个变量,它以关键字var来声明。根据声明变量类型和值的不同,如存储和计算 +变量和属性,存储变量和属性监视,和静态变量属性,有着不同的声明形式。(待改进) +所使用的声明形式取决于变量所声明的范围和你打算声明的变量类型。 + +>注意: +你也可以在协议声明的上下文声明属性,详情参见类型属性声明。 + +###存储型变量和存储型属性 + +下面的形式声明了一个存储型变量或存储型变量属性 + +> var `variable name`: `type` = `expression` + +你可以在全局,函数内,或者在类和结构体的声明(context)中使用这种形式来声明一个变量。当变量以这种形式 +在全局或者一个函数内被声明时,它代表一个存储型变量。当它在类或者结构体中被声明时,它代表一个存储型变量属性。 + +构造器表达式可以被 + +和常量声明相比,如果变量名是一个元祖类型,元祖的每一项的名字都要和初始化表达式一致。 + +正如名字一样,存储型变量的值或存储型变量属性存储在内存中。 + +###计算型变量和计算型属性 + +如下形式声明一个一个存储型变量或存储型属性: + +> var `variable name`: `type` { +> get { +> `statements` +> } +> set(`setter name`) { +> `statements` +> } +> } + +你可以在全局,函数体内或者类,结构体,枚举,扩展声明的上下文中使用这种形式的声明。 +当变量以这种形式在全局或者一个函数内被声明时,它代表一个计算型变量。当它在类,结构体,枚举,扩展声明的上下文 +中中被声明时,它代表一个计算型变量属性。 + +getter用来读取变量值,setter用来写入变量值。setter子句是可选择的,只有getter是必需的,你可以将这些语句 +都省略,只是简单的直接返回请求值,正如在只读计算属性(read-only computed properites)中描述的那样。 +但是如果你提供了一个setter语句,你也必需提供一个getter语句。 + +setter的名字和圆括号内的语句是可选的。如果你写了一个setter名,它就会作为setter的参数被使用。如果你不写setter名, +setter的初始名为newValue,正如在seter声明速记(shorthand setter declaration)中提到的那样。 + +不像存储型变量和存储型属性那样,计算型属性和计算型变量的值不存储在内存中。 + +获得更多信息,查看更多关于计算型属性的例子,请查看计算型属性(computed properties)一节。 + +###存储型变量监视器和属性监视器 + +你可以用willset和didset监视器来声明一个存储型变量或属性。一个包含监视器的存储型变量或属性按如下的形式声明: + +> var `variable name`: `type` = expression { +> willSet(setter name) { +> `statements` +> } +> didSet(`setter name`) { +> `statements` +> } +> } + +你可以在全局,函数体内或者类,结构体,枚举,扩展声明的上下文中使用这种形式的声明。 +当变量以这种形式在全局或者一个函数内被声明时,监视器代表一个存储型变量监视器; +当它在类,结构体,枚举,扩展声明的上下文中被声明时,监视器代表属性监视器。 + +你可以为适合的监视器添加任何存储型属性。你也可以通过重写子类属性的方式为适合的监视器添加任何继承的属性 +(无论是存储型还是计算型的),参见重写属性监视器(overriding properyt observers)。 + +初始化表达式在类或者结构体的声明中是可选的,但是在其他地方是必需的。无论在什么地方声明, +所有包含监视器的变量声明都必须有类型注释(type annotation)。 + +当变量或属性的值被改变时,willset和didset监视器提供了一个监视方法(适当的回应)。 +监视器不会在变量或属性第一次初始化时不会被运行,它们只有在值被外部初始化语句改变时才会被运行。 + +willset监视器只有在变量或属性值被改变之前运行。新的值作为一个常量经过过willset监视器,因此不可以在 +willset语句中改变它。didset监视器在变量或属性值被改变后立即运行。和willset监视器相反,为了以防止你仍然 +需要获得旧的数据,旧变量值或者属性会经过didset监视器。这意味着,如果你在变量或属性自身的didiset监视器语句 +中设置了一个值,你设置的新值会取代刚刚在willset监视器中经过的那个值。 + +在willset和didset语句中,setter名和圆括号的语句是可选的。如果你写了一个setter名,它就会作为willset和didset的参数被使用。如果你不写setter名, +willset监视器初始名为newvalue,didset监视器初始名为oldvalue。 + +当你提供一个willset语句时,didset语句是可选的。同样的,在你提供了一个didset语句时,willset语句是可选的。 + +获得更多信息,查看如何使用属性监视器的例子,请查看属性监视器(prpperty observers)一节。 + +###类和静态变量属性 + +class关键字用来声明类的计算型属性。static关键字用来声明类的静态变量属性。类和静态变量在类型属性(type properties)中有详细讨论。 + +> 变量声明语法 +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*模式构造器列表*](..\chapter3\05_Declarations.html#pattern_initializer_list) +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*getter-setter块*](..\chapter3\05_Declarations.html#getter_setter_block) +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block) +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*构造器*](..\chapter3\05_Declarations.html#initializer) _可选_ [*willSet-didSet代码块*](..\chapter3\05_Declarations.html#willSet_didSet_block) +> *变量声明头(Head)* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ **var** +> *变量名称* → [*标识符*](LexicalStructure.html#identifier) +> *getter-setter块* → **{** [*getter子句*](..\chapter3\05_Declarations.html#getter_clause) [*setter子句*](..\chapter3\05_Declarations.html#setter_clause) _可选_ **}** +> *getter-setter块* → **{** [*setter子句*](..\chapter3\05_Declarations.html#setter_clause) [*getter子句*](..\chapter3\05_Declarations.html#getter_clause) **}** +> *getter子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **get** [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *setter子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **set** [*setter名称*](..\chapter3\05_Declarations.html#setter_name) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *setter名称* → **(** [*标识符*](LexicalStructure.html#identifier) **)** +> *getter-setter关键字(Keyword)块* → **{** [*getter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#getter_keyword_clause) [*setter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#setter_keyword_clause) _可选_ **}** +> *getter-setter关键字(Keyword)块* → **{** [*setter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#setter_keyword_clause) [*getter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#getter_keyword_clause) **}** +> *getter关键字(Keyword)子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **get** +> *setter关键字(Keyword)子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **set** +> *willSet-didSet代码块* → **{** [*willSet子句*](..\chapter3\05_Declarations.html#willSet_clause) [*didSet子句*](..\chapter3\05_Declarations.html#didSet_clause) _可选_ **}** +> *willSet-didSet代码块* → **{** [*didSet子句*](..\chapter3\05_Declarations.html#didSet_clause) [*willSet子句*](..\chapter3\05_Declarations.html#willSet_clause) **}** +> *willSet子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **willSet** [*setter名称*](..\chapter3\05_Declarations.html#setter_name) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *didSet子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **didSet** [*setter名称*](..\chapter3\05_Declarations.html#setter_name) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block) + + +##类型的别名声明 + +类型别名的声明可以在你的程序里为一个已存在的类型声明一个别名。类型的别名声明以关键字typealias开始,遵循如下的 +形式: + +> `typealias name` = `existing type` + +当一个类型被别名被声明后,你可以在你程序的任何地方使用别名来代替已存在的类型。已存在的类型可以是已经被命名的 +类型或者是混合类型。类型的别名不产生新的类型,它只是简单的和已存在的类型做名称替换。 + +查看更多Protocol Associated Type Declaration. + +> 类型别名声明语法 +> *类型别名声明* → [*类型别名头(Head)*](..\chapter3\05_Declarations.html#typealias_head) [*类型别名赋值*](..\chapter3\05_Declarations.html#typealias_assignment) +> *类型别名头(Head)* → **typealias** [*类型别名名称*](..\chapter3\05_Declarations.html#typealias_name) +> *类型别名名称* → [*标识符*](LexicalStructure.html#identifier) +> *类型别名赋值* → **=** [*类型*](..\chapter3\03_Types.html#type) + + +##函数声明 + +你可以使用函数声明在你的程序里引入新的函数。函数可以在类的上下文,结构体,枚举,或者作为方法的协议中被声明。 +函数声明使用关键字func,遵循如下的形式: + +> func `function name`(`parameters`) -> `return type` { +> `statements` +> } + +如果函数不返回任何值,返回类型可以被忽略,如下所示: + +> func `function name`(`parameters`) { +> `statements` +> } + +每个参数的类型都要标明,它们不能被推断出来。初始时函数的参数是常值。在这些参数前面添加var使它们成为变量, +作用域内任何对变量的改变只在函数体内有效,或者用inout使的这些改变可以在调用域内生效。 +更多关于in-out参数的讨论,参见in-out参数(in-out parameters) + +函数可以使用元组类型作为返回值来返回多个变量。 + +函数定义可以出现在另一个函数声明内。这种函数被称作nested函数。更多关于nested函数的讨论,参见nestde functions。 + +###参数名 + +函数的参数是一个以逗号分隔的列表 。函数调用是的变量顺序必须和函数声明时的参数顺序一致。 +最简单的参数列表有着如下的形式: + +> `parameter name`: `parameter type` + +对于函数参数来讲,参数名在函数体内被使用,而不是在函数调用时使用。对于方法参数,参数名在函数体内被使用, +同时也在方法被调用时作为标签被使用。该方法的第一个参数名仅仅在函数体内被使用,就像函数的参数一样,举例来讲: + +```swift +func f(x: Int, y: String) -> String { + return y + String(x) +} +f(7, "hello") // x and y have no name +``` + +```swift +class C { + func f(x: Int, y: String) -> String { + return y + String(x) + } +} +let c = C() +c.f(7, y: "hello") // x没有名称,y有名称 +``` + +你可以按如下的形式,重写参数名被使用的过程: + +> `external parameter name` `local parameter name`: `parameter type` +> #`parameter name`: `parameter type` +> _ `local parameter name`: `parameter type` + +在本地参数前命名的第二名称(second name)使得参数有一个扩展名。且不同于本地的参数名。 +扩展参数名在函数被调用时必须被使用。对应的参数在方法或函数被调用时必须有扩展名 。 + +在参数名前所写的哈希符号(#)代表着这个参数名可以同时作为外部或本体参数名来使用。等同于书写两次本地参数名。 +在函数或方法调用时,与其对应的语句必须包含这个名字。 + +本地参数名前的强调字符(_)使参数在函数被调用时没有名称。在函数或方法调用时,与其对应的语句必须没有名字。 + +###特殊类型的参数 + +参数可以被忽略,值可以是变化的,并且提供一个初始值,这种方法有着如下的形式: + +> _ : <#parameter type#. +> `parameter name`: `parameter type`... +> `parameter name`: `parameter type` = `default argument value` + +以强调符(_)命名的参数明确的在函数体内不能被访问。 + +一个以基础类型名的参数,如果紧跟着三个点(...),被理解为是可变参数。一个函数至多可以拥有一个可变参数, +且必须是最后一个参数。可变参数被作为该基本类型名的数组来看待。举例来讲,可变参数int...被看做是int[]。 +查看可变参数的使用例子,详见可变参数(variadic parameters)一节。 + +在参数的类型后面有一个以等号(=)连接的表达式,这样的参数被看做有着给定表达式的初试值。如果参数在函数 +调用时被省略了,就会使用初始值。如果参数没有胜率,那么它在函数调用是必须有自己的名字.举例来讲, +f()和f(x:7)都是只有一个变量x的函数的有效调用,但是f(7)是非法的,因为它提供了一个值而不是名称。 + +###特殊方法 + +以self修饰的枚举或结构体方法必须以mutating关键字作为函数声明头。 + +子类重写的方法必须以override关键字作为函数声明头。不用override关键字重写的方法,使用了override关键字 +却并没有重写父类方法都会报错。 + +和类型相关而不是和类型实例相关的方法必须在static声明的结构以或枚举内,亦或是以class关键字定义的类内。 + +###柯里化函数和方法 + +柯里化函数或方法有着如下的形式: + +> func `function name`(`parameters`)(`parameters`) -> `return type` { +> `statements` +> } + +以这种形式定义的函数的返回值是另一个函数。举例来说,下面的两个声明时等价的: + +```swift +func addTwoNumbers(a: Int)(b: Int) -> Int { + return a + b +} +func addTwoNumbers(a: Int) -> (Int -> Int) { + func addTheSecondNumber(b: Int) -> Int { + return a + b + } + return addTheSecondNumber +} +``` + +```swift +addTwoNumbers(4)(5) // Returns 9 +``` + +多级柯里化应用如下 + +> 函数声明语法 +> *函数声明* → [*函数头*](..\chapter3\05_Declarations.html#function_head) [*函数名*](..\chapter3\05_Declarations.html#function_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*函数签名(Signature)*](..\chapter3\05_Declarations.html#function_signature) [*函数体*](..\chapter3\05_Declarations.html#function_body) +> *函数头* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ **func** +> *函数名* → [*标识符*](LexicalStructure.html#identifier) | [*运算符*](LexicalStructure.html#operator) +> *函数签名(Signature)* → [*parameter-clauses*](..\chapter3\05_Declarations.html#parameter_clauses) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ +> *函数结果* → **->** [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type) +> *函数体* → [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *parameter-clauses* → [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*parameter-clauses*](..\chapter3\05_Declarations.html#parameter_clauses) _可选_ +> *参数子句* → **(** **)** | **(** [*参数列表*](..\chapter3\05_Declarations.html#parameter_list) **...** _可选_ **)** +> *参数列表* → [*参数*](..\chapter3\05_Declarations.html#parameter) | [*参数*](..\chapter3\05_Declarations.html#parameter) **,** [*参数列表*](..\chapter3\05_Declarations.html#parameter_list) +> *参数* → **inout** _可选_ **let** _可选_ **#** _可选_ [*参数名*](..\chapter3\05_Declarations.html#parameter_name) [*本地参数名*](..\chapter3\05_Declarations.html#local_parameter_name) _可选_ [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*默认参数子句*](..\chapter3\05_Declarations.html#default_argument_clause) _可选_ +> *参数* → **inout** _可选_ **var** **#** _可选_ [*参数名*](..\chapter3\05_Declarations.html#parameter_name) [*本地参数名*](..\chapter3\05_Declarations.html#local_parameter_name) _可选_ [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*默认参数子句*](..\chapter3\05_Declarations.html#default_argument_clause) _可选_ +> *参数* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type) +> *参数名* → [*标识符*](LexicalStructure.html#identifier) | **_** +> *本地参数名* → [*标识符*](LexicalStructure.html#identifier) | **_** +> *默认参数子句* → **=** [*表达式*](..\chapter3\04_Expressions.html#expression) + + +##枚举声明 + +在你的程序里使用枚举声明来引入一个枚举类型。 + +枚举声明有两种基本的形式,使用关键字enum来声明。枚举声明体使用从零开始的变量——叫做枚举事件,和任意数量的 +声明,包括计算型属性,实例方法,静态方法,构造器,类型别名,甚至其他枚举,结构体,和类。枚举声明不能 +包含析构器或者协议声明。 + +不像类或者结构体。枚举类型并不提供隐式的初始构造器,所有构造器必须显式的声明。构造器可以委托枚举中的其他 +构造器,但是构造过程仅当构造器将一个枚举时间完成后才全部完成。 + +和结构体类似但是和类不同,枚举是值类型:枚举实例在赋予变量或常量时,或者被函数调用时被复制。 +更多关于值类型的信息,参见结构体和枚举都是值类型(Structures and Enumerations Are Value Types)一节。 + +你可以扩展枚举类型,正如在扩展名声明(Extension Declaration)中讨论的一样。 + +###任意事件类型的枚举 + +如下的形式声明了一个包含任意类型枚举时间的枚举变量 + +> enum `enumeration name` { +> case `enumeration case 1` +> case `enumeration case 2`(`associated value types`) +> } + +这种形式的枚举声明在其他语言中有时被叫做可识别联合(discrinminated)。 + +这种形式中,每一个事件块由关键字case开始,后面紧接着一个或多个以逗号分隔的枚举事件。每一个事件名必须是 +独一无二的。每一个事件也可以指定它所存储的指定类型的值,这些类型在关联值类型的元祖里被指定,立即书写在事件 +名后。获得更多关于关联值类型的信息和例子,请查看关联值(associated values)一节。 + +###使用原始事件值的枚举 + +以下的形式声明了一个包含相同基础类型的枚举事件的枚举: + +> enum `enumeration name`: `raw value type` { +> case `enumeration case 1` = `raw value 1` +> case `enumeration case 2` = `raw value 2` +> } + +在这种形式中,每一个事件块由case关键字开始,后面紧接着一个或多个以逗号分隔的枚举事件。和第一种形式的枚举 +事件不同,这种形式的枚举事件包含一个同类型的基础值,叫做原始值(raw value)。这些值的类型在原始值类型(raw value type) +中被指定,必须是字面上的整数,浮点数,字符或者字符串。 + +每一个事件必须有唯一的名字,必须有一个唯一的初始值。如果初始值类型被指定为int,则不必为事件显式的指定值, +它们会隐式的被标为值0,1,2等。每一个没有被赋值的Int类型时间会隐式的赋予一个初始值,它们是自动递增的。 + +```swift +num ExampleEnum: Int { + case A, B, C = 5, D +} +``` + +在上面的例子中,ExampleEnum.A的值是0,ExampleEnum.B的值是。因为ExampleEnum.C的值被显式的设定为5,因此 +ExampleEnum.D的值会自动增长为6. + +枚举事件的初始值可以调用方法roRaw获得,如ExampleEnum.B.toRaw()。你也可以通过调用fromRaw方法来使用初始值找到 +其对应的事件,并返回一个可选的事件。查看更多信息和获取初始值类型事件的信息,参阅初始值(raw values)。 + +###获得枚举事件 + +使用点(.)来引用枚举类型的事件,如 EnumerationType.EnumerationCase。当枚举类型可以上下文推断出时,你可以 +省略它(.仍然需要),参照枚举语法(Enumeration Syntax)和显式成员表达(Implicit Member Expression). + +使用switch语句来检验枚举事件的值,正如使用switch语句匹配枚举值(Matching Enumeration Values with a Switch Statement)一节描述的那样。 + +枚举类型是模式匹配(pattern-matched)的,和其相反的是switch语句case块中枚举事件匹配,在枚举事件类型(Enumeration Case Pattern)中有描述。 + +> 枚举声明语法 +> *枚举声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*联合式枚举*](..\chapter3\05_Declarations.html#union_style_enum) | [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*原始值式枚举*](..\chapter3\05_Declarations.html#raw_value_style_enum) +> *联合式枚举* → [*枚举名*](..\chapter3\05_Declarations.html#enum_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ **{** [*union-style-enum-members*](..\chapter3\05_Declarations.html#union_style_enum_members) _可选_ **}** +> *union-style-enum-members* → [*union-style-enum-member*](..\chapter3\05_Declarations.html#union_style_enum_member) [*union-style-enum-members*](..\chapter3\05_Declarations.html#union_style_enum_members) _可选_ +> *union-style-enum-member* → [*声明*](..\chapter3\05_Declarations.html#declaration) | [*联合式(Union Style)的枚举case子句*](..\chapter3\05_Declarations.html#union_style_enum_case_clause) +> *联合式(Union Style)的枚举case子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **case** [*联合式(Union Style)的枚举case列表*](..\chapter3\05_Declarations.html#union_style_enum_case_list) +> *联合式(Union Style)的枚举case列表* → [*联合式(Union Style)的case*](..\chapter3\05_Declarations.html#union_style_enum_case) | [*联合式(Union Style)的case*](..\chapter3\05_Declarations.html#union_style_enum_case) **,** [*联合式(Union Style)的枚举case列表*](..\chapter3\05_Declarations.html#union_style_enum_case_list) +> *联合式(Union Style)的case* → [*枚举的case名*](..\chapter3\05_Declarations.html#enum_case_name) [*元组类型*](..\chapter3\03_Types.html#tuple_type) _可选_ +> *枚举名* → [*标识符*](LexicalStructure.html#identifier) +> *枚举的case名* → [*标识符*](LexicalStructure.html#identifier) +> *原始值式枚举* → [*枚举名*](..\chapter3\05_Declarations.html#enum_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ **:** [*类型标识*](..\chapter3\03_Types.html#type_identifier) **{** [*原始值式枚举成员列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_members) _可选_ **}** +> *原始值式枚举成员列表* → [*原始值式枚举成员*](..\chapter3\05_Declarations.html#raw_value_style_enum_member) [*原始值式枚举成员列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_members) _可选_ +> *原始值式枚举成员* → [*声明*](..\chapter3\05_Declarations.html#declaration) | [*原始值式枚举case子句*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_clause) +> *原始值式枚举case子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **case** [*原始值式枚举case列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_list) +> *原始值式枚举case列表* → [*原始值式枚举case*](..\chapter3\05_Declarations.html#raw_value_style_enum_case) | [*原始值式枚举case*](..\chapter3\05_Declarations.html#raw_value_style_enum_case) **,** [*原始值式枚举case列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_list) +> *原始值式枚举case* → [*枚举的case名*](..\chapter3\05_Declarations.html#enum_case_name) [*原始值赋值*](..\chapter3\05_Declarations.html#raw_value_assignment) _可选_ +> *原始值赋值* → **=** [*字面量*](LexicalStructure.html#literal) + + +##结构体声明 + +使用结构体声明可以在你的程序里引入一个结构体类型。结构体声明使用struct关键字,遵循如下的形式: + +> struct `structure name`: `adopted protocols` { +> `declarations` +> } + +结构体内包含零或多个声明。这些声明可以包括存储型和计算型属性,静态属性,实例方法,静态方法,构造器, +类型别名,甚至其他结构体,类,和枚举声明。结构体声明不能包含析构器或者协议声明。详细讨论和包含多种结构体 +声明的实例,参见类和结构体一节。 + +结构体可以包含任意数量的协议,但是不能继承自类,枚举或者其他结构体。 + +有三种方法可以创建一个声明过的结构体实例: + +-调用结构体内声明的构造器,参照构造器(initializers)一节。 + +—如果没有声明构造器,调用结构体的逐个构造器,详情参见Memberwise Initializers for Structure Types. + +—如果没有声明析构器,结构体的所有属性都有初始值,调用结构体的默认构造器,详情参见默认构造器(Default Initializers). + +结构体的构造过程参见初始化(initiaization)一节。 + +结构体实例属性可以用点(.)来获得,详情参见获得属性(Accessing Properties)一节。 + +结构体是值类型;结构体的实例在被赋予变量或常量,被函数调用时被复制。获得关于值类型更多信息,参见 +结构体和枚举都是值类型(Structures and Enumerations Are Value Types)一节。 + +你可以使用扩展声明来扩展结构体类型的行为,参见扩展声明(Extension Declaration). + +> 结构体声明语法 +> *结构体声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **struct** [*结构体名称*](..\chapter3\05_Declarations.html#struct_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*结构体主体*](..\chapter3\05_Declarations.html#struct_body) +> *结构体名称* → [*标识符*](LexicalStructure.html#identifier) +> *结构体主体* → **{** [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ **}** + + +##类声明 + +你可以在你的程序中使用类声明来引入一个类。类声明使用关键字class,遵循如下的形式: + +> class `class name`: `superclass`, `adopted protocols` { +> `declarations` +> } + +一个类内包含零或多个声明。这些声明可以包括存储型和计算型属性,实例方法,类方法,构造器,单独的析构器方法, +类型别名,甚至其他结构体,类,和枚举声明。类声明不能包含协议声明。详细讨论和包含多种类声明的实例,参见类和 +结构体一节。 + +一个类只能继承一个父类,超类,但是可以包含任意数量的协议。这些超类第一次在type-inheritance-clause出现,遵循任意协议。 + +正如在初始化声明(Initializer Declaration)谈及的那样,类可以有指定和方便的构造器。当你声明任一中构造器时, +你可以使用requierd变量来标记构造器,要求任意子类来重写它。指定类的构造器必须初始化类所有的已声明的属性, +它必须在子类构造器调用前被执行。 + +类可以重写属性,方法和它的超类的构造器。重写的方法和属性必须以override标注。 + +虽然超类的属性和方法声明可以被当前类继承,但是超类声明的指定构造器却不能。这意味着,如果当前类重写了超类 +的所有指定构造器,它就继承了超类的方便构造器。Swift的类并不是继承自一个全局基础类。 + +有两种方法来创建已声明的类的实例: + +- 调用类的一个构造器,参见构造器(initializers)。 +- 如果没有声明构造器,而且类的所有属性都被赋予了初始值,调用类的默认构造器,参见默认构造器(default initializers). + +类实例属性可以用点(.)来获得,详情参见获得属性(Accessing Properties)一节。 + +类是引用类型;当被赋予常量或变量,函数调用时,类的实例是被引用,而不是复制。获得更多关于引用类型的信息, +结构体和枚举都是值类型(Structures and Enumerations Are Value Types)一节。 + +你可以使用扩展声明来扩展类的行为,参见扩展声明(Extension Declaration). + +> 类声明语法 +> *类声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **class** [*类名*](..\chapter3\05_Declarations.html#class_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*类主体*](..\chapter3\05_Declarations.html#class_body) +> *类名* → [*标识符*](LexicalStructure.html#identifier) +> *类主体* → **{** [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ **}** + + +##协议声明(translated by 小一) + +一个协议声明为你的程序引入一个命名了的协议类型。协议声明使用 `protocol` 关键词来进行声明并有下面这样的形式: + +> protocol `protocol name`: `inherited protocols` { +> `protocol member declarations` +> } + +协议的主体包含零或多个协议成员声明,这些成员描述了任何采用该协议必须满足的一致性要求。特别的,一个协议可以声明必须实现某些属性、方法、初始化程序及下标脚本的一致性类型。协议也可以声明专用种类的类型别名,叫做关联类型,它可以指定协议的不同声明之间的关系。协议成员声明会在下面的详情里进行讨论。 + +协议类型可以从很多其它协议那继承。当一个协议类型从其它协议那继承的时候,来自其它协议的所有要求就集合了,而且从当前协议继承的任何类型必须符合所有的这些要求。对于如何使用协议继承的例子,查看[协议继承](../chapter2/21_Protocols.html#protocol_inheritance) + +> 注意: +你也可以使用协议合成类型集合多个协议的一致性要求,详情参见[协议合成类型](../chapter3/03_Types.html#protocol_composition_type)和[协议合成](../chapter2/21_Protocols.html#protocol_composition) + +你可以通过采用在类型的扩展声明中的协议来为之前声明的类型添加协议一致性。在扩展中你必须实现所有采用协议的要求。如果该类型已经实现了所有的要求,你可以让这个扩展声明的主题留空。 + +默认地,符合某一个协议的类型必须实现所有声明在协议中的属性、方法和下标脚本。也就是说,你可以用`optional`属性标注这些协议成员声明以指定它们的一致性类型实现是可选的。`optional`属性仅仅可以用于使用`objc`属性标记过的协议。这样的结果就是仅仅类类型可以采用并符合包含可选成员要求的协议。更多关于如何使用`optional`属性的信息及如何访问可选协议成员的指导——比如当你不能肯定是否一致性的类型实现了它们——参见[可选协议要求](../chapter2/21_Protocols.html#optional_protocol_requirements) + +为了限制协议的采用仅仅针对类类型,需要使用`class_protocol`属性标记整个协议声明。任意继承自标记有`class_protocol`属性协议的协议都可以智能地仅能被类类型采用。 + +>注意: +如果协议已经用`object`属性标记了,`class_protocol`属性就隐性地应用于该协议;没有必要再明确地使用`class_protocol`属性来标记该协议了。 + +协议是命名的类型,因此它们可以以另一个命名类型出现在你代码的所有地方,就像[协议类型](../chapter2/21_Protocols.html#protocols_as_types)里讨论的那样。然而你不能构造一个协议的实例,因为协议实际上不提供它们指定的要求的实现。 + +你可以使用协议来声明一个类的代理的方法或者应该实现的结构,就像[委托(代理)模式](../chapter2/21_Protocols.html#delegation)描述的那样。 + +> 协议(Protocol)声明语法 +> *协议声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **protocol** [*协议名*](..\chapter3\05_Declarations.html#protocol_name) [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*协议主体*](..\chapter3\05_Declarations.html#protocol_body) +> *协议名* → [*标识符*](LexicalStructure.html#identifier) +> *协议主体* → **{** [*协议成员声明(Declarations)列表*](..\chapter3\05_Declarations.html#protocol_member_declarations) _可选_ **}** +> *协议成员声明* → [*协议属性声明*](..\chapter3\05_Declarations.html#protocol_property_declaration) +> *协议成员声明* → [*协议方法声明*](..\chapter3\05_Declarations.html#protocol_method_declaration) +> *协议成员声明* → [*协议构造器声明*](..\chapter3\05_Declarations.html#protocol_initializer_declaration) +> *协议成员声明* → [*协议附属脚本声明*](..\chapter3\05_Declarations.html#protocol_subscript_declaration) +> *协议成员声明* → [*协议关联类型声明*](..\chapter3\05_Declarations.html#protocol_associated_type_declaration) +> *协议成员声明(Declarations)列表* → [*协议成员声明*](..\chapter3\05_Declarations.html#protocol_member_declaration) [*协议成员声明(Declarations)列表*](..\chapter3\05_Declarations.html#protocol_member_declarations) _可选_ + + +###协议属性声明 + +协议声明了一致性类型必须在协议声明的主体里通过引入一个协议属性声明来实现一个属性。协议属性声明有一种特殊的类型声明形式: + +> var `property name`: `type` { get set } + +同其它协议成员声明一样,这些属性声明仅仅针对符合该协议的类型声明了`getter`和`setter`要求。结果就是你不需要在协议里它被声明的地方实现`getter`和`setter`。 + +`getter`和`setter`要求可以通过一致性类型以各种方式满足。如果属性声明包含`get`和`set`关键词,一致性类型就可以用可读写(实现了`getter`和`setter`)的存储型变量属性或计算型属性,但是属性不能以常量属性或只读计算型属性实现。如果属性声明仅仅包含`get`关键词的话,它可以作为任意类型的属性被实现。比如说实现了协议的属性要求的一致性类型,参见[属性要求](../chapter2/21_Protocols.html#property_requirements) + +更多参见[变量声明](../chapter3/05_Declarations.html#variable_declaration) + +> 协议属性声明语法 +> *协议属性声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block) + +###协议方法声明 + +协议声明了一致性类型必须在协议声明的主体里通过引入一个协议方法声明来实现一个方法. +协议方法声明和函数方法声明有着相同的形式,包含如下两条规则:它们不包括函数体,你不能在类的声明内为它们的 +参数提供初始值.举例来说,符合的类型执行协议必需的方法。参见必需方法一节。 + +使用关键字class可以在协议声明中声明一个类或必需的静态方法。执行这些方法的类也用关键字class声明。 +相反的,执行这些方法的结构体必须以关键字static声明。如果你想使用扩展方法,在扩展类时使用class关键字, +在扩展结构体时使用static关键字。 + +更多请参阅函数声明。 + +> 协议方法声明语法 +> *协议方法声明* → [*函数头*](..\chapter3\05_Declarations.html#function_head) [*函数名*](..\chapter3\05_Declarations.html#function_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*函数签名(Signature)*](..\chapter3\05_Declarations.html#function_signature) + +###协议构造器声明 + +协议声明了一致性类型必须在协议声明的主体里通过引入一个协议构造器声明来实现一个构造器。协议构造器声明 +除了不包含构造器体外,和构造器声明有着相同的形式, + +更多请参阅构造器声明。 + +> 协议构造器声明语法 +> *协议构造器声明* → [*构造器头(Head)*](..\chapter3\05_Declarations.html#initializer_head) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) + +###协议下标脚本声明 + +协议声明了一致性类型必须在协议声明的主体里通过引入一个协议下标脚本声明来实现一个下标脚本。协议属性声明 +对下标脚本声明有一个特殊的形式: + +> subscript (`parameters`) -> `return type` { get set } + +下标脚本声明只为和协议一致的类型声明了必需的最小数量的的getter和setter。如果下标脚本申明包含get和set关键字, +一致的类型也必须有一个getter和setter语句。如果下标脚本声明值包含get关键字,一致的类型必须至少包含一个 +getter语句,可以选择是否包含setter语句。 + +更多参阅下标脚本声明。 + +> 协议附属脚本声明语法 +> *协议附属脚本声明* → [*附属脚本头(Head)*](..\chapter3\05_Declarations.html#subscript_head) [*附属脚本结果(Result)*](..\chapter3\05_Declarations.html#subscript_result) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block) + +###协议相关类型声明 + +协议声明相关类型使用关键字typealias。相关类型为作为协议声明的一部分的类型提供了一个别名。相关类型和参数 +语句中的类型参数很相似,但是它们在声明的协议中包含self关键字。在这些语句中,self指代和协议一致的可能的类型。 +获得更多信息和例子,查看相关类型或类型别名声明。 + +> 协议关联类型声明语法 +> *协议关联类型声明* → [*类型别名头(Head)*](..\chapter3\05_Declarations.html#typealias_head) [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*类型别名赋值*](..\chapter3\05_Declarations.html#typealias_assignment) _可选_ + + +##构造器声明 + +构造器声明会为程序内的类,结构体或枚举引入构造器。构造器使用关键字Init来声明,遵循两条基本形式。 + +结构体,枚举,类可以有任意数量的构造器,但是类的构造器的规则和行为是不一样的。不像结构体和枚举那样,类 +有两种结构体,designed initializers 和convenience initializers,参见构造器一节。 + +如下的形式声明了结构体,枚举和类的指定构造器: + +> init(`parameters`) { +> `statements` +> } + +类的指定构造器将类的所有属性直接初始化。如果类有超类,它不能调用该类的其他构造器,它只能调用超类的一个 +指定构造器。如果该类从它的超类处继承了任何属性,这些属性在当前类内被赋值或修饰时,必须带哦用一个超类的 +指定构造器。 + +指定构造器可以在类声明的上下文中声明,因此它不能用扩展声明的方法加入一个类中。 + +结构体和枚举的构造器可以带哦用其他的已声明的构造器,来委托其中一个火全部进行初始化过程。 + +以关键字convenience来声明一个类的便利构造器: + +> convenience init(`parameters`) { +> `statements` +> } + +便利构造器可以将初始化过程委托给另一个便利构造器或类的一个指定构造器。这意味着,类的初始化过程必须 +以一个将所有类属性完全初始化的指定构造器的调用作为结束。便利构造器不能调用超类的构造器。 + +你可以使用requierd关键字,将便利构造器和指定构造器标记为每个子类的构造器都必须拥有的。因为指定构造器 +不被子类继承,它们必须被立即执行。当子类直接执行所有超类的指定构造器(或使用便利构造器重写指定构造器)时, +必需的便利构造器可以被隐式的执行,亦可以被继承。不像方法,下标脚本那样,你不需要为这些重写的构造器标注 +overrride关键字。 + +查看更多关于不同声明方法的构造器的例子,参阅构造过程一节。 + +> 构造器声明语法 +> *构造器声明* → [*构造器头(Head)*](..\chapter3\05_Declarations.html#initializer_head) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*构造器主体*](..\chapter3\05_Declarations.html#initializer_body) +> *构造器头(Head)* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **convenience** _可选_ **init** +> *构造器主体* → [*代码块*](..\chapter3\05_Declarations.html#code_block) + + +##析构声明 + +析构声明为类声明了一个析构器。析构器没有参数,遵循如下的格式: + +> deinit { +> `statements` +> } + +当类没有任何语句时将要被释放时,析构器会自动的被调用。析构器在类的声明体内只能被声明一次——但是不能在 +类的扩展声明内,每个类最多只能有一个。 + +子类继承了它的超类的析构器,在子类将要被释放时隐式的调用。子类在所有析构器被执行完毕前不会被释放。 + +析构器不会被直接调用。 + +查看例子和如何在类的声明中使用析构器,参见析构过程一节。 + +> 析构器声明语法 +> *析构器声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **deinit** [*代码块*](..\chapter3\05_Declarations.html#code_block) + + +##扩展声明 + +扩展声明用于扩展一个现存的类,结构体,枚举的行为。扩展声明以关键字extension开始,遵循如下的规则: + +> extension `type`: `adopted protocols` { +> `declarations` +> } + +一个扩展声明体包括零个或多个声明。这些声明可以包括计算型属性,计算型静态属性,实例方法,静态和类方法,构造器, +下标脚本声明,甚至其他结构体,类,和枚举声明。扩展声明不能包含析构器,协议声明,存储型属性,属性监测器或其他 +的扩展属性。详细讨论和查看包含多种扩展声明的实例,参见扩展一节。 + +扩展声明可以向现存的类,结构体,枚举内添加一致的协议。扩展声明不能向一个类中添加继承的类,因此 +type-inheritance-clause是一个只包含协议列表的扩展声明。 + +属性,方法,现存类型的构造器不能被它们类型的扩展所重写。 + +扩展声明可以包含构造器声明,这意味着,如果你扩展的类型在其他模块中定义,构造器声明必须委托另一个在 +那个模块里声明的构造器来恰当的初始化。 + +> 扩展(Extension)声明语法 +> *扩展声明* → **extension** [*类型标识*](..\chapter3\03_Types.html#type_identifier) [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*extension-body*](..\chapter3\05_Declarations.html#extension_body) +> *extension-body* → **{** [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ **}** + + +##下标脚本声明(translated by 林) + +附属脚本用于向特定类型添加附属脚本支持,通常为访问集合,列表和序列的元素时提供语法便利。附属脚本声明使用关键字`subscript`,声明形式如下: + +> subscript (`parameter`) -> (return type){ +> get{ +> `statements` +> } +> set(`setter name`){ +> `statements` +> } +> } + +附属脚本声明只能在类,结构体,枚举,扩展和协议声明的上下文进行声明。 + +_变量(parameters)_指定一个或多个用于在相关类型的下标脚本中访问元素的索引(例如,表达式`object[i]`中的`i`)。尽管用于元素访问的索引可以是任意类型的,但是每个变量必须包含一个用于指定每种索引类型的类型标注。_返回类型(return type)_指定被访问的元素的类型。 + +和计算性属性一样,下标脚本声明支持对访问元素的读写操作。getter用于读取值,setter用于写入值。setter子句是可选的,当仅需要一个getter子句时,可以将二者都忽略且直接返回请求的值即可。也就是说,如果使用了setter子句,就必须使用getter子句。 + +setter的名字和封闭的括号是可选的。如果使用了setter名称,它会被当做传给setter的变量的名称。如果不使用setter名称,那么传给setter的变量的名称默认是`value`。setter名称的类型必须与_返回类型(return type)_的类型相同。 + +可以在下标脚本声明的类型中,可以重载下标脚本,只要_变量(parameters)_或_返回类型(return type)_与先前的不同即可。此时,必须使用`override`关键字声明那个被覆盖的下标脚本。(注:好乱啊!到底是重载还是覆盖?!) + +同样可以在协议声明的上下文中声明下标脚本,[Protocol Subscript Declaration](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/doc/uid/TP40014097-CH34-XID_619)中有所描述。 + +更多关于下标脚本和下标脚本声明的例子,请参考[Subscripts](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Subscripts.html#//apple_ref/doc/uid/TP40014097-CH16-XID_393)。 + +> 附属脚本声明语法 +> *附属脚本声明* → [*附属脚本头(Head)*](..\chapter3\05_Declarations.html#subscript_head) [*附属脚本结果(Result)*](..\chapter3\05_Declarations.html#subscript_result) [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *附属脚本声明* → [*附属脚本头(Head)*](..\chapter3\05_Declarations.html#subscript_head) [*附属脚本结果(Result)*](..\chapter3\05_Declarations.html#subscript_result) [*getter-setter块*](..\chapter3\05_Declarations.html#getter_setter_block) +> *附属脚本声明* → [*附属脚本头(Head)*](..\chapter3\05_Declarations.html#subscript_head) [*附属脚本结果(Result)*](..\chapter3\05_Declarations.html#subscript_result) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block) +> *附属脚本头(Head)* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **subscript** [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) +> *附属脚本结果(Result)* → **->** [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type) + + +##运算符声明(translated by 林) + +运算符声明会向程序中引入中缀、前缀或后缀运算符,它使用上下文关键字`operator`声明。 +可以声明三种不同的缀性:中缀、前缀和后缀。操作符的缀性描述了操作符与它的操作数的相对位置。 +运算符声明有三种基本形式,每种缀性各一种。运算符的缀性通过在`operator`和运算符之间添加上下文关键字`infix`,`prefix`或`postfix`来指定。每种形式中,运算符的名字只能包含[Operators](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-XID_871)中定义的运算符字符。 + +下面的这种形式声明了一个新的中缀运算符: +> operator infix `operator name`{ +> previewprecedence `precedence level` +> associativity `associativity` +> } + +_中缀_运算符是二元运算符,它可以被置于两个操作数之间,比如表达式`1 + 2` 中的加法运算符(`+`)。 + +中缀运算符可以可选地指定优先级,结合性,或两者同时指定。 + +运算符的_优先级_可以指定在没有括号包围的情况下,运算符与它的操作数如何紧密绑定的。可以使用上下文关键字`precedence`并_优先级(precedence level)_一起来指定一个运算符的优先级。_优先级_可以是0到255之间的任何一个数字(十进制整数);与十进制整数字面量不同的是,它不可以包含任何下划线字符。尽管优先级是一个特定的数字,但它仅用作与另一个运算符比较(大小)。也就是说,一个操作数可以同时被两个运算符使用时,例如`2 + 3 * 5`,优先级更高的运算符将优先与操作数绑定。 + +运算符的_结合性_可以指定在没有括号包围的情况下,优先级相同的运算符以何种顺序被分组的。可以使用上下文关键字`associativity`并_结合性(associativity)_一起来指定一个运算符的结合性,其中_结合性_可以说是上下文关键字`left`,`right`或`none`中的任何一个。左结合运算符以从左到右的形式分组。例如,减法运算符(`-`)具有左结合性,因此`4 - 5 - 6`被以`(4 - 5) - 6`的形式分组,其结果为`-7`。 +右结合运算符以从右到左的形式分组,对于设置为`none`的非结合运算符,它们不以任何形式分组。具有相同优先级的非结合运算符,不可以互相邻接。例如,表达式`1 < 2 < 3`非法的。 + +声明时不指定任何优先级或结合性的中缀运算符,它们的优先级会被初始化为100,结合性被初始化为`none`。 + +下面的这种形式声明了一个新的前缀运算符: +> operator prefix `operator name`{} + +紧跟在操作数前边的_前缀运算符(prefix operator)_是一元运算符,例如表达式`++i`中的前缀递增运算符(`++`)。 + +前缀运算符的声明中不指定优先级。前缀运算符是非结合的。 + +下面的这种形式声明了一个新的后缀运算符: + +> operator postfix `operator name`{} + +紧跟在操作数后边的_后缀运算符(postfix operator)_是一元运算符,例如表达式`i++`中的前缀递增运算符(`++`)。 + +和前缀运算符一样,后缀运算符的声明中不指定优先级。后缀运算符是非结合的。 + +声明了一个新的运算符以后,需要声明一个跟这个运算符同名的函数来实现这个运算符。如何实现一个新的运算符,请参考[Custom Operators](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AdvancedOperators.html#//apple_ref/doc/uid/TP40014097-CH27-XID_48)。 + +> 运算符声明语法 +> *运算符声明* → [*前置运算符声明*](..\chapter3\05_Declarations.html#prefix_operator_declaration) | [*后置运算符声明*](..\chapter3\05_Declarations.html#postfix_operator_declaration) | [*中置运算符声明*](..\chapter3\05_Declarations.html#infix_operator_declaration) +> *前置运算符声明* → **运算符** **prefix** [*运算符*](LexicalStructure.html#operator) **{** **}** +> *后置运算符声明* → **运算符** **postfix** [*运算符*](LexicalStructure.html#operator) **{** **}** +> *中置运算符声明* → **运算符** **infix** [*运算符*](LexicalStructure.html#operator) **{** [*中置运算符属性*](..\chapter3\05_Declarations.html#infix_operator_attributes) _可选_ **}** +> *中置运算符属性* → [*优先级子句*](..\chapter3\05_Declarations.html#precedence_clause) _可选_ [*结和性子句*](..\chapter3\05_Declarations.html#associativity_clause) _可选_ +> *优先级子句* → **precedence** [*优先级水平*](..\chapter3\05_Declarations.html#precedence_level) +> *优先级水平* → 数值 0 到 255 +> *结和性子句* → **associativity** [*结和性*](..\chapter3\05_Declarations.html#associativity) +> *结和性* → **left** | **right** | **none** diff --git a/source/chapter3/06_Attributes.md b/source/chapter3/06_Attributes.md old mode 100644 new mode 100755 index 657a22d0..2964128d --- a/source/chapter3/06_Attributes.md +++ b/source/chapter3/06_Attributes.md @@ -1,115 +1,124 @@ -# 特性 - -特性提供了关于声明和类型的更多信息。在Swift中有两类特性,用于修饰声明的以及用于修饰类型的。例如,`required`特性,当应用于一个类的指定或便利初始化器声明时,表明它的每个子类都必须实现那个初始化器。再比如`noreturn`特性,当应用于函数或方法类型时,表明该函数或方法不会返回到它的调用者。 - -通过以下方式指定一个特性:符号`@`后面跟特性名,如果包含参数,则把参数带上: - -``` -@attribute name -@attribute name(attribute arguments) -``` - -有些声明特性通过接收参数来指定特性的更多信息以及它是如何修饰一个特定的声明的。这些特性的参数写在小括号内,它们的格式由它们所属的特性来定义。 - -## 声明特性 - -声明特性只能应用于声明。然而,你也可以将`noreturn`特性应用于函数或方法类型。 - -`assignment` - -该特性用于修饰重载了复合赋值运算符的函数。重载了复合赋值运算符的函数必需将它们的初始输入参数标记为`inout`。如何使用`assignment`特性的一个例子,请见:[复合赋值运算符]()。 - -`class_protocol` - -该特性用于修饰一个协议表明该协议只能被类类型采用[待改:adopted]。 - -如果你用`objc`特性修饰一个协议,`class_protocol`特性就会隐式地应用到该协议,因此无需显式地用`class_protocol`特性标记该协议。 - -`exported` - -该特性用于修饰导入声明,以此来导出已导入的模块,子模块,或当前模块的声明。如果另一个模块导入了当前模块,那么那个模块可以访问当前模块的导出项。 - -`final` - -该特性用于修饰一个类或类中的属性,方法,以及下标成员。如果用它修饰一个类,那么这个类则不能被继承。如果用它修饰类中的属性,方法或下标,则表示在子类中,它们不能被重写。 - -`lazy` - -该特性用于修饰类或结构体中的存储型变量属性,表示该属性的初始值最多只被计算和存储一次,且发生在第一次访问它时。如何使用`lazy`特性的一个例子,请见:[惰性存储型属性]()。 - -`noreturn` - -该特性用于修饰函数或方法声明,表明该函数或方法的对应类型,`T`,是`@noreturn T`。你可以用这个特性修饰函数或方法的类型,这样一来,函数或方法就不会返回到它的调用者中去。 - -对于一个没有用`noreturn`特性标记的函数或方法,你可以将它重写(override)为用该特性标记的。相反,对于一个已经用`noreturn`特性标记的函数或方法,你则不可以将它重写为没使用该特性标记的。相同的规则试用于当你在一个comforming类型中实现一个协议方法时。 - -`NSCopying` - -该特性用于修饰一个类的存储型变量属性。该特性将使属性的setter与属性值的一个副本合成,由`copyWithZone`方法返回,而不是属性本身的值。该属性的类型必需遵循`NSCopying`协议。 - -`NSCopying`特性的行为与Objective-C中的`copy`特性相似。 - -`NSManaged` - -该特性用于修饰`NSManagedObject`子类中的存储型变量属性,表明属性的存储和实现由Core Data在运行时基于相关实体描述动态提供。 - -`objc` - -该特性用于修饰任意可以在Objective-C中表示的声明,比如,非嵌套类,协议,类和协议中的属性和方法(包含getter和setter),初始化器,析构器,以下下标。`objc`特性告诉编译器该声明可以在Objective-C代码中使用。 - -如果你将`objc`特性应用于一个类或协议,它也会隐式地应用于那个类或协议的成员。对于标记了`objc`特性的类,编译器会隐式地为它的子类添加`objc`特性。标记了`objc`特性的协议不能继承自没有标记`objc`的协议。 - -`objc`特性有一个可选的参数,由标记符组成。当你想把`objc`所修饰的实体以一个不同的名字暴露给Objective-C,你就可以使用这个特性参数。你可以使用这个参数来命名类,协议,方法,getters,setters,以及初始化器。下面的例子把`ExampleClass`中`enabled`属性的getter暴露给Objective-C,名字是`isEnabled`,而不是它原来的属性名。 - -``` -@objc -class ExampleClass { - var enabled: Bool { - @objc(isEnabled) get { - // Return the appropriate value - } - } -} -``` - -`optional` - -用该特性修饰协议的属性,方法或下标成员,表示实现这些成员并不需要一致性类型(conforming type)。 - -你只能用`optional`特性修饰那些标记了`objc`特性的协议。因此,只有类类型可以adopt和comform to那些包含可选成员需求的协议。更多关于如何使用`optional`特性以及如何访问可选协议成员的指导,例如,当你不确定一个conforming类型是否实现了它们,请见:[可选协议需求]()。 - -`required` - -用该特性修饰一个类的指定或便利初始化器,表示该类的所有子类都必需实现该初始化器。 - -加了该特性的指定初始化器必需显式地实现,而便利初始化器既可显式地实现,也可以在子类实现了超类所有指定初始化器后继承而来(或者当子类使用便利初始化器重写了指定初始化器)。 - -### Interface Builder使用的声明特性 - -Interface Builder特性是Interface Builder用来与Xcode同步的声明特性。Swift提供了以下的Interface Builder特性:`IBAction`,`IBDesignable`,`IBInspectable`,以及`IBOutlet`。这些特性与Objective-C中对应的特性在概念上是相同的。 - -`IBOutlet`和`IBInspectable`用于修饰一个类的属性声明;`IBAction`特性用于修饰一个类的方法声明;`IBDesignable`用于修饰类的声明。 - -## 类型特性 - -类型特性只能用于修饰类型。然而,你也可以用`noreturn`特性去修饰函数或方法声明。 - -`auto_closure` - -这个特性通过自动地将表达式封闭到一个无参数闭包中来延迟表达式的求值。使用该特性修饰无参的函数或方法类型,返回表达式的类型。一个如何使用`auto_closure`特性的例子,见[函数类型]() - -`noreturn` - -该特性用于修饰函数或方法的类型,表明该函数或方法不会返回到它的调用者中去。你也可以用它标记函数或方法的声明,表示函数或方法的相应类型,`T`,是`@noreturn T`。 - -> 特性的语法 -> attribute -> @ [attribute-name]() [attribute-argument-clause]()opt -> attribute-name -> [identifier]() -> attribute-argument-clause -> ( [balanced-tokens]()opt ) -> attributes -> [attribute]() [attributes]()opt -> balanced-tokens -> [balanced-token]() [balanced-tokens]()opt -> balanced-token -> ( [balanced-tokens]()opt ) -> balanced-token -> [ [balanced-tokens]()opt ] -> balanced-token -> { [balanced-tokens]()opt } -> balanced-token -> 任意标识符,关键字,字面量,或运算符 -> balanced-token -> 任意标点符号,除了(, ), [, ], {, 或 } +> 翻译:[Hawstein](https://github.com/Hawstein) +> 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + +# 特性 +----------------- + +本页内容包括: + +- [声明特性](#declaration_attributes) +- [类型特性](#type_attributes) + +特性提供了关于声明和类型的更多信息。在Swift中有两类特性,用于修饰声明的以及用于修饰类型的。例如,`required`特性,当应用于一个类的指定或便利初始化器声明时,表明它的每个子类都必须实现那个初始化器。再比如`noreturn`特性,当应用于函数或方法类型时,表明该函数或方法不会返回到它的调用者。 + +通过以下方式指定一个特性:符号`@`后面跟特性名,如果包含参数,则把参数带上: + +> @`attribute name` +> @`attribute name`(`attribute arguments`) + +有些声明特性通过接收参数来指定特性的更多信息以及它是如何修饰一个特定的声明的。这些特性的参数写在小括号内,它们的格式由它们所属的特性来定义。 + + +## 声明特性 + +声明特性只能应用于声明。然而,你也可以将`noreturn`特性应用于函数或方法类型。 + +`assignment` + +该特性用于修饰重载了复合赋值运算符的函数。重载了复合赋值运算符的函数必需将它们的初始输入参数标记为`inout`。如何使用`assignment`特性的一个例子,请见:[复合赋值运算符]()。 + +`class_protocol` + +该特性用于修饰一个协议表明该协议只能被类类型采用[待改:adopted]。 + +如果你用`objc`特性修饰一个协议,`class_protocol`特性就会隐式地应用到该协议,因此无需显式地用`class_protocol`特性标记该协议。 + +`exported` + +该特性用于修饰导入声明,以此来导出已导入的模块,子模块,或当前模块的声明。如果另一个模块导入了当前模块,那么那个模块可以访问当前模块的导出项。 + +`final` + +该特性用于修饰一个类或类中的属性,方法,以及下标成员。如果用它修饰一个类,那么这个类则不能被继承。如果用它修饰类中的属性,方法或下标,则表示在子类中,它们不能被重写。 + +`lazy` + +该特性用于修饰类或结构体中的存储型变量属性,表示该属性的初始值最多只被计算和存储一次,且发生在第一次访问它时。如何使用`lazy`特性的一个例子,请见:[惰性存储型属性]()。 + +`noreturn` + +该特性用于修饰函数或方法声明,表明该函数或方法的对应类型,`T`,是`@noreturn T`。你可以用这个特性修饰函数或方法的类型,这样一来,函数或方法就不会返回到它的调用者中去。 + +对于一个没有用`noreturn`特性标记的函数或方法,你可以将它重写(override)为用该特性标记的。相反,对于一个已经用`noreturn`特性标记的函数或方法,你则不可以将它重写为没使用该特性标记的。相同的规则试用于当你在一个comforming类型中实现一个协议方法时。 + +`NSCopying` + +该特性用于修饰一个类的存储型变量属性。该特性将使属性的setter与属性值的一个副本合成,由`copyWithZone`方法返回,而不是属性本身的值。该属性的类型必需遵循`NSCopying`协议。 + +`NSCopying`特性的行为与Objective-C中的`copy`特性相似。 + +`NSManaged` + +该特性用于修饰`NSManagedObject`子类中的存储型变量属性,表明属性的存储和实现由Core Data在运行时基于相关实体描述动态提供。 + +`objc` + +该特性用于修饰任意可以在Objective-C中表示的声明,比如,非嵌套类,协议,类和协议中的属性和方法(包含getter和setter),初始化器,析构器,以下下标。`objc`特性告诉编译器该声明可以在Objective-C代码中使用。 + +如果你将`objc`特性应用于一个类或协议,它也会隐式地应用于那个类或协议的成员。对于标记了`objc`特性的类,编译器会隐式地为它的子类添加`objc`特性。标记了`objc`特性的协议不能继承自没有标记`objc`的协议。 + +`objc`特性有一个可选的参数,由标记符组成。当你想把`objc`所修饰的实体以一个不同的名字暴露给Objective-C,你就可以使用这个特性参数。你可以使用这个参数来命名类,协议,方法,getters,setters,以及初始化器。下面的例子把`ExampleClass`中`enabled`属性的getter暴露给Objective-C,名字是`isEnabled`,而不是它原来的属性名。 + +```swift +@objc +class ExampleClass { + var enabled: Bool { + @objc(isEnabled) get { + // Return the appropriate value + } + } +} +``` + +`optional` + +用该特性修饰协议的属性,方法或下标成员,表示实现这些成员并不需要一致性类型(conforming type)。 + +你只能用`optional`特性修饰那些标记了`objc`特性的协议。因此,只有类类型可以adopt和comform to那些包含可选成员需求的协议。更多关于如何使用`optional`特性以及如何访问可选协议成员的指导,例如,当你不确定一个conforming类型是否实现了它们,请见:[可选协议需求]()。 + +`required` + +用该特性修饰一个类的指定或便利初始化器,表示该类的所有子类都必需实现该初始化器。 + +加了该特性的指定初始化器必需显式地实现,而便利初始化器既可显式地实现,也可以在子类实现了超类所有指定初始化器后继承而来(或者当子类使用便利初始化器重写了指定初始化器)。 + +### Interface Builder使用的声明特性 + +Interface Builder特性是Interface Builder用来与Xcode同步的声明特性。Swift提供了以下的Interface Builder特性:`IBAction`,`IBDesignable`,`IBInspectable`,以及`IBOutlet`。这些特性与Objective-C中对应的特性在概念上是相同的。 + +`IBOutlet`和`IBInspectable`用于修饰一个类的属性声明;`IBAction`特性用于修饰一个类的方法声明;`IBDesignable`用于修饰类的声明。 + + +## 类型特性 + +类型特性只能用于修饰类型。然而,你也可以用`noreturn`特性去修饰函数或方法声明。 + +`auto_closure` + +这个特性通过自动地将表达式封闭到一个无参数闭包中来延迟表达式的求值。使用该特性修饰无参的函数或方法类型,返回表达式的类型。一个如何使用`auto_closure`特性的例子,见[函数类型]() + +`noreturn` + +该特性用于修饰函数或方法的类型,表明该函数或方法不会返回到它的调用者中去。你也可以用它标记函数或方法的声明,表示函数或方法的相应类型,`T`,是`@noreturn T`。 + +> 特性语法 +> *特性* → **@** [*特性名*](..\chapter3\06_Attributes.html#attribute_name) [*特性参数子句*](..\chapter3\06_Attributes.html#attribute_argument_clause) _可选_ +> *特性名* → [*标识符*](LexicalStructure.html#identifier) +> *特性参数子句* → **(** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **)** +> *特性(Attributes)列表* → [*特色*](..\chapter3\06_Attributes.html#attribute) [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ +> *平衡令牌列表* → [*平衡令牌*](..\chapter3\06_Attributes.html#balanced_token) [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ +> *平衡令牌* → **(** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **)** +> *平衡令牌* → **[** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **]** +> *平衡令牌* → **{** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **}** +> *平衡令牌* → **任意标识符, 关键字, 字面量或运算符** +> *平衡令牌* → **任意标点除了(, ), [, ], {, 或 }** diff --git a/source/chapter3/07_Patterns.md b/source/chapter3/07_Patterns.md old mode 100644 new mode 100755 index e69de29b..a9697629 --- a/source/chapter3/07_Patterns.md +++ b/source/chapter3/07_Patterns.md @@ -0,0 +1,182 @@ +> 翻译:[honghaoz](https://github.com/honghaoz) +> 校对:[numbbbbb](https://github.com/numbbbbb), [stanzhai](https://github.com/stanzhai) + +# 模式(Patterns) +----------------- + +本页内容包括: + +- [通配符模式(Wildcard Pattern)](#wildcard_pattern) +- [标识符模式(Identifier Pattern)](#identifier_pattern) +- [值绑定模式(Value-Binding Pattern)](#value-binding_pattern) +- [元组模式(Tuple Pattern)](#tuple_pattern) +- [枚举用例模式(Enumeration Case Pattern)](#enumeration_case_pattern) +- [类型转换模式(Type-Casting Patterns)](#type-casting_patterns) +- [表达式模式(Expression Pattern)](#expression_pattern) + +模式(pattern)代表了单个值或者复合值的结构。例如,元组`(1, 2)`的结构是逗号分隔的,包含两个元素的列表。因为模式代表一种值的结构,而不是特定的某个值,你可以把模式和各种同类型的值匹配起来。比如,`(x, y)`可以匹配元组`(1, 2)`,以及任何含两个元素的元组。除了将模式与一个值匹配外,你可以从合成值中提取出部分或全部,然后分别把各个部分和一个常量或变量绑定起来。 + +在Swift中,模式出现在变量和常量的声明(在它们的左侧),`for-in`语句和`switch`语句(在它们的case标签)中。尽管任何模式都可以出现在`switch`语句的case标签中,但在其他情况下,只有通配符模式(wildcard pattern),标识符模式(identifier pattern)和包含这两种模式的模式才能出现。 + +你可以为通配符模式(wildcard pattern),标识符模式(identifier pattern)和元组模式(tuple pattern)指定类型注释,用来限制这种模式只匹配某种类型的值。 + +> 模式(Patterns) 语法 +> *模式* → [*通配符模式*](..\chapter3\07_Patterns.html#wildcard_pattern) [*类型注解*](..\chapter3\03_Types.html#type_annotation) _可选_ +> *模式* → [*标识符模式*](..\chapter3\07_Patterns.html#identifier_pattern) [*类型注解*](..\chapter3\03_Types.html#type_annotati(Value Binding)on) _可选_ +> *模式* → [*值绑定模式*](..\chapter3\07_Patterns.html#value_binding_pattern) +> *模式* → [*元组模式*](..\chapter3\07_Patterns.html#tuple_pattern) [*类型注解*](..\chapter3\03_Types.html#type_annotation) _可选_ +> *模式* → [*enum-case-pattern*](..\chapter3\07_Patterns.html#enum_case_pattern) +> *模式* → [*type-casting-pattern*](..\chapter3\07_Patterns.html#type_casting_pattern) +> *模式* → [*表达式模式*](..\chapter3\07_Patterns.html#expression_pattern) + + +## 通配符模式(Wildcard Pattern) + +通配符模式匹配并忽略任何值,包含一个下划线(_)。当你不关心被匹配的值时,可以使用此模式。例如,下面这段代码进行了`1...3`的循环,并忽略了每次循环的值: + +```swift +for _ in 1...3 { + // Do something three times. +} +``` + +> 通配符模式语法 +> *通配符模式* → **_** + + +## 标识符模式(Identifier Pattern) + +标识符模式匹配任何值,并将匹配的值和一个变量或常量绑定起来。例如,在下面的常量申明中,`someValue`是一个标识符模式,匹配了类型是`Int`的`42`。 + +```swift +let someValue = 42 +``` + +当匹配成功时,`42`被绑定(赋值)给常量`someValue`。 + +当一个变量或常量申明的左边是标识符模式时,此时,标识符模式是隐式的值绑定模式(value-binding pattern)。 + +> 标识符模式语法 +> *标识符模式* → [*标识符*](LexicalStructure.html#identifier) + + +## 值绑定模式(Value-Binding Pattern) + +值绑定模式绑定匹配的值到一个变量或常量。当绑定匹配值给常量时,用关键字`let`,绑定给变量时,用关键之`var`。 + +标识符模式包含在值绑定模式中,绑定新的变量或常量到匹配的值。例如,你可以分解一个元组的元素,并把每个元素绑定到相应的标识符模式中。 + +```swift +let point = (3, 2) +switch point { + // Bind x and y to the elements of point. +case let (x, y): + println("The point is at (\(x), \(y)).") +} +// prints "The point is at (3, 2).” +``` + +在上面这个例子中,`let`将元组模式`(x, y)`分配到各个标识符模式。因为这种行为,`switch`语句中`case let (x, y):`和`case (let x, let y):`匹配的值是一样的。 + +> 值绑定(Value Binding)模式语法 +> *值绑定模式* → **var** [*模式*](..\chapter3\07_Patterns.html#pattern) | **let** [*模式*](..\chapter3\07_Patterns.html#pattern) + + +## 元组模式(Tuple Pattern) + +元组模式是逗号分隔的列表,包含一个或多个模式,并包含在一对圆括号中。元组模式匹配相应元组类型的值。 + +你可以使用类型注释来限制一个元组模式来匹配某种元组类型。例如,在常量申明`let (x, y): (Int, Int) = (1, 2)`中的元组模式`(x, y): (Int, Int)`,只匹配两个元素都是`Int`这种类型的元组。如果仅需要限制一个元组模式中的某几个元素,只需要直接对这几个元素提供类型注释即可。例如,在`let (x: String, y)`中的元组模式,只要某个元组类型是包含两个元素,且第一个元素类型是`String`,则被匹配。 + +当元组模式被用在`for-in`语句或者变量或常量申明时,它可以包含通配符模式,标识符模式或者其他包含这两种模式的模式。例如,下面这段代码是不正确的,因为`(x, 0)`中的元素`0`是一个表达式模式: + +```swift +let points = [(0, 0), (1, 0), (1, 1), (2, 0), (2, 1)] +// This code isn't valid. +for (x, 0) in points { + /* ... */ +} +``` + +对于只包含一个元素的元组,括号是不起作用的。模式匹配那个单个元素的类型。例如,下面是等效的: + +```swift +let a = 2 // a: Int = 2 +let (a) = 2 // a: Int = 2 +let (a): Int = 2 // a: Int = 2 +``` + +> 元组模式语法 +> *元组模式* → **(** [*元组模式元素列表*](..\chapter3\07_Patterns.html#tuple_pattern_element_list) _可选_ **)** +> *元组模式元素列表* → [*元组模式元素*](..\chapter3\07_Patterns.html#tuple_pattern_element) | [*元组模式元素*](..\chapter3\07_Patterns.html#tuple_pattern_element) **,** [*元组模式元素列表*](..\chapter3\07_Patterns.html#tuple_pattern_element_list) +> *元组模式元素* → [*模式*](..\chapter3\07_Patterns.html#pattern) + + +## 枚举用例模式(Enumeration Case Pattern) + +枚举用例模式匹配现有的枚举类型的某种用例。枚举用例模式仅在`switch`语句中的`case`标签中出现。 + +如果你准备匹配的枚举用例有任何关联的值,则相应的枚举用例模式必须指定一个包含每个关联值元素的元组模式。关于使用`switch`语句来匹配包含关联值枚举用例的例子,请参阅`Associated Values`. + +> 枚举用例模式语法 +> *enum-case-pattern* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) _可选_ **.** [*枚举的case名*](..\chapter3\05_Declarations.html#enum_case_name) [*元组模式*](..\chapter3\07_Patterns.html#tuple_pattern) _可选_ + + +## 类型转换模式(Type-Casting Patterns) + +有两种类型转换模式,`is`模式和`as`模式。这两种模式均只出现在`switch`语句中的`case`标签中。`is`模式和`as`模式有以下形式: + +> is `type` +> `pattern` as `type` + +`is`模式匹配一个值,如果这个值的类型在运行时(runtime)和`is`模式右边的指定类型(或者那个类型的子类)是一致的。`is`模式和`is`操作符一样,它们都进行类型转换,但是抛弃了返回的类型。 + +`as`模式匹配一个值,如果这个值的类型在运行时(runtime)和`as`模式右边的指定类型(或者那个类型的子类)是一致的。一旦匹配成功,匹配的值的类型被转换成`as`模式左边指定的模式。 + +关于使用`switch`语句来匹配`is`模式和`as`模式值的例子,请参阅`Type Casting for Any and AnyObject`。 + +> 类型转换模式语法 +> *type-casting-pattern* → [*is模式*](..\chapter3\07_Patterns.html#is_pattern) | [*as模式*](..\chapter3\07_Patterns.html#as_pattern) +> *is模式* → **is** [*类型*](..\chapter3\03_Types.html#type) +> *as模式* → [*模式*](..\chapter3\07_Patterns.html#pattern) **as** [*类型*](..\chapter3\03_Types.html#type) + + +## 表达式模式(Expression Pattern) + +表达式模式代表了一个表达式的值。这个模式只出现在`switch`语句中的`case`标签中。 + +由表达式模式所代表的表达式用Swift标准库中的`~=`操作符与输入表达式的值进行比较。如果`~=`操作符返回`true`,则匹配成功。默认情况下,`~=`操作符使用`==`操作符来比较两个相同类型的值。它也可以匹配一个整数值与一个`Range`对象中的整数范围,正如下面这个例子所示: + +```swift +let point = (1, 2) +switch point { +case (0, 0): + println("(0, 0) is at the origin.") +case (-2...2, -2...2): + println("(\(point.0), \(point.1)) is near the origin.") +default: + println("The point is at (\(point.0), \(point.1)).") +} +// prints "(1, 2) is near the origin.” +``` + +你可以重载`~=`操作符来提供自定义的表达式行为。例如,你可以重写上面的例子,以实现用字符串表达的点来比较`point`表达式。 + +```swift +// Overload the ~= operator to match a string with an integer +func ~=(pattern: String, value: Int) -> Bool { + return pattern == "\(value)" +} +switch point { +case ("0", "0"): + println("(0, 0) is at the origin.") +case ("-2...2", "-2...2"): + println("(\(point.0), \(point.1)) is near the origin.") +default: + println("The point is at (\(point.0), \(point.1)).") +} +// prints "(1, 2) is near the origin.” +``` + +> 表达式模式语法 +> *表达式模式* → [*表达式*](..\chapter3\04_Expressions.html#expression) \ No newline at end of file diff --git a/source/chapter3/08_Generic_Parameters_and_Arguments.md b/source/chapter3/08_Generic_Parameters_and_Arguments.md old mode 100644 new mode 100755 index 8032a029..ab76be6b --- a/source/chapter3/08_Generic_Parameters_and_Arguments.md +++ b/source/chapter3/08_Generic_Parameters_and_Arguments.md @@ -1,106 +1,106 @@ -# 泛型参数 ---------- - -本页包含内容: - -* 泛型形参语句 -* 泛型实参语句 - -本节涉及泛型类型、泛型函数以及泛型构造器的参数,包括形参和实参。声明泛型类型、函数或构造器时,须指定相应的类型参数。类型参数相当于一个占位符,当实例化泛型类型、调用泛型函数或泛型构造器时,就用具体的类型实参替代之。 - -关于 Swift 语言的泛型概述,见[泛型](../charpter2/22_Generics.md)(第二部分第22章)。 - -## 泛型实参语句 -泛型形参语句指定泛型类型或函数的类型形参,以及这些参数的关联约束和要求。泛型形参语句用尖括号(<>)包住,并且有以下两种声明形式: - - - - -泛型形参列表中泛型形参用逗号分开,每一个采用以下形式: - - type parameter : constrain - -泛型形参由两部分组成:类型形参及其后的可选约束。类型形参只是占位符类型(如T,U,V,KeyType,ValueType等)的名字而已。你可以在泛型类型、函数的其余部分或者构造器声明,以及函数或构造器的签名中使用它。 - -约束用于指明该类型形参继承自某个类或者遵守某个协议或协议的一部分。例如,在下面的泛型中,泛型形参`T: Comparable`表示任何用于替代类型形参`T`的类型实参必须满足`Comparable`协议。 - - func simpleMin(x: T, y: T) -> T { - if x < y { - return y - } - return x - } - -如,`Int`和`Double`均满足`Comparable`协议,该函数接受任何一种类型。与泛型类型相反,调用泛型函数或构造器时不需要指定泛型实参语句。类型实参由传递给函数或构造器的实参推断而出。 - - simpleMin(17, 42) // T is inferred to be Int - simpleMin(3.14159, 2.71828) // T is inferred to be Double - -## Where语句 - -要想对类型形参及其关联类型指定额外要求,可以在泛型形参列表之后添加`where`语句。`where`语句由关键字`where`及其后的用逗号分割的多个要求组成。 - -`where`语句中的要求用于指明该类型形参继承自某个类或遵守某个协议或协议的一部分。尽管`where`语句有助于表达类型形参上的简单约束(如`T: Comparable`等同于`T where T: Comparable`,等等),但是依然可以用来对类型形参及其关联约束提供更复杂的约束。如,``表示泛型类型`T`继承自类`C`且遵守协议`P`。 - -如上所述,可以强制约束类型形参的关联类型遵守某个协议。``表示`T`遵守`Generator`协议,而且`T`的关联类型`T.Element`遵守`Eauatable`协议(`T`有关联类型是因为`Generator`声明了`Element`,而`T`遵守`Generator`协议)。 - -也可以用操作符`==`来指定两个类型等效的要求。例如,有这样一个约束:`T`和`U`遵守`Generator`协议,同时要求它们的关联类型等同,可以这样来表达:``。 - -当然,替代类型形参的类型实参必须满足所有类型形参所要求的约束和要求。 - -泛型函数或构造器可以重载,但在泛型形参语句中的类型形参必须有不同的约束或要求,抑或二者皆不同。当调用重载的泛型函数或构造器时,编译器会用这些约束来决定调用哪个重载函数或构造器。 - -泛型类可以生成一个子类,但是这个子类也必须是泛型类。 - -> Grammar of a generic parameter clause - -> parameter-clause → <­generic-parameter-list­requirement-clause > -> ->­generic-parameter-list → generic-parameter­ generic-parameter­,­generic-parameter-list ­ -> -> generic-parameter → type-name­ -> -> generic-parameter → type-name­:­type-identifier­ -> -> generic-parameter → type-name­:­protocol-composition-type­ - -> requirement-clause → `where`­requirement-list­ -> -> requirement-list → requirement­ requirement­,­requirement-list­ -> -> requirement → conformance-requirement­ same-type-requirement­ - -> conformance-requirement → type-identifier­:­type-identifier­ -> -> conformance-requirement → type-identifier­:­protocol-composition-type­ -> -> same-type-requirement → type-identifier­==­type-identifier - -## 泛型实参语句 - -泛型实参语句指定泛型类型的类型实参。泛型实参语句用尖括号(<>)包住,并且按如下形式声明: - - < generic argument list > - -泛型实参列表中类型实参有逗号分开。类型实参是实际具体类型的名字,用来替代泛型类型的泛型形参语句中的相应的类型形参。从而得到泛型类型的一个特化版本。如,Swift标准库的泛型字典类型定义如下: - - struct Dictionary: Collection, - DictionaryLiteralConvertible { - /* .. */ - } - -泛型`Dictionary`类型的特化版本,`Dictionary`就是用具体的`String`和`Int`类型替代泛型类型`KeyType: Hashable`和`ValueType`产生的。每一个类型实参必须满足它所替代的泛型形参的所有约束,包括任何`where`语句所指定的额外的要求。上面的例子中,类型形参`KeyType`要求满足`Hashable`协议,因此`String`也必须满足`Hashable`协议。 - -可以用本身就是泛型类型的特化版本的类型实参替代类型形参(假设已满足合适的约束和要求)。例如,为了生成一个元素类型是整型数组的数组,可以用数组的特化版本`Array`替代泛型类型`Array`的类型形参`T`来实现。 - - let arrayOfArrays: Array> = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] - -同泛型形参语句一样,不能用泛型实参语句来指定泛型函数或构造器的类型实参。 - -> Grammar of a generic argument clause - -> generic-argument-clause → <­generic-argument-list­>­ - -> generic-argument-list → generic-argument­ generic-argument­,­generic-argument-list­ - -> generic-argument → type +> 翻译:[fd5788](https://github.com/fd5788) +> 校对:[yankuangshi](https://github.com/yankuangshi), [stanzhai](https://github.com/stanzhai) + +# 泛型参数 +--------- + +本页包含内容: + +- [泛型形参子句](#generic_parameter) +- [泛型实参子句](#generic_argument) + +本节涉及泛型类型、泛型函数以及泛型构造器的参数,包括形参和实参。声明泛型类型、函数或构造器时,须指定相应的类型参数。类型参数相当于一个占位符,当实例化泛型类型、调用泛型函数或泛型构造器时,就用具体的类型实参替代之。 + +关于 Swift 语言的泛型概述,见[泛型](../charpter2/22_Generics.md)(第二部分第22章)。 + + +## 泛型形参子句 + +泛型形参子句指定泛型类型或函数的类型形参,以及这些参数的关联约束和要求。泛型形参子句用尖括号(<>)包住,并且有以下两种形式: + +> <`generic parameter list`> +> <`generic parameter list` where `requirements`> + +泛型形参列表中泛型形参用逗号分开,每一个采用以下形式: + +> `type parameter` : `constrain` + +泛型形参由两部分组成:类型形参及其后的可选约束。类型形参只是占位符类型(如T,U,V,KeyType,ValueType等)的名字而已。你可以在泛型类型、函数的其余部分或者构造器声明,以及函数或构造器的签名中使用它。 + +约束用于指明该类型形参继承自某个类或者遵守某个协议或协议的一部分。例如,在下面的泛型中,泛型形参`T: Comparable`表示任何用于替代类型形参`T`的类型实参必须满足`Comparable`协议。 + +```swift +func simpleMin(x: T, y: T) -> T { + if x < y { + return y + } + return x +} +``` + +如,`Int`和`Double`均满足`Comparable`协议,该函数接受任何一种类型。与泛型类型相反,调用泛型函数或构造器时不需要指定泛型实参子句。类型实参由传递给函数或构造器的实参推断而出。 + +```swift +simpleMin(17, 42) // T is inferred to be Int +simpleMin(3.14159, 2.71828) // T is inferred to be Double +``` + +## Where 子句 + +要想对类型形参及其关联类型指定额外要求,可以在泛型形参列表之后添加`where`子句。`where`子句由关键字`where`及其后的用逗号分割的多个要求组成。 + +`where`子句中的要求用于指明该类型形参继承自某个类或遵守某个协议或协议的一部分。尽管`where`子句有助于表达类型形参上的简单约束(如`T: Comparable`等同于`T where T: Comparable`,等等),但是依然可以用来对类型形参及其关联约束提供更复杂的约束。如,``表示泛型类型`T`继承自类`C`且遵守协议`P`。 + +如上所述,可以强制约束类型形参的关联类型遵守某个协议。``表示`T`遵守`Generator`协议,而且`T`的关联类型`T.Element`遵守`Eauatable`协议(`T`有关联类型是因为`Generator`声明了`Element`,而`T`遵守`Generator`协议)。 + +也可以用操作符`==`来指定两个类型等效的要求。例如,有这样一个约束:`T`和`U`遵守`Generator`协议,同时要求它们的关联类型等同,可以这样来表达:``。 + +当然,替代类型形参的类型实参必须满足所有类型形参所要求的约束和要求。 + +泛型函数或构造器可以重载,但在泛型形参子句中的类型形参必须有不同的约束或要求,抑或二者皆不同。当调用重载的泛型函数或构造器时,编译器会用这些约束来决定调用哪个重载函数或构造器。 + +泛型类可以生成一个子类,但是这个子类也必须是泛型类。 + +> 泛型形参子句语法 +> *泛型参数子句* → **<** [*泛型参数列表*](GenericParametersAndArguments.html#generic_parameter_list) [*约束子句*](GenericParametersAndArguments.html#requirement_clause) _可选_ **>** +> *泛型参数列表* → [*泛形参数*](GenericParametersAndArguments.html#generic_parameter) | [*泛形参数*](GenericParametersAndArguments.html#generic_parameter) **,** [*泛型参数列表*](GenericParametersAndArguments.html#generic_parameter_list) +> *泛形参数* → [*类型名称*](..\chapter3\03_Types.html#type_name) +> *泛形参数* → [*类型名称*](..\chapter3\03_Types.html#type_name) **:** [*类型标识*](..\chapter3\03_Types.html#type_identifier) +> *泛形参数* → [*类型名称*](..\chapter3\03_Types.html#type_name) **:** [*协议合成类型*](..\chapter3\03_Types.html#protocol_composition_type) +> *约束子句* → **where** [*约束列表*](GenericParametersAndArguments.html#requirement_list) +> *约束列表* → [*约束*](GenericParametersAndArguments.html#requirement) | [*约束*](GenericParametersAndArguments.html#requirement) **,** [*约束列表*](GenericParametersAndArguments.html#requirement_list) +> *约束* → [*一致性约束*](GenericParametersAndArguments.html#conformance_requirement) | [*同类型约束*](GenericParametersAndArguments.html#same_type_requirement) +> *一致性约束* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) **:** [*类型标识*](..\chapter3\03_Types.html#type_identifier) +> *一致性约束* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) **:** [*协议合成类型*](..\chapter3\03_Types.html#protocol_composition_type) +> *同类型约束* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) **==** [*类型标识*](..\chapter3\03_Types.html#type_identifier) + + + +## 泛型实参子句 + +泛型实参子句指定_泛型类型_的类型实参。泛型实参子句用尖括号(<>)包住,形式如下: + +> <`generic argument list`> + +泛型实参列表中类型实参有逗号分开。类型实参是实际具体类型的名字,用来替代泛型类型的泛型形参子句中的相应的类型形参。从而得到泛型类型的一个特化版本。如,Swift标准库的泛型字典类型定义如下: + +```swift +struct Dictionary: Collection, DictionaryLiteralConvertible { + /* .. */ +} +``` + +泛型`Dictionary`类型的特化版本,`Dictionary`就是用具体的`String`和`Int`类型替代泛型类型`KeyType: Hashable`和`ValueType`产生的。每一个类型实参必须满足它所替代的泛型形参的所有约束,包括任何`where`子句所指定的额外的要求。上面的例子中,类型形参`KeyType`要求满足`Hashable`协议,因此`String`也必须满足`Hashable`协议。 + +可以用本身就是泛型类型的特化版本的类型实参替代类型形参(假设已满足合适的约束和要求)。例如,为了生成一个元素类型是整型数组的数组,可以用数组的特化版本`Array`替代泛型类型`Array`的类型形参`T`来实现。 + +```swift +let arrayOfArrays: Array> = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] +``` + +如[泛型形参子句](#generic_parameter)所述,不能用泛型实参子句来指定泛型函数或构造器的类型实参。 + +> 泛型实参子句语法 +> *(泛型参数子句Generic Argument Clause)* → **<** [*泛型参数列表*](GenericParametersAndArguments.html#generic_argument_list) **>** +> *泛型参数列表* → [*泛型参数*](GenericParametersAndArguments.html#generic_argument) | [*泛型参数*](GenericParametersAndArguments.html#generic_argument) **,** [*泛型参数列表*](GenericParametersAndArguments.html#generic_argument_list) +> *泛型参数* → [*类型*](..\chapter3\03_Types.html#type) \ No newline at end of file diff --git a/source/chapter3/09_Summary_of_the_Grammar.md b/source/chapter3/09_Summary_of_the_Grammar.md old mode 100644 new mode 100755 index e69de29b..2e307e09 --- a/source/chapter3/09_Summary_of_the_Grammar.md +++ b/source/chapter3/09_Summary_of_the_Grammar.md @@ -0,0 +1,743 @@ +> 翻译:[stanzhai](https://github.com/stanzhai) +> 校对:[xielingwang](https://github.com/xielingwang) + +# 语法总结 +_________________ + +本页包含内容: + +* [语句(Statements)](#statements) +* [泛型参数(Generic Parameters and Arguments)](#generic_parameters_and_arguments) +* [声明(Declarations)](#declarations) +* [模式(Patterns)](#patterns) +* [特性(Attributes)](#attributes) +* [表达式(Expressions)](#expressions) +* [词法结构(Lexical Structure)](#lexical_structure) +* [类型(Types)](#types) + + +## 语句 + +> 语句语法 +> *语句* → [*表达式*](..\chapter3\04_Expressions.html#expression) **;** _可选_ +> *语句* → [*声明*](..\chapter3\05_Declarations.html#declaration) **;** _可选_ +> *语句* → [*循环语句*](..\chapter3\10_Statements.html#loop_statement) **;** _可选_ +> *语句* → [*分支语句*](..\chapter3\10_Statements.html#branch_statement) **;** _可选_ +> *语句* → [*标记语句(Labeled Statement)*](..\chapter3\10_Statements.html#labeled_statement) +> *语句* → [*控制转移语句*](..\chapter3\10_Statements.html#control_transfer_statement) **;** _可选_ +> *多条语句(Statements)* → [*语句*](..\chapter3\10_Statements.html#statement) [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) _可选_ + + + +> 循环语句语法 +> *循环语句* → [*for语句*](..\chapter3\10_Statements.html#for_statement) +> *循环语句* → [*for-in语句*](..\chapter3\10_Statements.html#for_in_statement) +> *循环语句* → [*while语句*](..\chapter3\10_Statements.html#wheetatype类型ile_statement) +> *循环语句* → [*do-while语句*](..\chapter3\10_Statements.html#do_while_statement) + + + +> For 循环语法 +> *for语句* → **for** [*for初始条件*](..\chapter3\10_Statements.html#for_init) _可选_ **;** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ **;** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *for语句* → **for** **(** [*for初始条件*](..\chapter3\10_Statements.html#for_init) _可选_ **;** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ **;** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ **)** [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *for初始条件* → [*变量声明*](..\chapter3\05_Declarations.html#variable_declaration) | [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) + + + +> For-In 循环语法 +> *for-in语句* → **for** [*模式*](..\chapter3\07_Patterns.html#pattern) **in** [*表达式*](..\chapter3\04_Expressions.html#expression) [*代码块*](..\chapter3\05_Declarations.html#code_block) + + + +> While 循环语法 +> *while语句* → **while** [*while条件*](..\chapter3\10_Statements.html#while_condition) [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *while条件* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*声明*](..\chapter3\05_Declarations.html#declaration) + + + +> Do-While 循环语法 +> *do-while语句* → **do** [*代码块*](..\chapter3\05_Declarations.html#code_block) **while** [*while条件*](..\chapter3\10_Statements.html#while_condition) + + + +> 分支语句语法 +> *分支语句* → [*if语句*](..\chapter3\10_Statements.html#if_statement) +> *分支语句* → [*switch语句*](..\chapter3\10_Statements.html#switch_statement) + + + +> If语句语法 +> *if语句* → **if** [*if条件*](..\chapter3\10_Statements.html#if_condition) [*代码块*](..\chapter3\05_Declarations.html#code_block) [*else子句(Clause)*](..\chapter3\10_Statements.html#else_clause) _可选_ +> *if条件* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*声明*](..\chapter3\05_Declarations.html#declaration) +> *else子句(Clause)* → **else** [*代码块*](..\chapter3\05_Declarations.html#code_block) | **else** [*if语句*](..\chapter3\10_Statements.html#if_statement) + + + +> Switch语句语法 +> *switch语句* → **switch** [*表达式*](..\chapter3\04_Expressions.html#expression) **{** [*SwitchCase列表*](..\chapter3\10_Statements.html#switch_cases) _可选_ **}** +> *SwitchCase列表* → [*SwitchCase*](..\chapter3\10_Statements.html#switch_case) [*SwitchCase列表*](..\chapter3\10_Statements.html#switch_cases) _可选_ +> *SwitchCase* → [*case标签*](..\chapter3\10_Statements.html#case_label) [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) | [*default标签*](..\chapter3\10_Statements.html#default_label) [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) +> *SwitchCase* → [*case标签*](..\chapter3\10_Statements.html#case_label) **;** | [*default标签*](..\chapter3\10_Statements.html#default_label) **;** +> *case标签* → **case** [*case项列表*](..\chapter3\10_Statements.html#case_item_list) **:** +> *case项列表* → [*模式*](..\chapter3\07_Patterns.html#pattern) [*guard-clause*](..\chapter3\10_Statements.html#guard_clause) _可选_ | [*模式*](..\chapter3\07_Patterns.html#pattern) [*guard-clause*](..\chapter3\10_Statements.html#guard_clause) _可选_ **,** [*case项列表*](..\chapter3\10_Statements.html#case_item_list) +> *default标签* → **default** **:** +> *guard-clause* → **where** [*guard-expression*](..\chapter3\10_Statements.html#guard_expression) +> *guard-expression* → [*表达式*](..\chapter3\04_Expressions.html#expression) + + + +> 标记语句语法 +> *标记语句(Labeled Statement)* → [*语句标签*](..\chapter3\10_Statements.html#statement_label) [*循环语句*](..\chapter3\10_Statements.html#loop_statement) | [*语句标签*](..\chapter3\10_Statements.html#statement_label) [*switch语句*](..\chapter3\10_Statements.html#switch_statement) +> *语句标签* → [*标签名称*](..\chapter3\10_Statements.html#label_name) **:** +> *标签名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) + + + +> 控制传递语句(Control Transfer Statement) 语法 +> *控制传递语句* → [*break语句*](..\chapter3\10_Statements.html#break_statement) +> *控制传递语句* → [*continue语句*](..\chapter3\10_Statements.html#continue_statement) +> *控制传递语句* → [*fallthrough语句*](..\chapter3\10_Statements.html#fallthrough_statement) +> *控制传递语句* → [*return语句*](..\chapter3\10_Statements.html#return_statement) + + + +> Break 语句语法 +> *break语句* → **break** [*标签名称*](..\chapter3\10_Statements.html#label_name) _可选_ + + + +> Continue 语句语法 +> *continue语句* → **continue** [*标签名称*](..\chapter3\10_Statements.html#label_name) _可选_ + + + +> Fallthrough 语句语法 +> *fallthrough语句* → **fallthrough** + + + +> Return 语句语法 +> *return语句* → **return** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ + + +## 泛型参数 + +> 泛型形参子句(Generic Parameter Clause) 语法 +> *泛型参数子句* → **<** [*泛型参数列表*](GenericParametersAndArguments.html#generic_parameter_list) [*约束子句*](GenericParametersAndArguments.html#requirement_clause) _可选_ **>** +> *泛型参数列表* → [*泛形参数*](GenericParametersAndArguments.html#generic_parameter) | [*泛形参数*](GenericParametersAndArguments.html#generic_parameter) **,** [*泛型参数列表*](GenericParametersAndArguments.html#generic_parameter_list) +> *泛形参数* → [*类型名称*](..\chapter3\03_Types.html#type_name) +> *泛形参数* → [*类型名称*](..\chapter3\03_Types.html#type_name) **:** [*类型标识*](..\chapter3\03_Types.html#type_identifier) +> *泛形参数* → [*类型名称*](..\chapter3\03_Types.html#type_name) **:** [*协议合成类型*](..\chapter3\03_Types.html#protocol_composition_type) +> *约束子句* → **where** [*约束列表*](GenericParametersAndArguments.html#requirement_list) +> *约束列表* → [*约束*](GenericParametersAndArguments.html#requirement) | [*约束*](GenericParametersAndArguments.html#requirement) **,** [*约束列表*](GenericParametersAndArguments.html#requirement_list) +> *约束* → [*一致性约束*](GenericParametersAndArguments.html#conformance_requirement) | [*同类型约束*](GenericParametersAndArguments.html#same_type_requirement) +> *一致性约束* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) **:** [*类型标识*](..\chapter3\03_Types.html#type_identifier) +> *一致性约束* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) **:** [*协议合成类型*](..\chapter3\03_Types.html#protocol_composition_type) +> *同类型约束* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) **==** [*类型标识*](..\chapter3\03_Types.html#type_identifier) + + + +> 泛型实参子句语法 +> *(泛型参数子句Generic Argument Clause)* → **<** [*泛型参数列表*](GenericParametersAndArguments.html#generic_argument_list) **>** +> *泛型参数列表* → [*泛型参数*](GenericParametersAndArguments.html#generic_argument) | [*泛型参数*](GenericParametersAndArguments.html#generic_argument) **,** [*泛型参数列表*](GenericParametersAndArguments.html#generic_argument_list) +> *泛型参数* → [*类型*](..\chapter3\03_Types.html#type) + + +## 声明 (Declarations) + +> 声明语法 +> *声明* → [*导入声明*](..\chapter3\05_Declarations.html#import_declaration) +> *声明* → [*常量声明*](..\chapter3\05_Declarations.html#constant_declaration) +> *声明* → [*变量声明*](..\chapter3\05_Declarations.html#variable_declaration) +> *声明* → [*类型别名声明*](..\chapter3\05_Declarations.html#typealias_declaration) +> *声明* → [*函数声明*](..\chapter3\05_Declarations.html#function_declaration) +> *声明* → [*枚举声明*](..\chapter3\05_Declarations.html#enum_declaration) +> *声明* → [*结构体声明*](..\chapter3\05_Declarations.html#struct_declaration) +> *声明* → [*类声明*](..\chapter3\05_Declarations.html#class_declaration) +> *声明* → [*协议声明*](..\chapter3\05_Declarations.html#protocol_declaration) +> *声明* → [*构造器声明*](..\chapter3\05_Declarations.html#initializer_declaration) +> *声明* → [*析构器声明*](..\chapter3\05_Declarations.html#deinitializer_declaration) +> *声明* → [*扩展声明*](..\chapter3\05_Declarations.html#extension_declaration) +> *声明* → [*下标脚本声明*](..\chapter3\05_Declarations.html#subscript_declaration) +> *声明* → [*运算符声明*](..\chapter3\05_Declarations.html#operator_declaration) +> *声明(Declarations)列表* → [*声明*](..\chapter3\05_Declarations.html#declaration) [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ +> *声明描述符(Specifiers)列表* → [*声明描述符(Specifier)*](..\chapter3\05_Declarations.html#declaration_specifier) [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ +> *声明描述符(Specifier)* → **class** | **mutating** | **nonmutating** | **override** | **static** | **unowned** | **unowned(safe)** | **unowned(unsafe)** | **weak** + + + +> 顶级(Top Level) 声明语法 +> *顶级声明* → [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) _可选_ + + + +> 代码块语法 +> *代码块* → **{** [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) _可选_ **}** + + + +> 导入(Import)声明语法 +> *导入声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **import** [*导入类型*](..\chapter3\05_Declarations.html#import_kind) _可选_ [*导入路径*](..\chapter3\05_Declarations.html#import_path) +> *导入类型* → **typealias** | **struct** | **class** | **enum** | **protocol** | **var** | **func** +> *导入路径* → [*导入路径标识符*](..\chapter3\05_Declarations.html#import_path_identifier) | [*导入路径标识符*](..\chapter3\05_Declarations.html#import_path_identifier) **.** [*导入路径*](..\chapter3\05_Declarations.html#import_path) +> *导入路径标识符* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) + + + +> 常数声明语法 +> *常量声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ **let** [*模式构造器列表*](..\chapter3\05_Declarations.html#pattern_initializer_list) +> *模式构造器列表* → [*模式构造器*](..\chapter3\05_Declarations.html#pattern_initializer) | [*模式构造器*](..\chapter3\05_Declarations.html#pattern_initializer) **,** [*模式构造器列表*](..\chapter3\05_Declarations.html#pattern_initializer_list) +> *模式构造器* → [*模式*](..\chapter3\07_Patterns.html#pattern) [*构造器*](..\chapter3\05_Declarations.html#initializer) _可选_ +> *构造器* → **=** [*表达式*](..\chapter3\04_Expressions.html#expression) + + + +> 变量声明语法 +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*模式构造器列表*](..\chapter3\05_Declarations.html#pattern_initializer_list) +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*getter-setter块*](..\chapter3\05_Declarations.html#getter_setter_block) +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block) +> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*构造器*](..\chapter3\05_Declarations.html#initializer) _可选_ [*willSet-didSet代码块*](..\chapter3\05_Declarations.html#willSet_didSet_block) +> *变量声明头(Head)* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ **var** +> *变量名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *getter-setter块* → **{** [*getter子句*](..\chapter3\05_Declarations.html#getter_clause) [*setter子句*](..\chapter3\05_Declarations.html#setter_clause) _可选_ **}** +> *getter-setter块* → **{** [*setter子句*](..\chapter3\05_Declarations.html#setter_clause) [*getter子句*](..\chapter3\05_Declarations.html#getter_clause) **}** +> *getter子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **get** [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *setter子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **set** [*setter名称*](..\chapter3\05_Declarations.html#setter_name) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *setter名称* → **(** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) **)** +> *getter-setter关键字(Keyword)块* → **{** [*getter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#getter_keyword_clause) [*setter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#setter_keyword_clause) _可选_ **}** +> *getter-setter关键字(Keyword)块* → **{** [*setter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#setter_keyword_clause) [*getter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#getter_keyword_clause) **}** +> *getter关键字(Keyword)子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **get** +> *setter关键字(Keyword)子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **set** +> *willSet-didSet代码块* → **{** [*willSet子句*](..\chapter3\05_Declarations.html#willSet_clause) [*didSet子句*](..\chapter3\05_Declarations.html#didSet_clause) _可选_ **}** +> *willSet-didSet代码块* → **{** [*didSet子句*](..\chapter3\05_Declarations.html#didSet_clause) [*willSet子句*](..\chapter3\05_Declarations.html#willSet_clause) **}** +> *willSet子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **willSet** [*setter名称*](..\chapter3\05_Declarations.html#setter_name) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *didSet子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **didSet** [*setter名称*](..\chapter3\05_Declarations.html#setter_name) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block) + + + +> 类型别名声明语法 +> *类型别名声明* → [*类型别名头(Head)*](..\chapter3\05_Declarations.html#typealias_head) [*类型别名赋值*](..\chapter3\05_Declarations.html#typealias_assignment) +> *类型别名头(Head)* → **typealias** [*类型别名名称*](..\chapter3\05_Declarations.html#typealias_name) +> *类型别名名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *类型别名赋值* → **=** [*类型*](..\chapter3\03_Types.html#type) + + + +> 函数声明语法 +> *函数声明* → [*函数头*](..\chapter3\05_Declarations.html#function_head) [*函数名*](..\chapter3\05_Declarations.html#function_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*函数签名(Signature)*](..\chapter3\05_Declarations.html#function_signature) [*函数体*](..\chapter3\05_Declarations.html#function_body) +> *函数头* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ **func** +> *函数名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) +> *函数签名(Signature)* → [*parameter-clauses*](..\chapter3\05_Declarations.html#parameter_clauses) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ +> *函数结果* → **->** [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type) +> *函数体* → [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *parameter-clauses* → [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*parameter-clauses*](..\chapter3\05_Declarations.html#parameter_clauses) _可选_ +> *参数子句* → **(** **)** | **(** [*参数列表*](..\chapter3\05_Declarations.html#parameter_list) **...** _可选_ **)** +> *参数列表* → [*参数*](..\chapter3\05_Declarations.html#parameter) | [*参数*](..\chapter3\05_Declarations.html#parameter) **,** [*参数列表*](..\chapter3\05_Declarations.html#parameter_list) +> *参数* → **inout** _可选_ **let** _可选_ **#** _可选_ [*参数名*](..\chapter3\05_Declarations.html#parameter_name) [*本地参数名*](..\chapter3\05_Declarations.html#local_parameter_name) _可选_ [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*默认参数子句*](..\chapter3\05_Declarations.html#default_argument_clause) _可选_ +> *参数* → **inout** _可选_ **var** **#** _可选_ [*参数名*](..\chapter3\05_Declarations.html#parameter_name) [*本地参数名*](..\chapter3\05_Declarations.html#local_parameter_name) _可选_ [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*默认参数子句*](..\chapter3\05_Declarations.html#default_argument_clause) _可选_ +> *参数* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type) +> *参数名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | **_** +> *本地参数名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | **_** +> *默认参数子句* → **=** [*表达式*](..\chapter3\04_Expressions.html#expression) + + + +> 枚举声明语法 +> *枚举声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*联合式枚举*](..\chapter3\05_Declarations.html#union_style_enum) | [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*原始值式枚举*](..\chapter3\05_Declarations.html#raw_value_style_enum) +> *联合式枚举* → [*枚举名*](..\chapter3\05_Declarations.html#enum_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ **{** [*union-style-enum-members*](..\chapter3\05_Declarations.html#union_style_enum_members) _可选_ **}** +> *union-style-enum-members* → [*union-style-enum-member*](..\chapter3\05_Declarations.html#union_style_enum_member) [*union-style-enum-members*](..\chapter3\05_Declarations.html#union_style_enum_members) _可选_ +> *union-style-enum-member* → [*声明*](..\chapter3\05_Declarations.html#declaration) | [*联合式(Union Style)的枚举case子句*](..\chapter3\05_Declarations.html#union_style_enum_case_clause) +> *联合式(Union Style)的枚举case子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **case** [*联合式(Union Style)的枚举case列表*](..\chapter3\05_Declarations.html#union_style_enum_case_list) +> *联合式(Union Style)的枚举case列表* → [*联合式(Union Style)的case*](..\chapter3\05_Declarations.html#union_style_enum_case) | [*联合式(Union Style)的case*](..\chapter3\05_Declarations.html#union_style_enum_case) **,** [*联合式(Union Style)的枚举case列表*](..\chapter3\05_Declarations.html#union_style_enum_case_list) +> *联合式(Union Style)的case* → [*枚举的case名*](..\chapter3\05_Declarations.html#enum_case_name) [*元组类型*](..\chapter3\03_Types.html#tuple_type) _可选_ +> *枚举名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *枚举的case名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *原始值式枚举* → [*枚举名*](..\chapter3\05_Declarations.html#enum_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ **:** [*类型标识*](..\chapter3\03_Types.html#type_identifier) **{** [*原始值式枚举成员列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_members) _可选_ **}** +> *原始值式枚举成员列表* → [*原始值式枚举成员*](..\chapter3\05_Declarations.html#raw_value_style_enum_member) [*原始值式枚举成员列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_members) _可选_ +> *原始值式枚举成员* → [*声明*](..\chapter3\05_Declarations.html#declaration) | [*原始值式枚举case子句*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_clause) +> *原始值式枚举case子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **case** [*原始值式枚举case列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_list) +> *原始值式枚举case列表* → [*原始值式枚举case*](..\chapter3\05_Declarations.html#raw_value_style_enum_case) | [*原始值式枚举case*](..\chapter3\05_Declarations.html#raw_value_style_enum_case) **,** [*原始值式枚举case列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_list) +> *原始值式枚举case* → [*枚举的case名*](..\chapter3\05_Declarations.html#enum_case_name) [*原始值赋值*](..\chapter3\05_Declarations.html#raw_value_assignment) _可选_ +> *原始值赋值* → **=** [*字面量*](..\chapter3\02_Lexical_Structure.html#literal) + + + +> 结构体声明语法 +> *结构体声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **struct** [*结构体名称*](..\chapter3\05_Declarations.html#struct_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*结构体主体*](..\chapter3\05_Declarations.html#struct_body) +> *结构体名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *结构体主体* → **{** [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ **}** + + + +> 类声明语法 +> *类声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **class** [*类名*](..\chapter3\05_Declarations.html#class_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*类主体*](..\chapter3\05_Declarations.html#class_body) +> *类名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *类主体* → **{** [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ **}** + + + +> 协议(Protocol)声明语法 +> *协议声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **protocol** [*协议名*](..\chapter3\05_Declarations.html#protocol_name) [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*协议主体*](..\chapter3\05_Declarations.html#protocol_body) +> *协议名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *协议主体* → **{** [*协议成员声明(Declarations)列表*](..\chapter3\05_Declarations.html#protocol_member_declarations) _可选_ **}** +> *协议成员声明* → [*协议属性声明*](..\chapter3\05_Declarations.html#protocol_property_declaration) +> *协议成员声明* → [*协议方法声明*](..\chapter3\05_Declarations.html#protocol_method_declaration) +> *协议成员声明* → [*协议构造器声明*](..\chapter3\05_Declarations.html#protocol_initializer_declaration) +> *协议成员声明* → [*协议下标脚本声明*](..\chapter3\05_Declarations.html#protocol_subscript_declaration) +> *协议成员声明* → [*协议关联类型声明*](..\chapter3\05_Declarations.html#protocol_associated_type_declaration) +> *协议成员声明(Declarations)列表* → [*协议成员声明*](..\chapter3\05_Declarations.html#protocol_member_declaration) [*协议成员声明(Declarations)列表*](..\chapter3\05_Declarations.html#protocol_member_declarations) _可选_ + + + +> 协议属性声明语法 +> *协议属性声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block) + + + +> 协议方法声明语法 +> *协议方法声明* → [*函数头*](..\chapter3\05_Declarations.html#function_head) [*函数名*](..\chapter3\05_Declarations.html#function_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*函数签名(Signature)*](..\chapter3\05_Declarations.html#function_signature) + + + +> 协议构造器声明语法 +> *协议构造器声明* → [*构造器头(Head)*](..\chapter3\05_Declarations.html#initializer_head) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) + + + +> 协议下标脚本声明语法 +> *协议下标脚本声明* → [*下标脚本头(Head)*](..\chapter3\05_Declarations.html#subscript_head) [*下标脚本结果(Result)*](..\chapter3\05_Declarations.html#subscript_result) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block) + + + +> 协议关联类型声明语法 +> *协议关联类型声明* → [*类型别名头(Head)*](..\chapter3\05_Declarations.html#typealias_head) [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*类型别名赋值*](..\chapter3\05_Declarations.html#typealias_assignment) _可选_ + + + +> 构造器声明语法 +> *构造器声明* → [*构造器头(Head)*](..\chapter3\05_Declarations.html#initializer_head) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*构造器主体*](..\chapter3\05_Declarations.html#initializer_body) +> *构造器头(Head)* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **convenience** _可选_ **init** +> *构造器主体* → [*代码块*](..\chapter3\05_Declarations.html#code_block) + + + +> 析构器声明语法 +> *析构器声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **deinit** [*代码块*](..\chapter3\05_Declarations.html#code_block) + + + +> 扩展(Extension)声明语法 +> *扩展声明* → **extension** [*类型标识*](..\chapter3\03_Types.html#type_identifier) [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*extension-body*](..\chapter3\05_Declarations.html#extension_body) +> *extension-body* → **{** [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ **}** + + + +> 下标脚本声明语法 +> *下标脚本声明* → [*下标脚本头(Head)*](..\chapter3\05_Declarations.html#subscript_head) [*下标脚本结果(Result)*](..\chapter3\05_Declarations.html#subscript_result) [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *下标脚本声明* → [*下标脚本头(Head)*](..\chapter3\05_Declarations.html#subscript_head) [*下标脚本结果(Result)*](..\chapter3\05_Declarations.html#subscript_result) [*getter-setter块*](..\chapter3\05_Declarations.html#getter_setter_block) +> *下标脚本声明* → [*下标脚本头(Head)*](..\chapter3\05_Declarations.html#subscript_head) [*下标脚本结果(Result)*](..\chapter3\05_Declarations.html#subscript_result) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block) +> *下标脚本头(Head)* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **subscript** [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) +> *下标脚本结果(Result)* → **->** [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type) + + + +> 运算符声明语法 +> *运算符声明* → [*前置运算符声明*](..\chapter3\05_Declarations.html#prefix_operator_declaration) | [*后置运算符声明*](..\chapter3\05_Declarations.html#postfix_operator_declaration) | [*中置运算符声明*](..\chapter3\05_Declarations.html#infix_operator_declaration) +> *前置运算符声明* → **运算符** **prefix** [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) **{** **}** +> *后置运算符声明* → **运算符** **postfix** [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) **{** **}** +> *中置运算符声明* → **运算符** **infix** [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) **{** [*中置运算符属性*](..\chapter3\05_Declarations.html#infix_operator_attributes) _可选_ **}** +> *中置运算符属性* → [*优先级子句*](..\chapter3\05_Declarations.html#precedence_clause) _可选_ [*结和性子句*](..\chapter3\05_Declarations.html#associativity_clause) _可选_ +> *优先级子句* → **precedence** [*优先级水平*](..\chapter3\05_Declarations.html#precedence_level) +> *优先级水平* → 数值 0 到 255 +> *结和性子句* → **associativity** [*结和性*](..\chapter3\05_Declarations.html#associativity) +> *结和性* → **left** | **right** | **none** + + +## 模式 + +> 模式(Patterns) 语法 +> *模式* → [*通配符模式*](..\chapter3\07_Patterns.html#wildcard_pattern) [*类型注解*](..\chapter3\03_Types.html#type_annotation) _可选_ +> *模式* → [*标识符模式*](..\chapter3\07_Patterns.html#identifier_pattern) [*类型注解*](..\chapter3\03_Types.html#type_annotati(Value Binding)on) _可选_ +> *模式* → [*值绑定模式*](..\chapter3\07_Patterns.html#value_binding_pattern) +> *模式* → [*元组模式*](..\chapter3\07_Patterns.html#tuple_pattern) [*类型注解*](..\chapter3\03_Types.html#type_annotation) _可选_ +> *模式* → [*enum-case-pattern*](..\chapter3\07_Patterns.html#enum_case_pattern) +> *模式* → [*type-casting-pattern*](..\chapter3\07_Patterns.html#type_casting_pattern) +> *模式* → [*表达式模式*](..\chapter3\07_Patterns.html#expression_pattern) + + + +> 通配符模式语法 +> *通配符模式* → **_** + + + +> 标识符模式语法 +> *标识符模式* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) + + + +> 值绑定(Value Binding)模式语法 +> *值绑定模式* → **var** [*模式*](..\chapter3\07_Patterns.html#pattern) | **let** [*模式*](..\chapter3\07_Patterns.html#pattern) + + + +> 元组模式语法 +> *元组模式* → **(** [*元组模式元素列表*](..\chapter3\07_Patterns.html#tuple_pattern_element_list) _可选_ **)** +> *元组模式元素列表* → [*元组模式元素*](..\chapter3\07_Patterns.html#tuple_pattern_element) | [*元组模式元素*](..\chapter3\07_Patterns.html#tuple_pattern_element) **,** [*元组模式元素列表*](..\chapter3\07_Patterns.html#tuple_pattern_element_list) +> *元组模式元素* → [*模式*](..\chapter3\07_Patterns.html#pattern) + + + +> 枚举用例模式语法 +> *enum-case-pattern* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) _可选_ **.** [*枚举的case名*](..\chapter3\05_Declarations.html#enum_case_name) [*元组模式*](..\chapter3\07_Patterns.html#tuple_pattern) _可选_ + + + +> 类型转换模式语法 +> *type-casting-pattern* → [*is模式*](..\chapter3\07_Patterns.html#is_pattern) | [*as模式*](..\chapter3\07_Patterns.html#as_pattern) +> *is模式* → **is** [*类型*](..\chapter3\03_Types.html#type) +> *as模式* → [*模式*](..\chapter3\07_Patterns.html#pattern) **as** [*类型*](..\chapter3\03_Types.html#type) + + + +> 表达式模式语法 +> *表达式模式* → [*表达式*](..\chapter3\04_Expressions.html#expression) + + +## 特性 + +> 特性语法 +> *特色* → **@** [*特性名*](..\chapter3\06_Attributes.html#attribute_name) [*特性参数子句*](..\chapter3\06_Attributes.html#attribute_argument_clause) _可选_ +> *特性名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *特性参数子句* → **(** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **)** +> *特性(Attributes)列表* → [*特色*](..\chapter3\06_Attributes.html#attribute) [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ +> *平衡令牌列表* → [*平衡令牌*](..\chapter3\06_Attributes.html#balanced_token) [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ +> *平衡令牌* → **(** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **)** +> *平衡令牌* → **[** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **]** +> *平衡令牌* → **{** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **}** +> *平衡令牌* → **任意标识符, 关键字, 字面量或运算符** +> *平衡令牌* → **任意标点除了(, ), [, ], {, 或 }** + + +## 表达式 + +> 表达式语法 +> *表达式* → [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) [*二元表达式列表*](..\chapter3\04_Expressions.html#binary_expressions) _可选_ +> *表达式列表* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*表达式*](..\chapter3\04_Expressions.html#expression) **,** [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) + + + +> 前置表达式语法 +> *前置表达式* → [*前置运算符*](..\chapter3\02_Lexical_Structure.html#prefix_operator) _可选_ [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) +> *前置表达式* → [*写入写出(in-out)表达式*](..\chapter3\04_Expressions.html#in_out_expression) +> *写入写出(in-out)表达式* → **&** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) + + + +> 二元表达式语法 +> *二元表达式* → [*二元运算符*](..\chapter3\02_Lexical_Structure.html#binary_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) +> *二元表达式* → [*赋值运算符*](..\chapter3\04_Expressions.html#assignment_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) +> *二元表达式* → [*条件运算符*](..\chapter3\04_Expressions.html#conditional_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) +> *二元表达式* → [*类型转换运算符*](..\chapter3\04_Expressions.html#type_casting_operator) +> *二元表达式列表* → [*二元表达式*](..\chapter3\04_Expressions.html#binary_expression) [*二元表达式列表*](..\chapter3\04_Expressions.html#binary_expressions) _可选_ + + + +> 赋值运算符语法 +> *赋值运算符* → **=** + + + +> 三元条件运算符语法 +> *三元条件运算符* → **?** [*表达式*](..\chapter3\04_Expressions.html#expression) **:** + + + +> 类型转换运算符语法 +> *类型转换运算符* → **is** [*类型*](..\chapter3\03_Types.html#type) | **as** **?** _可选_ [*类型*](..\chapter3\03_Types.html#type) + + + +> 主表达式语法 +> *主表达式* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ +> *主表达式* → [*字面量表达式*](..\chapter3\04_Expressions.html#literal_expression) +> *主表达式* → [*self表达式*](..\chapter3\04_Expressions.html#self_expression) +> *主表达式* → [*超类表达式*](..\chapter3\04_Expressions.html#superclass_expression) +> *主表达式* → [*闭包表达式*](..\chapter3\04_Expressions.html#closure_expression) +> *主表达式* → [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression) +> *主表达式* → [*隐式成员表达式*](..\chapter3\04_Expressions.html#implicit_member_expression) +> *主表达式* → [*通配符表达式*](..\chapter3\04_Expressions.html#wildcard_expression) + + + +> 字面量表达式语法 +> *字面量表达式* → [*字面量*](..\chapter3\02_Lexical_Structure.html#literal) +> *字面量表达式* → [*数组字面量*](..\chapter3\04_Expressions.html#array_literal) | [*字典字面量*](..\chapter3\04_Expressions.html#dictionary_literal) +> *字面量表达式* → **__FILE__** | **__LINE__** | **__COLUMN__** | **__FUNCTION__** +> *数组字面量* → **[** [*数组字面量项列表*](..\chapter3\04_Expressions.html#array_literal_items) _可选_ **]** +> *数组字面量项列表* → [*数组字面量项*](..\chapter3\04_Expressions.html#array_literal_item) **,** _可选_ | [*数组字面量项*](..\chapter3\04_Expressions.html#array_literal_item) **,** [*数组字面量项列表*](..\chapter3\04_Expressions.html#array_literal_items) +> *数组字面量项* → [*表达式*](..\chapter3\04_Expressions.html#expression) +> *字典字面量* → **[** [*字典字面量项列表*](..\chapter3\04_Expressions.html#dictionary_literal_items) **]** | **[** **:** **]** +> *字典字面量项列表* → [*字典字面量项*](..\chapter3\04_Expressions.html#dictionary_literal_item) **,** _可选_ | [*字典字面量项*](..\chapter3\04_Expressions.html#dictionary_literal_item) **,** [*字典字面量项列表*](..\chapter3\04_Expressions.html#dictionary_literal_items) +> *字典字面量项* → [*表达式*](..\chapter3\04_Expressions.html#expression) **:** [*表达式*](..\chapter3\04_Expressions.html#expression) + + + +> Self 表达式语法 +> *self表达式* → **self** +> *self表达式* → **self** **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *self表达式* → **self** **[** [*表达式*](..\chapter3\04_Expressions.html#expression) **]** +> *self表达式* → **self** **.** **init** + + + +> 超类表达式语法 +> *超类表达式* → [*超类方法表达式*](..\chapter3\04_Expressions.html#superclass_method_expression) | [*超类下标表达式*](..\chapter3\04_Expressions.html#超类下标表达式) | [*超类构造器表达式*](..\chapter3\04_Expressions.html#superclass_initializer_expression) +> *超类方法表达式* → **super** **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) +> *超类下标表达式* → **super** **[** [*表达式*](..\chapter3\04_Expressions.html#expression) **]** +> *超类构造器表达式* → **super** **.** **init** + + + +> 闭包表达式语法 +> *闭包表达式* → **{** [*闭包签名(Signational)*](..\chapter3\04_Expressions.html#closure_signature) _可选_ [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) **}** +> *闭包签名(Signational)* → [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in** +> *闭包签名(Signational)* → [*标识符列表*](..\chapter3\02_Lexical_Structure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in** +> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in** +> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*标识符列表*](..\chapter3\02_Lexical_Structure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in** +> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) **in** +> *捕获(Capature)列表* → **[** [*捕获(Capature)说明符*](..\chapter3\04_Expressions.html#capture_specifier) [*表达式*](..\chapter3\04_Expressions.html#expression) **]** +> *捕获(Capature)说明符* → **weak** | **unowned** | **unowned(safe)** | **unowned(unsafe)** + + + +> 隐式成员表达式语法 +> *隐式成员表达式* → **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) + + + +> 圆括号表达式(Parenthesized Expression)语法 +> *圆括号表达式* → **(** [*表达式元素列表*](..\chapter3\04_Expressions.html#expression_element_list) _可选_ **)** +> *表达式元素列表* → [*表达式元素*](..\chapter3\04_Expressions.html#expression_element) | [*表达式元素*](..\chapter3\04_Expressions.html#expression_element) **,** [*表达式元素列表*](..\chapter3\04_Expressions.html#expression_element_list) +> *表达式元素* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) **:** [*表达式*](..\chapter3\04_Expressions.html#expression) + + + +> 通配符表达式语法 +> *通配符表达式* → **_** + + + +> 后置表达式语法 +> *后置表达式* → [*主表达式*](..\chapter3\04_Expressions.html#primary_expression) +> *后置表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*后置运算符*](..\chapter3\02_Lexical_Structure.html#postfix_operator) +> *后置表达式* → [*函数调用表达式*](..\chapter3\04_Expressions.html#function_call_expression) +> *后置表达式* → [*构造器表达式*](..\chapter3\04_Expressions.html#initializer_expression) +> *后置表达式* → [*显示成员表达式*](..\chapter3\04_Expressions.html#explicit_member_expression) +> *后置表达式* → [*后置self表达式*](..\chapter3\04_Expressions.html#postfix_self_expression) +> *后置表达式* → [*动态类型表达式*](..\chapter3\04_Expressions.html#dynamic_type_expression) +> *后置表达式* → [*下标表达式*](..\chapter3\04_Expressions.html#subscript_expression) +> *后置表达式* → [*强制取值(Forced Value)表达式*](..\chapter3\04_Expressions.html#forced_value_expression) +> *后置表达式* → [*可选链(Optional Chaining)表达式*](..\chapter3\04_Expressions.html#optional_chaining_expression) + + + +> 函数调用表达式语法 +> *函数调用表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression) +> *函数调用表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression) _可选_ [*后置闭包(Trailing Closure)*](..\chapter3\04_Expressions.html#trailing_closure) +> *后置闭包(Trailing Closure)* → [*闭包表达式*](..\chapter3\04_Expressions.html#closure_expression) + + + +> 构造器表达式语法 +> *构造器表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **init** + + + +> 显式成员表达式语法 +> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit) +> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ + + + +> 后置Self 表达式语法 +> *后置self表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **self** + + + +> 动态类型表达式语法 +> *动态类型表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **dynamicType** + + + +> 附属脚本表达式语法 +> *附属脚本表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **[** [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) **]** + + + +> 强制取值(Forced Value)语法 +> *强制取值(Forced Value)表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **!** + + + +> 可选链表达式语法 +> *可选链表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **?** + + +## 词法结构 + +> 标识符语法 +> *标识符* → [*标识符头(Head)*](..\chapter3\02_Lexical_Structure.html#identifier_head) [*标识符字符列表*](..\chapter3\02_Lexical_Structure.html#identifier_characters) _可选_ +> *标识符* → **`** [*标识符头(Head)*](..\chapter3\02_Lexical_Structure.html#identifier_head) [*标识符字符列表*](..\chapter3\02_Lexical_Structure.html#identifier_characters) _可选_ **`** +> *标识符* → [*隐式参数名*](..\chapter3\02_Lexical_Structure.html#implicit_parameter_name) +> *标识符列表* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) **,** [*标识符列表*](..\chapter3\02_Lexical_Structure.html#identifier_list) +> *标识符头(Head)* → Upper- or lowercase letter A through Z +> *标识符头(Head)* → U+00A8, U+00AA, U+00AD, U+00AF, U+00B2–U+00B5, or U+00B7–U+00BA +> *标识符头(Head)* → U+00BC–U+00BE, U+00C0–U+00D6, U+00D8–U+00F6, or U+00F8–U+00FF +> *标识符头(Head)* → U+0100–U+02FF, U+0370–U+167F, U+1681–U+180D, or U+180F–U+1DBF +> *标识符头(Head)* → U+1E00–U+1FFF +> *标识符头(Head)* → U+200B–U+200D, U+202A–U+202E, U+203F–U+2040, U+2054, or U+2060–U+206F +> *标识符头(Head)* → U+2070–U+20CF, U+2100–U+218F, U+2460–U+24FF, or U+2776–U+2793 +> *标识符头(Head)* → U+2C00–U+2DFF or U+2E80–U+2FFF +> *标识符头(Head)* → U+3004–U+3007, U+3021–U+302F, U+3031–U+303F, or U+3040–U+D7FF +> *标识符头(Head)* → U+F900–U+FD3D, U+FD40–U+FDCF, U+FDF0–U+FE1F, or U+FE30–U+FE44 +> *标识符头(Head)* → U+FE47–U+FFFD +> *标识符头(Head)* → U+10000–U+1FFFD, U+20000–U+2FFFD, U+30000–U+3FFFD, or U+40000–U+4FFFD +> *标识符头(Head)* → U+50000–U+5FFFD, U+60000–U+6FFFD, U+70000–U+7FFFD, or U+80000–U+8FFFD +> *标识符头(Head)* → U+90000–U+9FFFD, U+A0000–U+AFFFD, U+B0000–U+BFFFD, or U+C0000–U+CFFFD +> *标识符头(Head)* → U+D0000–U+DFFFD or U+E0000–U+EFFFD +> *标识符字符* → 数值 0 到 9 +> *标识符字符* → U+0300–U+036F, U+1DC0–U+1DFF, U+20D0–U+20FF, or U+FE20–U+FE2F +> *标识符字符* → [*标识符头(Head)*](..\chapter3\02_Lexical_Structure.html#identifier_head) +> *标识符字符列表* → [*标识符字符*](..\chapter3\02_Lexical_Structure.html#identifier_character) [*标识符字符列表*](..\chapter3\02_Lexical_Structure.html#identifier_characters) _可选_ +> *隐式参数名* → **$** [*十进制数字列表*](..\chapter3\02_Lexical_Structure.html#decimal_digits) + + + +> 字面量语法 +> *字面量* → [*整型字面量*](..\chapter3\02_Lexical_Structure.html#integer_literal) | [*浮点数字面量*](..\chapter3\02_Lexical_Structure.html#floating_point_literal) | [*字符串字面量*](..\chapter3\02_Lexical_Structure.html#string_literal) + + + +> 整型字面量语法 +> *整型字面量* → [*二进制字面量*](..\chapter3\02_Lexical_Structure.html#binary_literal) +> *整型字面量* → [*八进制字面量*](..\chapter3\02_Lexical_Structure.html#octal_literal) +> *整型字面量* → [*十进制字面量*](..\chapter3\02_Lexical_Structure.html#decimal_literal) +> *整型字面量* → [*十六进制字面量*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal) +> *二进制字面量* → **0b** [*二进制数字*](..\chapter3\02_Lexical_Structure.html#binary_digit) [*二进制字面量字符列表*](..\chapter3\02_Lexical_Structure.html#binary_literal_characters) _可选_ +> *二进制数字* → 数值 0 到 1 +> *二进制字面量字符* → [*二进制数字*](..\chapter3\02_Lexical_Structure.html#binary_digit) | **_** +> *二进制字面量字符列表* → [*二进制字面量字符*](..\chapter3\02_Lexical_Structure.html#binary_literal_character) [*二进制字面量字符列表*](..\chapter3\02_Lexical_Structure.html#binary_literal_characters) _可选_ +> *八进制字面量* → **0o** [*八进字数字*](..\chapter3\02_Lexical_Structure.html#octal_digit) [*八进制字符列表*](..\chapter3\02_Lexical_Structure.html#octal_literal_characters) _可选_ +> *八进字数字* → 数值 0 到 7 +> *八进制字符* → [*八进字数字*](..\chapter3\02_Lexical_Structure.html#octal_digit) | **_** +> *八进制字符列表* → [*八进制字符*](..\chapter3\02_Lexical_Structure.html#octal_literal_character) [*八进制字符列表*](..\chapter3\02_Lexical_Structure.html#octal_literal_characters) _可选_ +> *十进制字面量* → [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit) [*十进制字符列表*](..\chapter3\02_Lexical_Structure.html#decimal_literal_characters) _可选_ +> *十进制数字* → 数值 0 到 9 +> *十进制数字列表* → [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit) [*十进制数字列表*](..\chapter3\02_Lexical_Structure.html#decimal_digits) _可选_ +> *十进制字符* → [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit) | **_** +> *十进制字符列表* → [*十进制字符*](..\chapter3\02_Lexical_Structure.html#decimal_literal_character) [*十进制字符列表*](..\chapter3\02_Lexical_Structure.html#decimal_literal_characters) _可选_ +> *十六进制字面量* → **0x** [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制字面量字符列表*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal_characters) _可选_ +> *十六进制数字* → 数值 0 到 9, a through f, or A through F +> *十六进制字符* → [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) | **_** +> *十六进制字面量字符列表* → [*十六进制字符*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal_character) [*十六进制字面量字符列表*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal_characters) _可选_ + + + +> 浮点型字面量语法 +> *浮点数字面量* → [*十进制字面量*](..\chapter3\02_Lexical_Structure.html#decimal_literal) [*十进制分数*](..\chapter3\02_Lexical_Structure.html#decimal_fraction) _可选_ [*十进制指数*](..\chapter3\02_Lexical_Structure.html#decimal_exponent) _可选_ +> *浮点数字面量* → [*十六进制字面量*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal) [*十六进制分数*](..\chapter3\02_Lexical_Structure.html#hexadecimal_fraction) _可选_ [*十六进制指数*](..\chapter3\02_Lexical_Structure.html#hexadecimal_exponent) +> *十进制分数* → **.** [*十进制字面量*](..\chapter3\02_Lexical_Structure.html#decimal_literal) +> *十进制指数* → [*浮点数e*](..\chapter3\02_Lexical_Structure.html#floating_point_e) [*正负号*](..\chapter3\02_Lexical_Structure.html#sign) _可选_ [*十进制字面量*](..\chapter3\02_Lexical_Structure.html#decimal_literal) +> *十六进制分数* → **.** [*十六进制字面量*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal) _可选_ +> *十六进制指数* → [*浮点数p*](..\chapter3\02_Lexical_Structure.html#floating_point_p) [*正负号*](..\chapter3\02_Lexical_Structure.html#sign) _可选_ [*十六进制字面量*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal) +> *浮点数e* → **e** | **E** +> *浮点数p* → **p** | **P** +> *正负号* → **+** | **-** + + + +> 字符型字面量语法 +> *字符串字面量* → **"** [*引用文本*](..\chapter3\02_Lexical_Structure.html#quoted_text) **"** +> *引用文本* → [*引用文本条目*](..\chapter3\02_Lexical_Structure.html#quoted_text_item) [*引用文本*](..\chapter3\02_Lexical_Structure.html#quoted_text) _可选_ +> *引用文本条目* → [*转义字符*](..\chapter3\02_Lexical_Structure.html#escaped_character) +> *引用文本条目* → **\(** [*表达式*](..\chapter3\04_Expressions.html#expression) **)** +> *引用文本条目* → 除了"­, \­, U+000A, or U+000D的所有Unicode的字符 +> *转义字符* → **\0** | **\\** | **\t** | **\n** | **\r** | **\"** | **\'** +> *转义字符* → **\x** [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) +> *转义字符* → **\u** [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) +> *转义字符* → **\U** [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) + + + +> 运算符语法语法 +> *运算符* → [*运算符字符*](..\chapter3\02_Lexical_Structure.html#operator_character) [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) _可选_ +> *运算符字符* → **/** | **=** | **-** | **+** | **!** | ***** | **%** | **<** | **>** | **&** | **|** | **^** | **~** | **.** +> *二元运算符* → [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) +> *前置运算符* → [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) +> *后置运算符* → [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) + + +## 类型 + +> 类型语法 +> *类型* → [*数组类型*](..\chapter3\03_Types.html#array_type) | [*函数类型*](..\chapter3\03_Types.html#function_type) | [*类型标识*](..\chapter3\03_Types.html#type_identifier) | [*元组类型*](..\chapter3\03_Types.html#tuple_type) | [*可选类型*](..\chapter3\03_Types.html#optional_type) | [*隐式解析可选类型*](..\chapter3\03_Types.html#implicitly_unwrapped_optional_type) | [*协议合成类型*](..\chapter3\03_Types.html#protocol_composition_type) | [*元型类型*](..\chapter3\03_Types.html#metatype_type) + + + +> 类型注解语法 +> *类型注解* → **:** [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type) + + + +> 类型标识语法 +> *类型标识* → [*类型名称*](..\chapter3\03_Types.html#type_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ | [*类型名称*](..\chapter3\03_Types.html#type_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ **.** [*类型标识*](..\chapter3\03_Types.html#type_identifier) +> *类名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) + + + +> 元组类型语法 +> *元组类型* → **(** [*元组类型主体*](..\chapter3\03_Types.html#tuple_type_body) _可选_ **)** +> *元组类型主体* → [*元组类型的元素列表*](..\chapter3\03_Types.html#tuple_type_element_list) **...** _可选_ +> *元组类型的元素列表* → [*元组类型的元素*](..\chapter3\03_Types.html#tuple_type_element) | [*元组类型的元素*](..\chapter3\03_Types.html#tuple_type_element) **,** [*元组类型的元素列表*](..\chapter3\03_Types.html#tuple_type_element_list) +> *元组类型的元素* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **inout** _可选_ [*类型*](..\chapter3\03_Types.html#type) | **inout** _可选_ [*元素名*](..\chapter3\03_Types.html#element_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) +> *元素名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) + + + +> 函数类型语法 +> *函数类型* → [*类型*](..\chapter3\03_Types.html#type) **->** [*类型*](..\chapter3\03_Types.html#type) + + + +> 数组类型语法 +> *数组类型* → [*类型*](..\chapter3\03_Types.html#type) **[** **]** | [*数组类型*](..\chapter3\03_Types.html#array_type) **[** **]** + + + +> 可选类型语法 +> *可选类型* → [*类型*](..\chapter3\03_Types.html#type) **?** + + + +> 隐式解析可选类型(Implicitly Unwrapped Optional Type)语法 +> *隐式解析可选类型* → [*类型*](..\chapter3\03_Types.html#type) **!** + + + +> 协议合成类型语法 +> *协议合成类型* → **protocol** **<** [*协议标识符列表*](..\chapter3\03_Types.html#protocol_identifier_list) _可选_ **>** +> *协议标识符列表* → [*协议标识符*](..\chapter3\03_Types.html#protocol_identifier) | [*协议标识符*](..\chapter3\03_Types.html#protocol_identifier) **,** [*协议标识符列表*](..\chapter3\03_Types.html#protocol_identifier_list) +> *协议标识符* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) + + + +> 元(Metatype)类型语法 +> *元类型* → [*类型*](..\chapter3\03_Types.html#type) **.** **Type** | [*类型*](..\chapter3\03_Types.html#type) **.** **Protocol** + + + +> 类型继承子句语法 +> *类型继承子句* → **:** [*类型继承列表*](..\chapter3\03_Types.html#type_inheritance_list) +> *类型继承列表* → [*类型标识*](..\chapter3\03_Types.html#type_identifier) | [*类型标识*](..\chapter3\03_Types.html#type_identifier) **,** [*类型继承列表*](..\chapter3\03_Types.html#type_inheritance_list) diff --git a/source/chapter3/10_Statements.md b/source/chapter3/10_Statements.md old mode 100644 new mode 100755 index 34e15e13..c9bf88f9 --- a/source/chapter3/10_Statements.md +++ b/source/chapter3/10_Statements.md @@ -1,375 +1,322 @@ -# 语句 - -在 Swift 中,有两种类型的语句:简单语句和控制流语句。简单语句是最常见的,用于构造表达式和声明。控制流语句则用于控制程序执行的流程,Swift 中有三种类型的控制流语句:循环语句、分支语句和控制传递语句。 - -循环语句用于重复执行代码块;分支语句用于执行满足特定条件的代码块;控制传递语句则用于修改代码的执行顺序。在稍后的叙述中,将会详细地介绍每一种类型的控制流语句。 - -是否将分号(;)添加到语句的结尾处是可选的。但若要在同一行内写多条独立语句,请务必使用分号。 - -> GRAMMAR OF A STATEMENT - -> *statement* → [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression)**;** *opt* - -> *statement* → [*declaration*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/declaration)**;** *opt* - -> *statement* → [*loop-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/loop-statement)**;** *opt* - -> *statement* → [*branch-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/branch-statement)**;** *opt* - -> *statement* → [*labeled-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/labeled-statement) - -> *statement* → [*control-transfer-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/control-transfer-statement)**;** *opt* - -> *statement* → [*statment*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/statement) [*statements*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/statements)**;** *opt* - -## 循环语句 - -取决于特定的循环条件,循环语句允许重复执行代码块。Swift 提供四种类型的循环语句:`for`语句、`for-in`语句、`while`语句和`do-while`语句。 - -通过`break`语句和`continue`语句可以改变循环语句的控制流。有关这两条语句,请参考[*Break 语句*`待添加链接`]()和[*Continue 语句*`待添加链接`]()。 - -> GRAMMAR OF A LOOP STATEMENT - -> *loop-statement* → [*for-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/for-statement) - -> *loop-statement* → [*for-in-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/for-in-statement) - -> *loop-statement* → [*while-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/while-statement) - -> *loop-statement* → [*do-while-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/do-while-statement) - -### For 语句 - -`for`语句允许在重复执行代码块的同时,递增一个计数器。 - -`for`语句的形式如下: - -```swift -for `initialzation`; `condition`; `increment` { - `statements` -} -``` - -*initialzation*、*condition*和*increment*之间的分号,以及包围循环体*statements*的大括号都是不可省略的。 - -`for`语句的执行流程如下: - -1. *initialzation*只会被执行一次,通常用于声明和初始化在接下来的循环中需要使用的变量。 - -2. 计算*condition*表达式: - 如果为真(`true`),*statements*将会被执行,然后转到第3步。如果为假(`false`),*statements*和*increment*都不会被执行,`for`至此执行完毕。 - -3. 计算*increment*表达式,然后转到第2步。 - -定义在*initialzation*中的变量仅在`for`语句的作用域以内有效。*condition*表达式的值的类型必须符合`LogicValue`协议。 - -> GRAMMAR OF A FOR STATEMENT - -> *for-statement* → **for** [*for-init*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/for-init) *opt* **;** [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) *opt* **;** [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) *opt* [*code-block*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/code-block) - -> *for-statement* → **for ( ** [*for-init*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/for-init) *opt* **;** [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) *opt* **;** [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) *opt* **)** [*code-block*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/code-block) - -> *for-statement* → [*variable-declaration*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/variable-declaration) | [*expression-list*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression-list) - -### For-In 语句 - -`for-in`语句允许在重复执行代码块的同时,迭代集合(或符合`Sequence`协议的任意类型)中的每一项。 - -`for-in`语句的形式如下: - -```swift -for `item` in `collection` { - `statements` -} -``` - -`for-in`语句在循环开始前会调用*collection*表达式的`generate`方法来获取一个生成器类型(这是一个符合`Generator`协议的类型)的值。接下来循环开始,调用*collection*表达式的`next`方法。如果其返回值不是`None`,它将会被赋给*item*,然后执行*statements*,执行完毕后回到循环开始处;否则,将不会赋值给*item*也不会执行*statements*,`for-in`至此执行完毕。 - -> GRAMMAR OF A FOR-IN STATEMENT - -> *for-in-statement* → **for** [*pattern*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern) **in** [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) [*code-block*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/code-block) - -### While 语句 - -`while`语句允许重复执行代码块。 - -`while`语句的形式如下: - -```swift -while `condition` { - `statements` -} -``` - -`while`语句的执行流程如下: - -1. 计算*condition*表达式: - 如果为真(`true`),转到第2步。如果为假(`false`),`while`至此执行完毕。 - -2. 执行*statements*,然后转到第1步。 - -由于*condition*的值在*statements*执行前就已计算出,因此`while`语句中的*statements*可能会被执行若干次,也可能不会被执行。 - -*condition*表达式的值的类型必须符合`LogicValue`协议。同时,*condition*表达式也可以使用可选绑定,请参考[可选绑定`待添加链接`]()。 - -> GRAMMAR OF A WHILE STATEMENT - -> *while-statement* → **while** [*while-condition*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/while-condition) [*code-block*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/code-block) - -> *while-condition* → [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) | [*declaration*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/declaration) - -### Do-While 语句 - -`do-while`语句允许代码块被执行一次或多次。 - -`do-while`语句的形式如下: - -```swift -do { - `statements` -} while `condition` -``` - -`do-while`语句的执行流程如下: - -1. 执行*statements*,然后转到第2步。 - -2. 计算*condition*表达式: - 如果为真(`true`),转到第1步。如果为假(`false`),`do-while`至此执行完毕。 - -由于*condition*表达式的值是在*statements*表达式执行后才计算出,因此*do-while*语句中的*statements*至少会被执行一次。 - -*condition*表达式的值的类型必须符合`LogicValue`协议。同时,*condition*表达式也可以使用可选绑定,请参考[可选绑定`待添加链接`]()。 - -> GRAMMAR OF A DO-WHILE STATEMENT - -> *do-while-statement* → **do** [*code-block*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/code-block) **while** [*while-condition*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/while-condition) - -## 分支语句 - -取决于一个或者多个条件的值,分支语句允许程序执行指定部分的代码。显然,分支语句中条件的值将会决定如何分支以及执行哪一块代码。Swift 提供两种类型的分支语句:`if`语句和`switch`语句。 - -`switch`语句中的控制流可以用`break`语句修改,请参考[Break 语句`待添加链接`]()。 - -> GRAMMAR OF A BRANCH STATEMENT - -> *branch-statement* → [*if-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/if-statement) - -> *branch-statement* → [*switch-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/switch-statement) - -### If 语句 - -取决于一个或多个条件的值,`if`语句将决定执行哪一块代码。 - -`if`语句有两种标准形式,在这两种形式里都必须有大括号。 - -第一种形式是当且仅当条件为真时执行代码,像下面这样: - -```swift -if `condition` { - `statements` -} -``` - -第二种形式是在第一种形式的基础上添加*else语句*,当只有一个*else语句*时,像下面这样: - -```swift -if `condition` { - `statements to execute if condition is true` -} else { - `statements to execute if condition is false` -} -``` - -同时,*else语句*也可包含`if`语句,从而形成一条链来测试更多的条件,像下面这样: - -```swift -if `condition 1` { - `statements to execute if condition 1 is true` -} else if `condition 2` { - `statements to execute if condition 2 is true` -} -else { - `statements to execute if both conditions are false` -} -``` - -`if`语句中条件的值的类型必须符合`LogicValue`协议。同时,条件也可以使用可选绑定,请参考[可选绑定`待添加链接`]()。 - -> GRAMMAR OF AN IF STATEMENT - -> *if-statement* → **if** [*if-condition*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/if-condition) [*code-block*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/code-block) [*else-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/else-clause) *opt* - -> *if-condition* → [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) | [*declaration*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/declaration) - -> *else-clause* → **else** [*code-block*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/swift/grammar/code-block) | **else** [*if-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/if-statement) *opt* - -### Switch 语句 - -取决于`switch`语句的控制表达式(*control expression*),`switch`语句将决定执行哪一块代码。 - -`switch`语句的形式如下: - -```swift -switch `control expression` { - case `pattern 1`: - `statements` - case `pattern 2` where `condition`: - `statements` - case `pattern 3` where `condition`, - `pattern 4` where `condition`: - `statements` - default: - `statements` -} -``` - -`switch`语句的*控制表达式(control expression)*会首先被计算,然后与每一个*case*的模式(pattern)进行匹配。如果匹配成功,程序将会执行对应的*case*块里的*statements*。另外,每一个*case*块都不能为空,也就是说在每一个*case*块中至少有一条语句。如果你不想在匹配到的*case*块中执行代码,只需在块里写一条`break`语句即可。 - -可以用作控制表达式的值是十分灵活的,除了标量类型(scalar types,如`Int`、`Character`)外,你可以使用任何类型的值,包括浮点数、字符串、元组、自定义类的实例和可选(optional)类型,甚至是枚举类型中的成员值和指定的范围(range)等。关于在`switch`语句中使用这些类型,请参考[控制流`待添加链接`]()一章的[Switch`待添加链接`]()。 - -你可以在模式后面添加一个起保护作用的表达式(guard expression)。*起保护作用的表达式*是这样构成的:关键字`where`后面跟着一个作为额外测试条件的表达式。因此,当且仅当*控制表达式*匹配一个*case*的某个模式且起保护作用的表达式为真时,对应*case*块中的*statements*才会被执行。在下面的例子中,*控制表达式*只会匹配含两个相等元素的元组,如`(1, 1)`: - -```swift -case let (x, y) where x == y: -} -``` - -正如上面这个例子,也可以在模式中使用`let`(或`var`)语句来绑定常量(或变量)。这些常量(或变量)可以在其对应的起保护作用的表达式和其对应的*case*块里的代码中引用。但是,如果*case*中有多个模式匹配控制表达式,那么这些模式都不能绑定常量(或变量)。 - -`switch`语句也可以包含默认(`default`)块,只有其它*case*块都无法匹配控制表达式时,默认块中的代码才会被执行。一个`switch`语句只能有一个默认块,而且必须在`switch`语句的最后面。 - -尽管模式匹配操作实际的执行顺序,特别是模式的计算顺序是不可知的,但是 Swift 规定`switch`语句中的模式匹配的顺序和书写源代码的顺序保持一致。因此,当多个模式含有相同的值且能够匹配控制表达式时,程序只会执行源代码中第一个匹配的*case*块中的代码。 - -#### Switch 语句必须是完备的 - -在 Swift 中,`switch`语句中控制表达式的每一个可能的值都必须至少有一个`case`块与之对应。在某些情况下(例如,表达式的类型是`Int`),你可以使用默认块满足该要求。 - -#### 不存在隐式的贯穿(fall through) - -当匹配的*case*块中的代码执行完毕后,程序会终止`switch`语句,而不会继续执行下一个*case*块。这就意味着,如果你想执行下一个*case*块,需要显式地在你需要的*case*块里使用`fallthrough`语句。关于`fallthrough`语句的更多信息,请参考[Fallthrough 语句`待添加链接`]()。 - -> GRAMMAR OF A SWITCH STATEMENT - -> *switch-statement* → **switch** [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) **{** [*switch-cases*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/switch-cases) *opt* **}** - -> *switch-cases* → [*switch-case*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/switch-case) [*switch-cases*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/switch-cases) *opt* - -> *switch-case* → [*case-label*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/case-label) [*statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/statements) | [*default-label*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/default-label) [*statements*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/statements) - -> *switch-case* → [*case-label*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/case-label) **;** | [*default-label*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/default-label) **;** - -> *case-label* → **case** [*case-item-list*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/case-item-list) **:** - -> *case-item-list* → [*pattern*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern) [*guard-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/guard-clause) *opt* | [*pattern*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern) [*guard-clause*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/guard-clause) *opt*, [*case-item-list*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/case-item-list) - -> *default-label* → **default :** - -> *guard-clause* → **where** [*guard-expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/guard-expression) - -> *guard-expression* → [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) - -## 带标签的语句 - -你可以在循环语句或`switch`语句前面加上*标签*,它由标签名和紧随其后的冒号(:)组成。在`break`和`continue`后面跟上标签名可以显式地在循环语句或`switch`语句中更改控制流,把控制权传递给指定标签标记的语句。关于这两条语句用法,请参考[Break 语句`待添加链接`]()和[Continue 语句`待添加链接`]()。 - -标签的作用域是该标签所标记的语句之后的所有语句。你可以不使用带标签的语句,但只要使用它,标签名就必唯一。 - -关于使用带标签的语句的例子,请参考[控制流`待添加链接`]()一章的[带标签的语句`待添加链接`]()。 - -> GRAMMAR OF A LABELED STATEMENT - -> *labeled-statement* → [*statement-label*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/statement-label) [*loop-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/loop-statement) | [*statement-label*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/statement-label) [*switch-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/switch-statement) - -> *statement-label* → [*label-name*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/label-name) **:** - -> *label-name* → [*identifier*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/identifier) - -## 控制传递语句 - -通过无条件地把控制权从一片代码传递到另一片代码,控制传递语句能够改变代码执行的顺序。Swift 提供四种类型的控制传递语句:`break`语句、`continue`语句、`fallthrough`语句和`return`语句。 - -> GRAMMAR OF A CONTROL TRANSER STATEMENT - -> *control-transfer-statement* → [*break-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/break-statement) - -> *control-transfer-statement* → [*continue-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/continue-statement) - -> *control-transfer-statement* → [*fallthrough-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/fallthrough-statement) - -> *control-transfer-statement* → [*return-statement*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/return-statement) - -### Break 语句 - -`break`语句用于终止循环或`switch`语句的执行。使用`break`语句时,可以只写`break`这个关键词,也可以在`break`后面跟上标签名(label name),像下面这样: - -```swift -break -break `label name` -``` - -当`break`语句后面带标签名时,可用于终止由这个标签标记的循环或`switch`语句的执行。 - -而当只写`break`时,则会终止`switch`语句或上下文中包含`break`语句的最内层循环的执行。 - -在这两种情况下,控制权都会被传递给循环或`switch`语句外面的第一行语句。 - -关于使用`break`语句的例子,请参考[控制流`待添加链接`]()一章的[Break`待添加链接`]()和[带标签的语句`待添加链接`]()。 - -> GRAMMAR OF A BREAK STATEMENT - -> *break-statement* → **break** [*label-name*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/label-name) *opt* - -### Continue 语句 - -`continue`语句用于终止循环中当前迭代的执行,但不会终止该循环的执行。使用`continue`语句时,可以只写`continue`这个关键词,也可以在`continue`后面跟上标签名(label name),像下面这样: - -```swift -continue -continue `label name` -``` - -当`continue`语句后面带标签名时,可用于终止由这个标签标记的循环中当前迭代的执行。 - -而当只写`break`时,可用于终止上下文中包含`continue`语句的最内层循环中当前迭代的执行。 - -在这两种情况下,控制权都会被传递给循环外面的第一行语句。 - -在`for`语句中,`continue`语句执行后,*increment*表达式还是会被计算,这是因为每次循环体执行完毕后*increment*表达式都会被计算。 - -关于使用`continue`语句的例子,请参考[控制流`待添加链接`]()一章的[Continue`待添加链接`]()和[带标签的语句`待添加链接`]()。 - -> GRAMMAR OF A CONTINUE STATEMENT - -> *continue-statement* → **continue** [*label-name*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/label-name) *opt* - -### Fallthrough 语句 - -`fallthrough`语句用于在`switch`语句中传递控制权。`fallthrough`语句会把控制权从`switch`语句中的一个`case`传递给下一个`case`。这种传递是无条件的,即使下一个`case`的值与`switch`语句的控制表达式的值不匹配。 - -`fallthrough`语句可出现在`switch`语句中的任意`case`里,但不能出现在最后一个'case'块。同时,`fallthrough`语句也不能把控制权传递给使用了可选绑定的`case`块。 - -关于在`switch`语句中使用`fallthrough`语句的例子,请参考[控制流`待添加链接`]()一章的[控制传递语句`待添加链接`]()。 - -> GRAMMAR OF A FALLTRHOUGH STATEMENT - -> *continue-statement* → **fallthrough** - -### Return 语句 - -`return`语句用于在函数或方法的实现中将控制权传递给调用者,接着程序将会从调用者的位置继续向下执行。 - -使用`return`语句时,可以只写`return`这个关键词,也可以在`return`后面跟上表达式,像下面这样: - -```swift -return -return `表达式` -``` - -当`return`语句后面带表达式时,表达式的值将会返回给调用者。如果表达式值的类型与调用者期望的类型不匹配,Swift 则会在返回表达式的值之前将表达式值的类型转换为调用者期望的类型。 - -而当只写`return`时,仅仅是将控制权从该函数或方法传递给调用者,而不返回一个值。(这就是说,该函数或方法的返回类型为`Void`或`()`) - -> GRAMMAR OF A RETURN STATEMENT - -> *return-statement* → **return** [*expression*](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/expression) *opt* \ No newline at end of file +> 翻译:[coverxit](https://github.com/coverxit) +> 校对:[numbbbbb](https://github.com/numbbbbb), [coverxit](https://github.com/coverxit), [stanzhai](https://github.com/stanzhai) + +# 语句 +----------------- + +本页包含内容: + +- [循环语句](#loop_statements) +- [分支语句](#branch_statements) +- [带标签的语句](#labeled_statement) +- [控制传递语句](#control_transfer_statements) + +在 Swift 中,有两种类型的语句:简单语句和控制流语句。简单语句是最常见的,用于构造表达式和声明。控制流语句则用于控制程序执行的流程,Swift 中有三种类型的控制流语句:循环语句、分支语句和控制传递语句。 + +循环语句用于重复执行代码块;分支语句用于执行满足特定条件的代码块;控制传递语句则用于修改代码的执行顺序。在稍后的叙述中,将会详细地介绍每一种类型的控制流语句。 + +是否将分号(`;`)添加到语句的结尾处是可选的。但若要在同一行内写多条独立语句,请务必使用分号。 + +> 语句语法 +> *语句* → [*表达式*](..\chapter3\04_Expressions.html#expression) **;** _可选_ +> *语句* → [*声明*](..\chapter3\05_Declarations.html#declaration) **;** _可选_ +> *语句* → [*循环语句*](..\chapter3\10_Statements.html#loop_statement) **;** _可选_ +> *语句* → [*分支语句*](..\chapter3\10_Statements.html#branch_statement) **;** _可选_ +> *语句* → [*标记语句(Labeled Statement)*](..\chapter3\10_Statements.html#labeled_statement) +> *语句* → [*控制转移语句*](..\chapter3\10_Statements.html#control_transfer_statement) **;** _可选_ +> *多条语句(Statements)* → [*语句*](..\chapter3\10_Statements.html#statement) [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) _可选_ + + +## 循环语句 + +取决于特定的循环条件,循环语句允许重复执行代码块。Swift 提供四种类型的循环语句:`for`语句、`for-in`语句、`while`语句和`do-while`语句。 + +通过`break`语句和`continue`语句可以改变循环语句的控制流。有关这两条语句,详情参见 [Break 语句](#break_statement)和 [Continue 语句](#continue_statement)。 + +> 循环语句语法 +> *循环语句* → [*for语句*](..\chapter3\10_Statements.html#for_statement) +> *循环语句* → [*for-in语句*](..\chapter3\10_Statements.html#for_in_statement) +> *循环语句* → [*while语句*](..\chapter3\10_Statements.html#wheetatype类型ile_statement) +> *循环语句* → [*do-while语句*](..\chapter3\10_Statements.html#do_while_statement) + +### For 语句 + +`for`语句允许在重复执行代码块的同时,递增一个计数器。 + +`for`语句的形式如下: + +> for `initialzation`; `condition`; `increment` { +> `statements` +> } + +*initialzation*、*condition* 和 *increment* 之间的分号,以及包围循环体 *statements* 的大括号都是不可省略的。 + +`for`语句的执行流程如下: + +1. *initialzation* 只会被执行一次,通常用于声明和初始化在接下来的循环中需要使用的变量。 +2. 计算 *condition* 表达式: + 如果为`true`,*statements* 将会被执行,然后转到第3步。如果为`false`,*statements* 和 *increment* 都不会被执行,`for`至此执行完毕。 +3. 计算 *increment* 表达式,然后转到第2步。 + +定义在 *initialzation* 中的变量仅在`for`语句的作用域以内有效。*condition* 表达式的值的类型必须遵循`LogicValue`协议。 + +> For 循环语法 +> *for语句* → **for** [*for初始条件*](..\chapter3\10_Statements.html#for_init) _可选_ **;** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ **;** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *for语句* → **for** **(** [*for初始条件*](..\chapter3\10_Statements.html#for_init) _可选_ **;** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ **;** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ **)** [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *for初始条件* → [*变量声明*](..\chapter3\05_Declarations.html#variable_declaration) | [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) + +### For-In 语句 + +`for-in`语句允许在重复执行代码块的同时,迭代集合(或遵循`Sequence`协议的任意类型)中的每一项。 + +`for-in`语句的形式如下: + +> for `item` in `collection` { +> `statements` +> } + +`for-in`语句在循环开始前会调用 *collection* 表达式的`generate`方法来获取一个生成器类型(这是一个遵循`Generator`协议的类型)的值。接下来循环开始,调用 *collection* 表达式的`next`方法。如果其返回值不是`None`,它将会被赋给 *item*,然后执行 *statements*,执行完毕后回到循环开始处;否则,将不会赋值给 *item* 也不会执行 *statements*,`for-in`至此执行完毕。 + +> For-In 循环语法 +> *for-in语句* → **for** [*模式*](..\chapter3\07_Patterns.html#pattern) **in** [*表达式*](..\chapter3\04_Expressions.html#expression) [*代码块*](..\chapter3\05_Declarations.html#code_block) + +### While 语句 + +`while`语句允许重复执行代码块。 + +`while`语句的形式如下: + +> while `condition` { +> `statements` +> } + +`while`语句的执行流程如下: + +1. 计算 *condition* 表达式: + 如果为真`true`,转到第2步。如果为`false`,`while`至此执行完毕。 +2. 执行 *statements* ,然后转到第1步。 + +由于 *condition* 的值在 *statements* 执行前就已计算出,因此`while`语句中的 *statements* 可能会被执行若干次,也可能不会被执行。 + +*condition* 表达式的值的类型必须遵循`LogicValue`协议。同时,*condition* 表达式也可以使用可选绑定,详情参见[可选绑定](../chapter2/01_The_Basics.html#optional_binding)。 + +> While 循环语法 +> *while语句* → **while** [*while条件*](..\chapter3\10_Statements.html#while_condition) [*代码块*](..\chapter3\05_Declarations.html#code_block) +> *while条件* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*声明*](..\chapter3\05_Declarations.html#declaration) + +### Do-While 语句 + +`do-while`语句允许代码块被执行一次或多次。 + +`do-while`语句的形式如下: + +> do { +> `statements` +> } while `condition` + +`do-while`语句的执行流程如下: + +1. 执行 *statements*,然后转到第2步。 +2. 计算 *condition* 表达式: + 如果为`true`,转到第1步。如果为`false`,`do-while`至此执行完毕。 + +由于 *condition* 表达式的值是在 *statements* 执行后才计算出,因此`do-while`语句中的 *statements* 至少会被执行一次。 + +*condition* 表达式的值的类型必须遵循`LogicValue`协议。同时,*condition* 表达式也可以使用可选绑定,详情参见[可选绑定](../chapter2/01_The_Basics.html#optional_binding)。 + +> Do-While 循环语法 +> *do-while语句* → **do** [*代码块*](..\chapter3\05_Declarations.html#code_block) **while** [*while条件*](..\chapter3\10_Statements.html#while_condition) + + +## 分支语句 + +取决于一个或者多个条件的值,分支语句允许程序执行指定部分的代码。显然,分支语句中条件的值将会决定如何分支以及执行哪一块代码。Swift 提供两种类型的分支语句:`if`语句和`switch`语句。 + +`switch`语句中的控制流可以用`break`语句修改,详情请见[Break 语句](#break_statement)。 + +> 分支语句语法 +> *分支语句* → [*if语句*](..\chapter3\10_Statements.html#if_statement) +> *分支语句* → [*switch语句*](..\chapter3\10_Statements.html#switch_statement) + +### If 语句 + +取决于一个或多个条件的值,`if`语句将决定执行哪一块代码。 + +`if`语句有两种标准形式,在这两种形式里都必须有大括号。 + +第一种形式是当且仅当条件为真时执行代码,像下面这样: + +> if `condition` { +> `statements` +> } + +第二种形式是在第一种形式的基础上添加 *else 语句*,当只有一个 else 语句时,像下面这样: + +> if `condition` { +> `statements to execute if condition is true` +> } else { +> `statements to execute if condition is false` +> } + +同时,else 语句也可包含`if`语句,从而形成一条链来测试更多的条件,像下面这样: + +> if `condition 1` { +> `statements to execute if condition 1 is true` +> } else if `condition 2` { +> `statements to execute if condition 2 is true` +> } +> else { +> `statements to execute if both conditions are false` +> } + +`if`语句中条件的值的类型必须遵循`LogicValue`协议。同时,条件也可以使用可选绑定,详情参见[可选绑定](../chapter2/01_The_Basics.html#optional_binding)。 + +> If语句语法 +> *if语句* → **if** [*if条件*](..\chapter3\10_Statements.html#if_condition) [*代码块*](..\chapter3\05_Declarations.html#code_block) [*else子句(Clause)*](..\chapter3\10_Statements.html#else_clause) _可选_ +> *if条件* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*声明*](..\chapter3\05_Declarations.html#declaration) +> *else子句(Clause)* → **else** [*代码块*](..\chapter3\05_Declarations.html#code_block) | **else** [*if语句*](..\chapter3\10_Statements.html#if_statement) + +### Switch 语句 + +取决于`switch`语句的*控制表达式(control expression)*,`switch`语句将决定执行哪一块代码。 + +`switch`语句的形式如下: + +> switch `control expression` { +> case `pattern 1`: +> `statements` +> case `pattern 2` where `condition`: +> `statements` +> case `pattern 3` where `condition`, +> `pattern 4` where `condition`: +> `statements` +> default: +> `statements` +> } + +`switch`语句的*控制表达式(control expression)*会首先被计算,然后与每一个 case 的模式(pattern)进行匹配。如果匹配成功,程序将会执行对应的 case 分支里的 *statements*。另外,每一个 case 分支都不能为空,也就是说在每一个 case 分支中至少有一条语句。如果你不想在匹配到的 case 分支中执行代码,只需在该分支里写一条`break`语句即可。 + +可以用作控制表达式的值是十分灵活的,除了标量类型(scalar types,如`Int`、`Character`)外,你可以使用任何类型的值,包括浮点数、字符串、元组、自定义类的实例和可选(optional)类型,甚至是枚举类型中的成员值和指定的范围(range)等。关于在`switch`语句中使用这些类型,详情参见[控制流](../chapter2/05_Control_Flow.html)一章的 [Switch](../chapter2/05_Control_Flow.html#switch)。 + +你可以在模式后面添加一个起保护作用的表达式(guard expression)。*起保护作用的表达式*是这样构成的:关键字`where`后面跟着一个作为额外测试条件的表达式。因此,当且仅当*控制表达式*匹配一个*case*的某个模式且起保护作用的表达式为真时,对应 case 分支中的 *statements* 才会被执行。在下面的例子中,*控制表达式*只会匹配含两个相等元素的元组,如`(1, 1)`: + +```swift +case let (x, y) where x == y: +``` + +正如上面这个例子,也可以在模式中使用`let`(或`var`)语句来绑定常量(或变量)。这些常量(或变量)可以在其对应的起保护作用的表达式和其对应的*case*块里的代码中引用。但是,如果 case 中有多个模式匹配控制表达式,那么这些模式都不能绑定常量(或变量)。 + +`switch`语句也可以包含默认(`default`)分支,只有其它 case 分支都无法匹配控制表达式时,默认分支中的代码才会被执行。一个`switch`语句只能有一个默认分支,而且必须在`switch`语句的最后面。 + +尽管模式匹配操作实际的执行顺序,特别是模式的计算顺序是不可知的,但是 Swift 规定`switch`语句中的模式匹配的顺序和书写源代码的顺序保持一致。因此,当多个模式含有相同的值且能够匹配控制表达式时,程序只会执行源代码中第一个匹配的 case 分支中的代码。 + +#### Switch 语句必须是完备的 + +在 Swift 中,`switch`语句中控制表达式的每一个可能的值都必须至少有一个 case 分支与之对应。在某些情况下(例如,表达式的类型是`Int`),你可以使用默认块满足该要求。 + +#### 不存在隐式的贯穿(fall through) + +当匹配的 case 分支中的代码执行完毕后,程序会终止`switch`语句,而不会继续执行下一个 case 分支。这就意味着,如果你想执行下一个 case 分支,需要显式地在你需要的 case 分支里使用`fallthrough`语句。关于`fallthrough`语句的更多信息,详情参见 [Fallthrough 语句](#fallthrough_statement)。 + +> Switch语句语法 +> *switch语句* → **switch** [*表达式*](..\chapter3\04_Expressions.html#expression) **{** [*SwitchCase列表*](..\chapter3\10_Statements.html#switch_cases) _可选_ **}** +> *SwitchCase列表* → [*SwitchCase*](..\chapter3\10_Statements.html#switch_case) [*SwitchCase列表*](..\chapter3\10_Statements.html#switch_cases) _可选_ +> *SwitchCase* → [*case标签*](..\chapter3\10_Statements.html#case_label) [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) | [*default标签*](..\chapter3\10_Statements.html#default_label) [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) +> *SwitchCase* → [*case标签*](..\chapter3\10_Statements.html#case_label) **;** | [*default标签*](..\chapter3\10_Statements.html#default_label) **;** +> *case标签* → **case** [*case项列表*](..\chapter3\10_Statements.html#case_item_list) **:** +> *case项列表* → [*模式*](..\chapter3\07_Patterns.html#pattern) [*guard-clause*](..\chapter3\10_Statements.html#guard_clause) _可选_ | [*模式*](..\chapter3\07_Patterns.html#pattern) [*guard-clause*](..\chapter3\10_Statements.html#guard_clause) _可选_ **,** [*case项列表*](..\chapter3\10_Statements.html#case_item_list) +> *default标签* → **default** **:** +> *guard-clause* → **where** [*guard-expression*](..\chapter3\10_Statements.html#guard_expression) +> *guard-expression* → [*表达式*](..\chapter3\04_Expressions.html#expression) + + + 带标签的语句 + +你可以在循环语句或`switch`语句前面加上*标签*,它由标签名和紧随其后的冒号(:)组成。在`break`和`continue`后面跟上标签名可以显式地在循环语句或`switch`语句中更改控制流,把控制权传递给指定标签标记的语句。关于这两条语句用法,详情参见 [Break 语句](#break_statement)和 [Continue 语句](#continue_statement)。 + +标签的作用域是该标签所标记的语句之后的所有语句。你可以不使用带标签的语句,但只要使用它,标签名就必唯一。 + +关于使用带标签的语句的例子,详情参见[控制流](../chapter2/05_Control_Flow.html)一章的[带标签的语句](../chapter2/05_Control_Flow.html#labeled_statements)。 + +> 标记语句语法 +> *标记语句(Labeled Statement)* → [*语句标签*](..\chapter3\10_Statements.html#statement_label) [*循环语句*](..\chapter3\10_Statements.html#loop_statement) | [*语句标签*](..\chapter3\10_Statements.html#statement_label) [*switch语句*](..\chapter3\10_Statements.html#switch_statement) +> *语句标签* → [*标签名称*](..\chapter3\10_Statements.html#label_name) **:** +> *标签名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) + +## 控制传递语句 + +通过无条件地把控制权从一片代码传递到另一片代码,控制传递语句能够改变代码执行的顺序。Swift 提供四种类型的控制传递语句:`break`语句、`continue`语句、`fallthrough`语句和`return`语句。 + +> 控制传递语句(Control Transfer Statement) 语法 +> *控制传递语句* → [*break语句*](..\chapter3\10_Statements.html#break_statement) +> *控制传递语句* → [*continue语句*](..\chapter3\10_Statements.html#continue_statement) +> *控制传递语句* → [*fallthrough语句*](..\chapter3\10_Statements.html#fallthrough_statement) +> *控制传递语句* → [*return语句*](..\chapter3\10_Statements.html#return_statement) + + +### Break 语句 + +`break`语句用于终止循环或`switch`语句的执行。使用`break`语句时,可以只写`break`这个关键词,也可以在`break`后面跟上标签名(label name),像下面这样: + +> break +> break `label name` + +当`break`语句后面带标签名时,可用于终止由这个标签标记的循环或`switch`语句的执行。 + +而当只写`break`时,则会终止`switch`语句或上下文中包含`break`语句的最内层循环的执行。 + +在这两种情况下,控制权都会被传递给循环或`switch`语句外面的第一行语句。 + +关于使用`break`语句的例子,详情参见[控制流](../chapter2/05_Control_Flow.html)一章的 [Break](../chapter2/05_Control_Flow.html#break) 和[带标签的语句](../chapter2/05_Control_Flow.html#labeled_statements)。 + +> Break 语句语法 +> *break语句* → **break** [*标签名称*](..\chapter3\10_Statements.html#label_name) _可选_ + + +### Continue 语句 + +`continue`语句用于终止循环中当前迭代的执行,但不会终止该循环的执行。使用`continue`语句时,可以只写`continue`这个关键词,也可以在`continue`后面跟上标签名(label name),像下面这样: + +> continue +> continue `label name` + +当`continue`语句后面带标签名时,可用于终止由这个标签标记的循环中当前迭代的执行。 + +而当只写`break`时,可用于终止上下文中包含`continue`语句的最内层循环中当前迭代的执行。 + +在这两种情况下,控制权都会被传递给循环外面的第一行语句。 + +在`for`语句中,`continue`语句执行后,*increment* 表达式还是会被计算,这是因为每次循环体执行完毕后 *increment* 表达式都会被计算。 + +关于使用`continue`语句的例子,详情参见[控制流](../chapter2/05_Control_Flow.html)一章的 [Continue](../chapter2/05_Control_Flow.html#continue) 和[带标签的语句](../chapter2/05_Control_Flow.html#labeled_statements)。 + +> Continue 语句语法 +> *continue语句* → **continue** [*标签名称*](..\chapter3\10_Statements.html#label_name) _可选_ + + +### Fallthrough 语句 + +`fallthrough`语句用于在`switch`语句中传递控制权。`fallthrough`语句会把控制权从`switch`语句中的一个 case 传递给下一个 case 。这种传递是无条件的,即使下一个 case 的模式与`switch`语句的控制表达式的值不匹配。 + +`fallthrough`语句可出现在`switch`语句中的任意 case 里,但不能出现在最后一个 case 分支中。同时,`fallthrough`语句也不能把控制权传递给使用了可选绑定的 case 分支。 + +关于在`switch`语句中使用`fallthrough`语句的例子,详情参见[控制流](../chapter2/05_Control_Flow.html)一章的[控制传递语句](../chapter2/05_Control_Flow.html#control_transfer_statements)。 + +> Fallthrough 语句语法 +> *fallthrough语句* → **fallthrough** + +### Return 语句 + +`return`语句用于在函数或方法的实现中将控制权传递给调用者,接着程序将会从调用者的位置继续向下执行。 + +使用`return`语句时,可以只写`return`这个关键词,也可以在`return`后面跟上表达式,像下面这样: + +> return +> return `expression` + +当`return`语句后面带表达式时,表达式的值将会返回给调用者。如果表达式值的类型与调用者期望的类型不匹配,Swift 则会在返回表达式的值之前将表达式值的类型转换为调用者期望的类型。 + +而当只写`return`时,仅仅是将控制权从该函数或方法传递给调用者,而不返回一个值。(这就是说,该函数或方法的返回类型为`Void`或`()`) + +> Return 语句语法 +> *return语句* → **return** [*表达式*](..\chapter3\04_Expressions.html#expression) _可选_ diff --git a/source/chapter3/chapter3.md b/source/chapter3/chapter3.md old mode 100644 new mode 100755 diff --git a/source/cover.jpg b/source/cover.jpg new file mode 100644 index 00000000..ea7077ad Binary files /dev/null and b/source/cover.jpg differ diff --git a/source/cover_small.jpg b/source/cover_small.jpg new file mode 100644 index 00000000..d3aa2e69 Binary files /dev/null and b/source/cover_small.jpg differ