From: Austin Ziegler Date: 2004-02-05T03:30:56+09:00 Subject: Re: RCR draft for enhanced "case..when..else..end" syntax On Thu, 5 Feb 2004 03:00:04 +0900, Guoliang Cao wrote: >>> What you've written here will do alternatives checks. Thus, if you >>> have: >>> >>> a = "aaa" >>> b = "BBB" >>> >>> then "Lowercase detected" will be printed. With "AAA" and "bbb", >>> "Lowercase detected" will still be printed. > I think this is very tricky. ',' equals to '||' here. This should be made > very clear otherwise people should avoid use this form. It's not tricky at all; it's consistent with the way that case..when..end works at all. The form case when expr[, expr]+ when expr[, expr]+ else end Is roughly equivalent to case true when expr[, expr]+ when expr[, expr]+ else end In all cases, it's going to be cond === expr || cond === epxr2 (etc.), so that ',' is effectively an "or" condition in all case..when..end expressions. This is not a special case, so to speak. -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2004.02.04 * 13.26.16