Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: bash-style substrings & subarrays
- X-seq: zsh-workers 28427
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx (Zsh hackers list)
- Subject: Re: PATCH: bash-style substrings & subarrays
- Date: Sun, 21 Nov 2010 17:02:38 +0000
- In-reply-to: Your message of "Sat, 20 Nov 2010 22:34:01 PST." <101120223401.ZM6950@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Bart Schaefer wrote:
> } I don't think half-measures compatibility with other shells is
> } particularly useful, in the end is probably more confusing when you
> } find some things work the way you expect and some things don't.
>
> I'm confused about how that relates to the foregoing, sorry ...?
If KSH_ARRAYS is not set, lots of aspects of arrays don't work in a
fashion consistent with other shells, so the fact that one feature you
chanced upon does so, doesn't help you write scripts properly. If you
want proper compatibility you need a full emulation.
This doesn't impinge on the argument for saying the newly imitated
syntax only deals with offsets and for that reason shouldn't be affected
by KSH_ARRAYS, however. I'd be happy to get any other views. Should
${foo:1} always start 1 character/element beyond the first one,
regardless which subscripting rules are in use? I'm now inclining in
that direction.
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author