assert raises

2008-09-23 Thread Allen Rohner
Here's a first pass at an addition to test_is, the assert-raises macro. It asserts that the given expression throws an exception of the specified type. There are two things I don't like about this implementation: the name doesn't quite go with the test_is theme, and the (is :a :a) at the bottom.

Re: Cells in Clojure

2008-09-23 Thread Stuart Sierra
On Sep 23, 11:11 am, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Sep 23, 10:47 am, Stuart Sierra <[EMAIL PROTECTED]> > wrote: > > 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 ca

Re: Cells in Clojure

2008-09-23 Thread Rich Hickey
On Sep 23, 11:11 am, Rich Hickey <[EMAIL PROTECTED]> wrote: > 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

Re: Cells in Clojure

2008-09-23 Thread Rich Hickey
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. > > Coo

Re: Cells in Clojure

2008-09-23 Thread Rich Hickey
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. > > Coo

Re: Cells in Clojure

2008-09-23 Thread Stuart Sierra
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 possib

Re: Cells in Clojure

2008-09-23 Thread Stuart Sierra
Hi mac, On Sep 23, 6:42 am, mac <[EMAIL PROTECTED]> wrote: > Does this not mean that if several alter-cell statements execute in > parallell on the same cell then it is possible that some of the > functions set in the first send are discarded? I *think* this shouldn't matter, because only the *l

Re: Cells in Clojure

2008-09-23 Thread Rich Hickey
On Sep 22, 10:55 pm, "Stuart Sierra" <[EMAIL PROTECTED]> wrote: > Ok, here's another version of Cells, attached. This one uses Agents, > like MikeM wrote. It works even on a 1-link chain of dependencies > -- see examples in the comment at the end. Cells get updated > asynchronously via ac

Re: Cells in Clojure

2008-09-23 Thread mac
I just started looking at this today, I think it looks very cool. Can't say I completely understand the code yet because I just read through it rather quickly. But I have a question about the alter-cell function in the last version posted by Stuart: The last two lines of alter-cell are sends to th