Files
the-way-to-go_ZH_CN/eBook
Respawnz 43672654ca 从翻译上调整了一下英文原著解释中的因果顺序 (#606)
* 建议从翻译上调转了一下英文原著解释中的因果顺序

英文原著:
> Notice the use of the closure:  the current i, xi are passed to the closure as parameters, masking the i, xi variables from the outer for-loop.  This allows each goroutine to have its own copy of i, xi; otherwise, the next iteration of the for-loop would update i, xi in all goroutines. On the other hand, the res slice is not passed to the closure, since each goroutine does not need a separate copy of it.  The res slice is part of the closure’s environment but is not a parameter

原译文:
>注意闭合:i、xi 都是作为参数传入闭合函数的,从外层循环中隐藏了变量 i 和 xi。让每个协程有一份 i 和 xi 的拷贝;另外,for 循环的下一次迭代会更新所有协程中 i 和 xi 的值。切片 res 没有传入闭合函数,因为协程不需要单独拷贝一份。切片 res 也在闭合函数中但并不是参数。

 我的建议:
>注意上述代码中闭合函数的用法:`i`、`xi` 都是作为参数传入闭合函数的,这一做法使得每个协程有一份 `i` 和 `xi` 的拷贝,从而向闭合函数内部隐藏了外层循环中的变量 `i` 和 `xi`;否则,for 循环的下一次迭代会更新所有协程中 `i` 和 `xi` 的值。另一方面,切片 `res` 没有传入闭合函数,因为协程不需要`res`的单独拷贝。切片 `res` 也在闭合函数中但并不是参数。

* 增加了译者注和一些用词调整
2019-04-25 15:46:37 -04:00
..
2018-09-10 06:34:37 -04:00
2015-08-24 19:37:44 +08:00
2017-06-12 07:46:19 -04:00
2019-01-29 20:25:34 -05:00
2018-09-06 06:15:09 -04:00
2019-01-29 20:24:34 -05:00
2015-03-15 22:40:00 -04:00
2015-03-17 00:45:56 -04:00
2015-03-17 23:02:36 -04:00
2015-03-19 06:45:51 -04:00
2015-09-19 10:11:41 +08:00
2015-03-19 06:52:51 -04:00
2019-01-29 20:24:34 -05:00
2015-07-18 22:37:48 +08:00
2014-04-08 16:37:57 -04:00
2014-04-08 16:37:57 -04:00
2016-03-19 19:00:10 +08:00
2018-04-25 13:40:42 -04:00
2015-10-05 13:24:44 +08:00
2018-07-18 20:06:42 +08:00
2015-03-23 08:29:12 -04:00
2018-09-20 15:04:44 -04:00
2018-09-21 11:53:06 -04:00
2016-03-19 22:32:07 +08:00
2018-03-29 09:37:58 -04:00
2018-08-17 20:11:27 +08:00
2019-04-13 08:13:27 -04:00
2018-09-11 08:59:45 -04:00
2018-11-05 16:41:30 -05:00
2016-03-22 11:11:56 +08:00
2015-09-11 09:49:31 -04:00
2018-03-05 03:55:09 -05:00
2016-03-28 09:28:00 +08:00
2018-07-24 19:36:39 +08:00
2019-03-01 20:20:12 -05:00
2018-07-24 19:36:39 +08:00
2015-07-20 13:26:20 +08:00
2016-11-19 22:24:03 -05:00
2018-05-18 17:35:46 -04:00
2018-05-18 17:36:01 -04:00
2017-03-29 19:03:39 -04:00
2017-03-29 19:03:39 -04:00
2017-10-13 16:43:37 -04:00
2017-10-13 05:07:45 -04:00
2018-05-28 20:37:33 +08:00
2014-10-17 23:43:37 -04:00
2015-07-26 17:16:55 +08:00
2017-04-03 14:30:42 -04:00
2017-03-29 19:03:39 -04:00
2017-11-21 23:39:03 -05:00
2017-06-13 16:01:06 -04:00
2018-10-15 22:00:56 -04:00
2018-04-25 13:40:31 -04:00
2017-03-29 19:03:39 -04:00
2018-07-24 19:36:39 +08:00
2017-07-27 17:11:14 -04:00
2015-08-03 09:42:21 +08:00
2019-03-13 17:41:42 -04:00
2017-03-29 19:03:39 -04:00
2017-05-29 14:35:33 -04:00
2016-01-16 00:27:25 +08:00
2017-05-17 21:15:29 -04:00
2019-03-16 21:49:52 -04:00
2018-06-08 08:07:14 +08:00
2018-03-16 13:48:41 -04:00
2018-04-22 18:36:09 -04:00
2018-04-22 18:36:23 -04:00
2019-01-29 20:25:18 -05:00
2017-03-29 19:03:39 -04:00
2019-03-16 21:48:03 -04:00
2016-03-19 15:19:17 +08:00
2017-10-13 05:09:21 -04:00
2016-03-15 12:34:44 +08:00
2018-04-25 13:40:04 -04:00
2019-03-26 18:45:07 -04:00
2016-08-26 10:56:59 -07:00
2015-11-11 12:47:10 -05:00
2018-05-18 17:36:17 -04:00
2015-09-08 06:11:37 -04:00
2018-05-18 17:36:38 -04:00
2017-01-20 18:35:05 +08:00
2015-09-08 06:11:37 -04:00
2018-05-18 17:37:22 -04:00
2018-06-12 21:38:55 +08:00
2018-05-22 15:16:34 +08:00
2018-05-22 15:17:16 +08:00
2017-06-25 07:58:44 -04:00
2015-10-31 15:38:25 -04:00
2018-05-23 11:44:57 +08:00
2019-04-08 10:32:33 -04:00
2015-11-11 12:47:10 -05:00
2018-06-06 10:11:39 +08:00
2018-05-26 09:29:15 +08:00
2019-04-15 12:36:26 -04:00
2018-05-29 09:54:51 +08:00
2018-05-29 09:54:43 +08:00
2017-07-27 17:10:43 -04:00
2015-11-18 19:06:39 -05:00
2018-05-28 20:37:33 +08:00
2018-06-13 21:41:50 +08:00
2019-04-25 15:45:40 -04:00
2018-05-28 20:37:33 +08:00
2015-11-25 01:23:32 -05:00
2018-05-28 20:37:33 +08:00
2015-12-31 23:53:01 -05:00
2018-06-15 13:46:47 +08:00
2017-06-10 22:22:58 -04:00
2018-09-09 09:15:53 -04:00
2016-11-19 22:22:57 -05:00
2018-05-25 06:42:57 +08:00
2015-12-08 16:34:58 +08:00
2018-07-19 19:22:04 +08:00
2018-07-20 19:18:20 +08:00
2018-05-22 08:14:26 +08:00
2016-03-22 23:40:41 +08:00
2018-07-24 19:36:03 +08:00
2017-03-29 19:03:39 -04:00
2016-03-23 22:48:26 +08:00
2016-03-23 22:50:49 +08:00
2018-04-16 19:31:36 -04:00
2016-03-24 22:56:39 +08:00
2016-03-24 22:45:35 +08:00
2016-03-24 22:53:45 +08:00
2016-03-26 22:42:15 +08:00
2016-04-05 05:25:50 -04:00
2016-01-02 20:47:13 +08:00
2019-03-16 21:49:31 -04:00
2016-01-03 22:23:20 +08:00
2016-01-03 22:25:47 +08:00
2018-03-05 03:52:11 -05:00
2016-01-03 22:45:20 +08:00
2016-01-03 22:45:20 +08:00
2016-01-03 22:25:47 +08:00
2016-01-04 22:55:29 +08:00
2016-01-03 22:45:20 +08:00
2018-06-03 15:54:18 +08:00
2016-01-05 21:24:32 +08:00
2018-04-16 19:31:24 -04:00
2016-12-26 10:16:33 +08:00