Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] ksh_zero_subscript messes with associative arrays



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