[Issue 6253] Refuse definition too of impossible associative arrays
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 17 13:34:55 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6253
--- Comment #8 from bearophile_hugs at eml.cc 2012-04-17 13:35:45 PDT ---
One more comment:
http://forum.dlang.org/thread/mailman.1834.1334688099.4860.digitalmars-d@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: -------
More information about the Digitalmars-d-bugs
mailing list