Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: ordering of hash table scans

Bart Schaefer wrote:
> The only thing I could imagine is if someone were relying on use of a
> hashtable to "randomize" the order of some list of items; but that
> seems unlikely, and certainly there was no promise it would work.

They'd have to be doing it by using builtin queries ("typeset -m",
"alias -m", etc. etc.), which is even more unlikely.  Hash tables
substituted onto the command line still aren't sorted --- I only changed
it for cases where the output is printed immediately, so:

% typeset -A hashtable
% hashtable=(a A b B c C d D e E f F g G)
% print ${(kv)hashtable}
f F g G a A b B c C d D e E

(It confused me when I tried it with just a, b and c to begin with...)
There have always been the "o" and "O" flags to request an order here,

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview

Messages sorted by: Reverse Date, Date, Thread, Author