From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12476 invoked from network); 20 Jul 2009 09:11:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 20 Jul 2009 09:11:16 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 9724 invoked from network); 20 Jul 2009 09:11:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Jul 2009 09:11:03 -0000 Received: (qmail 21324 invoked by alias); 20 Jul 2009 09:10:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27179 Received: (qmail 21305 invoked from network); 20 Jul 2009 09:10:52 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 20 Jul 2009 09:10:52 -0000 Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by bifrost.dotsrc.org (Postfix) with ESMTP id 41FD78027106 for ; Mon, 20 Jul 2009 11:10:48 +0200 (CEST) Received: by ewy18 with SMTP id 18so2029343ewy.45 for ; Mon, 20 Jul 2009 02:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CYs8dGvutkG/OGDagwMw1RU7AxCXogiiXMrD59YqCQY=; b=pHHYsMRwbaB4M7RTdwT+66/30gVuks+dbIdaRnolxmlkknmsRpxXotE72vlORXaa2L nA365cmI4jh+dTQh+xFDZe82mg1YXVj0gFrGO5VQArrKOoCanIPY1s6oVTIJghJ70wcc Zab+6/mTizC2Nn3aQ0odds5q4UJrbZqYArDTQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pktN+fBaNaVcmHcxcFdtLu9poyhXI4oGUrancVxNGYpWHsxZ6QFz9yTIJQIES214uk o/raFc2gu1AcNq8YEXPqf0qmS13ljqySLPRQtb/3ONlOierqf5nEjl8RCTsCHCZloGDP HrgHMLWlxQwjmbifZ8I7UPfE5Djxq7/m4Gn24= MIME-Version: 1.0 Received: by 10.210.69.13 with SMTP id r13mr3339950eba.66.1248081047732; Mon, 20 Jul 2009 02:10:47 -0700 (PDT) In-Reply-To: <200907200850.n6K8ovIg028836@news01.csr.com> References: <20090719171651.GA7217@piper.oerlikon.madduck.net> <20090719232041.GA5156@scru.org> <20090720092757.77e812c7@news01> <237967ef0907200137j245d1bgc43303d2b9805249@mail.gmail.com> <200907200850.n6K8ovIg028836@news01.csr.com> Date: Mon, 20 Jul 2009 11:10:47 +0200 Message-ID: <237967ef0907200210k1df76e67u16056ff1e5d1be27@mail.gmail.com> Subject: Re: Bug#537596: regression: parse error near `()' in function definition From: Mikael Magnusson To: zsh-workers@sunsite.dk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9589/Sun Jul 19 05:14:56 2009 on bifrost X-Virus-Status: Clean 2009/7/20 Peter Stephenson : > Mikael Magnusson wrote: >> Just thought I'd mention you can also use \ at any time to escape an alias: > > Something like that is worth mentioning. > > Index: Etc/FAQ.yo > =================================================================== > RCS file: /cvsroot/zsh/zsh/Etc/FAQ.yo,v > retrieving revision 1.47 > diff -u -r1.47 FAQ.yo > --- Etc/FAQ.yo 21 Apr 2009 09:33:37 -0000 1.47 > +++ Etc/FAQ.yo 20 Jul 2009 08:50:23 -0000 > @@ -819,6 +819,14 @@ > use in the body of a function, but define the function first if the > alias has the same name as the function. > > + If you aware of the problem, you can always escape part or all of the > + name of the function: > + verb( > + 'l'() { /bin/ls -la "$@" | more } > + ) > + Adding the quotes has no effect on the function definition, but > + suppresses alias expansion for the function name. Hence this is > + guaranteed to be safe. I didn't look up more of the context than what is in the diff hunk, so maybe this guarantee only holds for aliases of l, but not generally: % alias l='echo hello' % alias \'l\'='echo bye' % l hello % 'l' bye % 'l'() {print i am a function} % l i am a function % 'l' i am a function % "'l'" zsh: command not found: 'l' % which l l: aliased to echo hello % which 'l' l: aliased to echo hello % which "'l'" 'l': aliased to echo bye What happened at this point: % 'l'() {print i am a function} was of course that i defined "echo" (and "bye"): % which echo echo () { print i am a function } -- Mikael Magnusson