Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Scope of local parameters
- X-seq: zsh-workers 18507
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: Scope of local parameters
- Date: Wed, 07 May 2003 10:39:44 +0200
- In-reply-to: <2148.1052215470@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <2148.1052215470@xxxxxxx>
Peter wrote:
>
> > Hmm ... making typeset create local parameters in sourced script by default
> > will definitely break a lot of existing scripts.
> > Probably extra argument to
> > typeset or (better) extra options to treat typesets in script as local.
>
> Certainly possible, but will need some extra wiring. I should think
> thre's some possible fudge involving locallevel, scanendscope and a new
> parameter flag, rather than adding a completely new mechanism. I think
Except that the parameter code has enough fudges holding it together
already.
So that we don't end up with too many typeset flags, this could perhaps
be combined with some facility for ksh93 style lexical scoping. Perhaps
allowing scope to be restricted to within { ... }, do .. done and if
... fi blocks. Another option might be some syntax for in place
functions - some variant of the { ... } block in which local variables
would apply.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author