On Sep 23, 10:47 am, Stuart Sierra <[EMAIL PROTECTED]>
wrote:
> On Sep 23, 9:50 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> > I've added some support for agent watches. You should consider it
> > experimental, but it will allow the creation of cell-like and other
> > reactive systems.
>
> Cool, thanks Rich!  This will be fun to play with.  One question -- is
> it possible to get the previous value of the agent (before the action)
> from within the callback fn?
>

It would be possible, but I'd like to hear more about why it is a good
idea. It seems to me to be a potential violation of encapsulation to
transmit state as part of a fundamental API. Many agents will/should
have a set of functions one should use to access their state, for
instance.  If the main use is to see if something has changed, that's
covered by the boolean.

> I noticed this -- if a callback throws an exception, the agent stops
> accepting messages, but agent-errors remains empty:
>

I'll look into how best to handle that. I think logically it's not a
problem of the agent itself, but it shouldn't get lost either.

I've been thinking about adding error streams for agents, so an
application could have agent-related exceptions put on one or more
queues for centralized handling...

Rich
--~--~---------~--~----~------------~-------~--~----~
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
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