Re: Things get slow if hashmap has 1000 Elements

2013-07-17 Thread Thomas Heller
One side node, *repeatedly* produces a lazy-seq. Since the REPL forces that seq when it tries do print everything you get the desired results, but if you were to (def x (repeatedly 1000 addmod) and then inspects mobs it would be empty, since no one forced the seq. If you want to force side-eff

Re: Things get slow if hashmap has 1000 Elements

2013-07-17 Thread vis
Awesome, thanks a lot! On Wednesday, July 17, 2013 11:19:06 AM UTC+2, puzzler wrote: > > This might help: > http://clojuredocs.org/clojure_core/clojure.core/*print-length* > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: Things get slow if hashmap has 1000 Elements

2013-07-17 Thread Mark Engelberg
This might help: http://clojuredocs.org/clojure_core/clojure.core/*print-length* -- -- 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

Things get slow if hashmap has 1000 Elements

2013-07-17 Thread vis
Hello everyone, I have a ref, which is a hashmap of monsters (they key is a unique id, the value is the monster) like this: *(defrecord mob [name level hp-cur hp-max]) (def mobs (ref {})) (defn addmob [] (dosync (alter mobs assoc (gen-id) (->mob "test" 1 2 3)))* Now if I add 1000 monsters, li