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

Re: f() { ...; } > file



On Thu, Nov 13, 2008 at 02:42:12PM +0000, Stephane Chazelas wrote:
[...]
> The patch below seems to fix it. It just removes the special
> case of f() { }. I don't why it was there in the first place.
> rev 1.1 of parse.c already had it.
[...]

I had a look at the old releases. It looks like in the beginning
only the:

f() { ... }

syntax was supported (I'm not talking of the function foo {...}
ksh syntax here).

Then, as part of the "short loops" feature (disabled with setopt
noshortloops), support for:

f() any command

was added (but disabled upon setopt noshortloops).

Then later the check for noshortloops was removed, possibly by
someone who realised that "emulate sh" would set noshortloops
and therefore break compatibility with sh which allows f() cmd

Cheers,
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author