#clojure logs

2008-07-07

06:38rk98x03(xml/emit xml) only prints the result - how do I get it as a return value, as to save it to a file `?
08:37msinghthis maven thing pulls a lot of dependencies :o
08:41Lau_of_DKwriting your own code seems to have lost its appeal
08:50ChouserLau_of_DK: (with-out-str (emit foo))
08:50Chouserbbl
08:54msinghis slime usable with clojure?
08:59rsynnottmsingh: bizarrely, yes
08:59rsynnottit even works quite well
08:59rsynnott(though no inspector)
09:01msinghrsynnott: cool, i'll give it an install
09:02msinghis it used in conjuction with clojure-mode and clojure-extra or seperately/
09:13Lau_of_DKmsingh: With clojure-mode-advanced
09:13Lau_of_DKIts linked on the Wiki
09:14Lau_of_DKChouser, thanks - One wonders how you've memorized every single clojure routine in the book :)
09:21msinghi've followed the instructions in swank-clojure.clj and i get the error "File error: Cannot open load file, clojure-mode" -- any ideas?
09:26hoeckmsingh: add the path where clojure-mode.el resides to you emacs load-path
09:26msinghhoeck: i have
09:26hoeckmhh
09:27msinghtriple checked it too ;P
09:28Lau_of_DKmsingh, 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:28msinghah, not good :)
09:28hoeckmsingh: and loading it directly with (load-file " ... ")?
09:30msinghsame error
09:30msinghoh i dont have clojure mode
09:30hoeckLau_of_DK: so you are using slime+clojure right now? or did you stick to another environment?
09:37msinghcool it works :P
09:41arbschtLau_of_DK: how did SBCL break, and did you resolve it?
09:41Lau_of_DKhoeck : I'm using slime+clojure mode advanced in emacs
09:42Lau_of_DKarbscht its still broken, and I didnt look into it, because I wanted to commit fully to Clojure
09:42arbschtLau_of_DK: in what way is it broken?
09:42msinghwhat do you guys have for slime-lisp-implementations
09:43Lau_of_DKarbscht I can let you know tonight when I get home from work, but I dont remember. I think it just failed to connect
09:44arbschtLau_of_DK: ok. is it like: you get an inferior-lisp repl, and slime keeps polling unsuccessfully for a connection?
09:47msinghhttp://paste.lisp.org/display/63396
09:47msinghany ideas?
09:51Lau_of_DKarbscht : I'll try to catch up with you tonight, then I can give you the exact error
09:51arbschtLau_of_DK: ok :)
10:41hoeckmsingh: this is common lisp code (the `(progn ..))
14:11Lau_of_DKEvening Gents
15:27Chouser_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:29Chouser_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:37Chouser_I guess that's a "not around"
15:37Chouser_:-)
15:43Lau_of_DKHe's on the same lattitude (?) as I am, which means is almost 10 pm now :)
15:51arbschtlongitude, probably
15:52Lau_of_DKthats the one
18:33jgrantdoes anyone know how to import/use a nested class ?
18:33jgrant(import '(org.apache.lucene.document Document Field Field.Store Field.Index))
18:33jgrantshould work but doesnt
18:33jgrant?
18:34jgrantresults in java.lang.ClassNotFoundException: org.apache.lucene.document.Field.Store
18:34jgranti probably should not try importing a nested class anyway
18:35pjb3jgrant: what happens if you don't import the nested class
18:35pjb3then try to us Field.Store?
18:35pjb3^use
18:35jgrantjava.lang.ClassNotFoundException: Field.Store
18:36jgranttrying (println Field.Store)
18:36pjb3hmm. (println (.Store Field)) ?
18:36jgrantjava.lang.NoSuchFieldException: Store
18:37pjb3sorry, just guessing :)
18:37jgrantgood guess though
18:37dudleyfField$Store
18:37dudleyf?
18:37jgrantUnable to resolve symbol: Field$Store in this context
18:38dudleyfHmm. I thought nested classes used the $
18:38jgrantwait a minute, can't even print Field
18:39jgrantfield is a public final class
18:39jgrantfirst i import with - (import '(org.apache.lucene.document Document Field))
18:40jgrant(println Field)
18:40jgrantresults in
18:40jgrantjava.lang.NoSuchFieldException: toString
18:53jgrantshould (println Field$Store) print the fully qualified nested class name ?
18:53jgranti get...
18:53jgrantjava.lang.Exception: Unable to resolve symbol: Field$Store in this context
18:56arbschtimport Field$Store explicitly
19:01jgrantarbscht: thanks that works !
22:14pjb3Does anyone know how to load a .clj file from the class path?
22:15pjb3load-file wants a file system path, I think
22:20pjb3Looks like (.loadResourceScript clojure.lang.RT "foo.clj") does it
23:06arohnerChouser, did you see the links from cgrand's html templating to CL-WHO and Franz's html templating?
23:50Chouserarohner: I saw CL-WHO
23:51arohnerthey're interesting
23:51arohnerthe one thing that bugs me is the need for another (:html) inside of code that generates html
23:51arohneri.e.
23:51arohner(html (:td (map (fn [row] (html (:tr row)))
23:52arohnerthough I guess pulling apart the interior code would be too much magic
23:52arohnerand error prone
23:52Chouseryeah, I cobbled something together myself (before seeing what others had done) that didn't require that.
23:52arohnerI'm trying to write one now
23:53arohnerit seems like it's good macro practice
23:54arohnerdo you know why they use the extra (html)?
23:54arohnerdoes it fix a corner case?
23:54Chouserwell, I thought I did, but now it's not making sense to me.
23:56ChouserHere's what I've got: http://n01se.net/paste/g25
23:57Chouserbut it does have a couple clumsy corners
23:57Chouserit didn't end up having to be a macro at all, which was a little disappointing. ;-)
23:57arohnerhah
23:58ChouserI suppose macro-ness could be applied to get better performance ... do more work at compile time and less at runtime.
23:58ChouserBut there are a couple details of the syntax I don't like.
23:58arohnerlike what?
23:58Chousertyring to spot an example...
23:59Chousertrying
23:59Chouserok, yeah. in that for loop
23:59ChouserI wanted it to produce two table-rows per iteration