http://d.puremagic.com/issues/show_bug.cgi?id=6253



--- Comment #8 from bearophile_h...@eml.cc 2012-04-17 13:35:45 PDT ---
One more comment:

http://forum.dlang.org/thread/mailman.1834.1334688099.4860.digitalmar...@puremagic.com#post-wnepqlefxamfbhddpaqs:40forum.dlang.org


This bug report is based on this idea:
http://en.wikipedia.org/wiki/Principle_of_least_astonishment

If I define:
Foo[] a;
I expect those Foo items to be mutable.

If I see:
int[Foo]
I expect those Foo keys to be mutable.

If I see:
immutable(Foo)[] a;
I expect those Foos to be immutable.

If I see:
int[immutable Foo]
I expect those Foo keys to be immutable.

If I see a int[Foo] and I get immutable Foo keys, I am astonished.

Not doing what I am saying here will add another special case to D language.
Avoiding many special cases is a reasons to choose D over C++.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to