zsh-users
 help / color / mirror / code / Atom feed
From: Seth Kurtzberg <seth@cql.com>
To: William Scott <wgscott@chemistry.ucsc.edu>
Cc: Thorsten Kampe <thorsten@thorstenkampe.de>, zsh-users@sunsite.dk
Subject: Re: odd recursion
Date: Mon, 31 Jan 2005 13:44:19 -0700	[thread overview]
Message-ID: <41FE98A3.8040700@cql.com> (raw)
In-Reply-To: <6f5f1b5c88ce1d0196392e62bcf981f1@chemistry.ucsc.edu>

William Scott wrote:

>>
>> I hope you have your reasons to tell the shell "a is b" and "a is c"
>> at the same time. Basically your aliasing ls two times simultaneously.
>>
>>
>
> The interesting thing is that if I issue
>
> "which lf"  it tells me that lf is aliased, not that it is defined as 
> a function.  If I then issue the newly defined lf command, the 
> function takes precedence over the alias (which is what I understood 
> to be the expected behavior), which I can see from the error messages 
> produced.
>
> The problem arose because a user made the alias without checking to 
> see that the function was defined, and that the function was written 
> as a posix function and defined after the alias in the sequence of 
> shell initialization.
>
> If the alias is defined after the posix function is defined, the 
> problem doesn't arise.

I don't see any way around this, without taking away good and necessary 
behavior.

You can always use the really simple solution, which is not to have a 
name clash at all.  I use a short script I wrote to tell me whether a 
name is already defined somewhere.  It's got a bug in it w.r.t. 
functions (which makes it useless at the moment) but I'll (presumably) 
fix that.

IMHO, it is always better to keep things explicit rather than relying on 
the sequence of operations in the implementation.

A warning, as someone suggested, might be a better solution.

>
>
> !DSPAM:41fe79f8244781930316049!
>


  reply	other threads:[~2005-01-31 20:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31 16:24 William Scott
2005-01-31 16:46 ` Bart Schaefer
2005-01-31 16:54 ` Thorsten Kampe
2005-01-31 18:16   ` William Scott
2005-01-31 20:44     ` Seth Kurtzberg [this message]
2005-01-31 23:30       ` William Scott
2005-02-01  2:48         ` Bart Schaefer

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=41FE98A3.8040700@cql.com \
    --to=seth@cql.com \
    --cc=thorsten@thorstenkampe.de \
    --cc=wgscott@chemistry.ucsc.edu \
    --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).