On 8 mar, 23:22, Michał Marczyk <michal.marc...@gmail.com> wrote: > I'd suggest a vector instead; they're countable in constant time and > you can use, say, conj and rest for add to end of queue / eject from > front of queue.
Conj adds to the end of a vector in constant time, but rest will not return another vector, but a sequence. Converting that sequence into another vector will take O(n). If you want queueing behaviour, you should use a clojure.lang.PersistentQueue: (-> clojure.lang.PersistentQueue/EMPTY (conj 5) (conj 7) pop (conj 8) peek) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en