Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] ksh_zero_subscript messes with associative arrays
- X-seq: zsh-workers 50429
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] ksh_zero_subscript messes with associative arrays
- Date: Tue, 26 Jul 2022 10:10:00 -0700
- Archived-at: <https://zsh.org/workers/50429>
- In-reply-to: <CAH+w=7Z8vK9NMOvdQZTdkeGni1_Si+UwuNJBNT64W-LKYJdomA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAMP44s3Os7D51aLZDswRir6j8DhkJVKbfHLH5JoYb-Mz_98WVQ@mail.gmail.com> <1174358605.42447.1658853176256@mail.virginmedia.com> <CAH+w=7Z8vK9NMOvdQZTdkeGni1_Si+UwuNJBNT64W-LKYJdomA@mail.gmail.com>
On Tue, Jul 26, 2022 at 10:00 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Something is tickling my brain to the effect that this was left this
> way for bug-compatibility with some version of (perhaps pd) ksh ...
More of this comes back to me ... I think the situation is/was this:
hash=( [Y]=why [0]=zero )
echo $hash
zero
That is, reference to the entire hash without subscript returns a
reference to the element with key "0", just as reference to an array
without subscript returns the 0th element.
So there's probably not after all a connection to other unset
elements, but I think PWS's patch will alter the above behavior as
well?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author