[slang-users] iterate the elements of an assoc_array in sorted order

John E. Davis davis at space.mit.edu
Sat Jun 3 21:53:13 EDT 2006


Jörg Sommer <joerg at alea.gnuu.de> wrote:
>Indeed. Why foreach do not output the elements of an assoc_array in
>sorted order? Isn't it implemented as a tree and do foreach not traverse
>the tree in-order?

The current implementation uses a double-hashing scheme.  The
foreach-method simply walks the hash-table.  It makes no attempt to
sort the keys.

--John




More information about the slang-users-l mailing list