2008-07-07
| 06:38 | rk98x03 | (xml/emit xml) only prints the result - how do I get it as a return value, as to save it to a file `? |
| 08:37 | msingh | this maven thing pulls a lot of dependencies :o |
| 08:41 | Lau_of_DK | writing your own code seems to have lost its appeal |
| 08:50 | Chouser | Lau_of_DK: (with-out-str (emit foo)) |
| 08:50 | Chouser | bbl |
| 08:54 | msingh | is slime usable with clojure? |
| 08:59 | rsynnott | msingh: bizarrely, yes |
| 08:59 | rsynnott | it even works quite well |
| 08:59 | rsynnott | (though no inspector) |
| 09:01 | msingh | rsynnott: cool, i'll give it an install |
| 09:02 | msingh | is it used in conjuction with clojure-mode and clojure-extra or seperately/ |
| 09:13 | Lau_of_DK | msingh: With clojure-mode-advanced |
| 09:13 | Lau_of_DK | Its linked on the Wiki |
| 09:14 | Lau_of_DK | Chouser, thanks - One wonders how you've memorized every single clojure routine in the book :) |
| 09:21 | msingh | i've followed the instructions in swank-clojure.clj and i get the error "File error: Cannot open load file, clojure-mode" -- any ideas? |
| 09:26 | hoeck | msingh: add the path where clojure-mode.el resides to you emacs load-path |
| 09:26 | msingh | hoeck: i have |
| 09:26 | hoeck | mhh |
| 09:27 | msingh | triple checked it too ;P |
| 09:28 | Lau_of_DK | msingh, I dont remember now, but it took me hours to get working, and when I finally did fix it (with hours of help from jgracin), SBCL broke instead |
| 09:28 | msingh | ah, not good :) |
| 09:28 | hoeck | msingh: and loading it directly with (load-file " ... ")? |
| 09:30 | msingh | same error |
| 09:30 | msingh | oh i dont have clojure mode |
| 09:30 | hoeck | Lau_of_DK: so you are using slime+clojure right now? or did you stick to another environment? |
| 09:37 | msingh | cool it works :P |
| 09:41 | arbscht | Lau_of_DK: how did SBCL break, and did you resolve it? |
| 09:41 | Lau_of_DK | hoeck : I'm using slime+clojure mode advanced in emacs |
| 09:42 | Lau_of_DK | arbscht its still broken, and I didnt look into it, because I wanted to commit fully to Clojure |
| 09:42 | arbscht | Lau_of_DK: in what way is it broken? |
| 09:42 | msingh | what do you guys have for slime-lisp-implementations |
| 09:43 | Lau_of_DK | arbscht I can let you know tonight when I get home from work, but I dont remember. I think it just failed to connect |
| 09:44 | arbscht | Lau_of_DK: ok. is it like: you get an inferior-lisp repl, and slime keeps polling unsuccessfully for a connection? |
| 09:47 | msingh | http://paste.lisp.org/display/63396 |
| 09:47 | msingh | any ideas? |
| 09:51 | Lau_of_DK | arbscht : I'll try to catch up with you tonight, then I can give you the exact error |
| 09:51 | arbscht | Lau_of_DK: ok :) |
| 10:41 | hoeck | msingh: this is common lisp code (the `(progn ..)) |
| 14:11 | Lau_of_DK | Evening Gents |
| 15:27 | Chouser_ | cgrand1: you around? I've been meaning to ask you about your xml templating API, and since you just brought it up on the group... |
| 15:29 | Chouser_ | I understand this is probably how CL-WHO does it, but do you think it's good to use side-effects to build up the tree like that? I understand they're captured by (html ...), but you still end up with doseqs all over. |
| 15:37 | Chouser_ | I guess that's a "not around" |
| 15:37 | Chouser_ | :-) |
| 15:43 | Lau_of_DK | He's on the same lattitude (?) as I am, which means is almost 10 pm now :) |
| 15:51 | arbscht | longitude, probably |
| 15:52 | Lau_of_DK | thats the one |
| 18:33 | jgrant | does anyone know how to import/use a nested class ? |
| 18:33 | jgrant | (import '(org.apache.lucene.document Document Field Field.Store Field.Index)) |
| 18:33 | jgrant | should work but doesnt |
| 18:33 | jgrant | ? |
| 18:34 | jgrant | results in java.lang.ClassNotFoundException: org.apache.lucene.document.Field.Store |
| 18:34 | jgrant | i probably should not try importing a nested class anyway |
| 18:35 | pjb3 | jgrant: what happens if you don't import the nested class |
| 18:35 | pjb3 | then try to us Field.Store? |
| 18:35 | pjb3 | ^use |
| 18:35 | jgrant | java.lang.ClassNotFoundException: Field.Store |
| 18:36 | jgrant | trying (println Field.Store) |
| 18:36 | pjb3 | hmm. (println (.Store Field)) ? |
| 18:36 | jgrant | java.lang.NoSuchFieldException: Store |
| 18:37 | pjb3 | sorry, just guessing :) |
| 18:37 | jgrant | good guess though |
| 18:37 | dudleyf | Field$Store |
| 18:37 | dudleyf | ? |
| 18:37 | jgrant | Unable to resolve symbol: Field$Store in this context |
| 18:38 | dudleyf | Hmm. I thought nested classes used the $ |
| 18:38 | jgrant | wait a minute, can't even print Field |
| 18:39 | jgrant | field is a public final class |
| 18:39 | jgrant | first i import with - (import '(org.apache.lucene.document Document Field)) |
| 18:40 | jgrant | (println Field) |
| 18:40 | jgrant | results in |
| 18:40 | jgrant | java.lang.NoSuchFieldException: toString |
| 18:53 | jgrant | should (println Field$Store) print the fully qualified nested class name ? |
| 18:53 | jgrant | i get... |
| 18:53 | jgrant | java.lang.Exception: Unable to resolve symbol: Field$Store in this context |
| 18:56 | arbscht | import Field$Store explicitly |
| 19:01 | jgrant | arbscht: thanks that works ! |
| 22:14 | pjb3 | Does anyone know how to load a .clj file from the class path? |
| 22:15 | pjb3 | load-file wants a file system path, I think |
| 22:20 | pjb3 | Looks like (.loadResourceScript clojure.lang.RT "foo.clj") does it |
| 23:06 | arohner | Chouser, did you see the links from cgrand's html templating to CL-WHO and Franz's html templating? |
| 23:50 | Chouser | arohner: I saw CL-WHO |
| 23:51 | arohner | they're interesting |
| 23:51 | arohner | the one thing that bugs me is the need for another (:html) inside of code that generates html |
| 23:51 | arohner | i.e. |
| 23:51 | arohner | (html (:td (map (fn [row] (html (:tr row))) |
| 23:52 | arohner | though I guess pulling apart the interior code would be too much magic |
| 23:52 | arohner | and error prone |
| 23:52 | Chouser | yeah, I cobbled something together myself (before seeing what others had done) that didn't require that. |
| 23:52 | arohner | I'm trying to write one now |
| 23:53 | arohner | it seems like it's good macro practice |
| 23:54 | arohner | do you know why they use the extra (html)? |
| 23:54 | arohner | does it fix a corner case? |
| 23:54 | Chouser | well, I thought I did, but now it's not making sense to me. |
| 23:56 | Chouser | Here's what I've got: http://n01se.net/paste/g25 |
| 23:57 | Chouser | but it does have a couple clumsy corners |
| 23:57 | Chouser | it didn't end up having to be a macro at all, which was a little disappointing. ;-) |
| 23:57 | arohner | hah |
| 23:58 | Chouser | I suppose macro-ness could be applied to get better performance ... do more work at compile time and less at runtime. |
| 23:58 | Chouser | But there are a couple details of the syntax I don't like. |
| 23:58 | arohner | like what? |
| 23:58 | Chouser | tyring to spot an example... |
| 23:59 | Chouser | trying |
| 23:59 | Chouser | ok, yeah. in that for loop |
| 23:59 | Chouser | I wanted it to produce two table-rows per iteration |