2

When I try to use the xor operator:

if(a ^ b)

I get the following error:

internal Error: unimplemented binary operator

Is there another way to do it in beanshell, or should I just do:

if((a && !b) || (!a && b))
Dave Novelli
  • 2,086
  • 4
  • 32
  • 42

2 Answers2

4

if(a != b) is equivalent to XOR (a ^ b) for booleans.

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
Tony Casale
  • 1,537
  • 8
  • 7
2

In Beanshell2 the xor operator is implemented, see http://code.google.com/p/beanshell2

Peter
  • 1,272
  • 11
  • 11