{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/77194231","id":77194231,"diff_hunk":"@@ -164,27 +226,50 @@ Async/await is my leading theory for what asynchronicity in Swift will look like\n \n The first function, `GetIntAsync` returns a tasks that waits for some amount of time, and then returns a value. Because it returns a `Task`, it is marked as `async`. The second function, `MyMethodAsync`, calls the first, using the keyword `await`. This signals to the system that it can do other work until the `Task` from `GetIntAsync` completes. Once it completes, control is restored to the function, and it can write to the console.\n \n+第一个函数方法，`GetIntAsync` 返回了一个任务，该任务等待一段时间后返回了一个值。因为这个函数返回了一个 `Task`，所以被标记为 `async`。第二个函数方法，首先调用 `MyMethodAsync`，使用关键词 `await`。这个信号监测了这个信号系统，在 `Task` 完成并执行 `GetIntAsync`\n+之前，这个系统可以做其他的事情。而一旦这个任务完成了，这个函数就会恢复控制功能，重新获得编写控制台输出的能力。\n+\n Judging from this example, `Task` objects in C# seem a lot like [promises](http://khanlou.com/2016/08/promises-in-swift/). Also, any function that uses the `await` keyword must itself be declared as `async`. The compiler can enforce this guarantee. This solution mirrors Swift’s error model: functions that throw must be caught, and if they don’t, they must be marked with `throws` as well.\n \n+从这个例子看来，C# 的 `Task` 对象看起来很像 [Promise (承诺)](http://khanlou.com/2016/08/promises-in-swift/)。此外，任何使用 `await` 的函数都必须被定义为 `async`。编译器可以确保这点。这个解决方案映射出了 Swift 的错误模型：被抛出的函数方法必须被捕捉到，而如果没有，那这些函数方法一定也是被标记了 `throws` 。\n+\n It also has the same flaws as the error model. Rather than being mere syntactic sugar over a more useful tool, a brand new construct and a bunch of keywords are added. This construct is partially dependent on types within defined in the standard library and partially dependent on syntax baked into the compiler.\n \n+它也像错误模型一样有着缺陷。一个全新的构造和一些关键词的添加之后使它变的更像是一种纯粹的语法糖而不是一个更有用的工具。这这种构造一部分依赖于在标准库中定义的类型，一部分依赖于编译器定义的语法。\n+\n ### Properties\n \n+### 属性\n+\n Property behaviors are another big feature that might come in Swift 4\\. There is a [rejected proposal](https://github.com/apple/swift-evolution/blob/master/proposals/0030-property-behavior-decls.md) for property behaviors, which is set to be examined more closely for Swift 4.\n \n+属性行为是 Swift 4 可能引入的另一个重大特性。这里是关于属性行为的[被拒绝的提案](https://github.com/apple/swift-evolution/blob/master/proposals/0030-property-behavior-decls.md)，被用来对 Swift 4 进行更加仔细地检查。\n+\n Property behaviors let you attach a behavior like `lazy` to a property. The `lazy` property, for example, would only set up a value the first time it’s accessed. While you currently can use this particular behavior, it’s hard-coded into the Swift compiler. Property behaviors as proposed would allow the facility for the standard library to implement some behaviors and for users to define others entirely.\n \n+属性行为让你可以对一个属性附加上一个类似 `lazy` 的行为。这个 `lazy` 属性，举个例子，将只在第一次访问时设置一个值。但你已经可以使用这个特定的行为，这是直接硬编码进 Swift 的编译器的。按照计划，属性行为将允许标准库设施来实现一些行为和允许用户去对其他进行完全的定义。","path":"TODO/my-least-favorite-thing-about-swift.md","position":237,"original_position":237,"commit_id":"2ec2ed16b7cb57d74e1a725373a14e632af1fce9","original_commit_id":"5f07c3cc9ee5bce07d75924e016a111676545fb9","user":{"login":"cbangchen","id":11977680,"avatar_url":"https://avatars.githubusercontent.com/u/11977680?v=3","gravatar_id":"","url":"https://api.github.com/users/cbangchen","html_url":"https://github.com/cbangchen","followers_url":"https://api.github.com/users/cbangchen/followers","following_url":"https://api.github.com/users/cbangchen/following{/other_user}","gists_url":"https://api.github.com/users/cbangchen/gists{/gist_id}","starred_url":"https://api.github.com/users/cbangchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbangchen/subscriptions","organizations_url":"https://api.github.com/users/cbangchen/orgs","repos_url":"https://api.github.com/users/cbangchen/repos","events_url":"https://api.github.com/users/cbangchen/events{/privacy}","received_events_url":"https://api.github.com/users/cbangchen/received_events","type":"User","site_admin":false},"body":"。。。前面有主语了","created_at":"2016-09-01T15:16:19Z","updated_at":"2016-09-01T15:16:19Z","html_url":"https://github.com/xitu/gold-miner/pull/698#discussion_r77194231","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/698","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/77194231"},"html":{"href":"https://github.com/xitu/gold-miner/pull/698#discussion_r77194231"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/698"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/698","id":83601116,"html_url":"https://github.com/xitu/gold-miner/pull/698","diff_url":"https://github.com/xitu/gold-miner/pull/698.diff","patch_url":"https://github.com/xitu/gold-miner/pull/698.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/698","number":698,"state":"open","locked":false,"title":"关于 Swift，我不喜欢的几点 ","user":{"login":"cbangchen","id":11977680,"avatar_url":"https://avatars.githubusercontent.com/u/11977680?v=3","gravatar_id":"","url":"https://api.github.com/users/cbangchen","html_url":"https://github.com/cbangchen","followers_url":"https://api.github.com/users/cbangchen/followers","following_url":"https://api.github.com/users/cbangchen/following{/other_user}","gists_url":"https://api.github.com/users/cbangchen/gists{/gist_id}","starred_url":"https://api.github.com/users/cbangchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbangchen/subscriptions","organizations_url":"https://api.github.com/users/cbangchen/orgs","repos_url":"https://api.github.com/users/cbangchen/repos","events_url":"https://api.github.com/users/cbangchen/events{/privacy}","received_events_url":"https://api.github.com/users/cbangchen/received_events","type":"User","site_admin":false},"body":"my-least-favorite-thing-about-swift 初稿完成","created_at":"2016-09-01T09:44:26Z","updated_at":"2016-09-01T15:16:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/698/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/698/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/698/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/2ec2ed16b7cb57d74e1a725373a14e632af1fce9","head":{"label":"cbangchen:translate","ref":"translate","sha":"2ec2ed16b7cb57d74e1a725373a14e632af1fce9","user":{"login":"cbangchen","id":11977680,"avatar_url":"https://avatars.githubusercontent.com/u/11977680?v=3","gravatar_id":"","url":"https://api.github.com/users/cbangchen","html_url":"https://github.com/cbangchen","followers_url":"https://api.github.com/users/cbangchen/followers","following_url":"https://api.github.com/users/cbangchen/following{/other_user}","gists_url":"https://api.github.com/users/cbangchen/gists{/gist_id}","starred_url":"https://api.github.com/users/cbangchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbangchen/subscriptions","organizations_url":"https://api.github.com/users/cbangchen/orgs","repos_url":"https://api.github.com/users/cbangchen/repos","events_url":"https://api.github.com/users/cbangchen/events{/privacy}","received_events_url":"https://api.github.com/users/cbangchen/received_events","type":"User","site_admin":false},"repo":{"id":67049211,"name":"gold-miner","full_name":"cbangchen/gold-miner","owner":{"login":"cbangchen","id":11977680,"avatar_url":"https://avatars.githubusercontent.com/u/11977680?v=3","gravatar_id":"","url":"https://api.github.com/users/cbangchen","html_url":"https://github.com/cbangchen","followers_url":"https://api.github.com/users/cbangchen/followers","following_url":"https://api.github.com/users/cbangchen/following{/other_user}","gists_url":"https://api.github.com/users/cbangchen/gists{/gist_id}","starred_url":"https://api.github.com/users/cbangchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbangchen/subscriptions","organizations_url":"https://api.github.com/users/cbangchen/orgs","repos_url":"https://api.github.com/users/cbangchen/repos","events_url":"https://api.github.com/users/cbangchen/events{/privacy}","received_events_url":"https://api.github.com/users/cbangchen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbangchen/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":true,"url":"https://api.github.com/repos/cbangchen/gold-miner","forks_url":"https://api.github.com/repos/cbangchen/gold-miner/forks","keys_url":"https://api.github.com/repos/cbangchen/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbangchen/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbangchen/gold-miner/teams","hooks_url":"https://api.github.com/repos/cbangchen/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/cbangchen/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/cbangchen/gold-miner/events","assignees_url":"https://api.github.com/repos/cbangchen/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/cbangchen/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/cbangchen/gold-miner/tags","blobs_url":"https://api.github.com/repos/cbangchen/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbangchen/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbangchen/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbangchen/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbangchen/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/cbangchen/gold-miner/languages","stargazers_url":"https://api.github.com/repos/cbangchen/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/cbangchen/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/cbangchen/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/cbangchen/gold-miner/subscription","commits_url":"https://api.github.com/repos/cbangchen/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbangchen/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbangchen/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbangchen/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbangchen/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/cbangchen/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbangchen/gold-miner/merges","archive_url":"https://api.github.com/repos/cbangchen/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbangchen/gold-miner/downloads","issues_url":"https://api.github.com/repos/cbangchen/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/cbangchen/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/cbangchen/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/cbangchen/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbangchen/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/cbangchen/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/cbangchen/gold-miner/deployments","created_at":"2016-08-31T15:18:58Z","updated_at":"2016-08-31T15:17:03Z","pushed_at":"2016-09-01T14:59:24Z","git_url":"git://github.com/cbangchen/gold-miner.git","ssh_url":"git@github.com:cbangchen/gold-miner.git","clone_url":"https://github.com/cbangchen/gold-miner.git","svn_url":"https://github.com/cbangchen/gold-miner","homepage":"http://gold.xitu.io","size":15042,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xitu:master","ref":"master","sha":"e5a0ca13785367468afd1264cbd4bdc397eeb90d","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/xitu/gold-miner/deployments","created_at":"2015-11-04T03:29:13Z","updated_at":"2016-09-01T15:15:51Z","pushed_at":"2016-09-01T14:59:24Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"http://gold.xitu.io","size":15955,"stargazers_count":3265,"watchers_count":3265,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":611,"mirror_url":null,"open_issues_count":20,"forks":611,"open_issues":20,"watchers":3265,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/698"},"html":{"href":"https://github.com/xitu/gold-miner/pull/698"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/698"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/698/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/698/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/698/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/2ec2ed16b7cb57d74e1a725373a14e632af1fce9"}}}}
{"actor":{"display_login":"cbangchen"}}