From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14471 invoked by alias); 8 Aug 2011 04:56:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29655 Received: (qmail 7507 invoked from network); 8 Aug 2011 04:56:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/DYmWqvW1E7lqYXlJyu0lbXSQKGlZ0k/jq4cP0912JU=; b=u4w08kuofVvMjm8Y/m7hw/rxQFccCdHDAe3v2IBfh235bZLqPzhX2zzz0yuzJRbddP d1vvJAqvCN3s+d7/08NiFAD8hg3NFaFlmrOKLnbTUMBD5ckyHSIH4yX3jFTo74Qkj0Qn 6Xo+0kTfKcKM3jQvVpgbey90kI+jNLU47jKvE= MIME-Version: 1.0 In-Reply-To: <20110731193922.237278da@pws-pc.ntlworld.com> References: <20110731141715.GA66652@stack.nl> <20110731193922.237278da@pws-pc.ntlworld.com> Date: Mon, 8 Aug 2011 06:29:01 +0200 Message-ID: Subject: Re: syntax error with anonymous functions when an argument begins with ( From: Mikael Magnusson To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 31 July 2011 20:39, Peter Stephenson wrote: > On Sun, 31 Jul 2011 16:17:15 +0200 > Jilles Tjoelker wrote: >> > [people want stuff like () { echo yay } (a|b)] >> >> In fact, the closing brace may validly be followed by certain keywords >> in older zsh, for example >> >> if :; then () { echo hi; } else () { echo bye; } fi >> >> prints "hi" in zsh 4.3.12 from FreeBSD ports. > > You're quite right that this used to behave like if-then-else in 4.3.12 > and now no longer does. I actually had an anonymous function followed by 'done' in my .zshrc, but when I tested the new zsh version there was no error since the file was compiled. When I edited my .zshrc a week later though, zsh reported errors on startup, which took me a couple of minutes to figure out :). Is there a good reason to not stick on the $ZSH_PATCHLEVEL on the version stored in .zwc files, assuming it's stored as a string? -- Mikael Magnusson