From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16188 invoked from network); 4 Jun 2002 16:33:34 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 4 Jun 2002 16:33:34 -0000 Received: (qmail 17962 invoked by alias); 4 Jun 2002 16:33:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17284 Received: (qmail 17950 invoked from network); 4 Jun 2002 16:33:25 -0000 Date: Tue, 4 Jun 2002 09:33:15 -0700 (PDT) From: Bart Schaefer Sender: schaefer@ns1.sodaware.com To: Peter Stephenson cc: Zsh hackers list Subject: Re: PATCH: function parsing In-Reply-To: <20020604161825.A65341C0B5@pwstephenson.fsnet.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 4 Jun 2002, Peter Stephenson wrote: > % zsh -c 'function func { } this fails to cause a parse error' > zsh: parse error near `this' > % zsh -c 'func() { } this fails to cause a parse error' > % > > I'm assuming the first is correct, since the second certainly isn't as > the text is simply ignored. While you're at it, any chance you can "fix" redirections following a function definition? E.g. per ksh (and possibly per posix) this: func() { less } < /etc/termcap should be equivalent to this: func() { { less } < /etc/termcap } rather than the current zsh equivalent: { func() { less } } < /etc/termcap Note that: func() less < /etc/termcap is already equivalent to: func() { less < /etc/termcap } so the first case above must be only a small matter of parsing.