This commit is contained in:
Bjørn Erik Pedersen 2018-05-25 15:05:23 +02:00
commit 7b9dbef41a
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
34 changed files with 517 additions and 32 deletions

View file

@ -24,3 +24,9 @@ Example:
```
Would emit "goose" if the `$geese` array has exactly 1 item, or "geese" otherwise.
{{% warning %}}
Whenever you use a `cond` function, *both* variable expressions are *always* evaluated. This means that a usage like `cond false (div 1 0) 27` will throw an error because `div 1 0` will be evaluated *even though the condition is false*.
In other words, the `cond` function does *not* provide [short-circuit evaluation](https://en.wikipedia.org/wiki/Short-circuit_evaluation) and does *not* work like a normal [ternary operator](https://en.wikipedia.org/wiki/%3F:) that will pass over the first expression if the condition returns `false`.
{{% /warning %}}