Changeset 13947


Ignore:
Timestamp:
05/24/12 17:50:29 (9 years ago)
Author:
rschlatte
Message:

change slot names to avoid symbols from CL

  • The mop-feature-tests suite tells us that using symbols from the CL package is not allowed. This means slots named DOCUMENTATION, TYPE, FUNCTION, GENERIC-FUNCTION, METHOD-COMBINATION, SLOT-DEFINITION need to be renamed.
  • Decreases missing standard features (as reported by mop-feature-tests) from 52 to 41.
Location:
trunk/abcl/src/org/armedbear/lisp
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Primitives.java

    r13942 r13947  
    55625562                return ((LispClass)arg).getDocumentation();
    55635563            else
    5564                 return ((StandardObject)arg).getInstanceSlotValue(Symbol.DOCUMENTATION);
     5564                return ((StandardObject)arg).getInstanceSlotValue(Symbol._DOCUMENTATION);
    55655565        }
    55665566    };
     
    55805580                ((LispClass)first).setDocumentation(second);
    55815581            else
    5582                 ((StandardObject)first).setInstanceSlotValue(Symbol.DOCUMENTATION, second);
     5582                ((StandardObject)first).setInstanceSlotValue(Symbol._DOCUMENTATION, second);
    55835583            return second;
    55845584        }
  • trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java

    r13897 r13947  
    105105  }
    106106
     107  public SlotDefinition(LispObject name, LispObject readers,
     108                        Function initFunction, LispObject initargs)
     109  {
     110    this();
     111    Debug.assertTrue(name instanceof Symbol);
     112    slots[SlotDefinitionClass.SLOT_INDEX_NAME] = name;
     113    slots[SlotDefinitionClass.SLOT_INDEX_INITFUNCTION] = initFunction;
     114    slots[SlotDefinitionClass.SLOT_INDEX_INITFORM] = NIL;
     115    slots[SlotDefinitionClass.SLOT_INDEX_INITARGS] = initargs;
     116    slots[SlotDefinitionClass.SLOT_INDEX_READERS] = readers;
     117    slots[SlotDefinitionClass.SLOT_INDEX_ALLOCATION] = Keyword.INSTANCE;
     118  }
     119
    107120  public static StandardObject checkSlotDefinition(LispObject obj) {
    108121          if (obj instanceof StandardObject) return (StandardObject)obj;
     
    279292  };
    280293
    281   private static final Primitive SET_SLOT_DEFINITION_INITARGS
     294  static final Primitive SET_SLOT_DEFINITION_INITARGS
    282295    = new pf_set_slot_definition_initargs();
    283296  @DocString(name="set-slot-definition-initargs",
  • trunk/abcl/src/org/armedbear/lisp/SlotDefinitionClass.java

    r13897 r13947  
    6767            pkg.intern("ALLOCATION-CLASS"),
    6868            pkg.intern("LOCATION"),
    69             Symbol.TYPE,
    70             Symbol.DOCUMENTATION
     69            Symbol._TYPE,
     70            Symbol._DOCUMENTATION
    7171        };
    7272        setClassLayout(new Layout(this, instanceSlotNames, NIL));
     
    7979        // in its constructor; here we make Lisp-side subclasses of
    8080        // standard-*-slot-definition do the same.
    81         LispObject locationSlot = slotDefinitions.nthcdr(8).car();
     81        LispObject locationSlot = slotDefinitions.nthcdr(SLOT_INDEX_LOCATION).car();
    8282        SlotDefinition.SET_SLOT_DEFINITION_INITFORM.execute(locationSlot, NIL);
    8383        SlotDefinition.SET_SLOT_DEFINITION_INITFUNCTION.execute(locationSlot, StandardClass.constantlyNil);
    8484        setDirectSlotDefinitions(slotDefinitions);
    8585        setSlotDefinitions(slotDefinitions);
     86        // Fix initargs of TYPE, DOCUMENTATION slots.
     87        LispObject typeSlot = slotDefinitions.nthcdr(SLOT_INDEX_TYPE).car();
     88        SlotDefinition.SET_SLOT_DEFINITION_INITARGS.execute(typeSlot, list(internKeyword("TYPE")));
     89        LispObject documentationSlot = slotDefinitions.nthcdr(SLOT_INDEX_DOCUMENTATION).car();
     90        SlotDefinition.SET_SLOT_DEFINITION_INITARGS.execute(documentationSlot, list(internKeyword("DOCUMENTATION")));
    8691
    8792        setFinalized(true);
  • trunk/abcl/src/org/armedbear/lisp/StandardClass.java

    r13871 r13947  
    8484                      symDefaultInitargs,
    8585                      symFinalizedP,
    86                       Symbol.DOCUMENTATION),
     86                      Symbol._DOCUMENTATION),
    8787                 NIL)
    8888      {
     
    107107                      symDefaultInitargs,
    108108                      symFinalizedP,
    109                       Symbol.DOCUMENTATION),
     109                      Symbol._DOCUMENTATION),
    110110                 NIL)
    111111      {
     
    293293  public LispObject getDocumentation()
    294294  {
    295     return getInstanceSlotValue(Symbol.DOCUMENTATION);
     295    return getInstanceSlotValue(Symbol._DOCUMENTATION);
    296296  }
    297297
     
    299299  public void setDocumentation(LispObject doc)
    300300  {
    301     setInstanceSlotValue(Symbol.DOCUMENTATION, doc);
     301    setInstanceSlotValue(Symbol._DOCUMENTATION, doc);
    302302  }
    303303
     
    413413             helperMakeSlotDefinition("DEFAULT-INITARGS", constantlyNil),
    414414             helperMakeSlotDefinition("FINALIZED-P", constantlyNil),
    415              helperMakeSlotDefinition("DOCUMENTATION", constantlyNil));
     415             new SlotDefinition(Symbol._DOCUMENTATION,
     416                                list(PACKAGE_MOP.intern("CLASS-DOCUMENTATION")),
     417                                constantlyNil, list(internKeyword("DOCUMENTATION"))));
    416418  }
    417419
     
    740742                           BuiltInClass.CLASS_T);
    741743    STANDARD_METHOD.setDirectSlotDefinitions(
    742       list(new SlotDefinition(Symbol.GENERIC_FUNCTION, NIL, constantlyNil),
     744      list(new SlotDefinition(Symbol._GENERIC_FUNCTION, NIL, constantlyNil,
     745                              list(internKeyword("GENERIC-FUNCTION"))),
    743746           new SlotDefinition(Symbol.LAMBDA_LIST, NIL, constantlyNil),
    744747           new SlotDefinition(Symbol.KEYWORDS, NIL, constantlyNil),
     
    746749           new SlotDefinition(Symbol.SPECIALIZERS, NIL, constantlyNil),
    747750           new SlotDefinition(Symbol.QUALIFIERS, NIL, constantlyNil),
    748            new SlotDefinition(Symbol.FUNCTION, NIL, constantlyNil),
     751           new SlotDefinition(Symbol._FUNCTION, NIL, constantlyNil,
     752                              list(internKeyword("FUNCTION"))),
    749753           new SlotDefinition(Symbol.FAST_FUNCTION, NIL, constantlyNil),
    750            new SlotDefinition(Symbol.DOCUMENTATION, NIL, constantlyNil)));
     754           new SlotDefinition(Symbol._DOCUMENTATION, NIL, constantlyNil,
     755                              list(internKeyword("DOCUMENTATION")))));
    751756    STANDARD_ACCESSOR_METHOD.setCPL(STANDARD_ACCESSOR_METHOD, STANDARD_METHOD,
    752757                                    METHOD, METAOBJECT, STANDARD_OBJECT,
    753758                                    BuiltInClass.CLASS_T);
    754759    STANDARD_ACCESSOR_METHOD.setDirectSlotDefinitions(
    755       list(new SlotDefinition(Symbol.SLOT_DEFINITION, NIL)));
     760      list(new SlotDefinition(Symbol._SLOT_DEFINITION, NIL, constantlyNil,
     761                              list(internKeyword("SLOT-DEFINITION")))));
    756762    STANDARD_READER_METHOD.setCPL(STANDARD_READER_METHOD,
    757763                                  STANDARD_ACCESSOR_METHOD, STANDARD_METHOD,
     
    768774                              list(Symbol.METHOD_COMBINATION_NAME),
    769775                              constantlyNil),
    770            new SlotDefinition(Symbol.DOCUMENTATION,
     776           new SlotDefinition(Symbol._DOCUMENTATION,
    771777                              list(Symbol.METHOD_COMBINATION_DOCUMENTATION),
    772                               constantlyNil)));
     778                              constantlyNil, list(internKeyword("DOCUMENTATION")))));
    773779    SHORT_METHOD_COMBINATION.setCPL(SHORT_METHOD_COMBINATION,
    774780                                    METHOD_COMBINATION, METAOBJECT,
  • trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java

    r13888 r13947  
    9494    StandardObject method
    9595        = (StandardObject)StandardClass.STANDARD_METHOD.allocateInstance();
    96     method.setInstanceSlotValue(Symbol.GENERIC_FUNCTION, this);
     96    method.setInstanceSlotValue(Symbol._GENERIC_FUNCTION, this);
    9797    method.setInstanceSlotValue(Symbol.LAMBDA_LIST, lambdaList);
    9898    method.setInstanceSlotValue(Symbol.KEYWORDS, NIL);
     
    104104    // removed for the implementation of subclassable standard-method).
    105105    // (rudi 2012-01-27)
    106     method.setInstanceSlotValue(Symbol.FUNCTION, NIL);
     106    method.setInstanceSlotValue(Symbol._FUNCTION, NIL);
    107107    method.setInstanceSlotValue(Symbol.FAST_FUNCTION, function);
    108     method.setInstanceSlotValue(Symbol.DOCUMENTATION, NIL);
     108    method.setInstanceSlotValue(Symbol._DOCUMENTATION, NIL);
    109109    slots[StandardGenericFunctionClass.SLOT_INDEX_METHODS] =
    110110      list(method);
  • trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java

    r13871 r13947  
    6464        pkg.intern("METHODS"),
    6565        pkg.intern("METHOD-CLASS"),
    66         pkg.intern("METHOD-COMBINATION"),
     66        pkg.intern("%METHOD-COMBINATION"),
    6767        pkg.intern("ARGUMENT-PRECEDENCE-ORDER"),
    6868        pkg.intern("CLASSES-TO-EMF-TABLE"),
    69         Symbol.DOCUMENTATION
     69        Symbol._DOCUMENTATION
    7070      };
    7171    setClassLayout(new Layout(this, instanceSlotNames, NIL));
  • trunk/abcl/src/org/armedbear/lisp/Symbol.java

    r13814 r13947  
    31633163    PACKAGE_SYS.addInternalSymbol("FORMAT-CONTROL");
    31643164  public static final Symbol FSET = PACKAGE_SYS.addInternalSymbol("FSET");
     3165  public static final Symbol _FUNCTION =
     3166    PACKAGE_SYS.addInternalSymbol("%FUNCTION");
    31653167  public static final Symbol FUNCTION_PRELOAD =
    31663168    PACKAGE_SYS.addInternalSymbol("FUNCTION-PRELOAD");
     3169  public static final Symbol _GENERIC_FUNCTION =
     3170    PACKAGE_SYS.addInternalSymbol("%GENERIC-FUNCTION");
    31673171  public static final Symbol INSTANCE =
    31683172    PACKAGE_SYS.addInternalSymbol("INSTANCE");
     
    31853189  public static final Symbol QUALIFIERS =
    31863190    PACKAGE_SYS.addInternalSymbol("QUALIFIERS");
     3191  public static final Symbol _SLOT_DEFINITION =
     3192    PACKAGE_SYS.addInternalSymbol("%SLOT-DEFINITION");
    31873193  public static final Symbol _SOURCE =
    31883194    PACKAGE_SYS.addInternalSymbol("%SOURCE");
     
    31993205  public static final Symbol STACK_FRAME =
    32003206    PACKAGE_SYS.addInternalSymbol("STACK-FRAME");
     3207  public static final Symbol _TYPE =
     3208    PACKAGE_SYS.addInternalSymbol("%TYPE");
    32013209  public static final Symbol LISP_STACK_FRAME =
    32023210    PACKAGE_SYS.addInternalSymbol("LISP-STACK-FRAME");
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r13939 r13947  
    211211                      funcallable-standard-class))))
    212212(fixup-standard-class-hierarchy)
    213 
    214213
    215214(defun no-applicable-method (generic-function &rest args)
     
    870869  (let ((instance (std-allocate-instance (find-class 'long-method-combination))))
    871870    (setf (std-slot-value instance 'sys::name) name)
    872     (setf (std-slot-value instance 'documentation) documentation)
     871    (setf (std-slot-value instance 'sys:%documentation) documentation)
    873872    (setf (std-slot-value instance 'sys::lambda-list) lambda-list)
    874873    (setf (std-slot-value instance 'method-group-specs) method-group-specs)
     
    888887(defun method-combination-documentation (method-combination)
    889888  (check-type method-combination method-combination)
    890   (std-slot-value method-combination 'documentation))
     889  (std-slot-value method-combination 'sys:%documentation))
    891890
    892891(defun short-method-combination-operator (method-combination)
     
    944943                        (find-class 'short-method-combination))))
    945944         (setf (std-slot-value instance 'sys::name) ',name)
    946          (setf (std-slot-value instance 'documentation) ',documentation)
     945         (setf (std-slot-value instance 'sys:%documentation) ',documentation)
    947946         (setf (std-slot-value instance 'operator) ',operator)
    948947         (setf (std-slot-value instance 'identity-with-one-argument)
     
    12781277
    12791278(defun std-method-function (method)
    1280   (std-slot-value method 'cl:function))
     1279  (std-slot-value method 'sys::%function))
    12811280
    12821281(defun std-method-generic-function (method)
    1283   (std-slot-value method 'cl:generic-function))
     1282  (std-slot-value method 'sys::%generic-function))
    12841283
    12851284(defun std-method-specializers (method)
     
    12901289
    12911290(defun std-accessor-method-slot-definition (accessor-method)
    1292   (std-slot-value accessor-method 'sys:slot-definition))
     1291  (std-slot-value accessor-method 'sys::%slot-definition))
    12931292
    12941293;;; Additional method readers
     
    13731372
    13741373(defun method-documentation (method)
    1375   (std-slot-value method 'documentation))
     1374  (std-slot-value method 'sys:%documentation))
    13761375
    13771376(defun (setf method-documentation) (new-value method)
    1378   (setf (std-slot-value method 'documentation) new-value))
     1377  (setf (std-slot-value method 'sys:%documentation) new-value))
    13791378
    13801379;;; defgeneric
     
    18701869          (canonicalize-specializers specializers))
    18711870    (setf (method-documentation method) documentation)
    1872     (setf (std-slot-value method 'generic-function) nil) ; set by add-method
    1873     (setf (std-slot-value method 'function) function)
     1871    (setf (std-slot-value method 'sys::%generic-function) nil) ; set by add-method
     1872    (setf (std-slot-value method 'sys::%function) function)
    18741873    (setf (std-slot-value method 'sys::fast-function) fast-function)
    18751874    (setf (std-slot-value method 'sys::keywords) (getf analyzed-args :keywords))
     
    19041903    (when old-method
    19051904      (std-remove-method gf old-method)))
    1906   (setf (std-slot-value method 'generic-function) gf)
     1905  (setf (std-slot-value method 'sys::%generic-function) gf)
    19071906  (push method (generic-function-methods gf))
    19081907  (dolist (specializer (method-specializers method))
     
    19141913  (setf (generic-function-methods gf)
    19151914        (remove method (generic-function-methods gf)))
    1916   (setf (std-slot-value method 'generic-function) nil)
     1915  (setf (std-slot-value method 'sys::%generic-function) nil)
    19171916  (dolist (specializer (method-specializers method))
    19181917    (remove-direct-method specializer method))
     
    25672566          (canonicalize-specializers specializers))
    25682567    (setf (method-documentation method) documentation)
    2569     (setf (std-slot-value method 'generic-function) nil)
    2570     (setf (std-slot-value method 'function) function)
     2568    (setf (std-slot-value method 'sys::%generic-function) nil)
     2569    (setf (std-slot-value method 'sys::%function) function)
    25712570    (setf (std-slot-value method 'sys::fast-function) fast-function)
    2572     (setf (std-slot-value method 'sys:slot-definition) slot-definition)
     2571    (setf (std-slot-value method 'sys::%slot-definition) slot-definition)
    25732572    (setf (std-slot-value method 'sys::keywords) nil)
    25742573    (setf (std-slot-value method 'sys::other-keywords-p) nil)
     
    36803679    (slot-definition-dispatch slot-definition
    36813680      (%slot-definition-type slot-definition)
    3682       (slot-value slot-definition 'cl:type))))
     3681      (slot-value slot-definition 'sys::%type))))
    36833682
    36843683(atomic-defgeneric (setf slot-definition-type) (value slot-definition)
     
    36863685    (slot-definition-dispatch slot-definition
    36873686      (set-slot-definition-type slot-definition value)
    3688       (setf (slot-value slot-definition 'cl:type) value))))
     3687      (setf (slot-value slot-definition 'sys::%type) value))))
    36893688
    36903689(atomic-defgeneric slot-definition-documentation (slot-definition)
     
    36923691    (slot-definition-dispatch slot-definition
    36933692      (%slot-definition-documentation slot-definition)
    3694       (slot-value slot-definition 'cl:documentation))))
     3693      (slot-value slot-definition 'sys:%documentation))))
    36953694
    36963695(atomic-defgeneric (setf slot-definition-documentation) (value slot-definition)
     
    36983697    (slot-definition-dispatch slot-definition
    36993698      (set-slot-definition-documentation slot-definition value)
    3700       (setf (slot-value slot-definition 'cl:documentation) value))))
     3699      (setf (slot-value slot-definition 'sys:%documentation) value))))
    37013700
    37023701
Note: See TracChangeset for help on using the changeset viewer.