[erlang-questions] [SPAM] Re: Cannot get the hang of single assignment
Wed Aug 22 22:26:21 CEST 2007
Thanks for the pointers. I eventually worked this out. The example
code I came up with is here:
Now, another question. Is this a useful idiom in Erlang or is it the
bastard offspring of an OO programmer trying to bring his baggage into
the Functional/Actor world.
David Mercer wrote:
> On Friday, August 17, 2007, Tom Ayerst wrote:
>> How should I track the state (position and vector) of each Boid?
> The short answer is that your boid is in a loop: implement that loop as a
> tail-recursive function, passing the state from the previous iteration in as
> arguments to the next. Something like:
> boid_loop(State) ->
> . . .
> New_state = ...
> Does this help?
> erlang-questions mailing list
More information about the erlang-questions