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

Re: Surprising parsing result with anonymous functions and for loops



> The presence of braces around the entire body simply allows the parser
> to distinguish the body from the arguments.  If there are other
> syntactic clues, those also distinguish body from arguments

Incidentally, I think this is related to zsh's non-standard handling
of redirections following a function definition.  POSIX says that

foo() { echo foo; } >/tmp/foo

should behave the same as

foo() { { echo foo; } >/tmp/foo }

but in zsh it behaves like

{ foo() { echo foo; } } >/tmp/foo



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