zsh-users
 help / color / mirror / code / Atom feed
From: William Scott <wgscott@chemistry.ucsc.edu>
To: L:ZSH-users <zsh-users@sunsite.dk>
Subject: Re: odd recursion
Date: Mon, 31 Jan 2005 15:30:34 -0800	[thread overview]
Message-ID: <07053ae70a0e029b3df8b8431dfa6243@chemistry.ucsc.edu> (raw)
In-Reply-To: <41FE98A3.8040700@cql.com>

Thanks very much to everyone who answered.

Just to clarify -- I know the simplest solution is just to avoid it, 
the next most simple solution is to use
zsh/ksh function syntax rather than posix syntax.

The main point of the question was that I don't see how/why it is a 
recursion, from the logic of the expressions, which is why I said there 
was some sort of fundamental gap in my understanding of how zsh works.

On Jan 31, 2005, at 12:44 PM, Seth Kurtzberg wrote:

> 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.
>  


  reply	other threads:[~2005-01-31 23:31 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
2005-01-31 23:30       ` William Scott [this message]
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=07053ae70a0e029b3df8b8431dfa6243@chemistry.ucsc.edu \
    --to=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).