Re: Clojure Poetry

2009-05-13 Thread David Nolen
I notice this code is using lists instead of vectors, this quite a performance hit, on my machine: (def my-vector (vec (range 0 1000))) (def my-list (apply list (range 0 1000))) ;; ~30ms (time (dotimes [x 100] (nth my-vector 999))) ;; ~9000ms (time (dotimes [x 100] (nth my-list 999))) On

Re: Clojure Poetry

2009-05-13 Thread Jeremy James
On Apr 24, 10:52 am, tmountain wrote: > Very cool. I actually cleaned up the code a little bit more this > morning trying to speed things up a bit. It's still not as fast as I'd > like, but I'm not up to speed on Closure optimization either, so I > could be missing something. I'm glad you are

Re: Clojure Poetry

2009-05-13 Thread Christophe Grand
tmountain a écrit : > Very cool. I actually cleaned up the code a little bit more this > morning trying to speed things up a bit. It's still not as fast as I'd > like, but I'm not up to speed on Closure optimization either, so I > could be missing something. > There are two things that I notic

Re: Clojure Poetry

2009-04-24 Thread Michael Wood
On Fri, Apr 24, 2009 at 7:52 PM, tmountain wrote: > > Very cool. I actually cleaned up the code a little bit more this > morning trying to speed things up a bit. It's still not as fast as I'd > like, but I'm not up to speed on Closure optimization either, so I > could be missing something. This

Re: Clojure Poetry

2009-04-24 Thread tmountain
Very cool. I actually cleaned up the code a little bit more this morning trying to speed things up a bit. It's still not as fast as I'd like, but I'm not up to speed on Closure optimization either, so I could be missing something. Revised code: (ns markov (use clojure.contrib.str-utils)) (def

Re: Clojure Poetry

2009-04-24 Thread Luke VanderHart
Cool... I actually did a Markov chain generator myself as one of my early Clojure projects. I posted about it at the DC Study group, here: http://groups.google.com/group/clojure-study-dc/browse_thread/thread/26ccdc8acb102f9/d18d7627ddcaf167 It looks like yours is more succinct... I'll definitely