Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: syntax error with anonymous functions when an argument begins with (



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