Documentation for package rsm.delayed

Author : R. Scott McIntire

Version: 1.0

Overview:

Overloads the names of the usual set of list functions with stream versions
(delayed lists). These functions will work with ordinary lists or ordinary lists
combined with delayed lists.

REQUIRES: packages rsm.queue and rsm.filter.

Function summary:
car       : Delayed list version of car.
cdr       : Delayed list version of cdr.
cycle     : Form a stream consisting of a repeated cycle.
drop      : Remove some number of elements from a delayed list.
delayed   : Type for delayed list.
delayed-p : Predicate for a delayed list.
list      : Delayed list version of list.
mapcar    : Mapcar for delayed lists.
nth       : Nth for delayed lists.
repeat    : Form a delayed list consisting of a repeated value.
take      : Return a list formed by retrieving some number of elements of
            a stream.
zip-with  : Form a delayed list by "zipping" together two
            delayed lists using a zip function.



car (stream)

The "car" for a delayed list; it is identical to cl:car when <stream> is an
ordinary list.

cdr (stream)

The "cdr" for a delayed list; it is identical to cl:cdr when <stream> is an
ordinary list.

cons (first &body body)

A delayed "cons".

cycle (list)

Repeat the list, <list>, indefinitely.

delayed-p (stream)

Predicate that determines if <stream> is a delayed list.

drop (n stream)

Drop the first <n> elements from <stream>, return the resulting (possibly
delayed) list. Will work when <stream> is an ordinary lists as well.  In this
case the result is an ordinary list.

filter (stream pruner)

Filter a stream (or an ordinary list) by excluding elements that satisfy
<pruner>. If <stream> is an ordinary list an ordinary list is returned.

list (&rest elems)

A delayed "list".

mapcar (func &rest streams)

Mapcar for delayed lists. However, will work with a mixture of delayed lists
and ordinary lists.

nth (n stream)

Nth for delayed lists. Works when <stream> is an ordinary list.

repeat (x)

Repeat x indefinitely.

take (n stream)

Take the first <n> elements from <stream>, returning them as a list.  Works
when <stream> is an ordinary list.

zip-with (s1 s2 &optional (zip-func #'cons))

A Lisp version of Haskell's zipWith function. Will work with mixtures of
ordinary lists and delayed lists.