• (defstream type-tag args & body)
Define object of the given type as a stream whose implementation
of stream-next is defined by args and body. This macro adds
a type-specific method for stream-next and derives type
from stream-type.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/stream_utils.clj:73 top

(defmacro defstream
  "Define object of the given type as a stream whose implementation
   of stream-next is defined by args and body. This macro adds
   a type-specific method for stream-next and derives type
   from stream-type."
  [type-tag args & body]
  `(do
     (derive ~type-tag stream-type)
     (defmethod stream-next ~type-tag ~args ~@body)))
Vars in clojure.contrib.stream-utils/defstream: defmacro concat defmethod derive list seq
Used in 0 other vars

Comments top

No comments for defstream. Log in to add a comment.