On Saturday, October 12, 2002, at 01:10 PM, Luke Palmer wrote: >> Date: Sat, 12 Oct 2002 08:43:46 -0700 (PDT) >> From: Larry Wall <[EMAIL PROTECTED]> >> >> If we use | and & as sugar for any() and all(), then their precedence >> should probably be the same as || and &&. > > Should they? I had in mind something just above comparisons. That > way: > > if $x == 3 || $y == 4 {...} > > and > > if $x == 1 | 2 { ... } > > both DWIM. Is there a case for not doing this?
Just a thought, but don't we already have this with the "smart match" operator? if $x =~ (1, 2) { ... } Or would & and | be a bit more strict in use, and thus easier for the compiler to optimize? For instance, would we be able to: if $x == 1 | "hello" { ... } or would both operands have to be of the same type?