map-data function stream [Function]

Maps function over each item in stream. Function is passed one argument, the currently mapped item. Note that items are often transformed into an internal form different than what was externally specified to the item stream.

Example:

(defun stream-list (stream)
  (let ((l '()))
    (map-data #'(lambda (x) (push x l)) stream)
    (nreverse l)))

(defun stream-items (stream)
  (let ((l '()))
    (map-data #'(lambda (x)
                    (if (typep x 'item-stream)
                        (push (stream-items x) l)
                        (push x l)))
               stream)
    (nreverse l)))

See Also:

doitems, item, read-items


Last Modified: 5-Mar-1998