[armedbear-cvs] r12598 - trunk/abcl/src/org/armedbear/lisp
Ville Voutilainen
vvoutilainen at common-lisp.net
Sat Apr 10 21:03:13 UTC 2010
Author: vvoutilainen
Date: Sat Apr 10 17:03:12 2010
New Revision: 12598
Log:
Make listp/endp/SYMBOLP final.
Modified:
trunk/abcl/src/org/armedbear/lisp/Cons.java
trunk/abcl/src/org/armedbear/lisp/LispObject.java
trunk/abcl/src/org/armedbear/lisp/Nil.java
trunk/abcl/src/org/armedbear/lisp/Symbol.java
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 Sat Apr 10 17:03:12 2010
@@ -330,18 +330,6 @@
}
@Override
- public final boolean listp()
- {
- return true;
- }
-
- @Override
- public final boolean endp()
- {
- return false;
- }
-
- @Override
public final LispObject[] copyToArray()
{
final int length = length();
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 Sat Apr 10 17:03:12 2010
@@ -593,14 +593,14 @@
return null;
}
- public LispObject SYMBOLP()
+ public final LispObject SYMBOLP()
{
- return NIL;
+ return (this instanceof Symbol) ? T : NIL;
}
- public boolean listp()
+ public final boolean listp()
{
- return false;
+ return (this instanceof Cons) || (this instanceof Nil);
}
public final LispObject LISTP()
@@ -608,8 +608,12 @@
return listp() ? T : NIL;
}
- public boolean endp()
+ public final boolean endp()
{
+ if (this instanceof Cons)
+ return false;
+ else if (this instanceof Nil)
+ return true;
type_error(this, Symbol.LIST);
// Not reached.
return false;
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 Sat Apr 10 17:03:12 2010
@@ -146,18 +146,6 @@
}
@Override
- public boolean listp()
- {
- return true;
- }
-
- @Override
- public boolean endp()
- {
- return true;
- }
-
- @Override
public LispObject NOT()
{
return T;
Modified: trunk/abcl/src/org/armedbear/lisp/Symbol.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Symbol.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/Symbol.java Sat Apr 10 17:03:12 2010
@@ -168,12 +168,6 @@
}
@Override
- public final LispObject SYMBOLP()
- {
- return T;
- }
-
- @Override
public boolean constantp()
{
return (flags & FLAG_CONSTANT) != 0;
More information about the armedbear-cvs
mailing list