zl.slice Reference

Slice a list in two

zl.slice

Description

zl.slice is used to divide a list into two lists. This mode takes a number argument which specifies the size, in elements, of a list. This value can also be specified as an int to the right inlet. A list received in the left inlet will be split into two lists - the first list contains the number of items specified by the argument, and is sent out the left outlet. Any remaining list elements are sent out the right outlet of the object. Note: Lists are sent out the right outlet first.

Arguments

initial-size [int]

Optional

Sets the initial size of the slice. Must be a positive number.

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

A number in the right inlet sets the size of the left slice.

float

TEXT_HERE

list

A list in the left inlet sets the list to slice and causes output.

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

anything

Out left outlet:
Left slice of list (as set by the input to the right inlet or initial object argument).

Out right outlet:
Remaining elements of list.

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.sort
zl.stack
zl.stream
zl.sub
zl.sum
zl.swap
zl.thin
zl.union
zl.unique