diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-01-28 20:56:46 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-01-28 21:02:27 -0500 |
| commit | 9cfc45f731a121282f47218d6ab80c5b9b06e277 (patch) | |
| tree | e5934a40c9c3e94651d767472369bfa7a38113f3 /help/predicate.md | |
| parent | 0c716e4c6b7c2c44bbfd02b6503cae66af7b7480 (diff) | |
Add ;:? to keybar and help
Diffstat (limited to 'help/predicate.md')
| -rw-r--r-- | help/predicate.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/help/predicate.md b/help/predicate.md new file mode 100644 index 00000000..eefd390a --- /dev/null +++ b/help/predicate.md @@ -0,0 +1,16 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/predicate.html).* + +# Question Mark (`?`) + +## `?`: Predicate +[→full documentation](../doc/block.md#predicates) + +Follows a statement in a block, which must return 0 or 1. If it's 0, stop the current body and evaluate the next eligible one instead. Variables defined before the `?` stay if execution continues (1) but don't carry over to other bodies (0). + + {0 ? 3 ; 4} + + Min ← {𝕨<𝕩 ? 𝕨 ; 𝕩} + + 3 Min 5 + + 4 Min 2 |
