seeding the pot for 2.0 features

kris foo at bar.com
Tue Jan 23 14:01:50 PST 2007


BCS wrote:
> Now that the big 1.0 is out, I think that we should start considering 
> what to put into 2.0. I don't think we need to rush anything into D yet, 
> but maybe we should start accumulating a list of things to consider.
> 
> One overall thought I had is that it seems the big killer for C++ was to 
> some extent that it is a strict superset of C. Maybe we should avoid 
> this problem and not requiter that D2.0 be backwards compatible at the 
> source level, but only at the ABI level sort of like C and D are now. 
> Anyway, just a thought.
> Here are a few of my ideas for 2.0.
> 
> 
> 1)  Modules structs and classes can have static this() functions, why 
> functions? If a static nested constructor were allowed for functions, it 
> would allow static function variable to be initialized at load time.
> 
> 
> 
> 2)  Why is there no tupleof property for interfaces? It would allow for 
> some intriguing possibilities.
> 
> interface I{...}
> 
> class C : I
> {
>     mixin ImpInterface!(I);
> }
> 
> template ImpInterface(T)
> {
>     mixin ImpInterface_!(T.tupleof);
> 
>     private ImpInterface_(F, V...)
>     {
>         mixin Implement!(F)
>         static if(V.length > 0
>             mixin ImpInterface_!(V);
>     }
> }
> 
> 3) promote static foreach to the same level as static if. This with #2 
> could be reel slick.
> 
> template ImpInterface(T)
> {
>     static foreach(F; T.tupleof);
>     {
>         F    // assumes that F is a function             // including 
> name and everything
>         {
>             // implement F
>         }
>     }
> }
> 
> 4) I guess that also needs a "implementable function alias". The syntax, 
> not to mention the name, could ues a little work, but I expect you get 
> the picture.
> 
> 


Hrm, I may be a dolt but the above looks like greek -- I have no idea, 
at first glance, what the heck it does -- that's an important concern 
for the target audience, surely? Actually, what is the target audience 
for D? Specifically? Perhaps that's a good place to start :)

Other than that, my suggestions for 2.0 would be to fix the problems in 
1.0. The dreaded mixin noted above is a case in point. How about 
/removing/ that broken macro-expansion feature for 2.0 :D

(somewhat tongue-in-cheek)



More information about the Digitalmars-d mailing list