diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-01-19 15:10:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-19 15:10:38 -0500 |
| commit | ce364aeae795ca8a8e46e653b8024ac5a9ad0982 (patch) | |
| tree | 7af238dbdb370a768f965066dadadd144cbd70f7 /help/prefixes_take.md | |
| parent | 8f0aa14fa695ff3aa3b3ed96c02fdb2ab99f272c (diff) | |
| parent | edddb9be0aa1f03c8608d3dabf7ccfea3fdde206 (diff) | |
Merge pull request #55 from razetime/master
Simple help pages for Primitive Symbols
Diffstat (limited to 'help/prefixes_take.md')
| -rw-r--r-- | help/prefixes_take.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/help/prefixes_take.md b/help/prefixes_take.md new file mode 100644 index 00000000..636574fa --- /dev/null +++ b/help/prefixes_take.md @@ -0,0 +1,35 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/prefixes_take.html).* + +# Up Arrow (`↑`) + +## `↑ 𝕩`: Prefixes + +Prefixes of array `𝕩` along its first axis. + + ↑ 1‿2‿3‿4 + + a ← 3‿3 ⥊ ↕9 + + ↑ a + + + +## `𝕨 ↑ 𝕩`: Take + +For each integer in `𝕨`, take that many elements from each dimension of `𝕩`. + +Negative numbers take from the end. + +If any of the elements in `𝕨` are greater than the length of their respective dimension, the dimension is extended with a fill value. + + 3 ↑ 1‿3‿5‿67 + + a ← 4‿4 ⥊ ↕16 + + 3‿3 ↑ a + + 5‿5 ↑ a + + 3‿¯3 ↑ a + + |
