Changeset 4111


Ignore:
Timestamp:
09/28/03 19:34:28 (19 years ago)
Author:
piso
Message:

MAKE-INSTANCE-STANDARD-CLASS: work in progress.

File:
1 edited

Legend:

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

    r4104 r4111  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: StandardClass.java,v 1.5 2003-09-28 18:32:16 piso Exp $
     5 * $Id: StandardClass.java,v 1.6 2003-09-28 19:34:28 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5656    }
    5757
    58     private static final Primitive MAKE_INSTANCE_STANDARD_CLASS =
    59         new Primitive("make-instance-standard-class", PACKAGE_SYS, false)
     58    // ### make-instance-standard-class
     59    // make-instance-standard-class name all-keys => class
     60    private static final Primitive2 MAKE_INSTANCE_STANDARD_CLASS =
     61        new Primitive2("make-instance-standard-class", PACKAGE_SYS, false)
    6062    {
    61         public LispObject execute(LispObject[] args) throws ConditionThrowable
     63        public LispObject execute(LispObject first, LispObject second)
     64            throws ConditionThrowable
    6265        {
    63             if (args.length < 1)
    64                 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this));
    65             Symbol symbol = checkSymbol(args[0]);
    66             return new StandardClass(symbol, NIL);
     66            Symbol symbol = checkSymbol(first);
     67            LispObject directSuperclasses = NIL;
     68            LispObject allKeys = second;
     69            while (allKeys != NIL) {
     70                LispObject key = allKeys.car();
     71                LispObject value = allKeys.cadr();
     72                if (key == Keyword.DIRECT_SUPERCLASSES)
     73                    directSuperclasses = value;
     74                allKeys = allKeys.cddr();
     75            }
     76            return new StandardClass(symbol, directSuperclasses);
    6777        }
    6878    };
Note: See TracChangeset for help on using the changeset viewer.