#clojure log - Jul 07 2008

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

6: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 `?

8:37 msingh: this maven thing pulls a lot of dependencies :o

8:41 Lau_of_DK: writing your own code seems to have lost its appeal

8:50 Chouser: Lau_of_DK: (with-out-str (emit foo))

8:50 bbl

8:54 msingh: is slime usable with clojure?

8:59 rsynnott: msingh: bizarrely, yes

8:59 it even works quite well

8:59 (though no inspector)

9:01 msingh: rsynnott: cool, i'll give it an install

9:02 is it used in conjuction with clojure-mode and clojure-extra or seperately/

9:13 Lau_of_DK: msingh: With clojure-mode-advanced

9:13 Its linked on the Wiki

9:14 Chouser, thanks - One wonders how you've memorized every single clojure routine in the book :)

9: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?

9:26 hoeck: msingh: add the path where clojure-mode.el resides to you emacs load-path

9:26 msingh: hoeck: i have

9:26 hoeck: mhh

9:27 msingh: triple checked it too ;P

9: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

9:28 msingh: ah, not good :)

9:28 hoeck: msingh: and loading it directly with (load-file " ... ")?

9:30 msingh: same error

9:30 oh i dont have clojure mode

9:30 hoeck: Lau_of_DK: so you are using slime+clojure right now? or did you stick to another environment?

9:34 * msingh gives up

9:37 msingh: cool it works :P

9:41 arbscht: Lau_of_DK: how did SBCL break, and did you resolve it?

9:41 Lau_of_DK: hoeck : I'm using slime+clojure mode advanced in emacs

9:42 arbscht its still broken, and I didnt look into it, because I wanted to commit fully to Clojure

9:42 arbscht: Lau_of_DK: in what way is it broken?

9:42 msingh: what do you guys have for slime-lisp-implementations

9: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

9:44 arbscht: Lau_of_DK: ok. is it like: you get an inferior-lisp repl, and slime keeps polling unsuccessfully for a connection?

9:47 msingh: http://paste.lisp.org/display/63396

9:47 any ideas?

9:51 Lau_of_DK: arbscht : I'll try to catch up with you tonight, then I can give you the exact error

9:51 arbscht: Lau_of_DK: ok :)

10:41 hoeck: msingh: this is common lisp code (the `(progn ..))

14:11 Lau_of_DK: Evening Gents

14:13 * Chouser_ waves

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 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 I guess that's a "not around"

15:37 :-)

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

16:06 * meredydd waves

16:06 * Chouser_ waves back

18:33 jgrant: does anyone know how to import/use a nested class ?

18:33 (import '(org.apache.lucene.document Document Field Field.Store Field.Index))

18:33 should work but doesnt

18:33 ?

18:34 results in java.lang.ClassNotFoundException: org.apache.lucene.document.Field.Store

18:34 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 then try to us Field.Store?

18:35 ^use

18:35 jgrant: java.lang.ClassNotFoundException: Field.Store

18:36 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 ?

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 field is a public final class

18:39 first i import with - (import '(org.apache.lucene.document Document Field))

18:40 (println Field)

18:40 results in

18:40 java.lang.NoSuchFieldException: toString

18:53 should (println Field$Store) print the fully qualified nested class name ?

18:53 i get...

18:53 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 load-file wants a file system path, I think

22:20 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 the one thing that bugs me is the need for another (:html) inside of code that generates html

23:51 i.e.

23:51 (html (:td (map (fn [row] (html (:tr row)))

23:52 though I guess pulling apart the interior code would be too much magic

23:52 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 it seems like it's good macro practice

23:54 do you know why they use the extra (html)?

23:54 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 Here's what I've got: http://n01se.net/paste/g25

23:57 but it does have a couple clumsy corners

23:57 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 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 trying

23:59 ok, yeah. in that for loop

23:59 I wanted it to produce two table-rows per iteration

Logging service provided by n01se.net