numbers {option value}* [Macro]

Creates a stream of cyclic or random numbers.

numbers implements the following option value pairs:

in {pattern}
Sets the pattern type of the stream. Only cycle and random are implemented.
from {number | stream}
Sets the initial value for number generation, defaults to 0.
to {number | stream}
Sets the inclusive upper bound for number generation.
below {number | stream}
Sets the exclusive upper bound for number generation.
downto {number | stream}
Sets the inclusive lower bound for number generation.
above {number | stream}
Sets the exclusive lower bound for number generation.
by {number | stream}
Sets the increment amount, defaults to 1.
An additional set of basic option valuepairs are available in all item stream macros. Others may be available based on the pattern type specified to the macro.

Example:

? (setf x (numbers from 1 below (items 5 10) in random))
#<RANDOM-NUMBER-STREAM 136100641>

? (read-items x)
(1 1 1 2)

? (read-items x)
(3 8 1 6 4 8 1 8 9)

See Also:

Item Streams


Last Modified: 5-Mar-1998