From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26223 invoked from network); 31 Jan 2005 23:31:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 31 Jan 2005 23:31:38 -0000 Received: (qmail 27619 invoked from network); 31 Jan 2005 23:31:32 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 31 Jan 2005 23:31:32 -0000 Received: (qmail 2999 invoked by alias); 31 Jan 2005 23:31:14 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8446 Received: (qmail 2986 invoked from network); 31 Jan 2005 23:31:14 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 31 Jan 2005 23:31:14 -0000 Received: (qmail 26145 invoked from network); 31 Jan 2005 23:30:38 -0000 Received: from hydrogen.ucsc.edu (128.114.41.29) by a.mx.sunsite.dk with SMTP; 31 Jan 2005 23:30:34 -0000 Received: from [128.114.139.204] (xanana.ucsc.edu [128.114.139.204]) by hydrogen.ucsc.edu (8.12.11/8.12.11) with ESMTP id j0VNQBkh013603 for ; Mon, 31 Jan 2005 15:26:11 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v619.2) In-Reply-To: <41FE98A3.8040700@cql.com> References: <5ced8dfb84fe26e20350095da48dd44d@chemistry.ucsc.edu> <1ba5918552xff.dlg@thorstenkampe.de> <6f5f1b5c88ce1d0196392e62bcf981f1@chemistry.ucsc.edu> <41FE98A3.8040700@cql.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <07053ae70a0e029b3df8b8431dfa6243@chemistry.ucsc.edu> Content-Transfer-Encoding: 7bit From: William Scott Subject: Re: odd recursion Date: Mon, 31 Jan 2005 15:30:34 -0800 To: L:ZSH-users X-Mailer: Apple Mail (2.619.2) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 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. >