Asssociative Array by Key-Value-Pair

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 15 09:52:03 PST 2014


On Mon, 15 Dec 2014 17:37:13 +0000
Tobias Pankrath via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:

> I think we should require byKeys and byValues to iterate the 
> elements in the same order. Than we can just zip them for the 
> pairwise iteration.
> 
> Would this impose a performance problem with the current 
> implementation?
i was always sure that they doing that in the same order. at least this
was true some time ago, but i see that runtime AA changed since, so i
don't sure if it works like this now. but i agree that this
requirement should be documented. and i bet it will not, 'cause this
will support principle of least astonishment, which is completely alien
for D.

the only way to get it into the specs is to write the useful library
that relies on that behavior and then scream "don't break our code,
it's regression!" then it eventually may be turned to requirement and
documented.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141215/063d42e7/attachment.sig>


More information about the Digitalmars-d-learn mailing list