Creating queues

287 views
Skip to first unread message

Nicolas Buduroi

unread,
Jun 16, 2010, 2:12:11 PM6/16/10
to Clojure Dev
Hi, I've just learned about queues from The Joy of Clojure and wonder
if there's some plan to include a function to create them? Here's what
I'm using:

(defn queue [& items]
(let [q clojure.lang.PersistentQueue/EMPTY]
(if items
(apply conj q items)
q)))

Chouser

unread,
Jun 16, 2010, 2:46:05 PM6/16/10
to cloju...@googlegroups.com

(into clojure.lang.PersistentQueue/EMPTY q) should work as well.

--Chouser

Sean Devlin

unread,
Jun 16, 2010, 3:08:03 PM6/16/10
to cloju...@googlegroups.com
#[] for a reader macro?  Just throwing it out there.


--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To post to this group, send email to cloju...@googlegroups.com.
To unsubscribe from this group, send email to clojure-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clojure-dev?hl=en.


Nicolas Buduroi

unread,
Jun 16, 2010, 10:25:41 PM6/16/10
to Clojure Dev

> #[] for a reader macro?  Just throwing it out there.

+1
Reply all
Reply to author
Forward
0 new messages