2008-10-01
| 00:56 | abrooks | Cool. I've not SEGV'd the JVM before. |
| 01:00 | abrooks | BTW, that was not using JNA or any non-stock Sun JNI. |
| 01:00 | arohner | impressive. |
| 06:33 | H4ns | hi. i'm looking at clojure-contrib/src/clojure/contrib/zip_filter/xml/ and the example shows that i'd want to call (zip/xml-zip (xml/parse ...)) to turn some xml into a data structure that zip_filter can handle. zip/xml-zip does not seem to exist anymore, though. can anyone help? i'll also email the maintainer, but i'd like to progress. |
| 06:48 | H4ns | ah. never mind me again. |
| 11:38 | Chouser | H4ns: so is zip-filter behaving for you now? |
| 11:46 | H4ns | Chouser: yes - to the extent that i can run the example. i have not yet figured out how i can collect multiple sub-elements of an element that i have found. is there something that i could read to learn more, text or code? |
| 11:49 | Chouser | I thought it was self-documenting. ha ha. |
| 11:50 | Chouser | each step of the filtering process creates a seq of zip-trees, and expects to consume a seq of zip-trees. |
| 11:51 | Chouser | so you're always dealing with multiple sub-elements. Do you mean you've found one specific element and you're want to pull data from a few different kinds of sub-elements beneath it? |
| 11:53 | H4ns | correct - i am in fact parsing a rss document and want to extract certain elements out of each item for processing. i might even do the processing while walking the tree, but currently i'm trying to bend my head around the syntax and the basic functionality. |
| 11:53 | Chouser | in that case, you'll want to store the element you've got (using let or by passing it to another fn or whatever), and then use a new xml-> expression on that for each of the sub-elements you want. |
| 11:54 | Chouser | perhaps something like (for [e (xml-> doc ... :item)] {:author (xml-> e ... :author text), :title (xml-> e ... :title text)}) |
| 11:55 | Chouser | something like that would return to you a seq of hash-maps with the details you want. |
| 11:55 | H4ns | ah, ok - so you say i would basically traverse the subtree multiple times. i think i was trying to traverse it from within the initial traversal. |
| 11:56 | H4ns | that makes a lot of sense, thank you very much! |
| 11:56 | Chouser | well, any common traversal can be done once, but then if you want to "branch" and follow different sub-paths, yeah, you'll want to traverse each of them separately. |
| 11:57 | Chouser | BTW, you might also look at clojure.contrib.lazy-xml which you can drop in as a replacement for clojure.xml |
| 11:58 | H4ns | i have looked at that, but i first need to learn some basics. |
| 11:58 | Chouser | :-) ok |
| 11:59 | H4ns | what is a "java.lang.IncompatibleClassChangeError"? i get that when trying to execute a slightly (!) edited version of the for loop |
| 12:00 | H4ns | (for [e [1 2 3]] ...) works, (for [ e (xml -> ...)] ...) gives me the error |
| 12:00 | H4ns | (xml-> ...) works |
| 12:01 | H4ns | ah. no. never mind me. |
| 12:01 | H4ns | the error message is kind of, well, uhm, disconnected from what i typed. |
| 12:03 | H4ns | (xml-> :foo) creates a java.lang.IncompatibleClassChangeError, which strikes me as odd. |
| 12:06 | Chouser | well, it's expecting an zip xml node, not a keyword. I guess the error could be more specific. |
| 12:07 | H4ns | i'm not complaining. i was just mislead. i think i'll get used to the error messages once i can read clojure code better. |
| 14:41 | H4ns | is there a print friendly version of the documentation available somewhere? i can certainly walk the site and then create my own css, but maybe that has been done |
| 14:42 | Chouser | H4ns: I'm not aware of anything like that. |
| 14:43 | Chouser | It's been mentioned before, though, so if you go to any kind of effort people on the google group would probably be happy to know about it. |
| 14:44 | H4ns | Chouser: ok, thanks. i'll look into that and post to the group if i have anything usable |
| 14:45 | Chouser | you might even ask on the group first as well. Maybe somebody's got something and either hasn't mentioned it or I missed it. |
| 14:45 | H4ns | good idea. will do. |
| 15:21 | danlarkin | clojure errors are not yet very helpful to me :-/ |
| 15:25 | drewr | danlarkin: You're not alone. |
| 15:29 | danlarkin | I've got the syntax for cond wrong, but I can't figure out why |
| 15:30 | drewr | (cond pred ... pred ...) |
| 15:31 | drewr | No extra parens. |
| 15:32 | danlarkin | d'oh! |
| 15:33 | danlarkin | these slight differences with CL are throwing totally me off |
| 15:33 | drewr | ;-) |
| 15:33 | danlarkin | especially with no examples on the API page |
| 15:33 | danlarkin | *hint hint* |
| 15:33 | drewr | There is much to be done in Clojureland. |
| 15:34 | H4ns | there is this "clojure for scheme/cl programmers" page that would propably deserve an entry for cond |
| 15:34 | H4ns | "differences with lisps" it is. |
| 15:38 | danm_ | hey guys, anyone familiar with the translation of the PCL simple database example to clojure? |
| 15:39 | danm_ | just curious about the sync form, is that just to ensure that nothing happens to *db* if an exception is generated or somesuch? |
| 15:42 | Chouser | danm_: I'm not finding that page, but dosync is about changing refs more than exceptions. Documented here: http://clojure.org/refs |
| 15:42 | danm_ | oh, ok |
| 15:42 | danm_ | rtfm |
| 15:44 | danm_ | thanks |
| 15:44 | Chouser | sure |
| 17:21 | ericthorsen | what are people doing for readable namespaces? |
| 17:22 | rhickey | ericthorsen: what do you mean? |
| 17:23 | ericthorsen | rhickey: I'm attempting to use the printed output of a namespace for input to the reader |
| 17:23 | rhickey | you mean all the vars? |
| 17:24 | ericthorsen | #<Namespace: clojure> |
| 17:24 | ericthorsen | just the namespace |
| 17:24 | rhickey | ah |
| 17:24 | ericthorsen | I have it as a reference in a map |
| 17:24 | ericthorsen | {:ns (find-ns 'clojure)} |
| 17:25 | ericthorsen | The printed output of that read in |
| 17:25 | rhickey | there's no reader format for namespaces yet |
| 17:25 | ericthorsen | rhickey: bummer |
| 17:56 | blackdog | clojure the jvm answer to f#? http://lambda-the-ultimate.org/node/3032 |
| 17:57 | walters | http://ocamljava.x9c.fr/ is probably closer to F# |
| 17:57 | blackdog | well of course |
| 17:57 | blackdog | but he's going on about F# being unique functional language on a industrial strenght platform etc |
| 17:58 | blackdog | oh, scuse me, i didn't notice ocamljava there :) |
| 17:59 | blackdog | anyway clojure with ericthorsen work i think probably rains on the parade |
| 19:44 | qmrw | rhickey: do you have your talk from the other day on the web? |
| 19:44 | qmrw | slides or video |
| 19:59 | rhickey | qmrw: uploading now |
| 20:21 | danlarkin | qmrw: last night he was encoding the video to flash for upload |
| 20:28 | rhickey | part 1 is up: http://clojure.blip.tv/file/1313398 |
| 20:39 | sellout | an excellent talk, too ... both in content and presentation |
| 20:40 | rhickey | part 2 is uploading... |
| 20:40 | sellout | Not often do you get people to sit down for a 90 minute talk and then get excited when it runs to 180 minutes. |
| 20:42 | rhickey | the audience was a key part, I hope the questions are semi-audible... |
| 20:45 | danlarkin | rhickey: any plans for a presentation near the NY capital region? |
| 20:47 | rhickey | danlarkin: not so far |
| 20:48 | danlarkin | you should :-D |
| 20:50 | rhickey | danlarkin: are there sizable groups up there? |
| 20:52 | danlarkin | TBH I'm not sure... just being greedy |
| 21:00 | H4ns | ok, i have uploaded a pdf version of the website to the Google group. happy printing! |
| 21:24 | H4ns | (let [foo #((if % (recur nil)))] (foo true)) complains that recur can only be used in the tail position, but (let [foo (fn [a] (when a (recur nil)))] (foo true)) does not. why? |
| 21:26 | Chouser | you have extra parens on your #() |
| 21:27 | H4ns | ah. thanks! |
| 21:28 | rhickey | part 2 is up: http://clojure.blip.tv/file/1313503 |
| 21:49 | H4ns | did anyone come up with an emacs tweak that automatically makes a closing paren into the matching open curly/bracket? it's kind of annoying having to do that by hand and i could not adopt to paredit. |
| 21:51 | drewr | Takes some getting used to but it's invaluable. |
| 21:52 | H4ns | does it automatically indent if you remove, say, a with- form? |
| 21:52 | H4ns | (that could get me sold) |
| 21:52 | drewr | It doesn't, but that's only a C-M-q away. |
| 21:53 | H4ns | drewr: there is 1036 WITH-DATABASE-CONNECTIONS form i need to kill, so the C-M-q actually would matter :) |
| 21:53 | drewr | Kbd macro. :-) |
| 21:53 | H4ns | yup. no paredit needed for that. |
| 22:00 | H4ns | has there been a function spit that is now gone? |
| 22:01 | H4ns | or, asked the other way round, is there a function that i can call to write a string to a file? |
| 22:16 | H4ns | ah, duck_streams. |
| 23:19 | Chouser | unfortunately most of the questions on this recording are inaudible. |