Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How sensible is ... ?
- X-seq: zsh-workers 4898
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx
- Subject: Re: How sensible is ... ?
- Date: Wed, 13 Jan 1999 13:45:40 +0100
- In-reply-to: "Phil Pennock"'s message of "Wed, 13 Jan 1999 12:01:53 NFT." <19990113120153.A7542@xxxxxxxx>
Phil Pennock wrote:
> I found that using 'alias' inside there failed to work (in an autoloaded
> function anyway) and had to convert to a function.
That's a general feature.
% testal() { al='print alias'; al; }
% testal
zsh: command not found: al
The entire function is parsed before the alias is defined, so the `al'
never gets expanded. A script is parsed line by line, so this doesn't
happen.
> And useing 'typeset
> -f leavecmd' then defining it after a possible 'setopt localfunctions',
> it remained in scope. I'm at work and decided against spending more time
> on that so just used TRAPEXIT to unfunction it -- maybe I'm just doing
> something wrong ...
I don't think there is another way of making functions have local
scope at the moment.
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author