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

Re: uninvited members of associative array



On Thu, Dec 15, 2022 at 04:48:51PM -0800, Ray Andrews wrote:
>
> On 2022-12-15 16:05, Lawrence Velázquez wrote:
> > How are you creating and populating "main"? Can you provide a test
> > case that the rest of us can actually use?
>
> There's always the chance it doesn't even come to that, some artifact in the
> way the array prints or something.   But if you need to see an
> initialization:
>
>
> # nlist(): Initialize 'main' array.  10 elements:
> -----------------------------
> main[window]="main"
> main[list]='List'
> main[lastE]="$#List"
> main[hight]=$(( mainWH - 2 ))
> main[width]=$(( mainWW - 2 ))
> main[bottomE]="$main[hight]"
> main[topE]=1
> main[currentE]=1
> main[offset]=0
> main[active]=1
>
> ... all values assign properly, so where do the uninvited keywords come
> from?  As Bart explained, the order of the printout has no regularity, so
> there's no pattern to look for.

Probability of 95% or more that the array gets modified after the
initialisation by some stray code.  Put prints all over the place
to find the place where the array gets modified.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




Messages sorted by: Reverse Date, Date, Thread, Author