On Jul 29, 2011, at 1:50 AM, Laurent PETIT wrote:

> Without too much thinking about it, I would have thought monsters, players, 
> etc. need to be changed in a same "transaction", so would have by default 
> implemented them as refs instead of atoms.
> 
> Could you elaborate more on the choice of atoms as design decisions ?

Not to hijack the question, but in my game I used a single atom containing the 
state of the entire game world as a hash. This is not too inefficient thanks to 
Clojure's structure-sharing, and has certain advantages: saving or printing the 
world state becomes trivial, and you can simplify argument lists for functions 
that need to use multiple world objects (though some would object to passing 
the entire world to a function that uses only certain parts of it).

-- 
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

Reply via email to