From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.10/8.6.9) with SMTP id KAA28322 for ; Fri, 26 May 1995 10:10:22 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA21381 (5.65c/Gatech-10.0-IDA for ); Thu, 25 May 1995 20:03:17 -0400 Received: by math (5.x/SMI-SVR4) id AA29937; Thu, 25 May 1995 19:59:33 -0400 Resent-Date: Thu, 25 May 1995 19:58:18 -0400 Old-Return-Path: Message-Id: <9505252358.AA29229@redwood.skiles.gatech.edu> X-Mailer: exmh version 1.5.3 12/28/94 To: zsh-workers@math.gatech.edu Subject: Re: Reserved words and aliases In-Reply-To: Your message of "Thu, 25 May 1995 14:05:30 BST." <553.9505251305@pyro.swan.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 25 May 1995 19:58:18 -0400 From: Richard Coleman Resent-Message-Id: <"Oggu23.0.hJ7.bdHnl"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/37 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > The problem is a Z-shell Kludge (TM): the aliases and reserved words > shared the same hash table. The old behaviour was that making exec > an alias stopped the real exec from being recognised as a shell > reserved word and this couldn't be undone. > > I could have fixed this by compounding the kludge, e.g. by adding an > extra flag if an alias was a reserved word that was aliased. Instead > I decided to do it properly and put the reserved words in their own > hash table. This enabled some minor data size optimisations at the > expense of some minor code increase. It also opens the way in future > to turn off aliases as an option if that ever becomes necessary. Totally excellent! I think there are some other tables that probably should be split like this. > There is the odd minor but reasonable change in behaviour, for example > compctl's alias flag won't produce reserved words any more (they still > appear for command completion and spell checking). I guess we will need (yet another) flag to match reserved words. I consider that a small price to pay for this particular cleanup. > You can now do > > % alias exec="((SHLVL++, SAVEHIST=0)); exec" > > if you really want. I'm not sure why you would want to do this, but it's cool that it will be possible. rc