2008-02-16
| 13:20 | Chouser | Is there a way to test if something is a keyword? |
| 13:21 | rhickey_ | not built in, I should add it |
| 13:21 | rhickey_ | instance? clojure.lang.Keyword |
| 13:21 | Chouser | ok, thanks. |
| 13:22 | Chouser | BTW, I'm poking casually at a query tool for map/seq trees like the kind xml.clj produces (as well as in general). |
| 13:23 | Chouser | I 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:24 | Chouser | Anyway, 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:27 | rhickey_ | well, there are noi parent references (tricky in a functional language), but that doesn't mean the traverser can't maintain a stack |
| 13:28 | rhickey_ | I imagine there'd be much interest in something like xquery for Clojure maps |
| 13:33 | Chouser | well 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:35 | Chouser | ...a stack in the context of the query, of course. |
| 13:38 | rhickey_ | Have you read: http://www.st.cs.uni-sb.de/edu/seminare/2005/advanced-fp/docs/huet-zipper.pdf |
| 15:18 | jh06 | I asked about a day ago about not being able to redefine if |
| 15:19 | rhickey_ | ok |
| 15:19 | jh06 | apparently 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:19 | jh06 | I mean I understand that if is a special operator |
| 15:21 | rhickey_ | 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:21 | jh06 | honestly nothing in particular, I was just looking at how Clojure is implemented |
| 15:22 | jh06 | I would like to see if CL and Scheme do something similar |
| 15:23 | rhickey_ | 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:24 | jh06 | makes sense |
| 15:45 | Chouser | so you won't let me use a thread-local binding to, say, instrument "if", or log it or anything. |
| 15:46 | rhickey_ | no, it really is primitive |
| 15:46 | rhickey_ | not many things are |
| 15:47 | rhickey_ | 16? |
| 15:48 | Chouser | :-) ok |
| 17:10 | ericthor | assuming 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:10 | ericthor | oops...no Rich |
| 22:33 | jonathan_ | hi Rich, thanks for the help today! |
| 22:35 | jonathan_ | And thanks for pointing out function literals. I'm really looking forward to trying them in something useful |
| 22:36 | jonathan_ | oops...no Rich |
| 22:36 | jonathan_ | doh |
| 22:37 | jonathan_ | "Cheers" to anyone enjoying a beer. And "Snap" to anyone enjoying a Boddingtons... |