[armedbear-devel] How to access Java fields?
dmiles@users.sourceforge.net
logicmoo at gmail.com
Wed Feb 10 12:59:05 UTC 2010
Blake,
On Tue, Feb 9, 2010 at 7:15 PM, Blake McBride <blake at mcbride.name> wrote:
>
> BTW, I've now got a Lisp macro that maps all the methods in a Java class
> into a corresponding CLOS class.
>
>
This is pretty neat. Yes there is no reason that CLOS or at least very
usefull form of a object system that reuses existing java class should not
be defined by macros to make it smooth
I used to imagine that the runtime-class.lisp was piso's original
plan (generated java classes from lisp .. which these objects could be
mixins subclasing pre-exisitng java classes)
In my ABCL Clojure extension
http://code.google.com/p/opensim4opencog/source/browse/trunk/bin/cl-cogbot.lisp?r=46,
(this file is simplistic becasue some code is i the non-lisp sources) but
you get the gist.
I preroll existing C#/.NET class into a set of existing methods gleaned from
java's reflection using a name-mangling contract (as-needed).
In cases I have multple possible methods per class (or interface).. i end up
doing a (defun someclass-somemethod (self &rest args) (... guess the right
jcall ....))
Static class fields, like String.CASE_INSENSITIVE_ORDER i make a symbol
macro on %JAVA-LANG-STRING/CASE-INSENSITIVE-ORDER
But my blindspot still is on how to please a more CLOSy clonsuming codebase
so I am very interested in seeing how you set things up from your macros.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20100210/52e7f1c5/attachment.html>
More information about the armedbear-devel
mailing list