item stream [Function]
item stream &key :kill :chord :rest [Function]

Returns two values, the next item from the item stream stream and the state of the stream after the item was read. As with all multiple values in Lisp, this second value may be ignored.

Within an algorithm macro, item supports the additional keyword arguments :kill, :chord and :rest which have the following meaning:

:kill {integer | t | nil}
Stops (kills) the algorithm after some number of periods have been read from stream. If nil (the default) the algorithm is not killed. If t the algorithm stops after one period of items has been read, otherwise it stops after integer number of periods have been read.
:chord {t | nil}
Controls whether or not the system checks for chords. Defaults to t.
:rest {t | nil}
Controls whether or not the system checks for rests. Defaults to t.

Example:

? (setf x (items foo bar))
#<CYCLIC-ITEM-STREAM 133134441>

? (item x)
FOO
NIL

? (item x)
BAR
:END-OF-PERIOD

See Also:

doitems, Item Streams, read-items


Last Modified: 5-Mar-1998