listfunnel

Index elements of a list and output them individually

Description

listfunnel is similar to funnel, but outputs the elements of a list in the format:
[index] [element]
for each element of the list.

Arguments

Name Type Opt Description
offset int opt An integer argument is used to specify an offset for the first index value. If no argument is present, the list elements are numbered beginning with the default index of 0.

Messages

int input-for-indexing [int]
The low index value and the received number are sent out as a two-element list.
float input-for-indexing [float]
The low index value and the received number are sent out as a two-element list.
list elements-for-indexing [list]
Each element of the list is indexed and this index is prepended to the list element and sent out the outlet as a two-element list. The input list may contain ints, floats, and symbols (provided that the first element of the list is not a symbol).
anything elements-for-indexing [list]
Performs the same as list.
offset first-index [int]
The word offset followed by an integer argument is used to specify an offset for the first index value.

Information for box attributes common to all objects

Output

list: When a list is received in the inlet, listfunnel outputs a two-element list for each element of the input list, consisting of the elements index followed the liost element. listfunnel is designed for conveniently replacing a combination of unpack and funnel objects.

Examples

Use listfunnel not only for convenience but also for variable-length lists.

See Also

Name Description
funnel Tag data with a number that identifies its inlet
spray Distribute a value to a numbered outlet