Changeset 4281


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

ALLOCATE-STD-INSTANCE

File:
1 edited

Legend:

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

    r3926 r4281  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: StandardObject.java,v 1.1 2003-09-20 16:54:55 piso Exp $
     5 * $Id: StandardObject.java,v 1.2 2003-10-10 14:16:54 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class StandardObject extends LispObject
    2525{
     26    // Slots.
     27    private LispObject cls;
     28    private LispObject slots; // A simple vector.
     29
     30    protected StandardObject()
     31    {
     32    }
     33
     34    private StandardObject(LispObject cls, LispObject slots)
     35    {
     36        this.cls = cls;
     37        this.slots = slots;
     38    }
     39
    2640    public LispObject typeOf()
    2741    {
     
    3852        if (type == Symbol.STANDARD_OBJECT)
    3953            return T;
     54        if (type == BuiltInClass.STANDARD_OBJECT)
     55            return T;
    4056        return super.typep(type);
    4157    }
     58
     59    // ### allocate-std-instance
     60    // allocate-std-instance class slots => instance
     61    private static final Primitive2 ALLOCATE_STD_INSTANCE =
     62        new Primitive2("allocate-std-instance", PACKAGE_SYS, false)
     63    {
     64        public LispObject execute(LispObject first, LispObject second)
     65        {
     66            if (first == BuiltInClass.STANDARD_CLASS)
     67                return new StandardClass();
     68            return new StandardObject(first, second);
     69        }
     70    };
    4271}
Note: See TracChangeset for help on using the changeset viewer.