LinkedList enum

Enumerates all entries using an input function with the possibility to interrupt. The elements can be read but cannot be modified using this function.

Arguments

The

list
to enumerate.
body
is the callable to be called for each list entry. It has the following stack notation:

( value -- condition )

Each list entry will be provided as input

value
to the callable. When the output
condition
is FALSE, enumeration interrupts.

Return values

None

Complexity

O(size)

Example

"sl/linkedList" useFile a: (1 2 0 5 "Hello" 0.3) makeList; a [v:; v print "," print v 0 = ~] enum
Output:
1,2,0,