zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: pws@ifh.de (Peter Stephenson)
Cc: zsh-workers@math.gatech.edu
Subject: Re: zsh3.0.0 bug: aliases in if-statement
Date: Wed, 2 Oct 1996 14:02:46 +0200 (MET DST)	[thread overview]
Message-ID: <199610021202.OAA10512@bolyai.cs.elte.hu> (raw)
In-Reply-To: <199610021055.MAA21971@sgi.ifh.de> from Peter Stephenson at "Oct 2, 96 12:55:41 pm"

Peter Stephenson wrote:
> "Bart Schaefer" wrote:
> > IMHO, alias expansion has always happened too soon in zsh, but it greatly
> > complicates matters to go around reshaping syntax trees at execution time.
> 
> Not just too soon, I've often thought, but too much.  I don't like the
> following at all.
> 
> % which ls
> ls: aliased to ls -F
> % foo() { command ls }
> % which foo
> foo () {
>         command ls -F
> }

bash, ksh and pdksh behaves similarily.  Aliases should be thought as
macros which expand during compile time.  That's especially true for global
aliases.  Shell functions can do almost anything that a non-global alias
can.  Adding special checks for aliases in the body of comblex commands
would require reparsing of the body which would make zsh much slower and
the code would become more compicated.  POSIX omitted aliases because shell
functions have much more clear semantics and provide more functionality
than aliases and they are even more portable than aliases.

Zoltan


      reply	other threads:[~1996-10-02 12:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-01 23:51 Huy Le
1996-10-02  0:34 ` Bart Schaefer
1996-10-02 10:55   ` Peter Stephenson
1996-10-02 12:02     ` Zoltan Hidvegi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199610021202.OAA10512@bolyai.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=pws@ifh.de \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).