1.2.0 permalink Arrow_down_16x16
  • (defst name args streams & body)
Define the stream transformer name by body.
The non-stream arguments args and the stream arguments streams
are given separately, with args being possibly empty.

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:183 top

(defmacro defst
  "Define the stream transformer name by body.
   The non-stream arguments args and the stream arguments streams
   are given separately, with args being possibly empty."
  [name args streams & body]
  (if (= (first streams) '&)
    `(defn ~name ~(vec (concat args streams))
       (let [~'st (with-monad stream-m ~@body)]
	 (st-as-stream ~'st ~(second streams))))
    `(defn ~name ~(vec (concat args streams))
       (let [~'st (with-monad stream-m
		    (let [~streams (range ~(count streams))]
		      ~@body))]
	 (st-as-stream ~'st ~streams)))))
Vars in clojure.contrib.stream-utils/defst: = concat count defmacro first name second vec apply defn let list range seq vector
Used in 0 other vars

Comments top

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