From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15800 invoked by alias); 10 Nov 2015 20:52:19 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20947 Received: (qmail 12323 invoked from network); 10 Nov 2015 20:52:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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== MIME-Version: 1.0 X-Received: by 10.112.147.10 with SMTP id tg10mr2857955lbb.58.1447188735269; Tue, 10 Nov 2015 12:52:15 -0800 (PST) In-Reply-To: <151107095140.ZM24168@torch.brasslantern.com> References: <151107095140.ZM24168@torch.brasslantern.com> Date: Tue, 10 Nov 2015 21:52:15 +0100 Message-ID: Subject: Re: How to preserve order of associative array? From: Dominik Ritter To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 > 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.