zip for filters

Combine a stream with the input.

Signature

> zip (other)

Parameters

  • other: the other input

Examples

Zip two lists

> [1 2] | zip [3 4]
╭───┬───────────╮
│ 0 │ ╭───┬───╮ │
│   │ │ 01 │ │
│   │ │ 13 │ │
│   │ ╰───┴───╯ │
│ 1 │ ╭───┬───╮ │
│   │ │ 02 │ │
│   │ │ 14 │ │
│   │ ╰───┴───╯ │
╰───┴───────────╯

Zip two ranges

> 1..3 | zip 4..6
╭───┬───────────╮
│ 0 │ ╭───┬───╮ │
│   │ │ 01 │ │
│   │ │ 14 │ │
│   │ ╰───┴───╯ │
│ 1 │ ╭───┬───╮ │
│   │ │ 02 │ │
│   │ │ 15 │ │
│   │ ╰───┴───╯ │
│ 2 │ ╭───┬───╮ │
│   │ │ 03 │ │
│   │ │ 16 │ │
│   │ ╰───┴───╯ │
╰───┴───────────╯

Rename .ogg files to match an existing list of filenames

> glob *.ogg | zip ['bang.ogg', 'fanfare.ogg', 'laser.ogg'] | each {|| mv $in.0 $in.1 }