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

Re: Global arrays in widgets



On Jan 17,  1:18pm, Sebastian Gniazdowski wrote:
}
} typeset -g __zew_csw_index __zew_csw_left __zew_csw_right
} typeset -ga __zew_csw_found

[...]

} But the variable __zew_csw_found doesn't survive between calls. I
} tested various things and found that the only array that I can keep
} between calls is reply. Why?

Digging into the source from the link in your previous message, which
ideally I would not have had to do ...  it's this:

    typeset -U __zew_csw_found

This creates a new local with the same name as the global.  Why not
just apply the -U at the first declaration?  If for some reason you
don't want to do that, use

    typeset -gU __zew_csw_found

to apply the -U to the global parameter.



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