[Issue 13556] inconsistent 'new' syntax for arrays
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Nov 9 10:40:41 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13556
--- Comment #6 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
(In reply to Stewart Gordon from comment #5)
i understand why it's not working as one expecting. but i'm talking about
"principle of least astonishment" (ah, this is sore spot of D…).
people are not computers. my common sense tells me that if `int[] a0 = new
int[256];` works by creating 256-element array of ints, then ` int[][] a1 = new
int[256][256];` should create 256x256 element matrix. but D is constantly
fighting with common sense, i'm starting to get used to this. ;-)
--
More information about the Digitalmars-d-bugs
mailing list