Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: `try' syntax
- X-seq: zsh-workers 20061
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: Re: PATCH: `try' syntax
- Date: Wed, 16 Jun 2004 10:21:57 -0700 (PDT)
- In-reply-to: <15239.1087396405@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Reply-to: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Sender: schaefer@xxxxxxxxxxxxxxxxxx
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