Hi,

how do Clojure agents relate to Erlang actors?
To gain some insights, I tried to implement Erlang style message
passing between agents. The first version is just a very incomplete
sketch (no mailbox, case instead of pattern matching ...), but already
shows that it is quite easily doable:
https://github.com/bertschi/clojure-stuff/blob/master/src/stuff/actors.clj

The idea is that the agent holds a dispatch function which is then
called by ! (send) with the message to be send. Somehow it resembles
the way closures can be used to implement an object system. Thus,
agents seem to be the functional analog of agents:
                    Functional programming         Object-oriented
programming
sequential              closure
object
concurrent               agent
actors

Another great design from Rich Hickey! Clojure is fun and gets better
every day ...

Thanks,

    Nils

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

Reply via email to