Changeset 3978


Ignore:
Timestamp:
09/21/03 19:48:51 (20 years ago)
Author:
piso
Message:

SYS::CLASS-PRECEDENCE-LIST

File:
1 edited

Legend:

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

    r3976 r3978  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: LispClass.java,v 1.24 2003-09-21 19:32:34 piso Exp $
     5 * $Id: LispClass.java,v 1.25 2003-09-21 19:48:51 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4444    protected final Symbol symbol;
    4545    private LispObject directSuperclasses;
    46     private LispObject classPrecendenceList;
     46    private LispObject classPrecedenceList = NIL;
    4747
    4848    protected LispClass(Symbol symbol)
     
    8181    public final LispObject getCPL()
    8282    {
    83         return classPrecendenceList;
     83        return classPrecedenceList;
    8484    }
    8585
     
    8787    {
    8888        Debug.assertTrue(obj1 == this);
    89         classPrecendenceList = new Cons(obj1);
     89        classPrecedenceList = new Cons(obj1);
    9090    }
    9191
     
    9393    {
    9494        Debug.assertTrue(obj1 == this);
    95         classPrecendenceList = list2(obj1, obj2);
     95        classPrecedenceList = list2(obj1, obj2);
    9696    }
    9797
     
    9999    {
    100100        Debug.assertTrue(obj1 == this);
    101         classPrecendenceList = list3(obj1, obj2, obj3);
     101        classPrecedenceList = list3(obj1, obj2, obj3);
    102102    }
    103103
     
    106106    {
    107107        Debug.assertTrue(obj1 == this);
    108         classPrecendenceList = list4(obj1, obj2, obj3, obj4);
     108        classPrecedenceList = list4(obj1, obj2, obj3, obj4);
    109109    }
    110110
     
    113113    {
    114114        Debug.assertTrue(obj1 == this);
    115         classPrecendenceList = list5(obj1, obj2, obj3, obj4, obj5);
     115        classPrecedenceList = list5(obj1, obj2, obj3, obj4, obj5);
    116116    }
    117117
     
    120120    {
    121121        Debug.assertTrue(obj1 == this);
    122         classPrecendenceList = list6(obj1, obj2, obj3, obj4, obj5, obj6);
     122        classPrecedenceList = list6(obj1, obj2, obj3, obj4, obj5, obj6);
    123123    }
    124124
     
    128128    {
    129129        Debug.assertTrue(obj1 == this);
    130         classPrecendenceList = list7(obj1, obj2, obj3, obj4, obj5, obj6, obj7);
     130        classPrecedenceList = list7(obj1, obj2, obj3, obj4, obj5, obj6, obj7);
    131131    }
    132132
     
    190190    };
    191191
     192    private static final Primitive1 CLASS_PRECEDENCE_LIST =
     193        new Primitive1("class-precedence-list", PACKAGE_SYS, false)
     194    {
     195        public LispObject execute(LispObject arg) throws ConditionThrowable
     196        {
     197            if (arg instanceof LispClass)
     198                return ((LispClass)arg).getCPL();
     199            throw new ConditionThrowable(new TypeError(arg, "class"));
     200        }
     201    };
     202
    192203    private static final Primitive1 CLASSP =
    193204        new Primitive1("classp", PACKAGE_SYS, false)
Note: See TracChangeset for help on using the changeset viewer.