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

Re: Could someone clarify how math functions work?



[> workers]

On Dec 19,  9:35am, Peter Stephenson wrote:
}
} I'm wondering, however, if we can do a bit better by strengthening the
} warnings against variant syntax --- whose sole role appears to be to
} confuse the user --- and provide some kind of good practice guide for
} complex syntax such as functions, loops, etc.  But would anyone read it?

Grammatically, "subshell() ( ... )" is not "variant syntax" it's just an
uncommon usage of the standard syntax.  SHORT_LOOPS on the other hand ...

Either way, we could introduce an option similar to WARN_CREATE_GLOBAL
that prints runtime (parse time? "verbose" output time?) warnings for
some of these things.  It'd take a bit of work to track down all the
cases we might want to warn about.

Then one could e.g.
	zsh -o warn_odd_syntax -n scriptfile

We'd have to decide whether multios are in this category, etc.  There is
no clear line between zsh-specific syntax that one might use intentionally
and "variant" syntax that one might use accidentally.  And subshells are
even more a case of "did-he-mean-that?" when used where a current-shell
construct in braces would be more common.



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