From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10495 invoked by alias); 11 Nov 2015 00:59:56 -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: 20948 Received: (qmail 16998 invoked from network); 11 Nov 2015 00:59:55 -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=iJVKFCgRiAUZVKFlUBy6mmDsR9WsSGPBdP4QEh7aHOI=; b=wk2qIijoIL1bRIFoA4/HJ+nV4Dx980VQdxoTw2XirkDOsEYzNc3mY1c2E0DPqif9AZ r37EGueYF3QUnp/62s0nFVGksvL9kgXzwG3sUvmcPhBj6FU0HNZ1qZcDtxSrVNBbr/uB qz88UN9U/hSm73NInwo0/iSELeM5TwqLVZKB90ftBy8y8CgXwbpCWpG3Ku9fqudpENuX /hGlI4FvJWj84cteYCMRx/e5sqAhvyHK29Toc/fmgVkj5Kdhe7DfYMgJkptzRVLAWM4/ 88lnteAbk/rPx594+hDU3XzNR5lTSDGfJbE9gxOcmxb0MLaeLRGHbMf6RrDSCi3DhkX9 BBew== 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=iJVKFCgRiAUZVKFlUBy6mmDsR9WsSGPBdP4QEh7aHOI=; b=Ca8O3L6RtGjMYe5FK6zV6guHVJ2LEUeh5pTQTIxmLdR5fiEhVuJImvh6csQpBS6Byo zU0BgXphnIGENehRYCguyidePmycYLtnyHMWLQJrEkm5rWu/rTBJC5xVQaj2QbVWDlbg zQrw3VHL6X/vdES7J/v5c2pR7zDnHue7YPHnfnssbSECIgOrKR4l2KGnfByEBEZK1VDu f1GQg16wII+FeXz/5HElePYXMUwZr+HbTUADTZvOLVqC+KxAHdCUBohAMW6uyzLpH1Jv 1jmWduA0wqRlb2icssaYmxa46Jxe9Q3VYBMpFc56fcAG+xLb6+OjzapeJrMr2QYddiRR 4LPQ== X-Gm-Message-State: ALoCoQl0f+W5n1/YzQOUBP0ghR8c1DwOCQ9xf6PB33ftIGn52jxTwF6ZLa7ooPE57HCeCslL9gMh X-Received: by 10.202.242.138 with SMTP id q132mr3348660oih.49.1447203591110; Tue, 10 Nov 2015 16:59:51 -0800 (PST) From: Bart Schaefer Message-Id: <151110165948.ZM2029@torch.brasslantern.com> Date: Tue, 10 Nov 2015 16:59:48 -0800 In-Reply-To: Comments: In reply to Dominik Ritter "Re: How to preserve order of associative array?" (Nov 10, 9:52pm) References: <151107095140.ZM24168@torch.brasslantern.com> 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 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.