Changeset 4283


Ignore:
Timestamp:
10/10/03 14:21:55 (20 years ago)
Author:
piso
Message:

CLASS-SLOTS
%SET-CLASS-SLOTS

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/Autoload.java

    r4249 r4283  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Autoload.java,v 1.83 2003-10-07 17:23:21 piso Exp $
     5 * $Id: Autoload.java,v 1.84 2003-10-10 14:21:55 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    188188        autoload("copy-structure", "StructureObject");
    189189        autoload("delete-package", "PackageFunctions");
     190        autoload("describe", "describe");
    190191        autoload("directory-namestring", "Pathname");
    191         autoload("describe", "describe");
    192192        autoload("file-write-date", "Time");
    193193        autoload("find-class", "LispClass");
     
    252252        autoload(PACKAGE_SYS, "%open-input-file", "open");
    253253        autoload(PACKAGE_SYS, "%open-output-file", "open");
     254        autoload(PACKAGE_SYS, "%set-class-slots", "StandardClass");
    254255        autoload(PACKAGE_SYS, "%string-capitalize", "StringFunctions");
    255256        autoload(PACKAGE_SYS, "%string-downcase", "StringFunctions");
     
    276277        autoload(PACKAGE_SYS, "%structure-set-2", "StructureObject");
    277278        autoload(PACKAGE_SYS, "%time", "Time");
     279        autoload(PACKAGE_SYS, "class-slots", "StandardClass");
    278280        autoload(PACKAGE_SYS, "default-time-zone", "Time");
    279281        autoload(PACKAGE_SYS, "hash-table-entries", "HashTable");
  • trunk/j/src/org/armedbear/lisp/StandardClass.java

    r4111 r4283  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: StandardClass.java,v 1.6 2003-09-28 19:34:28 piso Exp $
     5 * $Id: StandardClass.java,v 1.7 2003-10-10 14:18:24 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class StandardClass extends LispClass
    2525{
     26    private LispObject directSlots;
     27    private LispObject effectiveSlots;
     28    private LispObject directSubclasses;
     29    private LispObject directMethods;
     30
     31    public StandardClass()
     32    {
     33    }
     34
    2635    public StandardClass(Symbol symbol, LispObject directSuperclasses)
    2736    {
     
    5665    }
    5766
    58     // ### make-instance-standard-class
    59     // make-instance-standard-class name all-keys => class
    60     private static final Primitive2 MAKE_INSTANCE_STANDARD_CLASS =
    61         new Primitive2("make-instance-standard-class", PACKAGE_SYS, false)
     67    // ### class-slots
     68    private static final Primitive1 CLASS_SLOTS =
     69        new Primitive1("class-slots", PACKAGE_SYS, false)
     70    {
     71        public LispObject execute(LispObject arg)
     72            throws ConditionThrowable
     73        {
     74            if (arg instanceof StandardClass)
     75                return ((StandardClass)arg).effectiveSlots;
     76            if (arg == BuiltInClass.STANDARD_CLASS)
     77                return NIL; // FIXME
     78            throw new ConditionThrowable(new TypeError(arg, "standard class"));
     79        }
     80    };
     81
     82    // ### %set-class-slots
     83    private static final Primitive2 _SET_CLASS_SLOTS =
     84        new Primitive2("%set-class-slots", PACKAGE_SYS, false)
    6285    {
    6386        public LispObject execute(LispObject first, LispObject second)
    6487            throws ConditionThrowable
    6588        {
    66             Symbol symbol = checkSymbol(first);
    67             LispObject directSuperclasses = NIL;
    68             LispObject allKeys = second;
    69             while (allKeys != NIL) {
    70                 LispObject key = allKeys.car();
    71                 LispObject value = allKeys.cadr();
    72                 if (key == Keyword.DIRECT_SUPERCLASSES)
    73                     directSuperclasses = value;
    74                 allKeys = allKeys.cddr();
     89            if (first instanceof StandardClass) {
     90                ((StandardClass)first).effectiveSlots = second;
     91                return second;
    7592            }
    76             return new StandardClass(symbol, directSuperclasses);
     93            throw new ConditionThrowable(new TypeError(first, "standard class"));
    7794        }
    7895    };
Note: See TracChangeset for help on using the changeset viewer.