com.waveset.expression
Class ExFunction.f_or

java.lang.Object
  extended bycom.waveset.expression.ExNode
      extended bycom.waveset.expression.ExFunction.f_or
All Implemented Interfaces:
com.sun.idm.debugger.common.Locatable
Enclosing class:
ExFunction

public static class ExFunction.f_or
extends ExNode

The function node for the <or> expression.

The or expression returns a value that is logically true if any of the subexpression values are logically true. If all subexpression values are logically false, the expression returns the integer 0.

Logical truth is defined by the ExValue.isTrue() method. Essentially, any string or object value that is non-null or any integer value that is non-zero, is considered logically true.

The function returns logical truth by returning the first logically true subexpression value. This behavior is useful, and can be used to implement conditional selection from a list of possible values. UPDATE: The convention of returning zero if none of the inner expressions are true makes this hard to use as a selector when null is a possible result. I'm a little afraid of changing the return value of so I added