#286 XOR not implemented for booleans ?

open
nobody
General (151)
5
2007-02-19
2007-02-19
Pascal Meheut
No

The line:

interpreter.eval("boolean a=true; boolean b=true; boolean c=a^b; print(c)");

returns:

bsh.InterpreterError: unimplemented binary operator
at bsh.Primitive.booleanBinaryOperation(Primitive.java:287)

although it is valid in Java.

booleanBinaryOperation in Primitive.java does not implements XOR, I guess it lacks something like:

case XOR: return lhs ^ rhs ? Boolean.TRUE : Boolean.FALSE;

Discussion

  • Pascal Meheut
    Pascal Meheut
    2007-02-19

    Logged In: YES
    user_id=1723411
    Originator: YES

    Sorry, I did not saw it was already in the database. My mistake