From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25561 invoked by alias); 7 Nov 2015 17:51:45 -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: 20925 Received: (qmail 16055 invoked from network); 7 Nov 2015 17:51:44 -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,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern_com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=qGNOs1wPc/ShXLVlZknd2DTrH/ssxAKvYnSy+DNvidI=; b=GtUkuFK70/1U2yFC8BYH0pQHVmFxqfuXx0CqMg2Bqs1bhXJMyQq65TqUx6sspyAjf0 NVBfEji3eB+ko6BUepVDCQy3OyJR333+4VecGCwJDh1n4TxmYOo22N+JWfHEKVuHC4Mz SQ5meIQ7CkY8kCBTUZkVFtcsIhdi0NqOAM/PI2C4Ry3KzycO6jeDVuJFA7TBIYStSrx9 3ro0F1JLyEhML2URtOBrDIpB1jf4sV4hw1RAV3Uhau41cHV4HsifQ17HiI9d81lXdl+V r4ZreSxxeAgrVSMtu1Nqx1hCoU0DVeEjuPtG/UvlOi3PQ9RnhxmTfsFwLOZEsZZG+KD8 hHcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=qGNOs1wPc/ShXLVlZknd2DTrH/ssxAKvYnSy+DNvidI=; b=CDQJk2c3xTsyvJhQiwe4axeM4Lg/RyuMblNOrIAwtefiDAffPzos/2rohG6bOgld7Y vqcSfnQ7s+WiES+A9Br/eERFnzLOtWJD4N9WXoPLywKu/vaQYT+poibBUlNhRHHT2e/o co44SyPyzx9Jo5ac2mqbIZxcPKSP+fFpaNbuvnMqfejEmuO8/twjgCfZv/5kM6k6VHgo 6ehB7tUhaeiXb7kJXbEcpcpMLUCyatNr4hcyf2aQ739SD9gqk/VZzVy3LHPq0K4cGhhm nSYftMvxdsBZcZslHM/+ObRDG3qMQ6Jrkr1dJChDiXrJnurCjv0fblfcTcFvHo7xcgV/ 4LiA== X-Gm-Message-State: ALoCoQlg+VVkgF2AqnY7eHPYWFil+Kr45656tntxKYNMdTHwLFuDYWGtWdai4OOLajKocpFz98jC X-Received: by 10.60.233.10 with SMTP id ts10mr6092427oec.8.1446918702880; Sat, 07 Nov 2015 09:51:42 -0800 (PST) From: Bart Schaefer Message-Id: <151107095140.ZM24168@torch.brasslantern.com> Date: Sat, 7 Nov 2015 09:51:40 -0800 In-Reply-To: Comments: In reply to Dominik Ritter "How to preserve order of associative array?" (Nov 7, 5:11pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: How to preserve order of associative array? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 7, 5:11pm, Dominik Ritter wrote: } } I struggle to the order of an associative array right. Second paragraph in the doc under "Parameters": 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_). 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]}