* Make reserved word "function" a little more reserved?
@ 2009-01-21 5:01 Bart Schaefer
0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2009-01-21 5:01 UTC (permalink / raw)
To: zsh-workers
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.
--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-21 5:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-21 5:01 Make reserved word "function" a little more reserved? Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).