From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29513 invoked from network); 29 Jun 2000 12:07:17 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Jun 2000 12:07:17 -0000 Received: (qmail 13502 invoked by alias); 29 Jun 2000 12:07:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12125 Received: (qmail 13495 invoked from network); 29 Jun 2000 12:07:02 -0000 Date: Thu, 29 Jun 2000 14:06:59 +0200 (MET DST) Message-Id: <200006291206.OAA05600@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Thu, 29 Jun 2000 12:38:54 +0100 Subject: PATCH: Re: function declaration syntax Peter Stephenson wrote: > Did anybody notice that according to the manual (and the reference card, > which was how I noticed) this was supposed to work? > > % fn() print foo > # Looks like it worked... > % which fn > fn() { > print foo > } > # but it doesn't. > % fn > % > > Either we should fix it or remove it. My fault, I guess. I have a faint memory of having tested it, but that was probably before the last changes to the word code stuff. Bye Sven P.S.: The comments in parse.c talk about a list1 being allowed there, which would be a sublist. The manual says it's a command. It would be easy to change... Index: Src/parse.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/parse.c,v retrieving revision 1.9 diff -u -r1.9 parse.c --- Src/parse.c 2000/06/14 09:26:56 1.9 +++ Src/parse.c 2000/06/29 12:05:34 @@ -1516,10 +1516,11 @@ } yylex(); } else { - int ll, sl, c = 0; + int ll, sl, pl, c = 0; ll = ecadd(0); sl = ecadd(0); + pl = ecadd(WCB_PIPE(WC_PIPE_END, 0)); par_cmd(&c); Index: Test/09funcdef.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/09funcdef.ztst,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 09funcdef.ztst --- Test/09funcdef.ztst 2000/01/31 11:46:35 1.1.1.1 +++ Test/09funcdef.ztst 2000/06/29 12:05:35 @@ -6,3 +6,8 @@ f$$ 0:Regression test: `function f$$ () { ... }' >regress expansion of function names + + function foo () print bar + foo +0:Function definition without braces +>bar -- Sven Wischnowsky wischnow@informatik.hu-berlin.de