Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; I found having to explicitly use clojure.lang.PersistentQueue/EMPTY ugly and
- ;; takes up too much real estate in a Clojure source file. I wrote this to
- ;; emulate the core `list' and `vector' functions.
- (defn- queue
- "For any number of parameters, create a persistent queue."
- ([]
- clojure.lang.PersistentQueue/EMPTY)
- ([x]
- (conj clojure.lang.PersistentQueue/EMPTY x))
- ([x & xs]
- (into clojure.lang.PersistentQueue/EMPTY (cons x xs))))
Advertisement
Add Comment
Please, Sign In to add comment