[armedbear-cvs] r12467 - branches/metaclass/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Sun Feb 14 07:13:32 UTC 2010
Author: ehuelsmann
Date: Sun Feb 14 02:13:28 2010
New Revision: 12467
Log:
Convert CLASS-PRECEDENCE-LIST of STANDARD-CLASS to a slot.
Modified:
branches/metaclass/abcl/src/org/armedbear/lisp/LispClass.java
branches/metaclass/abcl/src/org/armedbear/lisp/StandardClass.java
Modified: branches/metaclass/abcl/src/org/armedbear/lisp/LispClass.java
==============================================================================
--- branches/metaclass/abcl/src/org/armedbear/lisp/LispClass.java (original)
+++ branches/metaclass/abcl/src/org/armedbear/lisp/LispClass.java Sun Feb 14 02:13:28 2010
@@ -227,12 +227,12 @@
this.directSubclasses = directSubclasses;
}
- public final LispObject getCPL()
+ public LispObject getCPL()
{
return classPrecedenceList;
}
- public final void setCPL(LispObject... cpl)
+ public void setCPL(LispObject... cpl)
{
LispObject obj1 = cpl[0];
if (obj1 instanceof Cons && cpl.length == 1)
Modified: branches/metaclass/abcl/src/org/armedbear/lisp/StandardClass.java
==============================================================================
--- branches/metaclass/abcl/src/org/armedbear/lisp/StandardClass.java (original)
+++ branches/metaclass/abcl/src/org/armedbear/lisp/StandardClass.java Sun Feb 14 02:13:28 2010
@@ -44,7 +44,8 @@
= PACKAGE_MOP.intern("DIRECT-SUPERCLASSES");
private static Symbol symDirectSubclasses
= PACKAGE_MOP.intern("DIRECT-SUBCLASSES");
-
+ private static Symbol symClassPrecedenceList
+ = PACKAGE_MOP.intern("CLASS-PRECEDENCE-LIST");
static Layout layoutStandardClass =
new Layout(null,
@@ -52,7 +53,7 @@
symLayout,
symDirectSuperclasses,
symDirectSubclasses,
- PACKAGE_MOP.intern("CLASS-PRECEDENCE-LIST"),
+ symClassPrecedenceList,
PACKAGE_MOP.intern("DIRECT-METHODS"),
PACKAGE_MOP.intern("DOCUMENTATION"),
PACKAGE_MOP.intern("DIRECT-SLOTS"),
@@ -73,6 +74,10 @@
super(layoutStandardClass);
setDirectSuperclasses(NIL);
setDirectSubclasses(NIL);
+
+ // because of the assert below, we need to set the slot directly
+ // and can't use setCPL()
+ setInstanceSlotValue(symClassPrecedenceList, NIL);
}
public StandardClass(Symbol symbol, LispObject directSuperclasses)
@@ -80,6 +85,10 @@
super(layoutStandardClass,
symbol, directSuperclasses);
setDirectSubclasses(NIL);
+
+ // because of the assert below, we need to set the slot directly
+ // and can't use setCPL()
+ setInstanceSlotValue(symClassPrecedenceList, NIL);
}
@Override
@@ -131,6 +140,28 @@
setInstanceSlotValue(symDirectSubclasses, directSubclasses);
}
+ @Override
+ public LispObject getCPL()
+ {
+ return getInstanceSlotValue(symClassPrecedenceList);
+ }
+
+ @Override
+ public void setCPL(LispObject... cpl)
+ {
+ LispObject obj1 = cpl[0];
+ if (obj1 instanceof Cons && cpl.length == 1)
+ setInstanceSlotValue(symClassPrecedenceList, obj1);
+ else
+ {
+ Debug.assertTrue(obj1 == this);
+ LispObject l = NIL;
+ for (int i = cpl.length; i-- > 0;)
+ l = new Cons(cpl[i], l);
+ setInstanceSlotValue(symClassPrecedenceList, l);
+ }
+ }
+
@Override
More information about the armedbear-cvs
mailing list