Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
944b432
简洁翻译Andrei Alexandrescu的话
Heromyth Jul 13, 2017
c805bd5
Translated by zxp
Heromyth Jul 14, 2017
4dfc78a
翻译导致错误格式
Jul 14, 2017
65cf15c
Translated by Heromyth
Heromyth Jul 18, 2017
747a9b7
Project translation
Heromyth Jul 18, 2017
07147e4
Project translation
Heromyth Jul 18, 2017
e74ac6e
改进ddoc文档翻译
Heromyth Jul 18, 2017
5e11a38
Translated by Heromyth
Heromyth Jul 18, 2017
ce5b31f
Translated by Heromyth
Heromyth Jul 19, 2017
feefc58
Translated by Heromyth
Heromyth Jul 19, 2017
98b30f7
Translated by Heromyth
Heromyth Jul 20, 2017
f4929fe
Project translation
Heromyth Jul 21, 2017
1e637af
Project translation
Heromyth Jul 21, 2017
7d3afcc
Translated by Heromyth
Heromyth Jul 21, 2017
0b09a89
Project translation
Heromyth Jul 26, 2017
5fe1e73
Translated by Heromyth
Heromyth Jul 26, 2017
f473918
Translated by Heromyth
Heromyth Jul 26, 2017
fa2fc7c
Translated by Heromyth
Heromyth Aug 1, 2017
7383971
Translated by Heromyth
Heromyth Aug 1, 2017
9589d48
Translated by Heromyth
Heromyth Aug 1, 2017
a0681b3
Translated by Heromyth
Heromyth Aug 1, 2017
adf75ea
Translated by Heromyth
Heromyth Aug 1, 2017
9dbb29e
Translated by Heromyth
Heromyth Aug 2, 2017
c1f0c7b
Translated by Heromyth
Heromyth Aug 2, 2017
7feb4d0
Translated by Heromyth
Heromyth Aug 2, 2017
19b82d9
Project translation
Heromyth Aug 2, 2017
b722ef1
Translated by Heromyth
Heromyth Aug 2, 2017
a9489e5
Project translation
Heromyth Aug 2, 2017
3380765
Translated by Heromyth
Heromyth Aug 2, 2017
74f50be
Translated by Heromyth
Heromyth Aug 3, 2017
96d675c
Translated by Heromyth
Heromyth Aug 3, 2017
6b13ce1
Project translation
Heromyth Aug 3, 2017
3aad6ad
Translated by Heromyth
Heromyth Aug 3, 2017
36904b2
Translated by Heromyth
Heromyth Aug 3, 2017
cb130e9
Translated by Heromyth
Heromyth Aug 3, 2017
343f793
Translated by Heromyth
Heromyth Aug 3, 2017
6fe8394
Translated by Heromyth
Heromyth Aug 4, 2017
e091b65
Translated by Heromyth
Heromyth Aug 4, 2017
faebdef
Project translation
Heromyth Aug 4, 2017
b41f108
Translated by Heromyth
Heromyth Aug 4, 2017
a278210
Translated by Heromyth
Heromyth Aug 5, 2017
1f46771
Translated by Heromyth
Heromyth Aug 10, 2017
3c4367f
Translated by Heromyth
Heromyth Aug 14, 2017
62b1e00
Translated by Heromyth
Heromyth Aug 15, 2017
ebc1d2f
Translated by Heromyth
Heromyth Aug 15, 2017
798c60e
Translated by Heromyth
Heromyth Aug 15, 2017
ecb0617
Translated by Heromyth
Heromyth Aug 16, 2017
cfcd5ca
Translated by Heromyth
Heromyth Aug 16, 2017
bbcce2c
Translated by Heromyth
Heromyth Aug 16, 2017
d5af254
Project translation
Heromyth Aug 16, 2017
881d206
完成uda和index两页翻译
Heromyth Aug 16, 2017
ad71087
简化共享翻译目录结构
Heromyth Aug 16, 2017
2d6721b
Translated by Heromyth
Heromyth Aug 17, 2017
5eb545b
优化目录结构
Heromyth Aug 17, 2017
93270bd
移除已译原文档
Heromyth Aug 17, 2017
80ea6be
Translated by Heromyth
Heromyth Aug 17, 2017
623dbcf
Translated by Heromyth
Heromyth Aug 17, 2017
360ba08
Project translation
Heromyth Aug 17, 2017
5cb47cd
Translated by Heromyth
Heromyth Aug 17, 2017
40c637d
完成数组一章的翻译
Heromyth Aug 17, 2017
05648c4
Project translation
Heromyth Aug 18, 2017
e12086b
Translated by Heromyth
Heromyth Aug 18, 2017
244ce73
Project translation
Heromyth Aug 18, 2017
dfaf3c2
Translated by Heromyth
Heromyth Aug 18, 2017
e27f9fe
Project translation
Heromyth Aug 18, 2017
741076d
Translated by Heromyth
Heromyth Aug 18, 2017
0768764
分配新章节翻译
Heromyth Aug 19, 2017
ddb31ac
Translated by Heromyth
Heromyth Aug 19, 2017
848368d
Translated by Heromyth
Heromyth Aug 19, 2017
9bce589
Translated by Heromyth
Heromyth Aug 19, 2017
b2bd24b
Translated by Heromyth
Heromyth Aug 19, 2017
9240e9e
Translated by Heromyth
Heromyth Aug 19, 2017
ac43df2
Translated by Heromyth
Heromyth Aug 19, 2017
94ed59d
Translated by Heromyth
Heromyth Aug 19, 2017
8f3c97e
Translated by Heromyth
Heromyth Aug 19, 2017
1b9c6f3
Translated by Heromyth
Heromyth Aug 19, 2017
99f4f91
Translated by Heromyth
Heromyth Aug 20, 2017
87ce45f
Project translation
Heromyth Aug 20, 2017
dcd999b
Translated by Heromyth
Heromyth Aug 20, 2017
cc45751
Translated by Heromyth
Heromyth Aug 20, 2017
04f6487
Project translation
Heromyth Aug 20, 2017
3d77497
Translated by Heromyth
Heromyth Aug 20, 2017
344d762
Project translation
Heromyth Aug 20, 2017
c025f25
Translated by Heromyth
Heromyth Aug 20, 2017
39e7860
Project translation
Heromyth Aug 20, 2017
c078e39
Translated by Heromyth
Heromyth Aug 20, 2017
2865efe
Project translation
Heromyth Aug 20, 2017
769e1b7
Project translation
Heromyth Aug 20, 2017
9a81d99
准备新章节翻译
Heromyth Aug 20, 2017
7dea49d
Translated by Heromyth
Heromyth Aug 23, 2017
72a3062
Project translation
Heromyth Aug 23, 2017
a0971c5
Translated by Heromyth
Heromyth Aug 24, 2017
6878388
Translated by Heromyth
Heromyth Aug 24, 2017
72df2b3
Translated by Heromyth
Heromyth Aug 24, 2017
505863f
Translated by Heromyth
Heromyth Aug 25, 2017
afc37b1
Translated by Heromyth
Heromyth Aug 25, 2017
41d2532
Translated by Heromyth
Heromyth Aug 25, 2017
54b7a5a
Translated by Heromyth
Heromyth Aug 25, 2017
5038f87
Translated by Heromyth
Heromyth Aug 25, 2017
d3485a1
Translated by Heromyth
Heromyth Aug 25, 2017
e0e527f
Translated by Heromyth
Heromyth Aug 25, 2017
e69437f
Project translation
Heromyth Aug 25, 2017
adb7852
Translated by Heromyth
Heromyth Aug 25, 2017
d5d517c
Translated by Heromyth
Heromyth Aug 25, 2017
7ad2387
Translated by Heromyth
Heromyth Aug 25, 2017
92b90f8
Translated by Heromyth
Heromyth Aug 25, 2017
6d62e7d
Translated by Heromyth
Heromyth Aug 26, 2017
150cc33
Translated by Heromyth
Heromyth Aug 26, 2017
f00cefa
Translated by Heromyth
Heromyth Aug 26, 2017
0914c92
Translated by Heromyth
Heromyth Aug 26, 2017
45a9903
Project translation
Heromyth Aug 26, 2017
6bdbb36
新的翻译章节
Heromyth Aug 26, 2017
f592b19
Translated by Heromyth
Heromyth Aug 26, 2017
56e5e45
Translated by Heromyth
Heromyth Aug 26, 2017
3c8073a
Translated by Heromyth
Heromyth Aug 26, 2017
c33c8d4
Translated by Heromyth
Heromyth Aug 26, 2017
e360e0a
Translated by Heromyth
Heromyth Aug 26, 2017
82da330
Translated by Heromyth
Heromyth Aug 26, 2017
9e1c20c
Translated by Heromyth
Heromyth Aug 26, 2017
21ec55e
Translated by Heromyth
Heromyth Aug 26, 2017
7fc3bf5
Translated by Heromyth
Heromyth Aug 26, 2017
aee9712
Translated by Heromyth
Heromyth Aug 26, 2017
707e46e
Translated by Heromyth
Heromyth Aug 26, 2017
f7158dc
Translated by Heromyth
Heromyth Aug 26, 2017
b7753a6
Translated by Heromyth
Heromyth Aug 26, 2017
ffbc25b
Translated by Heromyth
Heromyth Aug 26, 2017
ad472c3
Translated by Heromyth
Heromyth Aug 26, 2017
c94e776
Translated by Heromyth
Heromyth Aug 26, 2017
6a1cccb
Translated by Heromyth
Heromyth Aug 26, 2017
52078d3
Project translation
Heromyth Aug 26, 2017
ed7609b
Translated by Heromyth
Heromyth Aug 26, 2017
5e8d4f0
Translated by Heromyth
Heromyth Aug 26, 2017
caf189f
Translated by Heromyth
Heromyth Aug 26, 2017
26fd982
Translated by Heromyth
Heromyth Aug 26, 2017
6e0571d
Translated by Heromyth
Heromyth Aug 26, 2017
91fc42c
Translated by Heromyth
Heromyth Aug 26, 2017
f5af2bb
Translated by Heromyth
Heromyth Aug 26, 2017
9314ad3
Translated by Heromyth
Heromyth Aug 26, 2017
fc1cf37
Translated by Heromyth
Heromyth Aug 26, 2017
8bf6c12
Translated by Heromyth
Heromyth Aug 26, 2017
593ce18
Translated by Heromyth
Heromyth Aug 26, 2017
48ff43f
Project translation
Heromyth Aug 26, 2017
5c701d4
Translated by Heromyth
Heromyth Aug 26, 2017
992faf0
Translated by Heromyth
Heromyth Aug 26, 2017
4c94289
Project translation
Heromyth Aug 26, 2017
d938712
Translated by Heromyth
Heromyth Aug 27, 2017
95329e1
Translated by Heromyth
Heromyth Aug 27, 2017
b950a7a
Translated by Heromyth
Heromyth Aug 27, 2017
5549015
Translated by Heromyth
Heromyth Aug 27, 2017
d328596
Translated by Heromyth
Heromyth Aug 27, 2017
6217eb6
Translated by Heromyth
Heromyth Aug 27, 2017
5c719cf
Translated by Heromyth
Heromyth Aug 27, 2017
a2fd06e
Translated by Heromyth
Heromyth Aug 27, 2017
4a798d3
Translated by Heromyth
Heromyth Aug 27, 2017
de7288d
Translated by Heromyth
Heromyth Aug 27, 2017
1293a2f
Project translation
Heromyth Aug 27, 2017
105e43e
Project translation
Heromyth Aug 27, 2017
bdb2c7f
Translated by Heromyth
Heromyth Aug 27, 2017
c8198fa
Project translation
Heromyth Aug 27, 2017
4de543d
Translated by Heromyth
Heromyth Aug 31, 2017
d327086
Project translation
Heromyth Aug 31, 2017
3dfc2ea
准备新的翻译章节
Heromyth Aug 31, 2017
730f52d
Translated by Heromyth
Heromyth Sep 5, 2017
b9ab914
Translated by Heromyth
Heromyth Sep 6, 2017
d1649c0
Translated by Heromyth
Heromyth Sep 6, 2017
5850dd6
Translated by Heromyth
Heromyth Sep 6, 2017
a88f33e
Translated by Heromyth
Heromyth Sep 6, 2017
5cffad8
Project translation
Heromyth Sep 6, 2017
ecbdab5
Translated by Heromyth
Heromyth Sep 6, 2017
6edd3ed
Translated by Heromyth
Heromyth Sep 9, 2017
e86cdd4
Translated by Heromyth
Heromyth Sep 12, 2017
73b917b
Translated by Heromyth
Heromyth Sep 13, 2017
3360a6e
Translated by Heromyth
Heromyth Sep 13, 2017
7c50d92
Translated by Heromyth
Heromyth Sep 13, 2017
66ed291
Translated by Heromyth
Heromyth Sep 14, 2017
dfb7cac
Translated by Heromyth
Heromyth Sep 14, 2017
b3bc0ce
Translated by Heromyth
Heromyth Sep 14, 2017
3e08a76
Translated by Heromyth
Heromyth Sep 15, 2017
fb4d4cf
Translated by Heromyth
Heromyth Sep 15, 2017
186bff5
Translated by Heromyth
Heromyth Sep 15, 2017
6cb1d95
Translated by Heromyth
Heromyth Oct 17, 2017
ff326fc
Translated by Heromyth
Heromyth Oct 17, 2017
036c6b7
Translated by Heromyth
Heromyth Oct 17, 2017
e91ed45
Translated by Heromyth
Heromyth Oct 17, 2017
e747612
Translated by Heromyth
Heromyth Oct 18, 2017
7facf80
Translated by Heromyth
Heromyth Oct 18, 2017
c694cd4
Translated by Heromyth
Heromyth Oct 21, 2017
63fe9f3
Translated by Heromyth
Heromyth Oct 21, 2017
fe2c761
Translated by Heromyth
Heromyth Oct 22, 2017
3f40a93
Project translation
Heromyth Oct 22, 2017
6407b37
合并最新英文原文
Heromyth Oct 22, 2017
8e2b523
Translated by Heromyth
Heromyth Oct 24, 2017
25997b1
Translated by Heromyth
Heromyth Oct 25, 2017
bdef20f
Translated by Heromyth
Heromyth Oct 25, 2017
bee517a
Translated by Heromyth
Heromyth Oct 27, 2017
c146bb8
Translated by Heromyth
Heromyth Oct 27, 2017
c9d7fad
Translated by Heromyth
Heromyth Nov 1, 2017
2d45785
Translated by Heromyth
Heromyth Jan 5, 2018
30b9a0e
Translated by Heromyth
Heromyth Jan 5, 2018
1c995c0
Translated by Heromyth
Heromyth Jan 5, 2018
3315a62
Translated by Heromyth
Heromyth Jan 27, 2018
bd8e249
Translated by Heromyth
Heromyth Jan 27, 2018
90483f8
Translated by Heromyth
Heromyth Feb 10, 2018
6610ff6
Translated by Heromyth
Heromyth Feb 10, 2018
06d299e
同步最新英文文档
Heromyth Feb 13, 2018
f48920c
Translated by Heromyth
Heromyth Feb 13, 2018
32e69b0
清理掉已翻译文件
Heromyth Feb 13, 2018
a064e0f
更新翻译成果
Heromyth Feb 13, 2018
60d1f36
Translated by Heromyth
Heromyth Feb 13, 2018
69fa482
Translated by Heromyth
Heromyth Feb 13, 2018
67547be
Translated by Heromyth
Heromyth Feb 18, 2018
8acd9e7
Translated by Heromyth
Heromyth Feb 18, 2018
3ae3970
Translated by Heromyth
Heromyth Feb 18, 2018
53d40d7
Translated by Heromyth
Heromyth Feb 20, 2018
984acd8
Translated by Heromyth
Heromyth Feb 20, 2018
8ea4760
Translated by Heromyth
Heromyth Mar 6, 2018
04ff651
Translated by Heromyth
Heromyth Mar 6, 2018
7f40333
Translated by Heromyth
Heromyth Mar 6, 2018
553d861
Translated by Heromyth
Heromyth Mar 6, 2018
5c6c932
Translated by Heromyth
Heromyth Mar 6, 2018
0d8d0d3
Translated by Heromyth
Heromyth Mar 30, 2018
94f0f5e
更新原稿至最新
Heromyth Jun 19, 2018
a938ca4
更新原文至最新
Heromyth Jul 10, 2018
7c18ab7
Translated by Heromyth
Heromyth Jul 10, 2018
da78074
Translated by Heromyth
Heromyth Jul 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
185 changes: 93 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Chinese Translation Project of [Programming in D](http://ddili.org/ders/d.en
## Why "Programming in D"? 为什么选择此书?
Instead of falling for getting things done quickly, "Programming in D" focuses on getting things done properly, to the lasting benefit of its reader. -Andrei Alexandrescu

本书注重于如何恰到好处地使用D语言将任务处理得当,而非试图快速地完成一切却有失于代码质量,这使得它的读者能够长久受益。 ——大A
本书没有急于求成,而是将各方面都处理得恰到好处,让读者受益匪浅。 ——Andrei Alexandrescu

## How to join us 怎样加入我们
### Tencent QQ
Expand Down Expand Up @@ -48,104 +48,105 @@ Instead of falling for getting things done quickly, "Programming in D" focuses o

## Progress 进度
### Translated 已完成翻译
- [编译 Compilation](ddili/src/ders/d.cn/compiler.d) By Lucifer & meatatt
- [元组 Tuples](ddili/src/ders/d.cn/tuples.d) By meatatt
- [is 表达式 is Expression](ddili/src/ders/d.cn/is_expr.d) By meatatt
- [命名作用域 Name Scope](ddili/src/ders/d.cn/name_space.d) By LinGo
- [从标准输入中读取数据 Reading from the Standard Input](ddili/src/ders/d.cn/input.d) By Lucifer
- [前言 Preface(合并自:Acknowledgments,Introduction)](ddili/src/ders/d.cn/preface.d) By IceNature
- [文件 Files](ddili/src/ders/d.cn/files.d) By IceNature
- [if 语句 if Statement](ddili/src/ders/d.cn/if.d) By IceNature
- [auto 和 typeof auto and typeof](ddili/src/ders/d.cn/auto_and_typeof.d) By andot
- [Object](ddili/src/ders/d.cn/object.d) By 大处着手小处着眼
- [异常 Exceptions](ddili/src/ders/d.cn/exceptions.d) By xmdqvb
- [scope](ddili/src/ders/d.cn/scope.d) By 大处着手小处着眼
- [类 Classes](ddili/src/ders/d.cn/class.d) By 大处着手小处着眼
- [并行 Parallelism](ddili/src/ders/d.cn/parallelism.d) By IceNature
- [关联数组 Associative Arrays](ddili/src/ders/d.cn/aa.d) By 大处着手小处着眼
- [do-while 循环 do-while Loop](ddili/src/ders/d.cn/do_while.d) By mogu
- [alias 与 with alias and with](ddili/src/ders/d.cn/alias.d) By mogu
- [alias this](ddili/src/ders/d.cn/alias_this.d) By mogu
- [并发消息传递 Message Passing Concurrency](ddili/src/ders/d.cn/concurrency.d) By IceNature
- [字符串 Strings](ddili/src/ders/d.cn/strings.d) By 大处着手小处着眼
- [惰性运算符 Lazy Operators](ddili/src/ders/d.cn/lazy_operators.d) By mogu
- [左值与右值 Lvalues and Rvalues](ddili/src/ders/d.cn/lvalue_rvalue.d) By mogu
- [三元运算符 ?: Ternary Operator ?:](ddili/src/ders/d.cn/ternary.d) By IceNature
- [模板 Templates](ddili/src/ders/d.cn/templates.d) By meatatt
- [通用函数调用语法 Universal Function Call Syntax (UFCS)](ddili/src/ders/d.cn/ufcs.d) By mogu
- [属性 Properties](ddili/src/ders/d.cn/property.d) By IceNature
- [const ref 参数 and const 成员函数 const ref Parameters and const Member Functions](ddili/src/ders/d.cn/const_member_functions.d) By IceNature
- [格式化输出 Formatted Output](ddili/src/ders/d.cn/formatted_output.d) By IceNature
- [Pragmas](ddili/src/ders/d.cn/pragma.d) By mogu
- [数组 Arrays](target/arrays.d) By 大处着手小处着眼
- [编译 Compilation](target/compiler.d) By Lucifer & meatatt
- [元组 Tuples](target/tuples.d) By meatatt
- [is 表达式 is Expression](target/is_expr.d) By meatatt
- [命名作用域 Name Scope](target/name_space.d) By LinGo
- [从标准输入中读取数据 Reading from the Standard Input](target/input.d) By Lucifer
- [前言 Preface(合并自:Acknowledgments,Introduction)](target/preface.d) By IceNature
- [文件 Files](target/files.d) By IceNature
- [if 语句 if Statement](target/if.d) By IceNature
- [auto 和 typeof auto and typeof](target/auto_and_typeof.d) By andot
- [Object](target/object.d) By 大处着手小处着眼
- [异常 Exceptions](target/exceptions.d) By xmdqvb
- [scope](target/scope.d) By 大处着手小处着眼
- [类 Classes](target/class.d) By 大处着手小处着眼
- [并行 Parallelism](target/parallelism.d) By IceNature
- [关联数组 Associative Arrays](target/aa.d) By 大处着手小处着眼
- [do-while 循环 do-while Loop](target/do_while.d) By mogu
- [alias 与 with alias and with](target/alias.d) By mogu
- [alias this](target/alias_this.d) By mogu
- [并发消息传递 Message Passing Concurrency](target/concurrency.d) By IceNature
- [字符串 Strings](target/strings.d) By 大处着手小处着眼
- [惰性运算符 Lazy Operators](target/lazy_operators.d) By mogu
- [左值与右值 Lvalues and Rvalues](target/lvalue_rvalue.d) By mogu
- [三元运算符 ?: Ternary Operator ?:](target/ternary.d) By IceNature
- [模板 Templates](target/templates.d) By meatatt
- [通用函数调用语法 Universal Function Call Syntax (UFCS)](target/ufcs.d) By mogu
- [属性 Properties](target/property.d) By IceNature
- [const ref 参数 and const 成员函数 const ref Parameters and const Member Functions](target/const_member_functions.d) By IceNature
- [格式化输出 Formatted Output](target/formatted_output.d) By IceNature
- [Pragmas](target/pragma.d) By mogu
- [自定义属性 (UDA)](target/uda.d) by Heromyth

### Reviewing 审核中
- [Slices and Other Array Features](ddili/src/ders/d.cn/slices.d) By 大处着手小处着眼
- [More Templates](ddili/src/ders/d.cn/templates_more.d) By meatatt
- [Slices and Other Array Features](target/slices.d) By 大处着手小处着眼
- [More Templates](target/templates_more.d) By meatatt

### Review Delayed 审核搁置
- [Arrays](ddili/src/ders/d.cn/arrays.d) By 大处着手小处着眼


### Outdated 旧项目待更新
- [The Hello World Program](ddili/src/ders/d.cn/hello_world.d) By Lucifer
- [writeln and write](ddili/src/ders/d.cn/writeln.d) By Lucifer
- [Fundamental Types](ddili/src/ders/d.cn/types.d) By Lucifer
- [Assignment and Order of Evaluation](ddili/src/ders/d.cn/assignment.d) By Lucifer
- [Variables](ddili/src/ders/d.cn/variables.d) By Lucifer
- [Standard Input and Output Streams](ddili/src/ders/d.cn/io.d) By Lucifer
- [The Hello World Program](target/hello_world.d) By Lucifer
- [writeln and write](target/writeln.d) By Lucifer
- [Fundamental Types](target/types.d) By Lucifer
- [Assignment and Order of Evaluation](target/assignment.d) By Lucifer
- [Variables](target/variables.d) By Lucifer
- [Standard Input and Output Streams](target/io.d) By Lucifer

### Adopted 已被领取
- [Lifetimes and Fundamental Operations](ddili/src/ders/d.cn/lifetimes.d) By 渡世白玉
- [Ranges](ddili/src/ders/d.cn/ranges.d) By Lucifer
- [while Loop](ddili/src/ders/d.cn/while.d) By KimmyLeo
- [Redirecting Standard Input and Output Streams](ddili/src/ders/d.cn/stream_redirect.d) By mogu
- [Function Pointers, Delegates, and Lambdas](ddili/src/ders/d.cn/lambda.d) By zhaopuming
- [Modules and Libraries](ddili/src/ders/d.cn/modules.d) By 大处着手小处着眼
- [Variable Number of Parameters](ddili/src/ders/d.cn/parameter_flexibility.d) By meatatt
- [Conditional Compilation](ddili/src/ders/d.cn/cond_comp.d) By IceNature
- [Immutability](ddili/src/ders/d.cn/const_and_immutable.d) By IceNature
- [Type Conversions](ddili/src/ders/d.cn/cast.d) By IceNature
- [Formatted Input](ddili/src/ders/d.cn/formatted_input.d) By IceNature
- [Lifetimes and Fundamental Operations](target/lifetimes.d) By 渡世白玉
- [Ranges](target/ranges.d) By Lucifer
- [while Loop](target/while.d) By KimmyLeo
- [Redirecting Standard Input and Output Streams](target/stream_redirect.d) By mogu
- [Function Pointers, Delegates, and Lambdas](target/lambda.d) By zhaopuming
- [Modules and Libraries](target/modules.d) By 大处着手小处着眼
- [Variable Number of Parameters](target/parameter_flexibility.d) By meatatt
- [Conditional Compilation](target/cond_comp.d) By IceNature
- [Immutability](target/const_and_immutable.d) By IceNature
- [Type Conversions](target/cast.d) By IceNature
- [Formatted Input](target/formatted_input.d) By IceNature

### Orphans 待领取
- [Foreword by Andrei Alexandrescu](ddili/src/ders/d.cn/foreword2.d)
- [Logical Expressions](ddili/src/ders/d.cn/logical_expressions.d)
- [Integers and Arithmetic Operations](ddili/src/ders/d.cn/arithmetic.d)
- [Floating Point Types](ddili/src/ders/d.cn/floating_point.d)
- [Characters](ddili/src/ders/d.cn/characters.d)
- [for Loop](ddili/src/ders/d.cn/for.d)
- [Literals](ddili/src/ders/d.cn/literals.d)
- [foreach Loop](ddili/src/ders/d.cn/foreach.d)
- [switch and case](ddili/src/ders/d.cn/switch_case.d)
- [enum](ddili/src/ders/d.cn/enum.d)
- [Functions](ddili/src/ders/d.cn/functions.d)
- [Value Types and Reference Types](ddili/src/ders/d.cn/value_vs_reference.d)
- [Function Parameters](ddili/src/ders/d.cn/function_parameters.d)
- [Program Environment](ddili/src/ders/d.cn/main.d)
- [assert and enforce](ddili/src/ders/d.cn/assert.d)
- [Unit Testing](ddili/src/ders/d.cn/unit_testing.d)
- [Contract Programming](ddili/src/ders/d.cn/contracts.d)
- [The null Value and the is Operator](ddili/src/ders/d.cn/null_is.d)
- [Structs](ddili/src/ders/d.cn/struct.d)
- [Function Overloading](ddili/src/ders/d.cn/function_overloading.d)
- [Member Functions](ddili/src/ders/d.cn/member_functions.d)
- [Constructor and Other Special Functions](ddili/src/ders/d.cn/special_functions.d)
- [Operator Overloading](ddili/src/ders/d.cn/operator_overloading.d)
- [Inheritance](ddili/src/ders/d.cn/inheritance.d)
- [Interfaces](ddili/src/ders/d.cn/interface.d)
- [destroy and scoped](ddili/src/ders/d.cn/destroy.d)
- [Encapsulation and Protection Attributes](ddili/src/ders/d.cn/encapsulation.d)
- [Contract Programming for Structs and Classes](ddili/src/ders/d.cn/invariant.d)
- [Pointers](ddili/src/ders/d.cn/pointers.d)
- [Bit Operations](ddili/src/ders/d.cn/bit_operations.d)
- [foreach with Structs and Classes](ddili/src/ders/d.cn/foreach_opapply.d)
- [Nested Functions, Structs, and Classes](ddili/src/ders/d.cn/nested.d)
- [Unions](ddili/src/ders/d.cn/union.d)
- [Labels and goto](ddili/src/ders/d.cn/goto.d)
- [More Functions](ddili/src/ders/d.cn/functions_more.d)
- [Mixins](ddili/src/ders/d.cn/mixin.d)
- [More Ranges](ddili/src/ders/d.cn/ranges_more.d)
- [Data Sharing Concurrency](ddili/src/ders/d.cn/concurrency_shared.d)
- [Fibers](ddili/src/ders/d.cn/fibers.d)
- [Memory Management](ddili/src/ders/d.cn/memory.d)
- [User Defined Attributes (UDA)](ddili/src/ders/d.cn/uda.d)
- [Operator Precedence](ddili/src/ders/d.cn/operator_precedence.d)
- [Foreword by Andrei Alexandrescu](target/foreword2.d)
- [Logical Expressions](target/logical_expressions.d)
- [Integers and Arithmetic Operations](target/arithmetic.d)
- [Floating Point Types](target/floating_point.d)
- [Characters](target/characters.d)
- [for Loop](target/for.d)
- [Literals](target/literals.d)
- [foreach Loop](target/foreach.d)
- [switch and case](target/switch_case.d)
- [enum](target/enum.d)
- [Functions](target/functions.d)
- [Value Types and Reference Types](target/value_vs_reference.d)
- [Function Parameters](target/function_parameters.d)
- [Program Environment](target/main.d)
- [assert and enforce](target/assert.d)
- [Unit Testing](target/unit_testing.d)
- [Contract Programming](target/contracts.d)
- [The null Value and the is Operator](target/null_is.d)
- [Structs](target/struct.d)
- [Function Overloading](target/function_overloading.d)
- [Member Functions](target/member_functions.d)
- [Constructor and Other Special Functions](target/special_functions.d)
- [Operator Overloading](target/operator_overloading.d)
- [Inheritance](target/inheritance.d)
- [Interfaces](target/interface.d)
- [destroy and scoped](target/destroy.d)
- [Encapsulation and Protection Attributes](target/encapsulation.d)
- [Contract Programming for Structs and Classes](target/invariant.d)
- [Pointers](target/pointers.d)
- [Bit Operations](target/bit_operations.d)
- [foreach with Structs and Classes](target/foreach_opapply.d)
- [Nested Functions, Structs, and Classes](target/nested.d)
- [Unions](target/union.d)
- [Labels and goto](target/goto.d)
- [More Functions](target/functions_more.d)
- [Mixins](target/mixin.d)
- [More Ranges](target/ranges_more.d)
- [Data Sharing Concurrency](target/concurrency_shared.d)
- [Fibers](target/fibers.d)
- [Memory Management](target/memory.d)
- [Operator Precedence](target/operator_precedence.d)
File renamed without changes.
176 changes: 176 additions & 0 deletions d.en/alias_this.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
Ddoc

$(DERS_BOLUMU $(IX alias this) $(CH4 alias this))

$(P
We have seen the individual meanings of the $(C alias) and the $(C this) keywords in previous chapters. These two keywords have a completely different meaning when used together as $(C alias this).
)

$(P
$(IX automatic type conversion) $(IX type conversion, automatic) $(IX implicit type conversion) $(IX type conversion, implicit) $(C alias this) enables $(I automatic type conversions) (also known as $(I implicit type conversions)) of user-defined types. As we have seen in $(LINK2 /ders/d.en/operator_overloading.html, the Operator Overloading chapter), another way of providing type conversions for a type is by defining $(C opCast) for that type. The difference is that, while $(C opCast) is for explicit type conversions, $(C alias this) is for automatic type conversions.
)

$(P
The keywords $(C alias) and $(C this) are written separately where the name of a member variable or a member function is specified between them:
)

---
alias $(I member_variable_or_member_function) this;
---

$(P
$(C alias this) enables the specific conversion from the user-defined type to the type of that member. The value of the member becomes the resulting value of the conversion .
)

$(P
The following $(C Fraction) example uses $(C alias this) with a $(I member function). The $(C TeachingAssistant) example that is further below will use it with $(I member variables).
)

$(P
Since the return type of $(C value()) below is $(C double), the following $(C alias this) enables automatic conversion of $(C Fraction) objects to $(C double) values:
)

---
import std.stdio;

struct Fraction {
long numerator;
long denominator;

$(HILITE double value()) const @property {
return double(numerator) / denominator;
}

alias $(HILITE value) this;

// ...
}

double calculate(double lhs, double rhs) {
return 2 * lhs + rhs;
}

void main() {
auto fraction = Fraction(1, 4); // meaning 1/4
writeln(calculate($(HILITE fraction), 0.75));
}
---

$(P
$(C value()) gets called automatically to produce a $(C double) value when $(C Fraction) objects appear in places where a $(C double) value is expected. That is why the variable $(C fraction) can be passed to $(C calculate()) as an argument. $(C value()) returns 0.25 as the value of 1/4 and the program prints the result of 2 * 0.25 + 0.75:
)

$(SHELL
1.25
)

$(H5 $(IX multiple inheritance) $(IX inheritance, multiple) Multiple inheritance)

$(P
We have seen in $(LINK2 /ders/d.en/inheritance.html, the Inheritance chapter) that classes can inherit from only one $(C class). (On the other hand, there is no limit in the number of $(C interface)s to inherit from.) Some other object oriented languages allow inheriting from multiple classes. This is called $(I multiple inheritance).
)

$(P
$(C alias this) enables using D classes in designs that could benefit from multiple inheritance. Multiple $(C alias this) declarations enable types to be used in places of multiple different types.
)

$(P
$(HILITE $(I $(B Note:) dmd 2.078.0, the compiler that was used last to compile the examples in this chapter, allowed only one $(C alias this) declaration.))
)

$(P
The following $(C TeachingAssistant) class has two member variables of types $(C Student) and $(C Teacher). The $(C alias this) declarations would allow objects of this type to be used in places of both $(C Student) and $(C Teacher):
)

---
import std.stdio;

class Student {
string name;
uint[] grades;

this(string name) {
this.name = name;
}
}

class Teacher {
string name;
string subject;

this(string name, string subject) {
this.name = name;
this.subject = subject;
}
}

class TeachingAssistant {
Student studentIdentity;
Teacher teacherIdentity;

this(string name, string subject) {
this.studentIdentity = new Student(name);
this.teacherIdentity = new Teacher(name, subject);
}

/* The following two 'alias this' declarations will enable
* this type to be used both as a Student and as a Teacher.
*
* Note: dmd 2.078.0 did not support multiple 'alias this'
* declarations. */
alias $(HILITE teacherIdentity) this;
$(CODE_COMMENT_OUT compiler limitation)alias $(HILITE studentIdentity) this;
}

void attendClass(Teacher teacher, Student[] students)
in {
assert(teacher !is null);
assert(students.length > 0);

} do {
writef("%s is teaching %s to the following students:",
teacher.name, teacher.subject);

foreach (student; students) {
writef(" %s", student.name);
}

writeln();
}

void main() {
auto students = [ new Student("Shelly"),
new Student("Stan") ];

/* An object that can be used both as a Teacher and a
* Student: */
auto tim = new TeachingAssistant("Tim", "math");

// 'tim' is the teacher in the following use:
attendClass($(HILITE tim), students);

// 'tim' is one of the students in the following use:
auto amy = new Teacher("Amy", "physics");
$(CODE_COMMENT_OUT compiler limitation)attendClass(amy, students ~ $(HILITE tim));
}
---

$(P
The output of the program shows that the same object has been used as two different types:
)

$(SHELL
$(HILITE Tim) is teaching math to the following students: Shelly Stan
Amy is teaching physics to the following students: Shelly Stan $(HILITE Tim)
)

Macros:
SUBTITLE=alias this

DESCRIPTION=Nesnelerin otomatik olarak başka tür olarak kullanılmalarını sağlayan 'alias this'.

KEYWORDS=d programlama dili ders dersler öğrenmek tutorial alias takma isim alias this

SOZLER=
$(kalitim)

File renamed without changes.
Loading