Anvil | Smiths Smiths | Register Register | Login Login |
Search:
Show links Show tools Show tree | Previous document Next document | njet.org > Anvil > Documentation > Language reference > Expressions > Boolean operators

Boolean operators

Boolean operators always yield anvil.lang.boolean. However, they can operate with any value, converting them to boolean by calling the toBoolean method.

Boolean and (``&&´´) yields ``true´´ if and only if both operands yield "true". The second operand is not evaluated even if the first one is false.

Boolean or (``||´´) yields ``true´´ if and only if either operand yields "true". The second operand is not evaluated even if first one is "true".

Boolean xor (``^^´´) yields ``true´´ if and only if another operand is "true" and another is "false". Both operands are always evaluated.

  or-expr  := expr "||" expr 
  xor-expr := expr "^^" expr 
  and-expr := expr "&&" expr 
See also  | Expressions  | Grammar
Contributes notes:
Add a note
What's new | Anvil