Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Properties of special hashes in zsh/parameter module
- X-seq: zsh-workers 36649
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Properties of special hashes in zsh/parameter module
- Date: Sat, 26 Sep 2015 15:29:21 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Some of the special parameters in zsh/parameter are referenced as read-only
hashes. The normal properties of assocative arrays imply that if you refer
to all the values in one of these hashes, e.g. ${history[*]}, that they may
be returned in any order.
In practice these special hashes don't use a hash table implementation and
the order of values is guaranteed to be fixed, and in the case of $history
are guaranteed to be in the same order as $(history -rn 1).
Should we document this and make it a reliable condition for scripting? Or
do we prefer to keep open the option of implementing atop an unordered hash
at some point in the future?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author