Changeset 4280


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

%SET-CLASS-NAME

File:
1 edited

Legend:

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

    r4105 r4280  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: LispClass.java,v 1.28 2003-09-28 18:32:49 piso Exp $
     5 * $Id: LispClass.java,v 1.29 2003-10-10 14:16:19 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4242    }
    4343
    44     protected final Symbol symbol;
     44    protected Symbol symbol;
    4545    private LispObject directSuperclasses;
    4646    private LispObject classPrecedenceList = NIL;
     47
     48    protected LispClass()
     49    {
     50    }
    4751
    4852    protected LispClass(Symbol symbol)
     
    207211
    208212    // ### class-name
    209     private static final Primitive1 CLASS_NAME = new Primitive1("class-name") {
     213    private static final Primitive1 CLASS_NAME = new Primitive1("class-name")
     214    {
    210215        public LispObject execute(LispObject arg) throws ConditionThrowable
    211216        {
     
    215220            catch (ClassCastException e) {
    216221                throw new ConditionThrowable(new TypeError(arg, "class"));
     222            }
     223        }
     224    };
     225
     226    // ### %set-class-name
     227    private static final Primitive2 _SET_CLASS_NAME =
     228        new Primitive2("%set-class-name", PACKAGE_SYS, false)
     229    {
     230        public LispObject execute(LispObject first, LispObject second)
     231            throws ConditionThrowable
     232        {
     233            try {
     234                ((LispClass)first).symbol = checkSymbol(second);
     235                return second;
     236            }
     237            catch (ClassCastException e) {
     238                throw new ConditionThrowable(new TypeError(first, "class"));
    217239            }
    218240        }
Note: See TracChangeset for help on using the changeset viewer.