Combinatorics

This category of functions is containing many functions that perform many simple but important operations on lists.

rev

Reverse a list.

  • Arguments:
    • None

Example:

(rev 1 2 3 [1 2 3])

rot

Rotates a list. This will move the n first steps at the end of the list.

  • Arguments:
    • n: How many steps to rotate by

Example:

(rot [1 2 3] 1) # gives [2 3 1]

pal

Creates a palindrome. This will keep the list as is but will also append the list in reverse.

  • Arguments:
    • cut: whether to repeat the last/first value of reversed list or not.

Example:

(pal [1:10] ::cut 1) # or ::cut 0

shuf

Shuffle any list.

Description ...

  • Arguments:
    • None

Example:

(shuf 1 2 3 4 5)

leave

Braid multiple lists of uneven length.

  • Arguments:
    • ...: feed multiple lists to braid them together.

Example:

(leave [1 2 3] [3 4 5] [1 2] [4 8 6 4])

insertp

Insert a fixed element as pair element of each list.

  • Arguments:
    • None

Example:

insert

Insert a fixed element as odd element of each list.

  • Arguments:
    • None

Example:

insertprot

Description ...

  • Arguments:
    • None

Example:

insertrot

aspeed