Re: Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-16 Thread Brandon Ferguson
Ended up updating it to use lazy sequences. https://gist.github.com/887256 Already feels much better! I do still have a bit of state with the tracking of which frame we're on but I'll certainly take that over the glob of atoms before. Next up is handling some of the more hairy bits with user inp

Re: Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-14 Thread Brandon Ferguson
Holy crap that's a lot to digest! Thanks! A lot of ideas in here to play with. For me and my purposes with Processing the big challenge has been the fact that I have little say about the draw loop. It just fires (or I can call it manually with a redraw, but then it just executes whatever is in that

Re: Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-14 Thread Brandon Ferguson
This is definitely a good place to start. At very least getting most of the functions away from the global bits. Thanks! On Apr 14, 10:42 am, jweiss wrote: > I'd start by making functions that take arguments.  For instance (defn > draw-ball [ball] ...) > > On Apr 13, 1:22 pm, Brandon Ferguson wr

Re: Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-14 Thread Ken Wesson
On Wed, Apr 13, 2011 at 1:22 PM, Brandon Ferguson wrote: > I'm not sure if this is the place to ask this but I've been struggling > with a few things in the world of Clojure. I've been using Processing > to learn Clojure (since I'm somewhat familiar with Processing) but the > tough part has been d

Re: Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-14 Thread jweiss
I'd start by making functions that take arguments. For instance (defn draw-ball [ball] ...) On Apr 13, 1:22 pm, Brandon Ferguson wrote: > I'm not sure if this is the place to ask this but I've been struggling > with a few things in the world of Clojure. I've been using Processing > to learn Clo

Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-14 Thread Brandon Ferguson
I'm not sure if this is the place to ask this but I've been struggling with a few things in the world of Clojure. I've been using Processing to learn Clojure (since I'm somewhat familiar with Processing) but the tough part has been dealing with things like x, y positions of objects without keeping