Public outcry against new .init behaviour

Walter Bright newshound1 at digitalmars.com
Mon Jul 2 11:04:09 PDT 2007


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