Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: syntax error with anonymous functions when an argument begins with (
- X-seq: zsh-workers 29655
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: syntax error with anonymous functions when an argument begins with (
- Date: Mon, 8 Aug 2011 06:29:01 +0200
- 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=
- In-reply-to: <20110731193922.237278da@pws-pc.ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20110731141715.GA66652@stack.nl> <20110731193922.237278da@pws-pc.ntlworld.com>
On 31 July 2011 20:39, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Sun, 31 Jul 2011 16:17:15 +0200
> Jilles Tjoelker <jilles@xxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author