On Fri, Jul 03, 2009 at 09:40:12AM +0200, TSa wrote:
> I see. But I wouldn't make that an exception but ^^ returns a tristate
> value instead of boolean. The third state besides True and False is
> TooMany that evaluates to False in boolean context. But ^^ can react
> to it as you describe. That solves the associativity problem, indeed.
> Hmm, perhaps a TooFew value is nice as well. Then one can use that to
> switch over the xor:
>    given $x ^^ $y ^^ $z
>    {
>        when TooMany {...}
>        when TooFew {...}
>        when True {...}
>    }
> A nicer set of return values would be Many, One and Zero. Numeric values
> could be Many = -1, One = 1 and Zero = 0, so that they numerify nicely.
> So can we write that into the spec?

I suspect that boolean operators should stay boolean operators,
and counting should usually be done with normal integers.  In
other words, this is too much mechanism for too little payback.


Reply via email to