[erlang-questions] How to do counters?

Jarrod Roberson <>
Mon Jun 29 18:09:05 CEST 2009


first off thanks for all the examples, it is very nice to see that everyone
suggested pretty much the same solution.
I have joe's book and ordered the new "erlang programming" book from amazon
yesterday.
ok, I think I have gotten my head around how a process can store state, and
using messages to manipulate it.
I understand how to manipulate the counter examples that were provided.

One thing I can't figure out now is how to make many counters.
One example usings ?MODULE to register the process, another uses
"global_counter" as name.
Either way the only way I see to create multiple unique counters is to
copy/paste the module and rename/edit it.
That doesn't "smell" right to me. Is there a better way to create
"instances" of these counter module examples?


More information about the erlang-questions mailing list