#clojure logs

2008-07-27

07:54hoeckis it possible to query a clojure fn about the number of arguments it expects?
08:01hoeckahh, yes it is, thanks to reflection!
14:59ChouserI know absolutely nothing about this, so I really am asking -- why is the clojure namespace not org.clojure.lang, etc.?
15:37rhickeyChouser: for the same reason that java.lang is not org.java.lang (i.e. no good reason)
15:44Chouserheh
15:44Chouserok
15:45ChouserI see this line near the top of PHM.java: new EmptyNode()
15:46ChouserBut when I do: (clojure.lang.PersistentHashMap$EmptyNode.) I get No matching ctor found
15:46Chouserwhat am I missing
16:01hoeckChouser: i guess the inner class EmptyNode is not public
16:02Chouserah, ok. thanks. Shows just how little Java I know, I guess. :-/
16:05hoecki'm used to the openess of clojure too, but i had the "no matching ctor found" exception quite often and now my eyes are trained to recognize the missing `public' :)
16:12Chouserseeing something that isn't there is a pretty impressive skill.
16:31joekarma[lunch]I see dead people
20:34Chouserrhickey: trying to use :exposes is failing for me, and indeed getField returns nil. But getDeclaredField seems to return the desired result.
20:34ChouserThis is stock gen-class, testing on javax.swing.DefaultCellEditor's clickCountToStart field.
20:35Chouser(.getField (identity javax.swing.DefaultCellEditor) "clickCountToStart")
20:51Chouserfrom the Java docs it looks like getField only finds public fields, not protected ones like :exposes is looking for.
21:02rhickeyChouser: ok, do you have a fix you want me to add?
21:02ChouserI think so, but my test cases are pretty thin.
21:03ChouserI'll post what I've got later tonight, tests and all.
21:03rhickeyisa-based multimethods and a la carte hierarchies are up!
21:04Chousernice.
21:04Chouseryou have the 15 pages of docs and examples up too, right? ;-)
21:04Chouserdocs are such a drag.
21:05rhickeyall the functions are doc'ed, writing up a message to the group now
21:05rhickeyalso added resolving keywords - ::foo reads as :current-ns/foo
21:06Chouserinteresting.
21:08rhickeykeywords make better tags, since they print/read as themselves, but ` doesn't add namespaces to keywords that don't have them
21:08rhickeybut namespaces are important (required in fact) for tag hierarchies
21:09ChouserI used :xml-filter/something-or-other and felt odd about it. this'll be nice.
21:20ChouserActually, I probably should merge these two changes. If you want to replace line 415 of genclass.clj, it will fix my one test case:
21:20ChouserI probably should *not* merge these two changes.
21:20Chouser (let [fld (.getDeclaredField super (str f))
21:24rhickeyChouser: line 413?
21:25Chouseroh, probably. sorry, I've other changes in that file. just replace .getField with .getDeclaredField.
21:26rhickeyok, it's up
21:27Chouserfantastic -- works for me, now.
21:36Chouserok, I just posted my tiny gen-class patch and test. biab.
21:37lisppaste8rhickey pasted "isa? hierarchies" at http://paste.lisp.org/display/64336
22:17rhickeyEnhanced multimethods explained: http://groups.google.com/group/clojure/browse_frm/thread/9cc9926de1bdb128