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

Suggested "case" syntax extension



Newer versions of ksh allow an optional '(' before each pattern in a case
statement, complementary to the mandatory ')' following the pattern.  As
well as being esthetically symmetric, this also facilitates verifying that
a shell script has balanced parentheses (e.g. with the '%' command in vi).

It seems that zsh still recognizes only the classic Bourne shell syntax for
"case", with the ')' but no optional '('.  Considering all the syntactic
variation zsh supports, it would be quite reasonable for zsh to allow a
leading '(', thereby enhancing compatibility with ksh scripts.  Although
I have not looked into the zsh source, I imagine this should not pose an
implementation problem.

-- Morrie Siegel



edit




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