Ken Wesson kwess...@gmail.com writes:
On Sat, Jan 22, 2011 at 11:26 AM, Eric Schulte schulte.e...@gmail.com wrote:
Nice concise example,
Thanks.
A while back I implemented something similar; a propagator system using
agents fed with `send', coming in at a slightly more verbose ~35 lines
On Mon, Jan 24, 2011 at 3:22 AM, Eric Schulte schulte.e...@gmail.com wrote:
Ken Wesson kwess...@gmail.com writes:
Why (fn [_] value) instead of (constantly value)? OK, actually
(constantly value) is textually longer, but I'd argue it might be
clearer. And it works; (constantly foo) accepts all
That would be a great application for this system. Each cell of the
spreadsheet could be a cell, and each formula could be a propagator.
I've implemented this and it seems to work well, I've committed this to
the repo above, and posted the spreadsheet code with example usage into
a gist at
(defmacro consumer [[item] body]
`(agent
(fn c# [~item]
~@body
c#)))
(defmacro defconsumer [name item body]
`(def ~name (consumer ~item ~@body)))
(defn feed [consumer values]
(doseq [v values] (send-off consumer apply [v])))
Nine lines of code.
user= (defconsumer
Nice concise example,
A while back I implemented something similar; a propagator system using
agents fed with `send', coming in at a slightly more verbose ~35 lines
of code.
http://cs.unm.edu/~eschulte/research/propagator/
Cheers -- Eric
Ken Wesson kwess...@gmail.com writes:
(defmacro
On Sat, Jan 22, 2011 at 11:26 AM, Eric Schulte schulte.e...@gmail.com wrote:
Nice concise example,
Thanks.
A while back I implemented something similar; a propagator system using
agents fed with `send', coming in at a slightly more verbose ~35 lines
of code.