[Issue 8473] New: Guaranteed relative key-values with byKey and byValue
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 30 09:35:32 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8473
Summary: Guaranteed relative key-values with byKey and byValue
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: websites
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2012-07-30 09:35:30 PDT ---
This is a spinoff of Issue 5466
There is a common need to have a (lazy) range of keys and their corresponding
values of an associative array. Sometimes iterating them in parallel with a
foreach is not enough, and performing a lookup for each key generated by byKeys
is not efficient.
So I suggest to state in the D docs that if the associative array is not
modified in the iteration, its byKey and byValue yield corresponding key-values
(this is currently true, but not guaranteed to be true in all D
implementations).
This means that this will always be true in all future D implementations:
zip(aa.byKey, aa.byValue) === aa.byPair
--
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