Hi Cecil Clojure has a clojure.lang.PersistentQueue to work with queues. I don't know why it doesn't have a reader macro, but works fine and returns you a Clojure collection you can handle with cons and peek.
You can start with an empty queue with clojure.lang.PersistentQueue/EMPTY or insert your items in the constructor. I wrote some material about it in Portuguese if you have any interest. Regards Plinio > On 20/07/2014, at 08:48, Cecil Westerhof <cldwester...@gmail.com> wrote: > > I just wrote a moving average class in Java: > > https://github.com/CecilWesterhof/JavaExamples/blob/master/MovingAverageQueue.java > > I was just wondering: what is the best way to translate this to Clojure? > > At the moment Clojure does not have a queue. Should I just use the Java > calls, or is there a better way? > > -- > Cecil Westerhof > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.