#clojure logs

2008-04-05

16:38jgracinI see that var *agent* is used in the ants demo. Is this var documented somewhere?
16:39rhickeynot yet
16:39rhickeyit is a reference to the current running agent
16:40rhickeysince actions are functions of the state, but sometimes actions need to send messages to self or communicate agent identity to someone else
16:41rhickeystill experimental, but working out ok...
16:41jgracinThanks!
18:56rhickeyenhanced host syntax: http://groups.google.com/group/clojure/browse_frm/thread/dd64bd49191f8062
19:11ChouserInteresting.
19:12ChouserThe current syntax hadn't bothered me at all, but I guess I'll be happy to drop the extra parens on method calls.
20:36ChouserI thought I had this solved already, but apparently I don't.
20:37Chouserrhickey: Is there a right way for me to determine if an object is a zipper location?
20:38rhickeynot at present
20:39rhickeywhy do you need to?
20:43Chousermy zip-filter thingy generally expects each function to return a sequence of locs, but it's very convenient to use things like zip/up directly.
20:43ChouserIf I can detect that I'm being given a loc instead of a sequence, I can wrap a list around it automagically.
20:44ChouserWe talked about this before, and I was trying to tack my own meta-data key on to the root of the zip tree, and then look for it in the child nodes.
20:44ChouserI don't know why I thought that would work.
20:44rhickeyif the fns are really returning seqs, that is distinguishable from the loc vectors
20:44rhickeyseq? vector?
20:45rhickeystill relying on the implementation of locs though...
20:46rhickeydoes the metadata not get carried through?
20:50Chouserwhy would it?
20:50Chouserbut no, it appears to not be, assuming there's not bug in my test.
20:51rhickey(def data '[[a * b] + [c * d]])
20:51rhickey(def dz1 (vector-zip data))
20:51rhickey(def dz (with-meta dz1 (assoc ^dz1 :my-meta "foo")))
20:52rhickey (:my-meta ^(zip/right (zip/down (zip/right (zip/right (zip/down dz))))))
20:52rhickey-> "foo"
20:53Chouserhmph
20:54rhickeythere might be an unhandled case, but the intention is propagation, as is for all data structures
20:56Chouserindeed it appears to work fine now. I guess I'll blame my failing test on gremlins.
20:59Chousersorry for the false alarm