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

Re: uninvited members of associative array




On 2022-12-15 19:20, Bart Schaefer wrote:

I strongly suspect that somewhere you've tried to copy or save/restore
the array by doing something like

list=( $main )
main=( $list )

but have forgotten that for an associative array $main means only the
values, not the keys as well.

Given that you later say "main" is global, you may even have done this
accidentally while working on what you thought was another parameter
named "main", and now you're just finding the leftovers.

No time right now, but I'm going to bet that's exactly what's happened, I'd naively do exactly as you suggest.  I've only just started playing with AAs.  It's begging for trouble that I have " zcurses addwin main " and many similar.  And: " main[window]=main ".  But this goes back to Sebastian's original code.  I've been meaning to do something about it for a long time.








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