[erlang-questions] How to do counters?
Mon Jun 29 19:18:15 CEST 2009
2009/6/29 Witold Baryluk <baryluk@REDACTED>
> Another way is using just presented examples, and registering them on
> different names, or not registering them at all (they will be only
> referenced by Pid returned from spawn).
> You can register it using something like that:
> start(X) ->
> Pid = spawn(counter,loop,),
> Name = list_to_atom("counter_"++X),
> register(Name, Pid),
actually this is what I was trying to accomplish my self, I just couldn't
figure how how.
I guess I need to send in the name in the inc, dec, current methods as well
More information about the erlang-questions