Hi Stuart,

thanks for the info. I did not really think about some of these
differences. Basically, it was just a fun exercise ... not (yet)
useful for anything serious.

On Dec 2, 10:14 pm, Stuart Sierra <the.stuart.sie...@gmail.com> wrote:
> > how do Clojure agents relate to Erlang actors?
>
> There are several important differences:
>
> 1. Agents are designed for in-process communication only.
Right, whereas Erlang actors are distributed. This was not so
important for me at the moment.
>
> 2. Observing the state of an Agent does not require sending it a message.
Good point, I must have forgotten that ... maybe this makes agents
actually more general than actors?
>
> 3. Agents accept arbitrary functions instead of a predefined set of
> messages.
That is true, but I was wondering whether it is possible to simulate
Erlang style messages with this. In my sketch the state of an agent is
a handler function which only accepts a limited set of messages. Seems
to be a close fake of Erlang actors (and reading the state without
sending a message as in 2. is not very useful since it only returns
the handler function ... calling this function then acts as a send).
>
> -S

Best,

    Nils

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to