[armedbear-devel] Integration of CL and Java

Tobias C. Rittweiler tcr at freebits.de
Fri Jul 31 22:18:53 UTC 2009


To incite some discussion about what steps are required to make it
convenient to write Java from within CL. The result should probably be
added to Trac.

  Short term:

    * make Java objects inspectable.

    * make DESCRIBE be useful on Java objects. Should mention
      inheritance tree, public attributes, and methods.

    * fix inconsistencies, for example JMETHOD takes class-name first,
      then method-name, but JSTATIC takes it the other way around.

  Medium term:

    * make JMethods be a subclass of FUNCALLABLE-INSTANCE, so they can
      be funcalled, passed to HOFs, stored into SYMBOL-FUNCTION etc.

    * add reader-macros for convenience. For example, #J'class.method
      for (jmethod "class" "method").

    * add iteration macro, HOFs, for Java Collections.

    * Figure out how to get arglist information from Java methods.

    * Documentation

    * Useful PRINT-OBJECT methods for Java Objects. For example,
      Collection objects could be printed showing their content,
      e.g. #<JAVA-CLASS COLLECTION [a b c d e]>. Make sure to make it
      heed the printer variables properly, though.

  Long term:

    * Add an extensible sequence protocol, and make Java Collection
      abide it.

    * integrate Java's object hierarchy into the CLOS object
      hierarchy. I'm not a CLOS expert, but a few people come to mind
      who to ask. 

    * Make it possible to extend Java classes from Lisp.

    * Make it possible to implement Java interfaces from Lisp.

People who have experience with Clojure, and other Lisp-like languages
on the JVM are welcomed to chime in how other do the integration, and
how they like it.

Also people who have opinions how they'd like it to look like.

  -T.





More information about the armedbear-devel mailing list