Add flatten command, accessing destructured elements by index, WIP support for regular expressions

This commit is contained in:
2026-04-20 21:56:02 -05:00
parent fa851b680e
commit 37c27e5d0b
11 changed files with 206 additions and 21 deletions

View File

@@ -301,6 +301,10 @@ Example: `[foo, bar, foo]` -> `unique` -> `[foo, bar]`
Interleave the current destructured subject with the given other destructured subject.
Example: Say `$a` is `[1, 2, 3]` and subject is `[a, b, c]` -> `zip $a` -> `[a, 1, b, 2, c, 3]`
#### `flatten [<index>]`
Collapse a nested destructured string down a single level, optionally limiting to a specific `index`.
Example: `[[a,b], c, [d,e]]` -> `flatten 2` -> `[[a,b], c, d, e]`
### Working with Variables
@@ -310,6 +314,8 @@ Assign a variable using the standard syntax: `$a = 'mystr'`
You can then use them anywhere you may use a string: `split $a`
If you variable contains a `:: destructured`, you can access individual elements with their indices: `$a.0`, `$a.1`, &c.
There are also several commands for interactive with variables, defined below.
#### `to <var>`