Zsh Mailing List Archive
Messages sorted by:
Re: Feature request: two level sorting
- X-seq: zsh-users 21675
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Feature request: two level sorting
- Date: Thu, 16 Jun 2016 00:21:13 -0700
- 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==
- In-reply-to: <CAKc7PVBztgxUOdeA-L=wfvwKd34JTz0eV2GD5tE17hVMNr72Dw@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAsLwNVP0vjTvBebP5u+Ahe03yXaWxkvytOx4EPkN4V9Q@mail.gmail.com> <160615101239.ZM21280@torch.brasslantern.com> <CAKc7PVBztgxUOdeA-L=wfvwKd34JTz0eV2GD5tE17hVMNr72Dw@mail.gmail.com>
On Jun 16, 6:53am, Sebastian Gniazdowski wrote:
} Subject: Re: Feature request: two level sorting
} On 15 June 2016 at 19:12, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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.
Messages sorted by: