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

Re: PATCH: `try' syntax



On Wed, 16 Jun 2004, Oliver Kiddle wrote:

> Bart wrote:
> 
> > 	local -a +h reswords dis_reswords
> > 
> > either the values aren't restored and/or assigning to these arrays
> > doesn't accomplish enable/disable.
> 
> It's not odd if you look briefly at how everything in the parameters
> module is implemented. When a value is looked up it gets the
> information from the internal structure and returns it. Making local
> save and restore these internal structures would be fairly messy.

I'm pretty sure it works for _some_ variables; $functions in particular.

schaefer<501> x() {
> local -A +h functions
> print $#functions
> unfunction x
> print $#functions
> }
schaefer<502> x
502
501
schaefer<503> print $#functions
502
schaefer<504> x
502
501

Yep, works for $functions.  Maybe it's because $reswords is not a hash.
(Why did we go with two arrays rather than a hash with resword keys and
enabled/disabled values?  I've forgotten.)



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