To be honest I continued to work on my Clojure flocking code long after it was working.
I actually took this code as challenge to learn how to put together idiomatic, fast Clojure code that read better than the original Java on which it is based.
Of course, nearly a year later since I wrote this version, I can see ways to make it even faster (nearly on par with Java and faster when parallel), cleaner and more elegant.
Partly it's API familiarity - clojure and clojure.contrib have a LOT of functions to offer, and a lot of the time may have higher order functions to do what you might be doing the hard way :)
Comments
You sure are pretty prolific in the Clojure community. I look at my Clojure code and then I look at yours and I wish mine was as elegant as yours.
To be honest I continued to work on my Clojure flocking code long after it was working.
I actually took this code as challenge to learn how to put together idiomatic, fast Clojure code that read better than the original Java on which it is based.
Of course, nearly a year later since I wrote this version, I can see ways to make it even faster (nearly on par with Java and faster when parallel), cleaner and more elegant.
Do have any tips for someone looking to do better?
Partly it's API familiarity - clojure and clojure.contrib have a LOT of functions to offer, and a lot of the time may have higher order functions to do what you might be doing the hard way :)