Re: Problem about lambda expressions

2012-03-28 Thread Timon Gehr
On 03/28/2012 01:13 PM, Tongzhou Li wrote: On Wednesday, 28 March 2012 at 10:17:15 UTC, Timon Gehr wrote: On 03/28/2012 10:28 AM, Tongzhou Li wrote: On Wednesday, 28 March 2012 at 08:22:25 UTC, Tongzhou Li wrote: I understood. But why it compiles instead of giving an error? What does the compl

Re: Problem about lambda expressions

2012-03-28 Thread Tongzhou Li
On Wednesday, 28 March 2012 at 10:17:15 UTC, Timon Gehr wrote: On 03/28/2012 10:28 AM, Tongzhou Li wrote: On Wednesday, 28 March 2012 at 08:22:25 UTC, Tongzhou Li wrote: I understood. But why it compiles instead of giving an error? What does the complier do when I write the wrong code? Oh, I

Re: Problem about lambda expressions

2012-03-28 Thread Timon Gehr
On 03/28/2012 10:28 AM, Tongzhou Li wrote: On Wednesday, 28 March 2012 at 08:22:25 UTC, Tongzhou Li wrote: I understood. But why it compiles instead of giving an error? What does the complier do when I write the wrong code? Oh, I mean if I write the wrong code, what objectcode does the compile

Re: Problem about lambda expressions

2012-03-28 Thread Tongzhou Li
On Wednesday, 28 March 2012 at 08:22:25 UTC, Tongzhou Li wrote: I understood. But why it compiles instead of giving an error? What does the complier do when I write the wrong code? Oh, I mean if I write the wrong code, what objectcode does the compiler generate? My English is not good, sorry.

Re: Problem about lambda expressions

2012-03-28 Thread Tongzhou Li
On Tuesday, 27 March 2012 at 15:21:57 UTC, Kenji Hara wrote: On Tuesday, 27 March 2012 at 13:42:30 UTC, Tongzhou Li wrote: Hello again! I'm learning D, and I encountered a problem. I tried this code: http://ideone.com/hkpT6 It works well. (Have no idea why codepad.org failed to compile it) I tr

Re: Problem about lambda expressions

2012-03-28 Thread Tongzhou Li
On Tuesday, 27 March 2012 at 14:54:11 UTC, Artur Skawina wrote: On 03/27/12 15:52, Tongzhou Li wrote: Oh, I also tried: void seq_apply(Params..., Args...)(void delegate(Params) func, Args args) But I got a error: variadic template parameter must be last Does it mean that there can only

Re: Problem about lambda expressions

2012-03-28 Thread Tongzhou Li
On Tuesday, 27 March 2012 at 14:12:38 UTC, dennis luehring wrote: Am 27.03.2012 15:52, schrieb Tongzhou Li: Oh, I also tried: void seq_apply(Params..., Args...)(void delegate(Params) func, Args args) But I got a error: variadic template parameter must be last Does it mean that there ca

Re: Problem about lambda expressions

2012-03-27 Thread Ali Çehreli
On 03/27/2012 06:42 AM, Tongzhou Li wrote: > Hello again! I'm learning D, and I encountered a problem. > I tried this code: > http://ideone.com/hkpT6 > It works well. (Have no idea why codepad.org failed to compile it) > I tried to write a lambda instead of function f, but I got nothing printed.

Re: Problem about lambda expressions

2012-03-27 Thread Kenji Hara
On Tuesday, 27 March 2012 at 13:42:30 UTC, Tongzhou Li wrote: Hello again! I'm learning D, and I encountered a problem. I tried this code: http://ideone.com/hkpT6 It works well. (Have no idea why codepad.org failed to compile it) I tried to write a lambda instead of function f, but I got nothin

Re: Problem about lambda expressions

2012-03-27 Thread Artur Skawina
On 03/27/12 15:52, Tongzhou Li wrote: > Oh, I also tried: > void seq_apply(Params..., Args...)(void delegate(Params) func, Args args) > But I got a error: > variadic template parameter must be last > Does it mean that there can only be one variadic template parameter? How to > fix it? I'm

Re: Problem about lambda expressions

2012-03-27 Thread dennis luehring
Am 27.03.2012 15:52, schrieb Tongzhou Li: Oh, I also tried: void seq_apply(Params..., Args...)(void delegate(Params) func, Args args) But I got a error: variadic template parameter must be last Does it mean that there can only be one variadic template parameter? How to fix it? Thanks

Re: Problem about lambda expressions

2012-03-27 Thread Tongzhou Li
Oh, I also tried: void seq_apply(Params..., Args...)(void delegate(Params) func, Args args) But I got a error: variadic template parameter must be last Does it mean that there can only be one variadic template parameter? How to fix it? Thanks

Problem about lambda expressions

2012-03-27 Thread Tongzhou Li
Hello again! I'm learning D, and I encountered a problem. I tried this code: http://ideone.com/hkpT6 It works well. (Have no idea why codepad.org failed to compile it) I tried to write a lambda instead of function f, but I got nothing printed. Did I make something wrong? Compiler used: DMD32 D C