Add if command

This commit is contained in:
2026-04-20 22:14:55 -05:00
parent c7c605665c
commit 82510fea2f
3 changed files with 66 additions and 0 deletions

View File

@@ -381,6 +381,14 @@ str %> call $myFooReplacer bar
```
### Control Structures
#### `if <cond> <lambda>`
Execute the given lambda if `cond` is truthy. Cond may be a lambda, in which case it is executed.
A value is truthy UNLESS it is the literal empty string (`''`) or the integer `0`.
Example: `foo` -> `if (contains foo) (suffix bar)` -> `foobar`
### Misc
#### `lipsum <num> <word|line|para>`