http://d.puremagic.com/issues/show_bug.cgi?id=7227
Ivan Kazmenko <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Ivan Kazmenko <[email protected]> 2013-03-11 14:14:59 PDT --- I agree that an empty associative array could use a more convenient syntax. Consider having an associative array of associative arrays, like in the following example: ----- import std.stdio; void main () { int [int] [int] f; assert (f.length == 0); writeln (f); // [] f[5] = null; assert (f.length == 1); assert (f[5].length == 0); writeln (f); // [5:[]] } ----- Now, for a D newbie like me, the line "f[5] = null;" intuitively looks more like a "delete f[5] from f if it is present" than an "add an empty f[5] into f". A syntax like "f[5] = [];" or "f[5] = [:];" would certainly improve readability here. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
