2008-04-05
| 16:38 | jgracin | I see that var *agent* is used in the ants demo. Is this var documented somewhere? |
| 16:39 | rhickey | not yet |
| 16:39 | rhickey | it is a reference to the current running agent |
| 16:40 | rhickey | since actions are functions of the state, but sometimes actions need to send messages to self or communicate agent identity to someone else |
| 16:41 | rhickey | still experimental, but working out ok... |
| 16:41 | jgracin | Thanks! |
| 18:56 | rhickey | enhanced host syntax: http://groups.google.com/group/clojure/browse_frm/thread/dd64bd49191f8062 |
| 19:11 | Chouser | Interesting. |
| 19:12 | Chouser | The current syntax hadn't bothered me at all, but I guess I'll be happy to drop the extra parens on method calls. |
| 20:36 | Chouser | I thought I had this solved already, but apparently I don't. |
| 20:37 | Chouser | rhickey: Is there a right way for me to determine if an object is a zipper location? |
| 20:38 | rhickey | not at present |
| 20:39 | rhickey | why do you need to? |
| 20:43 | Chouser | my 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:43 | Chouser | If I can detect that I'm being given a loc instead of a sequence, I can wrap a list around it automagically. |
| 20:44 | Chouser | We 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:44 | Chouser | I don't know why I thought that would work. |
| 20:44 | rhickey | if the fns are really returning seqs, that is distinguishable from the loc vectors |
| 20:44 | rhickey | seq? vector? |
| 20:45 | rhickey | still relying on the implementation of locs though... |
| 20:46 | rhickey | does the metadata not get carried through? |
| 20:50 | Chouser | why would it? |
| 20:50 | Chouser | but no, it appears to not be, assuming there's not bug in my test. |
| 20:51 | rhickey | (def data '[[a * b] + [c * d]]) |
| 20:51 | rhickey | (def dz1 (vector-zip data)) |
| 20:51 | rhickey | (def dz (with-meta dz1 (assoc ^dz1 :my-meta "foo"))) |
| 20:52 | rhickey | (:my-meta ^(zip/right (zip/down (zip/right (zip/right (zip/down dz)))))) |
| 20:52 | rhickey | -> "foo" |
| 20:53 | Chouser | hmph |
| 20:54 | rhickey | there might be an unhandled case, but the intention is propagation, as is for all data structures |
| 20:56 | Chouser | indeed it appears to work fine now. I guess I'll blame my failing test on gremlins. |
| 20:59 | Chouser | sorry for the false alarm |