digitalmars.D - Some questions now D2 is frozen
- Lars T. Kyllingstad (18/18) Feb 18 2010 Andrei said in the 'D2 Closure' thread that D2 has officially been
- Andrei Alexandrescu (11/31) Feb 18 2010 No, but the compiler may take different decisions on allocation
- bearophile (4/8) Feb 18 2010 __traits is used often enough in generic code, and __gshared while not c...
- Stewart Gordon (3/11) Feb 18 2010 Don't jump the gun, the community is still waiting for a final D1 spec!
- Philippe Sigaud (6/15) Feb 18 2010 8. Universal function call syntax? If a.foo(b) doesn't compile, let's tr...
- Lars T. Kyllingstad (4/23) Feb 18 2010 Andrei said in an earlier thread that this is in the book -- hence, it's...
- Jacob Carlborg (2/25) Feb 19 2010 It's not implemented yet.
- Philippe Sigaud (11/12) Feb 21 2010 But do you know of it's on the plate for D2? Lars says it's in TDPL, so ...
- Michel Fortin (9/10) Feb 21 2010 I think this works already:
- Philippe Sigaud (15/22) Feb 21 2010 Hmm, I'm still a bit leery of 'alias this' as all my uses for it misfire...
- Michel Fortin (7/24) Feb 21 2010 I was using this to implicitly convert to an Object. Seems it does not
- Jacob Carlborg (4/17) Feb 21 2010 Andrei said it would be in D2 but then he also said it's already
Andrei said in the 'D2 Closure' thread that D2 has officially been frozen, and that he and Walter has made a lot of desicions on their own over the past few weeks. That makes me, and I'm sure others as well, curious as to what these desicions were, and what the final D2 spec looks like. I'd hate to have to wait for TDPL to come out, and the compiler releases catching up, to find out. ;) So, Walter, Andrei, and anyone else in the know: 1. Will array literals be immutable? 2. Have you found new names for the "ugly" keywords? (__gshared, __traits) 3. Have you found a "rule" for determining whether an attribute is a keyword or an annotation? 4. Will private members inside eponymous templates work? 5. Will opIndex and opSlice be merged? 6. Do arrays still have the built-in 'reverse' and 'sort' properties? 7. Are there any changes that haven't been mentioned or discussed on the NG yet? -Lars
Feb 18 2010
Lars T. Kyllingstad wrote:Andrei said in the 'D2 Closure' thread that D2 has officially been frozen, and that he and Walter has made a lot of desicions on their own over the past few weeks. That makes me, and I'm sure others as well, curious as to what these desicions were, and what the final D2 spec looks like. I'd hate to have to wait for TDPL to come out, and the compiler releases catching up, to find out. ;) So, Walter, Andrei, and anyone else in the know: 1. Will array literals be immutable?No, but the compiler may take different decisions on allocation depending on usage.2. Have you found new names for the "ugly" keywords? (__gshared, __traits)No, but we're not bound to those names. TDPL does not present the most obscure features.3. Have you found a "rule" for determining whether an attribute is a keyword or an annotation?No.4. Will private members inside eponymous templates work?Yes.5. Will opIndex and opSlice be merged?No.6. Do arrays still have the built-in 'reverse' and 'sort' properties?Should deprecate those.7. Are there any changes that haven't been mentioned or discussed on the NG yet?Don't think so. Andrei
Feb 18 2010
Andrei Alexandrescu:__traits is used often enough in generic code, and __gshared while not common is not obscure, it's not hard to understand. Bye, bearophile2. Have you found new names for the "ugly" keywords? (__gshared, __traits)No, but we're not bound to those names. TDPL does not present the most obscure features.
Feb 18 2010
Lars T. Kyllingstad wrote:Andrei said in the 'D2 Closure' thread that D2 has officially been frozen, and that he and Walter has made a lot of desicions on their own over the past few weeks. That makes me, and I'm sure others as well, curious as to what these desicions were, and what the final D2 spec looks like. I'd hate to have to wait for TDPL to come out, and the compiler releases catching up, to find out. ;)Don't jump the gun, the community is still waiting for a final D1 spec! Stewart.
Feb 18 2010
On Thu, Feb 18, 2010 at 09:28, Lars T. Kyllingstad <public kyllingen.nospamnet> wrote:Andrei said in the 'D2 Closure' thread that D2 has officially been frozen, and that he and Walter has made a lot of desicions on their own over the past few weeks. That makes me, and I'm sure others as well, curious as to what these desicions were, and what the final D2 spec looks like. I'd hate to have to wait for TDPL to come out, and the compiler releases catching up, to find out. ;) So, Walter, Andrei, and anyone else in the know: (...)8. Universal function call syntax? If a.foo(b) doesn't compile, let's try foo(a,b), whatever the types of a and b. Currently, it works only for arrays. Philippe
Feb 18 2010
Philippe Sigaud wrote:On Thu, Feb 18, 2010 at 09:28, Lars T. Kyllingstad <public kyllingen.nospamnet> wrote: Andrei said in the 'D2 Closure' thread that D2 has officially been frozen, and that he and Walter has made a lot of desicions on their own over the past few weeks. That makes me, and I'm sure others as well, curious as to what these desicions were, and what the final D2 spec looks like. I'd hate to have to wait for TDPL to come out, and the compiler releases catching up, to find out. ;) So, Walter, Andrei, and anyone else in the know: (...) 8. Universal function call syntax? If a.foo(b) doesn't compile, let's try foo(a,b), whatever the types of a and b. Currently, it works only for arrays.Andrei said in an earlier thread that this is in the book -- hence, it's in the language. :) -Lars
Feb 18 2010
On 2/19/10 08:29, Lars T. Kyllingstad wrote:Philippe Sigaud wrote:It's not implemented yet.On Thu, Feb 18, 2010 at 09:28, Lars T. Kyllingstad <public kyllingen.nospamnet> wrote: Andrei said in the 'D2 Closure' thread that D2 has officially been frozen, and that he and Walter has made a lot of desicions on their own over the past few weeks. That makes me, and I'm sure others as well, curious as to what these desicions were, and what the final D2 spec looks like. I'd hate to have to wait for TDPL to come out, and the compiler releases catching up, to find out. ;) So, Walter, Andrei, and anyone else in the know: (...) 8. Universal function call syntax? If a.foo(b) doesn't compile, let's try foo(a,b), whatever the types of a and b. Currently, it works only for arrays.Andrei said in an earlier thread that this is in the book -- hence, it's in the language. :) -Lars
Feb 19 2010
On Fri, Feb 19, 2010 at 13:51, Jacob Carlborg <doob me.com> wrote: [Universal function call syntax]It's not implemented yet.But do you know of it's on the plate for D2? Lars says it's in TDPL, so it must be on the todo list, hopefully. Well, I guess they all have too much to do right now, and as some recent new features are quite cool, I'm happy that way. Anyway, that would be a useful feature, particularly for generic code: you know some types have a method that you want to use, and you can add it to other types also with this mechanism. Another thing I'd be very happy to have is opImplicitCast.... Philippe
Feb 21 2010
On 2010-02-21 08:28:02 -0500, Philippe Sigaud <philippe.sigaud gmail.com> said:Another thing I'd be very happy to have is opImplicitCast....I think this works already: alias opImplicitCast this; property T opImplicitCast() { ... } -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Feb 21 2010
On Sun, Feb 21, 2010 at 14:34, Michel Fortin <michel.fortin michelf.com>wrote:On 2010-02-21 08:28:02 -0500, Philippe Sigaud <philippe.sigaud gmail.com> said: Another thing I'd be very happy to have is opImplicitCast....Hmm, I'm still a bit leery of 'alias this' as all my uses for it misfired. But if that works, then, being an obnoxious brat, I will ask for the possibility to have many 'alias this' in the same object :-) Anyway, I just tried: class C { alias opImplicitCast this; property int opImplicitCast() { return 1;} } auto c = new C(); int foo(int a) { return a;} foo(c); // error. function main.foo (int a) is not callable using argument types (C) auto i = cast(int)c; // This works, but I'd call that explicit cast... I'm doing something wrong there? Is calling foo on c an implicit cast?I think this works already: alias opImplicitCast this; property T opImplicitCast() { ... } <http://michelf.com/>
Feb 21 2010
On 2010-02-21 08:56:14 -0500, Philippe Sigaud <philippe.sigaud gmail.com> said:Anyway, I just tried: class C { alias opImplicitCast this; property int opImplicitCast() { return 1;} } auto c = new C(); int foo(int a) { return a;} foo(c); // error. function main.foo (int a) is not callable using argument types (C) auto i = cast(int)c; // This works, but I'd call that explicit cast... I'm doing something wrong there? Is calling foo on c an implicit cast?I was using this to implicitly convert to an Object. Seems it does not work for an int. -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Feb 21 2010
On 2/21/10 14:28, Philippe Sigaud wrote:On Fri, Feb 19, 2010 at 13:51, Jacob Carlborg <doob me.com <mailto:doob me.com>> wrote: [Universal function call syntax] It's not implemented yet. But do you know of it's on the plate for D2? Lars says it's in TDPL, so it must be on the todo list, hopefully.Andrei said it would be in D2 but then he also said it's already implemented, which it isn't. It's also easy to implement (at least for variables).Well, I guess they all have too much to do right now, and as some recent new features are quite cool, I'm happy that way. Anyway, that would be a useful feature, particularly for generic code: you know some types have a method that you want to use, and you can add it to other types also with this mechanism. Another thing I'd be very happy to have is opImplicitCast.... Philippe
Feb 21 2010