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

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


Author: mevenson
Date: Mon Jul 11 06:57:04 2011
New Revision: 13393

Log:
JAVA:JARRAY-FROM-LIST infers the type of the Java array.

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

Modified: trunk/abcl/src/org/armedbear/lisp/java.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/java.lisp	Mon Jul 11 05:19:43 2011	(r13392)
+++ trunk/abcl/src/org/armedbear/lisp/java.lisp	Mon Jul 11 06:57:04 2011	(r13393)
@@ -223,6 +223,14 @@
 	    i (1+ i)))
     jarray))
 
+(defun jarray-from-list (list)
+  "Return a Java array from LIST whose type is inferred from the first element.
+
+For more control over the type of the array, use JNEW-ARRAY-FROM-LIST."
+  (jnew-array-from-list
+   (jobject-class (first list))
+   list))
+
 (defun list-from-jarray (jarray)
   "Returns a list with the elements of `jarray`."
   (loop for i from 0 below (jarray-length jarray)




More information about the armedbear-cvs mailing list