David Storrs wrote: > On Fri, Jan 03, 2003 at 10:58:49AM -0800, Mr. Nobody wrote: > > > --- Smylers <[EMAIL PROTECTED]> wrote: > > > > > junction should be sufficient: > > > > > > print "date" if $var == any(1 .. 31); > > > > Superpositions in the core? You're kidding, right?
Yeah, somehow they just slipped right in there without anybody on this mailing list really noticing -- and certainly without any long threads discussing the syntax for their operator incarnations and the knock-on effect that could have on other operators ... > > What's wrong with "if 1 <= $var <= 31"? > > ...nothing. If you like it, by all means use it. But, (1) TIMTOWTDI, > (2) Smyler's version is more visually concise (although, granted, it > actually takes a few extra chars), (3) Smyler's version puts the > variable (the important thing in the expression) on the left instead > of the in the middle, and (4) IMHO, Smyler's version reads better as > English. Those are stylistic things, and to some degree a matter of taste. More importantly the junction version -- or even better, the smartmatch version as pointed out by Chris Dutton -- work for arbitrary sets, not just ranges of consecutive values. Smylers