digitalmars.D.bugs - [Issue 12139] New: AA.update
- d-bugmail puremagic.com (28/31) Feb 12 2014 https://d.puremagic.com/issues/show_bug.cgi?id=12139
https://d.puremagic.com/issues/show_bug.cgi?id=12139 Summary: AA.update Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc This is a possible enhancement. I don't know how much useful it is, but it seems worth thinking about. One recent change in the Erlang language is the syntax to handle associative arrays:Updating a map is done as follows:X is the old associative array. "=>" adds a new key, while ":=" updates an already existing key, and if it's not present an error is generated. So a spelling mistake cannot accidentally introduce a new key if you just want to update some value. This avoids a common bug. Similarly a simple "AA.update(key, val)" function in the D object module could be useful. It's a way to modify associative array values that requires the keys to be already present. This function modifies the value of a key-value if the key is present, and raises an exception if the key is missing. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 12 2014