[armedbear-cvs] r13359 - trunk/abcl/src/org/armedbear/lisp

mevenson at common-lisp.net mevenson at common-lisp.net
Wed Jun 22 12:25:29 UTC 2011


Author: mevenson
Date: Wed Jun 22 05:25:28 2011
New Revision: 13359

Log:
Created +NULL+, +TRUE+, and +FALSE+ constants in the JAVA package.

Deprecate JAVA:MAKE-IMMEDIATE-OBJECT in favor of using these constants
in the JAVA package for the associated wrapped primitive types.

Modified:
   trunk/abcl/src/org/armedbear/lisp/Java.java
   trunk/abcl/src/org/armedbear/lisp/JavaObject.java

Modified: trunk/abcl/src/org/armedbear/lisp/Java.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Java.java	Wed Jun 22 03:38:34 2011	(r13358)
+++ trunk/abcl/src/org/armedbear/lisp/Java.java	Wed Jun 22 05:25:28 2011	(r13359)
@@ -1085,12 +1085,18 @@
         }
     }
 
+    // DEPRECATED Remove MAKE-IMMEDIATE-OBJECT in abcl-0.29
     private static final Primitive MAKE_IMMEDIATE_OBJECT = new pf_make_immediate_object();
     @DocString(name="make-immediate-object", args="object &optional type",
-    doc="Attempts to coerce a given Lisp object into a java-object of the\n"+
-        "given type.  If type is not provided, works as jobject-lisp-value.\n"+
-        "Currently, type may be :BOOLEAN, treating the object as a truth value,\n"+
-        "or :REF, which returns Java null if NIL is provided.")
+    doc="Attempts to coerce a given Lisp object into a java-object of the\n"
+      + "given type.  If type is not provided, works as jobject-lisp-value.\n"
+      + "Currently, type may be :BOOLEAN, treating the object as a truth value,\n"
+      + "or :REF, which returns Java null if NIL is provided.\n"
+      + "\n"
+      + "Deprecated.  Please use JAVA:+NULL+, JAVA:+TRUE+, and JAVA:+FALSE+ for\n"
+      + "constructing wrapped primitive types, JAVA:JOBJECT-LISP-VALUE for converting a\n"
+      + "JAVA:JAVA-OBJECT to a Lisp value, or JAVA:JNULL_REF_P to distinguish a wrapped\n"
+      + "null JAVA_OBJECT from nil.")
     private static final class pf_make_immediate_object extends Primitive
     {
         pf_make_immediate_object()
@@ -1101,6 +1107,8 @@
         @Override
         public LispObject execute(LispObject[] args)
         {
+            Symbol.WARN.getSymbolFunction()
+                .execute(new SimpleString("JAVA:MAKE-IMMEDIATE-OBJECT is deprecated."));
             if (args.length < 1)
                 error(new WrongNumberOfArgumentsException(this));
             LispObject object = args[0];

Modified: trunk/abcl/src/org/armedbear/lisp/JavaObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JavaObject.java	Wed Jun 22 03:38:34 2011	(r13358)
+++ trunk/abcl/src/org/armedbear/lisp/JavaObject.java	Wed Jun 22 05:25:28 2011	(r13359)
@@ -659,4 +659,10 @@
             
         };
 
+    public final static Symbol NULL 
+        = Lisp.exportConstant("+NULL+", PACKAGE_JAVA, new JavaObject(null));
+    public final static Symbol TRUE
+        = Lisp.exportConstant("+TRUE+", PACKAGE_JAVA, new JavaObject(true));
+    public final static Symbol FALSE
+        = Lisp.exportConstant("+FALSE+", PACKAGE_JAVA, new JavaObject(false));
 }




More information about the armedbear-cvs mailing list