Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to preserve order of associative array?
- X-seq: zsh-users 20947
- From: Dominik Ritter <dritter03@xxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: How to preserve order of associative array?
- Date: Tue, 10 Nov 2015 21:52:15 +0100
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wY9ZRJaMShDBB23SYsaFk8+decfN853JvWWpFr/lj64=; b=gh31LdCCmjeh6yvZDMskyup7RBEpI+9s77DYhcDtSB0uJMrrkXKoWg5i1uxorSXePJ BoFHlIJwMZAwHpMwVJGSUgwDSyuF1ks9XVXbFaenlR21/qOR6CwKv8kgh1piAsIgvUQU bfreMpKeUpDiFocpH9wuxHMMtqQDzDV6mFf3qdjSkbYmXC9IWUeu5qxlKKJvJEjTzbuL /smjKyddrFEeAvw2rNYhFQzUabT1LGHMzWjM4Bd5+sOVOWw4X1QTmwr8zLkaYVPWt4PW MHqjb0fxFHnZ8vwmrwVjD8tAHcG6FIvBkgHFDQ31cYraFNJPX3iK+zrE/kBByXDAe3OJ 8HJA==
- In-reply-to: <151107095140.ZM24168@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAJjRh0RhVOWz95oCqMuGZ5RMbn39ZpVa3r0KR2cwVqvZ+ChEug@mail.gmail.com> <151107095140.ZM24168@torch.brasslantern.com>
> The attributes of a parameter determine the _type_ of its value, often
> referred to as the parameter type or variable type, and also control
> other processing that may be applied to the value when it is referenced.
> The value type may be a _scalar_ (a string, an integer, or a floating
> point number), an array (indexed numerically), or an _associative_
> array (an unordered set of name-value pairs, indexed by name, also
> referred to as a _hash_).
Thank you very much. That explains it. I've overseen that in the documentation.
> You can simulate an ordered set of name-value pairs like this (need zsh
> version 5.1 for assigning to an array during typeset):
>
> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author