Add flatten command, accessing destructured elements by index, WIP support for regular expressions
This commit is contained in:
6
HELP.md
6
HELP.md
@@ -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>`
|
||||
|
||||
Reference in New Issue
Block a user