forked from extern/nushell
The zip command. (#3919)
We introduce it here and allow it to work with regular lists (tables with no columns) as well as symmetric tables. Say we have two lists and wish to zip them, like so: ``` [0 2 4 6 8] | zip { [1 3 5 7 9] } | flatten ───┬─── 0 │ 0 1 │ 1 2 │ 2 3 │ 3 4 │ 4 5 │ 5 6 │ 6 7 │ 7 8 │ 8 9 │ 9 ───┴─── ``` In the case for two tables instead: ``` [[symbol]; ['('] ['['] ['{']] | zip { [[symbol]; [')'] [']'] ['}']] } | each { get symbol | $'($in.0)nushell($in.1)' } ───┬─────────── 0 │ (nushell) 1 │ [nushell] 2 │ {nushell} ───┴─────────── ```
This commit is contained in:
committed by
GitHub
parent
ee563ecf4e
commit
b873fa7a5f
@ -63,3 +63,4 @@ mod where_;
|
||||
mod which;
|
||||
mod with_env;
|
||||
mod wrap;
|
||||
mod zip;
|
||||
|
Reference in New Issue
Block a user