Re: How Nested Functions Work, part 2

2009-09-19 Thread bearophile
language_fan: >There is no real interest in D outside the community (IMHO).< There can be various causes: - At University here they teach mostly Java. So young people know and like VM-based languages. - Such people are "spoiled": they don't even want to touch a language that has no very good ID

Rich Hickey's slides from jvm lang summit - worth a read?

2009-09-19 Thread language_fan
http://wiki.jvmlangsummit.com/images/a/ab/HickeyJVMSummit2009.pdf

Re: Mixin a constructor ?

2009-09-19 Thread language_fan
>> template C () >> { >> this (int i) >> { >> } >> } >> class A >> { >> mixin C; >> this () >> { >> } >> } >> void main () >> { >> auto a = new A(3); >> } Since the constructor has no meaning outside classes, should it be interpreted as a free function if mixed in a non-class context? I really w

Re: How Nested Functions Work, part 2

2009-09-19 Thread language_fan
Sun, 20 Sep 2009 01:09:56 +, language_fan thusly wrote: > Sat, 19 Sep 2009 11:44:33 -0700, Walter Bright thusly wrote: > >> Lutger wrote: >>> Cool article, I posted a comment. Reddit seems to be going downhill >>> fast though, it's even worse than slashdot. >> >> I know, the negative comment

Re: How Nested Functions Work, part 2

2009-09-19 Thread language_fan
Sat, 19 Sep 2009 11:44:33 -0700, Walter Bright thusly wrote: > Lutger wrote: >> Cool article, I posted a comment. Reddit seems to be going downhill >> fast though, it's even worse than slashdot. > > I know, the negative comments don't even make any sense. > >> Are locally instantiated templates

memset and related things

2009-09-19 Thread bearophile
In a program I've seen that in the inner loop an array cleaning was taking too much time. To solve the problem I've done many experiments, and I've also produced the following testing program. The short summary is, to set array of 4 byte integers to a certain constant the best was are: - if len

Re: Mixin a constructor ?

2009-09-19 Thread Jacob Carlborg
On 9/19/09 20:55, Christopher Wright wrote: Jacob Carlborg wrote: Is it supposed to possible to mixin a constructor? The code below doesn't compile. The error: is "main.d(23): Error: constructor main.A.this() does not match parameter types (int) main.d(23): Error: expected 0 arguments, not 1"

Re: Mixin a constructor ?

2009-09-19 Thread BCS
Hello Jacob, Is it supposed to possible to mixin a constructor? The code below doesn't compile. The error: is "main.d(23): Error: constructor main.A.this() does not match parameter types (int) main.d(23): Error: expected 0 arguments, not 1" IIRC mixins can't overload with other mixins or non m

Re: Descent support dmd2.032£¿

2009-09-19 Thread dolive89
dolive89 дµ½: > > In addition, please provide the availability of language pack£¬Let's translate ISO-8859-1 encode don't Support Chinese£¬Show is Unrecognizable Code. help me dolive89

Re: Mixin a constructor ?

2009-09-19 Thread Christopher Wright
Jacob Carlborg wrote: Is it supposed to possible to mixin a constructor? The code below doesn't compile. The error: is "main.d(23): Error: constructor main.A.this() does not match parameter types (int) main.d(23): Error: expected 0 arguments, not 1" A template mixin introduces a new scope. Th

Re: How Nested Functions Work, part 2

2009-09-19 Thread Walter Bright
Max Samukha wrote: Walter Bright wrote: http://www.reddit.com/r/programming/comments/9lxy5/how_nested_functions_clos There is a typo in the example Thanks, fixed it.

Re: How Nested Functions Work, part 2

2009-09-19 Thread Walter Bright
Max Samukha wrote: Walter Bright wrote: http://www.reddit.com/r/programming/comments/9lxy5/how_nested_functions_clos There is a typo in the example Thanks, fixed it.

Re: How Nested Functions Work, part 2

2009-09-19 Thread Walter Bright
Lutger wrote: Cool article, I posted a comment. Reddit seems to be going downhill fast though, it's even worse than slashdot. I know, the negative comments don't even make any sense. Are locally instantiated templates used in phobos? Yes.

Re: Mixin a constructor ?

2009-09-19 Thread dsimcha
== Quote from Jacob Carlborg (d...@me.com)'s article > Is it supposed to possible to mixin a constructor? The code below > doesn't compile. The error: is "main.d(23): Error: constructor > main.A.this() does not match parameter types (int) > main.d(23): Error: expected 0 arguments, not 1" > template

Mixin a constructor ?

2009-09-19 Thread Jacob Carlborg
Is it supposed to possible to mixin a constructor? The code below doesn't compile. The error: is "main.d(23): Error: constructor main.A.this() does not match parameter types (int) main.d(23): Error: expected 0 arguments, not 1" template C () { this (int i) {

Re: How Nested Functions Work, part 2

2009-09-19 Thread Lutger
Cool article, I posted a comment. Reddit seems to be going downhill fast though, it's even worse than slashdot. Are locally instantiated templates used in phobos?

Re: How Nested Functions Work, part 2

2009-09-19 Thread Max Samukha
Walter Bright wrote: > http://www.reddit.com/r/programming/comments/9lxy5/how_nested_functions_clos There is a typo in the example (if it is supposed to be compiled with current dmd): int bar(int i) { int abc(int x) { return i + x; } return foo(&abc); } should be int bar(int i) {