zsh-users
 help / color / mirror / code / Atom feed
From: "Sean B. Palmer" <sean@miscoranda.com>
To: zsh-users@sunsite.dk
Subject: Keyword Aliasing Behaviour
Date: Sun, 26 Mar 2006 14:22:32 +0100	[thread overview]
Message-ID: <b6bb4d890603260522t56472c8bufd976d75676f8359@mail.gmail.com> (raw)

Using zsh 4.2.6, I note that keywords can be aliased. For example:

    alias in='test'

But then this gets expanded when the "in" keyword is used in a case:

   $ case $HOME in *) :;; esac
   zsh: parse error near `test'

I asked the #zsh IRC channel on Freenode, and a member there thought
it sounded like a bug and directed me to this mailing list. Can anyone
confirm that this is a bug, or is it a feature? If it's a bug, is it
fixed in a later version? If a feature, what is the rationale for it?

I notice that man zshall states that unless alias is provided with a
-g flag, making the alias global, the alias will only be expanded in a
command position. Since the "in" keyword in a case statement is not in
a command position, the behaviour I'm seeing appears to be erroneous.

The case $var { ... } syntax was suggested to me on #zsh, and is
useful but I probably shouldn't be rebinding keywords anyway.
Nevertheless, this was surprising behaviour.

Thanks,

--
Sean B. Palmer, http://inamidst.com/sbp/

             reply	other threads:[~2006-03-26 13:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-26 13:22 Sean B. Palmer [this message]
2006-03-26 18:54 ` Peter Stephenson

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=b6bb4d890603260522t56472c8bufd976d75676f8359@mail.gmail.com \
    --to=sean@miscoranda.com \
    --cc=zsh-users@sunsite.dk \
    /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).