Changeset 4288


Ignore:
Timestamp:
10/10/03 17:03:17 (19 years ago)
Author:
piso
Message:

CLASS-DIRECT-SUBCLASSES

File:
1 edited

Legend:

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

    r4284 r4288  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: LispClass.java,v 1.30 2003-10-10 14:46:21 piso Exp $
     5 * $Id: LispClass.java,v 1.31 2003-10-10 17:03:17 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4444    protected Symbol symbol;
    4545    private LispObject directSuperclasses;
     46    private LispObject directSubclasses;
    4647    private LispObject classPrecedenceList = NIL;
    4748
     
    8182    {
    8283        directSuperclasses = new Cons(superclass);
     84    }
     85
     86    public final LispObject getDirectSubclasses()
     87    {
     88        return directSubclasses;
     89    }
     90
     91    public final void setDirectSubclasses(LispObject directSubclasses)
     92    {
     93        this.directSubclasses = directSubclasses;
    8394    }
    8495
     
    268279    };
    269280
     281    // ### class-direct-subclasses
     282    private static final Primitive1 CLASS_DIRECT_SUBCLASSES =
     283        new Primitive1("class-direct-subclasses", PACKAGE_SYS, false)
     284    {
     285        public LispObject execute(LispObject arg) throws ConditionThrowable
     286        {
     287            if (arg instanceof LispClass)
     288                return ((LispClass)arg).getDirectSubclasses();
     289            throw new ConditionThrowable(new TypeError(arg, "class"));
     290        }
     291    };
     292
     293    // ### %set-class-direct-subclasses
     294    private static final Primitive2 _SET_CLASS_DIRECT_SUBCLASSES =
     295        new Primitive2("%set-class-direct-subclasses", PACKAGE_SYS, false)
     296    {
     297        public LispObject execute(LispObject first, LispObject second)
     298            throws ConditionThrowable
     299        {
     300            if (first instanceof LispClass) {
     301                ((LispClass)first).setDirectSubclasses(second);
     302                return second;
     303            }
     304            throw new ConditionThrowable(new TypeError(first, "class"));
     305        }
     306    };
     307
    270308    // ### class-precedence-list
    271309    private static final Primitive1 CLASS_PRECEDENCE_LIST =
     
    280318    };
    281319
     320    // ### %set-class-precedence-list
     321    private static final Primitive1 _SET_CLASS_PRECEDENCE_LIST =
     322        new Primitive1("%set-class-precedence-list", PACKAGE_SYS, false)
     323    {
     324        public LispObject execute(LispObject first, LispObject second)
     325            throws ConditionThrowable
     326        {
     327            if (first instanceof LispClass) {
     328                ((LispClass)first).classPrecedenceList = second;
     329                return second;
     330            }
     331            throw new ConditionThrowable(new TypeError(first, "class"));
     332        }
     333    };
     334
    282335    // ### classp
    283336    private static final Primitive1 CLASSP =
Note: See TracChangeset for help on using the changeset viewer.