Thread overview | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 22, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Beautiful! Just when I think D can't get better, it does! Thanks for all the hard work.
May I ask why you put the road there before traits? I know there's a std.traits, but perhaps a different keyword entirely or just a single underscore might be more appropriate...? It looks a bit like a compiler-specific extension to me...
Walter Bright Wrote:
>
> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.019.zip
>
> http://www.digitalmars.com/d/changelog.html http://ftp.digitalmars.com/dmd.2.003.zip
|
July 22, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > > http://www.digitalmars.com/d/1.0/changelog.html > http://ftp.digitalmars.com/dmd.1.019.zip > > http://www.digitalmars.com/d/changelog.html > http://ftp.digitalmars.com/dmd.2.003.zip In the spec for the new ForeachRangeStatement, it says: "If Foreach is foreach, then the variable is set to LwrExpression, then incremented at the end of each iteration." What does "incremented" mean, exactly? If have a class or struct that defines opAddAssign, would it call foo.opAddAssign(1) (as ++foo does)? Similarly, would the foreach_reverse form call foo.opSubAssign(1)? -- Kirk McDonald http://kirkmcdonald.blogspot.com Pyd: Connecting D and Python http://pyd.dsource.org |
July 23, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > > http://www.digitalmars.com/d/1.0/changelog.html > http://ftp.digitalmars.com/dmd.1.019.zip > > http://www.digitalmars.com/d/changelog.html > http://ftp.digitalmars.com/dmd.2.003.zip Well, this __traits stuff is certainly going to give me something to think about. One note: the lexical page doesn't seem to list it as a keyword. How many times have I rewritten Pyd? Three? Well, no matter. This should make things interesting again. -- Kirk McDonald http://kirkmcdonald.blogspot.com Pyd: Connecting D and Python http://pyd.dsource.org |
July 23, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.019.zip
>
> http://www.digitalmars.com/d/changelog.html
> http://ftp.digitalmars.com/dmd.2.003.zip
new toys! neat! thanks :)
|
July 23, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | "Walter Bright" <newshound1@digitalmars.com> wrote in message news:f80p2n$2k7a$1@digitalmars.com... > > http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.019.zip > > http://www.digitalmars.com/d/changelog.html http://ftp.digitalmars.com/dmd.2.003.zip You're really making it hard for me not to switch to D2.0. __traits looks absolutely amazing. Just remove const-ness and I'll switch ;) |
July 23, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | "Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:f817c6$a1o$1@digitalmars.com... > > You're really making it hard for me not to switch to D2.0. __traits looks absolutely amazing. Just remove const-ness and I'll switch ;) A question -- many of the descriptions of the __traits functions say that "an array is returned." But some of the samples look like tuples are being used: alias typeof(__traits(getVirtualFunctions, D, "foo")) b; foreach (t; b) writefln(typeid(t)); If this really did return an array, the typeof() it would be a single item, not a list, and you wouldn't be able to foreach over it. So does this return a tuple instead? |
July 23, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Fraser | Robert Fraser wrote:
> May I ask why you put the road there before traits? I know there's a std.traits, but perhaps a different keyword entirely or just a single underscore might be more appropriate...? It looks a bit like a compiler-specific extension to me...
I was thinking they should be buried inside of templates.
|
July 23, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kirk McDonald | Kirk McDonald wrote:
> In the spec for the new ForeachRangeStatement, it says:
>
> "If Foreach is foreach, then the variable is set to LwrExpression, then incremented at the end of each iteration."
>
> What does "incremented" mean, exactly? If have a class or struct that defines opAddAssign, would it call foo.opAddAssign(1) (as ++foo does)? Similarly, would the foreach_reverse form call foo.opSubAssign(1)?
Right now, it doesn't work with structs/classes, but when it does, it'll be as you wrote.
|
July 23, 2007 Re: DMD 1.019 and 2.003 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kirk McDonald | Kirk McDonald wrote:
> Well, this __traits stuff is certainly going to give me something to think about. One note: the lexical page doesn't seem to list it as a keyword.
>
> How many times have I rewritten Pyd? Three? Well, no matter. This should make things interesting again.
>
Hey, you asked for it <g>.
|
Copyright © 1999-2021 by the D Language Foundation