On 5/15/13 5:14 PM, Walter Bright wrote:
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.

I now understand the concern. I'd argue that static immutable/const fulfills that role, and that a member const is supposed to be initialized in a constructor (or via the default initializer syntax as for any other member) and stay constant throughout the lifetime of the object. That _is_ a very useful notion.

I'm not assuming you're proposing this, but I'm clarifying just in case: a member that takes per-instance memory YET always has the same value in all objects would be positively useless. _That_ should at best be an error.


Andrei
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to