Short-circuiting "and" and "or" operators

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1461 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-07-23 23:52:34 +00:00
parent 603442e75b
commit 0625cd0aff
6 changed files with 65 additions and 6 deletions
+5
View File
@@ -56,6 +56,11 @@ In a table:
| @true@ @false@ @true@ @false@ @true@
| @true@ @true@ @true@ @true@ @false@
The @and@ and @or@ operators use [[http://en.wikipedia.org/wiki/Short-circuit_evaluation|short-circuit evaluation]], which means that the second argument is only evaluated if the first argument does not suffice to determine the value of the expression.
For example
> true or card.field_that_does_not_exist
evaluates to @true@ instead of giving an error.
--Grouping and order--
Operators are ordered as usual, so