diff --git a/src/doc/doc/about/expressions.xml b/src/doc/doc/about/expressions.xml index 5d0b21ec1..af7ae589f 100644 --- a/src/doc/doc/about/expressions.xml +++ b/src/doc/doc/about/expressions.xml @@ -79,11 +79,12 @@ Box.new(-10, 0, 90, 60).width The "nil" value shortcuts numerical expressions the following way:
--nil + x -> nil -x + nil -> x -nil + nil -> nil -+
| Expression | Result |
|---|---|
| nil + x | nil |
| x + nil | x |
| nil + nil | nil |
The same applies to the other binary operators "*", "/", "-", "&" "|", "<< and ">>". @@ -97,16 +98,17 @@ nil + nil -> nil The logical binary operators "||" and "&&" behave this way:
--x || y -> x if x is not "nil" or "false", y otherwise -x || nil -> x -nil || x -> x -nil || nil -> nil -x && y -> y if x is not "nil" or "false", x otherwise -x && nil -> nil -nil && x -> nil -nil && nil -> nil -+
| Expression | Result |
|---|---|
| x || y | x if x is not "nil" or "false", y otherwise |
| x || nil | x |
| nil || x | x |
| nil || nil | nil |
| x && y | y if x is not "nil" or "false", x otherwise |
| x && nil | nil |
| nil && x | nil |
| nil && nil | nil |