Last active
December 30, 2015 22:39
-
-
Save micmarsh/7895142 to your computer and use it in GitHub Desktop.
Persistent Queue In Clojure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Clojure actually has a queue type, but it's not easily accesible. Here's a function to help with that | |
(defn queue | |
([] clojure.lang.PersistentQueue/EMPTY) | |
([& elements] | |
(into (queue) elements))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment