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

Ville Voutilainen vvoutilainen at common-lisp.net
Sun Nov 29 19:38:57 UTC 2009


Author: vvoutilainen
Date: Sun Nov 29 14:38:53 2009
New Revision: 12285

Log:
Make NUMBERP/LISTP/etc. type query functions final in LispObject.
These usually call their virtual boolean counterpart and then return T or
NIL in the final function. Same change is made for IS_* functions
in LispObject, those also invoke a virtual boolean counterpart.


Modified:
   trunk/abcl/src/org/armedbear/lisp/AbstractString.java
   trunk/abcl/src/org/armedbear/lisp/AbstractVector.java
   trunk/abcl/src/org/armedbear/lisp/Bignum.java
   trunk/abcl/src/org/armedbear/lisp/Complex.java
   trunk/abcl/src/org/armedbear/lisp/Cons.java
   trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java
   trunk/abcl/src/org/armedbear/lisp/Fixnum.java
   trunk/abcl/src/org/armedbear/lisp/LispCharacter.java
   trunk/abcl/src/org/armedbear/lisp/LispObject.java
   trunk/abcl/src/org/armedbear/lisp/Nil.java
   trunk/abcl/src/org/armedbear/lisp/Ratio.java
   trunk/abcl/src/org/armedbear/lisp/SingleFloat.java

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractString.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractString.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractString.java	Sun Nov 29 14:38:53 2009
@@ -52,12 +52,6 @@
     }
 
     @Override
-    public final LispObject STRINGP()
-    {
-        return T;
-    }
-
-    @Override
     public final boolean stringp()
     {
         return true;

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractVector.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractVector.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractVector.java	Sun Nov 29 14:38:53 2009
@@ -49,12 +49,6 @@
   }
 
   @Override
-  public final LispObject VECTORP()
-  {
-    return T;
-  }
-
-  @Override
   public final boolean vectorp()
   {
     return true;

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 Nov 29 14:38:53 2009
@@ -159,24 +159,12 @@
   }
 
   @Override
-  public LispObject NUMBERP()
-  {
-    return T;
-  }
-
-  @Override
   public boolean numberp()
   {
     return true;
   }
 
   @Override
-  public LispObject INTEGERP()
-  {
-    return T;
-  }
-
-  @Override
   public boolean integerp()
   {
     return true;

Modified: trunk/abcl/src/org/armedbear/lisp/Complex.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Complex.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Complex.java	Sun Nov 29 14:38:53 2009
@@ -105,12 +105,6 @@
   }
 
   @Override
-  public LispObject NUMBERP()
-  {
-    return T;
-  }
-
-  @Override
   public boolean numberp()
   {
     return true;

Modified: trunk/abcl/src/org/armedbear/lisp/Cons.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Cons.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Cons.java	Sun Nov 29 14:38:53 2009
@@ -112,12 +112,6 @@
   }
 
   @Override
-  public LispObject ATOM()
-  {
-    return NIL;
-  }
-
-  @Override
   public boolean atom()
   {
     return false;
@@ -414,24 +408,12 @@
   }
 
   @Override
-  public final LispObject LISTP()
-  {
-    return T;
-  }
-
-  @Override
   public final boolean endp()
   {
     return false;
   }
 
   @Override
-  public final LispObject ENDP()
-  {
-    return NIL;
-  }
-
-  @Override
   public final LispObject[] copyToArray()
   {
     final int length = length();

Modified: trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java	Sun Nov 29 14:38:53 2009
@@ -106,12 +106,6 @@
     }
 
     @Override
-    public LispObject NUMBERP()
-    {
-        return T;
-    }
-
-    @Override
     public boolean numberp()
     {
         return true;
@@ -212,12 +206,6 @@
     }
 
     @Override
-    public LispObject FLOATP()
-    {
-        return T;
-    }
-
-    @Override
     public boolean floatp()
     {
         return true;

Modified: trunk/abcl/src/org/armedbear/lisp/Fixnum.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Fixnum.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Fixnum.java	Sun Nov 29 14:38:53 2009
@@ -156,24 +156,12 @@
   }
 
   @Override
-  public LispObject NUMBERP()
-  {
-    return T;
-  }
-
-  @Override
   public boolean numberp()
   {
     return true;
   }
 
   @Override
-  public LispObject INTEGERP()
-  {
-    return T;
-  }
-
-  @Override
   public boolean integerp()
   {
     return true;

Modified: trunk/abcl/src/org/armedbear/lisp/LispCharacter.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispCharacter.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispCharacter.java	Sun Nov 29 14:38:53 2009
@@ -116,12 +116,6 @@
   }
 
   @Override
-  public LispObject CHARACTERP()
-  {
-    return T;
-  }
-
-  @Override
   public boolean characterp()
   {
     return true;

Modified: trunk/abcl/src/org/armedbear/lisp/LispObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispObject.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispObject.java	Sun Nov 29 14:38:53 2009
@@ -86,14 +86,14 @@
     return true;
   }
 
-  public LispObject CONSTANTP()
+  public final LispObject CONSTANTP()
   {
     return constantp() ? T : NIL;
   }
 
-  public LispObject ATOM()
+  public final LispObject ATOM()
   {
-    return T;
+    return atom() ? T : NIL;
   }
 
   public boolean atom()
@@ -268,7 +268,7 @@
     return type_error(this, Symbol.RATIONAL);
   }
 
-  public LispObject EVENP()
+  public final LispObject EVENP()
   {
     return evenp() ? T : NIL;
   }
@@ -280,7 +280,7 @@
     return false;
   }
 
-  public LispObject ODDP()
+  public final LispObject ODDP()
   {
     return oddp() ? T : NIL;
   }
@@ -292,7 +292,7 @@
     return false;
   }
 
-  public LispObject PLUSP()
+  public final LispObject PLUSP()
   {
     return plusp() ? T : NIL;
   }
@@ -304,7 +304,7 @@
     return false;
   }
 
-  public LispObject MINUSP()
+  public final LispObject MINUSP()
   {
     return minusp() ? T : NIL;
   }
@@ -316,9 +316,9 @@
     return false;
   }
 
-  public LispObject NUMBERP()
+  public final LispObject NUMBERP()
   {
-    return NIL;
+    return numberp() ? T : NIL;
   }
 
   public boolean numberp()
@@ -326,7 +326,7 @@
     return false;
   }
 
-  public LispObject ZEROP()
+  public final LispObject ZEROP()
   {
     return zerop() ? T : NIL;
   }
@@ -343,9 +343,9 @@
     return NIL;
   }
 
-  public LispObject FLOATP()
+  public final LispObject FLOATP()
   {
-    return NIL;
+    return floatp() ? T : NIL;
   }
 
   public boolean floatp()
@@ -353,9 +353,9 @@
     return false;
   }
 
-  public LispObject INTEGERP()
+  public final LispObject INTEGERP()
   {
-    return NIL;
+    return integerp() ? T : NIL;
   }
 
   public boolean integerp()
@@ -363,7 +363,7 @@
     return false;
   }
 
-  public LispObject RATIONALP()
+  public final LispObject RATIONALP()
   {
     return rationalp() ? T : NIL;
   }
@@ -373,7 +373,7 @@
     return false;
   }
 
-  public LispObject REALP()
+  public final LispObject REALP()
   {
     return realp() ? T : NIL;
   }
@@ -383,9 +383,9 @@
     return false;
   }
 
-  public LispObject STRINGP()
+  public final LispObject STRINGP()
   {
-    return NIL;
+    return stringp() ? T : NIL;
   }
 
   public boolean stringp()
@@ -398,9 +398,9 @@
     return NIL;
   }
 
-  public LispObject VECTORP()
+  public final LispObject VECTORP()
   {
-    return NIL;
+    return vectorp() ? T : NIL;
   }
 
   public boolean vectorp()
@@ -408,9 +408,9 @@
     return false;
   }
 
-  public LispObject CHARACTERP()
+  public final LispObject CHARACTERP()
   {
-    return NIL;
+    return characterp() ? T : NIL;
   }
 
   public boolean characterp()
@@ -555,9 +555,9 @@
     return false;
   }
 
-  public LispObject LISTP()
+  public final LispObject LISTP()
   {
-    return NIL;
+    return listp() ? T : NIL;
   }
 
   public boolean endp()
@@ -567,9 +567,9 @@
     return false;
   }
 
-  public LispObject ENDP()
+  public final LispObject ENDP()
   {
-    return type_error(this, Symbol.LIST);
+    return endp() ? T : NIL;
   }
 
   public LispObject NOT()
@@ -880,7 +880,7 @@
     return false;
   }
 
-  public LispObject IS_E(LispObject obj)
+  public final LispObject IS_E(LispObject obj)
   {
     return isEqualTo(obj) ? T : NIL;
   }
@@ -897,7 +897,7 @@
     return false;
   }
 
-  public LispObject IS_NE(LispObject obj)
+  public final LispObject IS_NE(LispObject obj)
   {
     return isNotEqualTo(obj) ? T : NIL;
   }
@@ -914,7 +914,7 @@
     return false;
   }
 
-  public LispObject IS_LT(LispObject obj)
+  public final LispObject IS_LT(LispObject obj)
   {
     return isLessThan(obj) ? T : NIL;
   }
@@ -931,7 +931,7 @@
     return false;
   }
 
-  public LispObject IS_GT(LispObject obj)
+  public final LispObject IS_GT(LispObject obj)
   {
     return isGreaterThan(obj) ? T : NIL;
   }
@@ -948,7 +948,7 @@
     return false;
   }
 
-  public LispObject IS_LE(LispObject obj)
+  public final LispObject IS_LE(LispObject obj)
   {
     return isLessThanOrEqualTo(obj) ? T : NIL;
   }
@@ -965,7 +965,7 @@
     return false;
   }
 
-  public LispObject IS_GE(LispObject obj)
+  public final LispObject IS_GE(LispObject obj)
   {
     return isGreaterThanOrEqualTo(obj) ? T : NIL;
   }

Modified: trunk/abcl/src/org/armedbear/lisp/Nil.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Nil.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Nil.java	Sun Nov 29 14:38:53 2009
@@ -200,24 +200,12 @@
     }
 
     @Override
-    public LispObject LISTP()
-    {
-        return T;
-    }
-
-    @Override
     public boolean endp()
     {
         return true;
     }
 
     @Override
-    public LispObject ENDP()
-    {
-        return T;
-    }
-
-    @Override
     public LispObject NOT()
     {
         return T;

Modified: trunk/abcl/src/org/armedbear/lisp/Ratio.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Ratio.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Ratio.java	Sun Nov 29 14:38:53 2009
@@ -97,12 +97,6 @@
     }
 
     @Override
-    public LispObject NUMBERP()
-    {
-        return T;
-    }
-
-    @Override
     public boolean numberp()
     {
         return true;

Modified: trunk/abcl/src/org/armedbear/lisp/SingleFloat.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SingleFloat.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/SingleFloat.java	Sun Nov 29 14:38:53 2009
@@ -106,12 +106,6 @@
     }
 
     @Override
-    public LispObject NUMBERP()
-    {
-        return T;
-    }
-
-    @Override
     public boolean numberp()
     {
         return true;
@@ -212,12 +206,6 @@
     }
 
     @Override
-    public LispObject FLOATP()
-    {
-        return T;
-    }
-
-    @Override
     public boolean floatp()
     {
         return true;




More information about the armedbear-cvs mailing list