Changeset 4311


Ignore:
Timestamp:
10/11/03 18:48:09 (19 years ago)
Author:
piso
Message:

CLASS-DIRECT-METHODS, %SET-CLASS-DIRECT-METHODS

File:
1 edited

Legend:

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

    r4288 r4311  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: LispClass.java,v 1.31 2003-10-10 17:03:17 piso Exp $
     5 * $Id: LispClass.java,v 1.32 2003-10-11 18:48:09 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4646    private LispObject directSubclasses;
    4747    private LispObject classPrecedenceList = NIL;
     48    private LispObject directMethods = NIL;
    4849
    4950    protected LispClass()
     
    333334    };
    334335
     336    // ### class-direct-methods
     337    private static final Primitive1 CLASS_DIRECT_METHODS =
     338        new Primitive1("class-direct-methods", PACKAGE_SYS, false)
     339    {
     340        public LispObject execute(LispObject arg)
     341            throws ConditionThrowable
     342        {
     343            if (arg instanceof LispClass)
     344                return ((LispClass)arg).directMethods;
     345            throw new ConditionThrowable(new TypeError(arg, "class"));
     346        }
     347    };
     348
     349    // ### %set-class-direct-methods
     350    private static final Primitive2 _SET_CLASS_DIRECT_METHODS =
     351        new Primitive2("%set-class-direct-methods", PACKAGE_SYS, false)
     352    {
     353        public LispObject execute(LispObject first, LispObject second)
     354            throws ConditionThrowable
     355        {
     356            if (first instanceof LispClass) {
     357                ((LispClass)first).directMethods = second;
     358                return second;
     359            }
     360            throw new ConditionThrowable(new TypeError(first, "class"));
     361        }
     362    };
     363
    335364    // ### classp
    336365    private static final Primitive1 CLASSP =
Note: See TracChangeset for help on using the changeset viewer.