Changeset 4849


Ignore:
Timestamp:
11/20/03 18:01:57 (18 years ago)
Author:
piso
Message:

extends LispClass? => extends SlotClass?

File:
1 edited

Legend:

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

    r4649 r4849  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: StandardClass.java,v 1.12 2003-11-05 01:47:47 piso Exp $
     5 * $Id: StandardClass.java,v 1.13 2003-11-20 18:01:57 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2222package org.armedbear.lisp;
    2323
    24 public class StandardClass extends LispClass
     24public class StandardClass extends SlotClass
    2525{
    26     private LispObject directSlots = NIL;
    27     private LispObject effectiveSlots = NIL;
    28     private LispObject directDefaultInitargs = NIL;
    29     private LispObject effectiveDefaultInitargs = NIL;
    30 
    3126    public StandardClass()
    3227    {
     
    6459        return sb.toString();
    6560    }
    66 
    67     // ### class-direct-slots
    68     private static final Primitive1 CLASS_DIRECT_SLOTS =
    69         new Primitive1("class-direct-slots", PACKAGE_SYS, false)
    70     {
    71         public LispObject execute(LispObject arg)
    72             throws ConditionThrowable
    73         {
    74             if (arg instanceof StandardClass)
    75                 return ((StandardClass)arg).directSlots;
    76             if (arg instanceof BuiltInClass)
    77                 return NIL;
    78             throw new ConditionThrowable(new TypeError(arg, "standard class"));
    79         }
    80     };
    81 
    82     // ### %set-class-direct-slots
    83     private static final Primitive2 _SET_CLASS_DIRECT_SLOTS =
    84         new Primitive2("%set-class-direct-slots", PACKAGE_SYS, false)
    85     {
    86         public LispObject execute(LispObject first, LispObject second)
    87             throws ConditionThrowable
    88         {
    89             if (first instanceof StandardClass) {
    90                 ((StandardClass)first).directSlots = second;
    91                 return second;
    92             }
    93             throw new ConditionThrowable(new TypeError(first, "standard class"));
    94         }
    95     };
    96 
    97     // ### class-slots
    98     private static final Primitive1 CLASS_SLOTS =
    99         new Primitive1("class-slots", PACKAGE_SYS, false)
    100     {
    101         public LispObject execute(LispObject arg)
    102             throws ConditionThrowable
    103         {
    104             if (arg instanceof StandardClass)
    105                 return ((StandardClass)arg).effectiveSlots;
    106             if (arg instanceof BuiltInClass)
    107                 return NIL;
    108             throw new ConditionThrowable(new TypeError(arg, "standard class"));
    109         }
    110     };
    111 
    112     // ### %set-class-slots
    113     private static final Primitive2 _SET_CLASS_SLOTS =
    114         new Primitive2("%set-class-slots", PACKAGE_SYS, false)
    115     {
    116         public LispObject execute(LispObject first, LispObject second)
    117             throws ConditionThrowable
    118         {
    119             if (first instanceof StandardClass) {
    120                 ((StandardClass)first).effectiveSlots = second;
    121                 return second;
    122             }
    123             throw new ConditionThrowable(new TypeError(first, "standard class"));
    124         }
    125     };
    126 
    127     // ### class-direct-default-initargs
    128     private static final Primitive1 CLASS_DIRECT_DEFAULT_INITARGS =
    129         new Primitive1("class-direct-default-initargs", PACKAGE_SYS, false)
    130     {
    131         public LispObject execute(LispObject arg)
    132             throws ConditionThrowable
    133         {
    134             if (arg instanceof StandardClass)
    135                 return ((StandardClass)arg).directDefaultInitargs;
    136             if (arg instanceof BuiltInClass)
    137                 return NIL;
    138             throw new ConditionThrowable(new TypeError(arg, "standard class"));
    139         }
    140     };
    141 
    142     // ### %set-class-direct-default-initargs
    143     private static final Primitive2 _SET_CLASS_DIRECT_DEFAULT_INITARGS =
    144         new Primitive2("%set-class-direct-default-initargs", PACKAGE_SYS, false)
    145     {
    146         public LispObject execute(LispObject first, LispObject second)
    147             throws ConditionThrowable
    148         {
    149             if (first instanceof StandardClass) {
    150                 ((StandardClass)first).directDefaultInitargs = second;
    151                 return second;
    152             }
    153             throw new ConditionThrowable(new TypeError(first, "standard class"));
    154         }
    155     };
    156 
    157     // ### class-default-initargs
    158     private static final Primitive1 CLASS_DEFAULT_INITARGS =
    159         new Primitive1("class-default-initargs", PACKAGE_SYS, false)
    160     {
    161         public LispObject execute(LispObject arg)
    162             throws ConditionThrowable
    163         {
    164             if (arg instanceof StandardClass)
    165                 return ((StandardClass)arg).effectiveDefaultInitargs;
    166             if (arg instanceof BuiltInClass)
    167                 return NIL;
    168             throw new ConditionThrowable(new TypeError(arg, "standard class"));
    169         }
    170     };
    171 
    172     // ### %set-class-default-initargs
    173     private static final Primitive2 _SET_CLASS_DEFAULT_INITARGS =
    174         new Primitive2("%set-class-default-initargs", PACKAGE_SYS, false)
    175     {
    176         public LispObject execute(LispObject first, LispObject second)
    177             throws ConditionThrowable
    178         {
    179             if (first instanceof StandardClass) {
    180                 ((StandardClass)first).effectiveDefaultInitargs = second;
    181                 return second;
    182             }
    183             throw new ConditionThrowable(new TypeError(first, "standard class"));
    184         }
    185     };
    18661}
Note: See TracChangeset for help on using the changeset viewer.