Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Make reserved word "function" a little more reserved?
- X-seq: zsh-workers 26385
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Make reserved word "function" a little more reserved?
- Date: Tue, 20 Jan 2009 21:01:04 -0800
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Consider:
zsh% eval function foo() { print $0 }
This defines both "eval" and "foo" as functions that print their name,
but leaves "function" untouched. Perhaps upon encountering the word
"function" in such a context, the parser could arrange to apply the
function definition only to the words that appear to its right, not to
the words that appear to its left?
Consider further:
zsh% eval function foo { print $0 }
zsh: parse error near `}'
This seems unnecessary, somehow.
Yeah, I know, eval isn't a reserved word, so neither is function in that
context, it's just anti-foot-shooting that makes this, ah, function.
--
Messages sorted by:
Reverse Date,
Date,
Thread,
Author