nushell/crates/nu-command/src
Andrés N. Robalino b873fa7a5f
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}
───┴───────────
```
2021-08-14 23:36:08 -05:00
..
classified Move path handling to nu-path (#3653) 2021-06-20 11:07:26 +12:00
commands The zip command. (#3919) 2021-08-14 23:36:08 -05:00
examples Fix clippy lint and disable broken lint (#3865) 2021-07-30 08:11:47 +12:00
utils Fix #3582 (#3583) 2021-06-09 18:07:54 +12:00
args.rs Begin directory contrib docs and split commands (#3650) 2021-06-19 12:06:44 +12:00
default_context.rs The zip command. (#3919) 2021-08-14 23:36:08 -05:00
examples.rs The zip command. (#3919) 2021-08-14 23:36:08 -05:00
lib.rs Begin directory contrib docs and split commands (#3650) 2021-06-19 12:06:44 +12:00
prelude.rs Fix issue in external subexpression paths (#3642) 2021-06-18 07:59:58 +12:00
utils.rs Fix #3582 (#3583) 2021-06-09 18:07:54 +12:00