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

Re: Proof of concept: "static" parameter scope



Peter Stephenson wrote on Sat, Oct 03, 2015 at 20:19:36 +0100:
> On Wed, 30 Sep 2015 17:27:48 -0700
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > Enabling the builtin again does not fix this:
> > 
> > torch% enable -r local
> > torch% zxxx
> > zxxx: number expected
> 
> Obviously, since it parsed the function zxxx when local wasn't a
> reserved word and you've done nothing to reparse it.  You need to parse
> it again.
> 
> % enable -r local
> % zxxx() { local x=(a b c); print $x }  
> % zxxx
> a b c

Related issue:

% disable -r local
% zxxx() { local x=(a b c); print $x }
% enable -r local  
% which zxxx
zxxx () {
	local x=(a b c)
	print $x
}

Should it output 'builtin local x=(a b c)'?



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