Changes between Initial Version and Version 1 of CLOSExtensions


Ignore:
Timestamp:
04/04/11 13:32:54 (4 years ago)
Author:
mevenson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CLOSExtensions

    v1 v1  
     1= Printing Java Objects =
     2
     3We've extended the CLOS to be a bit more friendly to dealing with Java objects by allowing a JAVA:JCLASS specializer.  This is especially useful for defining specializations of PRINT-OBJECT so that perhaps more useful information is returned when a JAVA-OBJECT is evaluated on the REPL. 
     4
     5For instance the following specialization would perhaps allow one to print more information about the contents of a java.util.Collection object
     6
     7{{{
     8(defmethod print-object ((coll (java:jclass "java.util.Collection")) stream)
     9 …
     10}}}
     11
     12If you are adding the class you wish to specialize on, you need to specify the classloader.  For example if using JSS, you will need to do something like
     13
     14{{{
     15
     16(defmethod print-object ((device-id (java:jclass "dto.nbi.service.hdm.alcatel.com.NBIDeviceID"
     17                                    (#"getBaseLoader" cl-user::*classpath-manager*)))
     18 …
     19}}}