zl.swap Reference

Swap two list indexes

zl.swap

Description

zl.swap accepts a list as an argument. A list of two numbers (0-based) in the right inlet will indicate a pair of indices to swap in the list received in the left inlet. For instance, if 1 3 is received in the right inlet, A B C D received in the left inlet will cause the object to output A D C B from the left output.

Arguments

initial-swap [list]

Sets the initial index pairs to swap.

Attributes

fuzzy [atom] (default: 0.)

Fuzzy floating-point comparison epsilon

zlmaxsize [atom_long]

Maximum List Length

Common Box Attributes

Messages

bang

Repeat previous output

int

TEXT_HERE

float

TEXT_HERE

list

In left inlet:
List to swap (causes output).

In right inlet:
Pair of indexes to use in swap.

anything

TEXT_HERE

mode

The word 'mode' followed by one of the following words will set the mode of the object:
change, compare, delace, ecils, group, indexmap, iter, join, lace, len, lookup, median, mth, nth, queue, reg, rev, rot, scramble, sect, slice, sort, stack, stream, sub, sum, swap, thin, union, or unique.

See the reference for the corresponding mode for more information.

zlclear

Clears the currently held list.

Output

list

List with swapped indexes as specified by the right input (or initial object argument).

See Also

Name Description
zl
zl.change
zl.compare
zl.delace
zl.ecils
zl.filter
zl.group
zl.indexmap
zl.iter
zl.join
zl.lace
zl.len
zl.lookup
zl.median
zl.mth
zl.nth
zl.queue
zl.reg
zl.rev
zl.rot
zl.scramble
zl.sect
zl.slice
zl.sort
zl.stack
zl.stream
zl.sub
zl.sum
zl.thin
zl.union
zl.unique