On Mon, 14 Nov 2011 10:27:21 +0200, Timon Gehr <timon.g...@gmx.ch> wrote:

It is the right design. Why should enum imply const or immutable? (or inout, for that matter). They are completely orthogonal.

enum Enum{
     opt1,
     opt2,
}

void main(){
     auto moo = Enum.opt1;
     moo = Enum.opt2; // who would seriously want an error here???
}

You are missing the point, nobody asked that. You are assigning it to auto, a runtime variable. Which was asked was about modifying a constant, sort(a) means sort a in-place. So you cant do:

immutable a;
sort(a);

But with current design you can do:

enum a;
sort(a);

Which is to me, quite wrong.

Reply via email to