On 5/15/2013 12:07 PM, Andrei Alexandrescu wrote:
On 5/15/13 3:02 PM, Walter Bright wrote:
I believe it was disallowed in earlier D2 versions. If I saw such code
in a project, I'd find it awfully suspect, not sensible.
On the contrary, examples abound. Consider:
class Image {
const double scalingFactor = 1.0; // no scaling
this(double sf) {
scalingFactor = sf;
...
}
...
}
What is suspect about this? I have about five others without even needing to
think that hard.
It means I can't read the code and easily determine what that const value is,
even though it is explicitly initialized with a value.
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta