Re: setting vars with macro

2010-05-17 Thread islon
Thanks for the answers. I realized the macro wasn't a good idea and I will keep using atoms to manage state, just found the reset! function =) Islon On May 17, 10:28 am, Michael Gardner wrote: > On May 15, 2010, at 4:56 PM, islon wrote: > > > I'm working in a simple single-thread console-based r

Re: setting vars with macro

2010-05-17 Thread Michael Gardner
On May 15, 2010, at 4:56 PM, islon wrote: > I'm working in a simple single-thread console-based rpg game in > clojure (a port from my own scala version) > and didn't want to use any concurrency structure because the game is > single threaded. > I was thinking about a macro like > > (defmacro set!

Re: setting vars with macro

2010-05-17 Thread Laurent PETIT
2010/5/15 islon : > I'm working in a simple single-thread console-based rpg game in > clojure (a port from my own scala version) > and didn't want to use any concurrency structure because the game is > single threaded. > I was thinking about a macro like > > (defmacro set!! [s val] >  `(def ~s ~val

setting vars with macro

2010-05-15 Thread islon
I'm working in a simple single-thread console-based rpg game in clojure (a port from my own scala version) and didn't want to use any concurrency structure because the game is single threaded. I was thinking about a macro like (defmacro set!! [s val] `(def ~s ~val)) so I can set my game state w