Slice

Qubes 6.5 Extracts a sub-list from a list.

Syntax

Slice(head, tail, step, elem1, elem2, ...)
head = extraction head index
tail = extraction tail index
step = extraction step
... = nth parameter in the set (value, range, or list)

Remarks

Extracts elements with an index between head and tail (inclusive), every step elements.

  • If step is positive, the extraction goes from head to tail.
  • If step is negative, the extraction goes from tail to head.
  • If step is zero, returns an empty list.

Examples

Slice(1, 3, 1, List(1, 2, 3)) = { 1, 2, 3 }
Slice(1, 4, 2, List(1, 2, 3)) = { 1, 3 }
Slice(1, 3, -2, List(1, 2, 3)) = { 3, 1 }

Classification

Ranges