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

Re: How to preserve order of associative array?



On Nov 10,  9:52pm, Dominik Ritter wrote:
}
} >     typeset -a ord_array=(one 1 two 2 three 3 four 4)
} >     print ${ord_array[ord_array[(i)three]+1]}
} 
} Perfect! I'll try that. Thanks.

I should note that this can fail if the same strings can appear as both
keys and values.



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