On 12/01/14 13:59, Jim - FooBar(); wrote:
On 12/01/14 13:57, bob wrote:
Thanks for the big help, I treated the protocol as interface. :)
no worries :)
I was also surprised to see that you are type-hinting the
clojure.lang.Atom...why would you do that? from what I can see you are
only using `reset!` and `swap!`...I doubt that you are getting
reflection with these...
Jim
also sorry for nitpicking but I saw this:
(map [this f]
(let [^DBIterator iterator (.iterator db)]
(.seekToFirst iterator)
(while (.hasNext iterator)
(let [^Map$Entry kv (.peekNext iterator)
k (.getKey kv)
v (.getValue kv)]
(f k v)
(.next iterator)))))
did you know that clojure has a built-in function `iterator-seq` ? While
I don't know much about levelDB, I suspect you can make this a lot nicer
and simpler like so:
(map [this f]
(let [^DBIterator iterator (.iterator db)]
(.seekToFirst iterator)
(clojure.core/map #(apply f %) (iterator-seq iterator))))
Jim
--
--
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/groups/opt_out.