On Thu, 24 Oct 2002, Deborah Ariel Pickett wrote:
: Which looks better?
:   if ($a == 1|2|3 || $b eq "x"|"y"|"z")
: or
:   if ($a == 1||2||3 | $b eq "x"||"y"||"z")
: ?

I think disjunctions of data values should be | and disjunctions of expressions
should be ||, so that the "bigger" concept has the bigger operator.

: Besides, maybe superposition is going to turn out to be a very common
: thing in Perl after all.

I think we'll see an awful lot of them that people won't even think of as
superpositions, for instance:

    when 1 | 2 | 3

You know, we could go so far as to say that in regexen, | is unordered
and || is ordered.  Then we could optimize | to work via DFA or in
parallel (for whatever definitions of parallel you want) .  But that'd
be a rather significant cultural change...

: I think I've already decided that I prefer it the way it is (for recent
: values of "is").  I just need some kind soul to pat me on the head and
: tell me it's OK.

It's really OK.  The head pat is more problematic--I seem to flip my
hemispherical sign bits one at a time, never both at once for the
same trip.  Perhaps Damian could give you a head pat by proxy next
time you run into each other.

Larry

Reply via email to