From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27434 invoked from network); 30 Aug 2005 15:21:37 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Aug 2005 15:21:37 -0000 Received: (qmail 45683 invoked from network); 30 Aug 2005 15:21:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Aug 2005 15:21:31 -0000 Received: (qmail 4999 invoked by alias); 30 Aug 2005 15:21:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21691 Received: (qmail 4990 invoked from network); 30 Aug 2005 15:21:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 30 Aug 2005 15:21:28 -0000 Received: (qmail 45369 invoked from network); 30 Aug 2005 15:21:28 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 30 Aug 2005 15:21:23 -0000 Received: from candle.brasslantern.com ([71.116.79.190]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-2.05 (built Apr 28 2005)) with ESMTPA id <0IM1009MTJZC3NW0@vms044.mailsrvcs.net> for zsh-workers@sunsite.dk; Tue, 30 Aug 2005 10:21:13 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j7UFLBQR019822; Tue, 30 Aug 2005 08:21:11 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j7UFL8S7019821; Tue, 30 Aug 2005 08:21:09 -0700 Date: Tue, 30 Aug 2005 15:21:08 +0000 From: Bart Schaefer Subject: Re: bug with aliases and declaring functions In-reply-to: <20050830010813.BEF5357B2D@hex.databits.net> To: Pete Fritchman , zsh-workers@sunsite.dk Message-id: <1050830152108.ZM19820@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050830010813.BEF5357B2D@hex.databits.net> Comments: In reply to Pete Fritchman "bug with aliases and declaring functions" (Aug 29, 6:08pm) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Aug 29, 6:08pm, Pete Fritchman wrote: } } So, my theory is that the zsh parser is } re-writing 'foo() { echo func; }' to 'foo () { echo func; }' and then } 'foo ' is seen at the beginning of the command, and foo's alias is } substituted. Yes, that's what's happening, as is explained in zsh FAQ #2.3, except that it's a mistake to call it "re-writing." The discussion of aliasing in the zsh manual says "Every token in the shell input is checked ..." -- note that it says token, indicating that aliasing is applied after lexical analysis, and that it specifically does not say anything about requiring spaces to surround the token.