6
2
If supported, which version of zsh should I use to take advantage of this feature? How to declare and use it in code?
6
2
If supported, which version of zsh should I use to take advantage of this feature? How to declare and use it in code?
15
Zsh supports hash tables, a quick google search returns many results, here's one
You must first typeset the variable:
% typeset -A hash
then you can store items in the table:
% hash[brown]="mm.. hash browns"
% hash[table]="clever data structure"
then you recover them as usual with arrays:
% print ${hash[brown]}
2Just a remark: This kind of variables are called associative arrays in
zsh
. – mpy – 2013-08-24T12:13:10.1931So they are in PHP, also; it's the rest of the world that calls them hash tables. – Fanfurlio – 2013-08-26T08:56:01.330