[armedbear-cvs] r13394 - trunk/abcl/contrib/jss

mevenson at common-lisp.net mevenson at common-lisp.net
Mon Jul 11 13:57:22 UTC 2011


Author: mevenson
Date: Mon Jul 11 06:57:21 2011
New Revision: 13394

Log:
Ensure that ASDF jar-file always loaded when encountered.

JSS:NEW is no longer deprecated.

Documentation improvements.

Update to version jss-2.1.0.

Modified:
   trunk/abcl/contrib/jss/README.markdown
   trunk/abcl/contrib/jss/asdf-jar.lisp
   trunk/abcl/contrib/jss/jss.asd
   trunk/abcl/contrib/jss/packages.lisp

Modified: trunk/abcl/contrib/jss/README.markdown
==============================================================================
--- trunk/abcl/contrib/jss/README.markdown	Mon Jul 11 06:57:04 2011	(r13393)
+++ trunk/abcl/contrib/jss/README.markdown	Mon Jul 11 06:57:21 2011	(r13394)
@@ -29,29 +29,61 @@
 recorded that b.c.d, b.C.d, C.d, c.d, and d potentially refer to this
 class. In your call to new, as long as the symbol can refer to only
 one class, we use that class. In this case, it is
-java.io.StringWriter. You could also have written (new
-'io.stringwriter), (new '|io.StringWriter|), (new
-'java.io.StringWriter)...
-
-the call (#"write" sw "Hello "), uses the code in invoke.java to
-call the method named "write" with the arguments sw and "Hello ". 
-JSS figures out the right java method to call, and calls it.
+java.io.StringWriter. You could also have written 
+
+     (new 'io.stringwriter)
+
+or      
+     (new '|io.StringWriter|)
+
+or     
+     (new 'java.io.StringWriter)
+
+The call 
+
+     (#"write" sw "Hello ")
+     
+uses the code in invoke.java to call the method named "write" with
+the arguments sw and "Hello ".  JSS figures out the right java method
+to call, and calls it.
+
+Static calls are possible as well with the #" macro, but the
+first argument MUST BE A SYMBOL to distinguish 
+
+     (#"getProperties" "java.lang.System")
+     
+from 
+
+     (#"getProperties" 'java.lang.System)     
+     
+The first attempts to call a method on the java.lang.String object
+with the contents "java.lang.System", which results in an error, while
+the second invokes the static java.lang.System.getProperties() method.     
 
 If you want to do a raw java call, use #0"toString". Raw calls
 return their results as Java objects, avoiding doing the usual Java
 object to Lisp object conversions that ABCL does.
 
-(with-constant-signature ((name jname raw?)*) &body body)
+
+    (with-constant-signature ((name jname raw?)*) &body body)
+    
 binds a macro which expands to a jcall, promising that the same method 
 will be called every time. Use this if you are making a lot of calls and 
 want to avoid the overhead of a the dynamic dispatch. 
-e.g. (with-constant-signature ((tostring "toString")) 
+e.g.
+ 
+    (with-constant-signature ((tostring "toString")) 
         (time (dotimes (i 10000) (tostring "foo"))))
-runs about 3x faster than (time (dotimes (i 10000) (#"toString" "foo")))
 
-(with-constant-signature ((tostring "toString" t)) ...) will cause the
-toString to be a raw java call. see get-all-jar-classnames below for
-an example.
+runs about three times faster than 
+ 
+    (time (dotimes (i 10000) (#"toString" "foo")))
+
+
+    (with-constant-signature ((tostring "toString" t)) ...) 
+    
+will cause the toString to be a raw java call. See
+JSS::GET-ALL-JAR-CLASSNAMES for an example.
  
 Implementation is that the first time the function is called, the
 method is looked up based on the arguments passed, and thereafter
@@ -61,3 +93,19 @@
 (japropos string) finds all class names matching string
 
 (jcmn class-name) lists the names of all methods for the class
+
+
+Compatibility
+-------------
+
+The function ENSURE-COMPATIBILITY attempts to provide a compatibility
+mode to existing users of JSS by importing the necessary symbols into
+CL-USER.
+
+Some notes on other compatibilty issues:
+
+*classpath-manager* 
+
+   Since we are no longer using Beanshell, this is no longer present.
+   For obtaining the current classloader use JAVA:*CLASSLOADER*.
+   

Modified: trunk/abcl/contrib/jss/asdf-jar.lisp
==============================================================================
--- trunk/abcl/contrib/jss/asdf-jar.lisp	Mon Jul 11 06:57:04 2011	(r13393)
+++ trunk/abcl/contrib/jss/asdf-jar.lisp	Mon Jul 11 06:57:21 2011	(r13394)
@@ -24,11 +24,9 @@
 
 (defmethod perform ((operation load-op) (c jar-file))
   (or jss:*inhibit-add-to-classpath*
-      (jss::add-to-classpath (component-pathname c))))
+      (jss:add-to-classpath (component-pathname c))))
 
 (defmethod operation-done-p ((operation load-op) (c jar-file))
-  t
-#+nil
   (or jss:*inhibit-add-to-classpath*
       (member (namestring (truename (component-pathname c))) jss:*added-to-classpath* :test 'equal)))
 

Modified: trunk/abcl/contrib/jss/jss.asd
==============================================================================
--- trunk/abcl/contrib/jss/jss.asd	Mon Jul 11 06:57:04 2011	(r13393)
+++ trunk/abcl/contrib/jss/jss.asd	Mon Jul 11 06:57:21 2011	(r13394)
@@ -3,7 +3,7 @@
 
 (defsystem :jss
   :author "Alan Ruttenberg, Mark Evenson"
-  :version "2.0.1" 
+  :version "2.1.0" 
   :components 
   ((:module base :pathname "" :serial t 
             :components ((:file "packages")

Modified: trunk/abcl/contrib/jss/packages.lisp
==============================================================================
--- trunk/abcl/contrib/jss/packages.lisp	Mon Jul 11 06:57:04 2011	(r13393)
+++ trunk/abcl/contrib/jss/packages.lisp	Mon Jul 11 06:57:21 2011	(r13394)
@@ -16,6 +16,7 @@
    #:need-to-add-directory-jar?
    #:jcmn
    #:japropos
+   #:new 
 
 ;;; Useful utilities to convert common Java items to Lisp counterparts
    #:hashmap-to-hashtable
@@ -25,7 +26,7 @@
    #:vector-to-list
 
 ;;; deprecated
-   #:new ; use JAVA:NEW
+
    #:get-java-field ; use JAVA:JFIELD
 
 ;;; Move to JAVA?




More information about the armedbear-cvs mailing list