Logical intersection (and)
The and operator produces a result of true if both of its operand values are true and false otherwise.
When the correlator evaluates a logical and expression it evaluates the left operand first. If the left operand evaluates to false then the correlator does not evaluate the right operand since the expression cannot be true. For example:
a and b
If a is false then whether or not b is true the expression will be false so the correlator does not evaluate b. This lets you write code such as the following:
if (dict.hasKey(k) and dict[k] = "someValue")
If k is not in the dictionary then the left operand evaluates to false and so the entire logical expression is false. The correlator never evaluates dict[k] = "someValue", which would cause an error if k is not in the dictionary.
Copyright © 2013
Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.