Dave Whipp <[EMAIL PROTECTED]> wrote: > > "Brent 'Dax' Royal-Gordon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > The overloading of 'or' there is (IMHO) far more dangerous than the > > overloading of '::' being discussed in this thread. > > Not necessarily. You're assuming that C<either> in a ternary operator. It > could be a binary operator, defined as {eval $RHS if $LHS; return $LHS}. For > that interpretation, one might choose a different name (e.g. C<implies>). > We could actually define ?? as a binary operator in much the same way.
Even if C<either> is defined as a binary operator such that C<or> isn't truly overloaded, it's *semantically* overloaded in a dangerous way. (That is, to humans, the C<either>/C<or> construct has very different behavior from a plain C<or>, even though to the computer it's just a couple of binary operators and some precedence.) Further, C<either>/C<or> is more dangerous because it will fail silently (by branching down the wrong path), while C<??>/C<::> will usually fail loudly (by throwing a syntax error at comple time or by throwing a "subroutine not found" error at runtime). -- Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> Perl and Parrot hacker There is no cabal. -- Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> Perl and Parrot hacker There is no cabal.