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

Erik Huelsmann ehuelsmann at common-lisp.net
Sun Feb 8 21:23:49 UTC 2009


Author: ehuelsmann
Date: Sun Feb  8 21:23:48 2009
New Revision: 11647

Log:
Add support for java.lang.Long arguments based on Bignums.

Found by: ayrnieu.

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

Modified: trunk/abcl/src/org/armedbear/lisp/Bignum.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Bignum.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Bignum.java	Sun Feb  8 21:23:48 2009
@@ -65,6 +65,21 @@
   }
 
   @Override
+  public Object javaInstance(Class c) {
+    String cn = c.getName();
+    if (cn.equals("java.lang.Byte") || cn.equals("byte"))
+      return Byte.valueOf((byte)value.intValue());
+    if (cn.equals("java.lang.Short") || cn.equals("short"))
+      return Short.valueOf((short)value.intValue());
+    if (cn.equals("java.lang.Integer") || cn.equals("int"))
+      return Integer.valueOf(value.intValue());
+    if (cn.equals("java.lang.Long") || cn.equals("long"))
+      return Long.valueOf((long)value.longValue());
+    return javaInstance();
+  }
+
+
+  @Override
   public LispObject typeOf()
   {
     if (value.signum() > 0)




More information about the armedbear-cvs mailing list