items {item}+ {option value}*
|
[Macro] |
Creates an item stream of untyped data. Each item may be a
Lisp object or an item stream.
items implements the following option value
pairs. These pairs are available in all item
stream macros:
- in {pattern}
- Sets the pattern type of the stream, which defaults to
cycle. Other available patterns are: accumulation,
function, graph, heap, palindrome,
random, rewrite, rotation and
sequence.
- for {integer | stream}
- Sets the period length of the stream, which defaults to a pattern
specific length. The value may be any non-negative number, including
0 or an item stream. If a period length is 0, then the stream is be
omitted from the superior pattern until it is reselected and sets its
period length to a number greater than 0. The period length counts
subperiods or values in the pattern's data, depending on the value of
the counting option.
- counting {periods | values}
- Controls whether the period length of the stream counts periods in
the pattern or values returned in the pattern. If periods
(the default), the number of items returned in the period is the sum
of that many period lengths in the data. If values, the
number of items returned is the same as the period length.
- traversing {depth | breadth}
- Controls whether the pattern visits its items in depth-first or
breadth-first order. If depth (the default), the pattern
increments only when the current item is at end-of-period. If
breadth, the pattern increments each enumeration.
(Traversing breadth may be implemented by setting the period lengths
of all substreams to 1, but this is less efficient).
- named {name}
- Sets the name of the item stream. A named item stream may be
subsequently referenced using find-item-stream, #@
or motive.
Other pairs may be available based on the pattern type specified to the macro.
Example:
? (setf x (items 1 two 3 four in heap))
#<HEAP-ITEM-STREAM 133137601>
? (read-items x)
(3 FOUR 1 TWO)
See Also:
Item Streams
Last Modified: 5-Mar-1998