From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16127 invoked by alias); 16 Jun 2016 07:21:15 -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: 21675 Received: (qmail 9329 invoked from network); 16 Jun 2016 07:20:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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.1 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; bh=nnRjGegAbXFqp9hEYlgimJ9jrGQGH+2V+lJ0a+Atz8U=; b=TMQbSLg9ZFfmo3LDA3MVNTl2MesKkqCCcK/bAOlKY8Amt0ERIH7pWS+jshrfRNEe/T BQYpan6uLPRYwxPN5LWGAN0DYnijqkUPPckOS4yPUdJJ+4q7esRnHVBJiDBvglFiz831 UtBidnVAIfDHoeE/51/tfUhsgB0a2ReoOsLDGwcjUHqSMHHAQLUTx2+MVx/Xi4n00XDJ bIwYrk/CHGTVlvQSyXBHVRFU2qbuDQQnbSrN7tjQMbDJh8fHs/DAUVIew05oz8qDBOu1 KLDvSJQNtwS8eKDsJu9yfKfWUH7JFGK+RFXrPiU9f+azPfCLvgcLOXZNAPns4iumZ2ZT Yf2w== 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; bh=nnRjGegAbXFqp9hEYlgimJ9jrGQGH+2V+lJ0a+Atz8U=; b=hUCw92j6Sjd8w2qr2JXvFK2Rhw9D8cmoeuW0RBCh739mtcNDu87H1yMUKjcq+iBAPc DRbppMwUjxN5cOL3ho7c88uE5YSlmFwPuvOfxqnsubKtX09KrIhRhuLSmpUyFR8ECA+Q gNerjOgy+RTbXmVwMnWRhL2Pdypr9Hf/cuwc1sLsDy2uHlChG3bz309LFFssu/sMVh6T Zb7oClwlAZNBtLBsbwSWmslVCaqtPrT6Lwfu/u979908JJwlpwPUU3vo5mHIgVTmAHn3 6sgFcjQHoIttC9fm1z7UtANBQBgcXCOrfIPfCjnr057i4i60QGaEg8GORwahn8/Lk4gZ /KiQ== X-Gm-Message-State: ALyK8tKyJQ6SBu4eNTzEss8J2NiEPTsdWDscgGUNDD38L7ADVp0ESEx4zGQFP1OPoqdlSA== X-Received: by 10.66.134.172 with SMTP id pl12mr3572955pab.66.1466061650428; Thu, 16 Jun 2016 00:20:50 -0700 (PDT) From: Bart Schaefer Message-Id: <160616002113.ZM23166@torch.brasslantern.com> Date: Thu, 16 Jun 2016 00:21:13 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Feature request: two level sorting" (Jun 16, 6:53am) References: <160615101239.ZM21280@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Feature request: two level sorting MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 16, 6:53am, Sebastian Gniazdowski wrote: } Subject: Re: Feature request: two level sorting } } On 15 June 2016 at 19:12, Bart Schaefer wrote: } > } > "Feature request: A one-line parameter expansion that ... } } Not sure what you mean, I didn't propose such functionality. OK, I see. You were actually proposing that the final solution use a second array to group the first one; I misread that as only an example of how to get the result you wanted. So what you're really suggesting is -- Given two arrays AA and AB which must be of equal length: (1) sort AB and apply that new ordering to the elements of AA (2) except that if two elements of AB are the same, use another sort to order the corresponding elements of AA -- and you want a syntax that passes the name of AB, the order to be applied to AB, and the secondary order of AA, via the expansion flags of a reference to AA. Have I got it this time? What if you need "two levels" of sorting for the desired order AB? } > Can you even suggest a syntax for this that wouldn't look worse than } > the "for" loop you already wrote? } } I don't think the for loop is that bad. I wouldn't have said so either, except that you want a new feature to replace it, so you must not like having to use the loop.