Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Reverse the order of an array?
- X-seq: zsh-workers 16607
- From: Derek Peschel <dpeschel@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Reverse the order of an array?
- Date: Tue, 12 Feb 2002 05:15:41 -0800
- In-reply-to: <20020211132620.27729.qmail@xxxxxxxxxxxxxxxxxxxxxx>; from okiddle@xxxxxxxxxxx on Mon, Feb 11, 2002 at 01:26:20PM +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <Pine.BSF.4.40.0202082359000.90676-100000@xxxxxxxxxxxxxxxx> <20020211132620.27729.qmail@xxxxxxxxxxxxxxxxxxxxxx>
On Mon, Feb 11, 2002 at 01:26:20PM +0000, Oliver Kiddle wrote:
> Allowing array slices to go backwards, is a possibility though I'd not
> be suprised if implementing it caused other things to break. The
> easiest might be a parameter expension flag (r and R are gone so we'd
> need a letter. ^ perhaps as we used that for the reversed prompt
> state). Does anyone else have any views on whether we should add
> something for this and if so how?
Eww, I don't like the idea of using ^.
I picked ^ as a prompt escape because it was similar to _. ^ is not
supposed to remind you of reversing in general (because the only thing
you can reverse is the parser state, I think). Instead, ^ is supposed
to be a variation of _ (that just happens to be reversed) and ^ is
supposed to remind you of _.
I hope I'm making sense. Anyway, is v or V (reVerse) used in parameter
expansion flags? How about b or B (backwards)?
It's too bad that the same ideas (reversing) keep popping up without
a consistent way to express them. (APL is very consistent about
expressing ideas, but I don't want to start using APL characters in
the shell!) We could probably find a consistent way, but it would
not be backward-compatible.
-- Derek
Messages sorted by:
Reverse Date,
Date,
Thread,
Author