From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22839 invoked from network); 13 Jan 1999 13:03:43 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 13 Jan 1999 13:03:43 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id IAA01072; Wed, 13 Jan 1999 08:01:47 -0500 (EST) Resent-Date: Wed, 13 Jan 1999 08:01:47 -0500 (EST) Message-Id: <9901131245.AA35423@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu Subject: Re: How sensible is ... ? In-Reply-To: "Phil Pennock"'s message of "Wed, 13 Jan 1999 12:01:53 NFT." <19990113120153.A7542@fysh.org> Date: Wed, 13 Jan 1999 13:45:40 +0100 From: Peter Stephenson Resent-Message-ID: <"b3_xA1.0.eG.xa9ds"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4898 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy