Changeset 4442


Ignore:
Timestamp:
10/17/03 19:37:45 (19 years ago)
Author:
piso
Message:

ADJUST-ARRAY

File:
1 edited

Legend:

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

    r4414 r4442  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Primitives.java,v 1.477 2003-10-16 19:40:49 piso Exp $
     5 * $Id: Primitives.java,v 1.478 2003-10-17 19:37:45 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    20252025    };
    20262026
     2027    // ### adjust-array
     2028    // FIXME Very incomplete!
     2029    private static final Primitive2 ADJUST_ARRAY = new Primitive2("adjust-array")
     2030    {
     2031        public LispObject execute(LispObject first, LispObject second)
     2032            throws ConditionThrowable
     2033        {
     2034            if (first instanceof Vector) {
     2035                Vector v = (Vector) first;
     2036                LispObject newSize = null;
     2037                if (second instanceof Cons) {
     2038                    if (second.length() == 1)
     2039                        newSize = second.car();
     2040                } else
     2041                    newSize = second;
     2042                if (newSize != null)
     2043                    return v.adjustArray(Fixnum.getValue(newSize));
     2044            }
     2045            throw new ConditionThrowable(new LispError("ADJUST-ARRAY: unsupported case"));
     2046        }
     2047    };
     2048
    20272049    // ### type-of
    20282050    private static final Primitive1 TYPE_OF = new Primitive1("type-of") {
Note: See TracChangeset for help on using the changeset viewer.