Public outcry against new .init behaviour

Robert Fraser fraserofthenight at gmail.com
Mon Jul 2 11:07:48 PDT 2007


I agree.... But the change should only be introduced to the 2.x branch... Breaking changes have no place in the stable branch.

Maybe you could add a different property that can get the old behavior for variables, too...?

Walter Bright Wrote:

> Deewiant wrote:
> > It's not deadly - I found 14 instances of such in about 7000 LOC (wc -l), and
> > they can be corrected - but it makes code noticeably uglier. This is one of
> > those small, simple bits of syntactic sugar which make coding in D fun and
> > productive. I want it back.
> 
> I'll repost what I did earlier on this:
> 
> > Andrei made an argument that if one had:
> > 
> >     struct S
> >     {
> >         static int foo;
> >     }
> > 
> >     S s = ...;
> >     assert(s.foo == S.foo);
> > 
> > then, analogously:
> > 
> >     T t = ...;
> >     assert(t.init == T.init);
> > 
> > should hold as well. Consistency is a strong argument.
> 
> 
> I like the old behavior too, but with the increasing use of generic 
> code, I worry that the inconsistency is going to cause a lot of problems 
> in the future.




More information about the Digitalmars-d mailing list