From: "Oliver Kiddle" <okiddle@yahoo.co.uk>
To: Bart Schaefer <schaefer@brasslantern.com>,
Steve Talley <stephen.talley@sun.com>
Cc: zsh-users@sunsite.dk
Subject: Re: Reverse the order of an array?
Date: Mon, 11 Feb 2002 13:26:20 +0000 (GMT) [thread overview]
Message-ID: <20020211132620.27729.qmail@web9302.mail.yahoo.com> (raw)
In-Reply-To: <Pine.BSF.4.40.0202082359000.90676-100000@brasslantern.com>
--- Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> Hmm, I should have thought of that.
>
> eval osvers\=\( \"\$osvers\[{$#osvers..1}\]\" \)
>
Not very intuitive that is it.
I recently wanted to loop over an array's elements in reverse and
though I could do it with a for loop counting the indices backwards I
did think that there ought to be a better way.
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?
Oliver
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
next prev parent reply other threads:[~2002-02-11 13:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-08 22:35 Steve Talley
2002-02-08 22:59 ` Bart Schaefer
2002-02-08 23:55 ` Steve Talley
2002-02-09 0:09 ` Bart Schaefer
2002-02-09 0:17 ` Steve Talley
2002-02-11 13:26 ` Oliver Kiddle [this message]
2002-02-11 18:41 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020211132620.27729.qmail@web9302.mail.yahoo.com \
--to=okiddle@yahoo.co.uk \
--cc=schaefer@brasslantern.com \
--cc=stephen.talley@sun.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).