On Jan 18, 2009, at 12:11 PM, mbrodersen wrote:
(defn html-write-cmd [out cmd] (doseq [key (keys cmd)] (.write out (format "<b>\"%s\"</b> => \"%s\"<br>" key (cmd key)))))
I gather this is a command you're sending to the agent via "send-off". The first argument to such a function should be (at least a placeholder for) the old state of the agent. The return value should be the new state of the agent.
You say this command worked, but I suspect if you check (agent-errors my-agent) right after sending this command to my-agent, you'll see that it is already in an error state.
Here's a version that leaves the old state in-tact: (defn html-write-cmd [state out cmd] (doseq [key (keys cmd)] (.write out (format "<b>\"%s\"</b> => \"%s\"<br>" key (cmd key)))) state) You would send it this way: (send-off my-agent html-write-cmd *out* {:one 1 :two 2}) --Steve
smime.p7s
Description: S/MIME cryptographic signature