On Sat, 26 Oct 2002, Damian Conway wrote: : Larry mused: : : : > Now I'm wondering whether these should be split into: : > : > +& +| +! - bitwise operations on int : > +&= +|= +!= : > : > ~& ~| ~! - bitwise operations on str : > ~&= ~|= ~!= : : I think this is UME (Unnecessary Multiplication of Entities), especially : given: : : > +$x .| +$y : > ~$x .| ~$y
Well, yes, but what does +$x .| ~$y do? I guess in a multimethod world it's too ambiguous to dispatch... We're also missing the actual C operators that are guaranteed to return 0 or 1: $x ?& $y # C's $x && $y $x ?| $y # C's $x || $y $x ?! $y # C's, er, !!$x ^ !!$y : > I think a good case can be made for *not* defining the corresponding : > super assignment operators: &=, |=, and umm...I guess it would have : > to be !=, er... : : I suspect disjunctive superpositions will get a great deal : of use as sets, and so the ability to add an element to an : existing set: : : $set |= $new_element; : : might be appreciated. But it's no big thing. Yes, but we certainly can't have !=. Another argument for not using ! for xor. I guess _ is available as a kind of | laying down. Can't have "x". We could use "o" as short for "one or other". $either = 1 o 2; $set o= 1; $comp = o $mask; if $x oo $y $c = $a ~o $b That's very distinctive. I think I could get to like it. : > I'd still love to the double angles for a qw synonym. : : I was hoping we'd be able to generalize << from the heredoc introducer to : the file slurp operator. But I can certainly see the attraction of: : : use enum <<d'oh ray me far solar tea>>; : : ;-) Actually, I meant the French double-angle quotes. Larry