Yigal Chripun wrote:
personally I'd like to see D enums replaced by Java style enums which make more sense to me. D enums are even worse than C enums since you can write:
enum foo = "text";

which to me looks very similar to:
auto cat = new Dog;


I agree that enum is a horrible keyword to use for declaring manifest constants. In my opinion the D developers are sometimes a bit too afraid of introducing new keywords, and this is one of the consequences.

Personally, I think this would be a better scheme:

    const: manifest constants, no storage (like const in D1, enum in D2)
 readonly: used for a read-only view of mutable data (like const in D2)
immutable: truly immutable data (like now)

-Lars

Reply via email to