[Issue 8363] New: Provide an intutive way to clear all entries in Associative Array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 9 06:22:11 PDT 2012


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

           Summary: Provide an intutive way to clear all entries in
                    Associative Array
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: puneet at coverify.org


--- Comment #0 from Puneet Goel <puneet at coverify.org> 2012-07-09 06:22:08 PDT ---
Deleting all the entries from an associative array is not intuitive. This has
been discussed at the D forum here:
http://forum.dlang.org/thread/iu3ll6$2d48$1@digitalmars.com

I suggest the following syntax should work

int[string] aa;
aa["foo"] = 1;
aa = []; // clear all array entries


At this point only this works. I think this is not very intuitive.

int[string] aa;
int[string] empty;

aa["foo"] = 1;
aa = empty;

-- 
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