#clojure logs

2008-02-16

13:20ChouserIs there a way to test if something is a keyword?
13:21rhickey_not built in, I should add it
13:21rhickey_instance? clojure.lang.Keyword
13:21Chouserok, thanks.
13:22ChouserBTW, I'm poking casually at a query tool for map/seq trees like the kind xml.clj produces (as well as in general).
13:23ChouserI like xpath, so it's definitely influencing the direction I go, but I don't what the queries to be strings that have to be parsed.
13:24ChouserAnyway, I realized just a moment ago that there is at least one thing xpath allows that I think will be essentially impossible because of the map/seq structure: ../
13:27rhickey_well, there are noi parent references (tricky in a functional language), but that doesn't mean the traverser can't maintain a stack
13:28rhickey_I imagine there'd be much interest in something like xquery for Clojure maps
13:33Chouserwell with "normal" DOM implementations, you can start your query on any node and still go to a parent, in which case a stack wouldn't be sufficient.
13:35Chouser...a stack in the context of the query, of course.
13:38rhickey_Have you read: http://www.st.cs.uni-sb.de/edu/seminare/2005/advanced-fp/docs/huet-zipper.pdf
15:18jh06I asked about a day ago about not being able to redefine if
15:19rhickey_ok
15:19jh06apparently you cannot define a function named if and it have any impact, but you can name a macro named if and it will take precedence. Is this how mosts Lisps work?
15:19jh06I mean I understand that if is a special operator
15:21rhickey_If you were able to define a macro, that's just a hole I'll end up plugging at some point. The recommendation is not to redefine special ops. What were you trying to do?
15:21jh06honestly nothing in particular, I was just looking at how Clojure is implemented
15:22jh06I would like to see if CL and Scheme do something similar
15:23rhickey_In general I'm not looking to support redefining the primitives - it leads to code that won't interoperate. That's why the reader is still closed. So, in that respect more restrictive than CL
15:24jh06makes sense
15:45Chouserso you won't let me use a thread-local binding to, say, instrument "if", or log it or anything.
15:46rhickey_no, it really is primitive
15:46rhickey_not many things are
15:47rhickey_16?
15:48Chouser:-) ok
17:10ericthorassuming there may be multiple streams writing clojure into a running JVM either for development purposes or possibly accessing a remote REPL, is the best way to do this to serialize the requests on a LinkedBlockingQueue and send them back to streams running the the requesting thread?
17:10ericthoroops...no Rich
22:33jonathan_hi Rich, thanks for the help today!
22:35jonathan_And thanks for pointing out function literals. I'm really looking forward to trying them in something useful
22:36jonathan_oops...no Rich
22:36jonathan_doh
22:37jonathan_"Cheers" to anyone enjoying a beer. And "Snap" to anyone enjoying a Boddingtons...