DMD 1.035 and 2.019 releases

bearophile bearophileHUGS at lycos.com
Wed Sep 3 16:52:04 PDT 2008


Walter Bright:
> If there's any constructor defined for S, then S(args) is a constructor call.
> If there's any opCall defined for S, then S(args) is an opCall call.
> Otherwise, it's a struct literal.

I haven't tried that in real code, so I can't be sure, but while it may work for the compiler, it sounds a bit too much complex for the person that later reads the code.
Too many alternative possibilities may make the code more complex to follow.

To reduce such ambiguity (ambiguity for the person, not for the compiler) may be to change the syntax of struct literals...

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list