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

Re: Proof of concept: "static" parameter scope



On Mon, 5 Oct 2015 21:55:14 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> % 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)'?

There's also the opposite case of loading some standard functions with
the full interface and disabling it to run some stuff of your own in
compatibility mode, for which there's no obvous fix without outputting
an "enable" (and hoping the user hasn't disabled enable to get the
printer control command...)

I'm not sure it's worth a code fix, though a well-placed note might be
useful.

pws

-- 
Peter Stephenson | Principal Engineer Samsung Cambridge Solution Centre
Email: p.stephenson@xxxxxxxxxxx | Phone: +44 1223 434724 |
www.samsung.com



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