www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: D2 status interim report ?

Koroskin Denis Wrote:

 On Mon, 23 Jun 2008 10:02:39 +0400, Extrawurst <spam extrawurst.org> wrote:
 Walter Bright schrieb:
 Extrawurst wrote:
 Hey Walter,
 this is just a list of changes which were originally planned to be  
 integrated into D2.0 according to the slides you and Andrei presented  
 on DConference '07. So please give us a comment on what perhaps has  
 changed or when certain things are going to be addressed.
 A little insight on your roadmap would be great.

 (1) STRUCT opImplicitCastTo/From (p.21)
 How do you want to solve the problem of overloading by return value  
 which would be necessary to solve something like the example in the  
 slides (p.21):

    struct S{
        int opImplicitCastTo(){...}
        float opImplicitCastTo(){...}

Still planning on it.

So does it mean we gonna get overloading on different return types ?

There was a suggestion to change a signature to something like this: struct S { void opImplicitCastTo(ref float result) { ... } void opImplicitCastTo(ref int result) { ... } } bacause overload on return value is basically unacceptable.

Yes, and the lack of orthogonality of the old/current system is annoying at best. The source code for Walnut was roughly 15% larger because of this. I abandoned the project mostly because the code that I thought was being generated was so vastly different from the code that was being generated. For example, passing a 16-byte struct was being done by rep movsd'ing the arguments while I was programming it envisioning xmm register usage for "arguments" and closure-like behavior for "self" and "context". I started reworking the whole project in fasm so I could write exactly what I thought, but then abandoned the scripting engine altogether to the next project about the time I finished writing the lexer because I became disinterested.
Jun 26 2008