Changeset 3785


Ignore:
Timestamp:
09/14/03 18:23:49 (19 years ago)
Author:
piso
Message:

elt()

File:
1 edited

Legend:

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

    r3770 r3785  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: DisplacedArray.java,v 1.7 2003-09-14 16:46:20 piso Exp $
     5 * $Id: DisplacedArray.java,v 1.8 2003-09-14 18:23:49 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    6565        if (typeSpecifier == Symbol.BIT_VECTOR)
    6666            return BIT_VECTOR_P();
     67        if (typeSpecifier == Symbol.SEQUENCE)
     68            return VECTORP();
    6769        if (typeSpecifier instanceof LispClass) {
    6870            final String name = typeSpecifier.getName();
     
    9698    public int length() throws LispError
    9799    {
    98         if (getRank() == 1)
     100        if (dimv.length == 1)
    99101            return size;
     102        throw new TypeError(this, "sequence");
     103    }
     104
     105    public LispObject elt(int index) throws LispError
     106    {
     107        if (dimv.length == 1)
     108            return getRowMajor(index);
    100109        throw new TypeError(this, "sequence");
    101110    }
     
    103112    public LispObject AREF(LispObject index) throws LispError
    104113    {
    105         if (getRank() == 1)
     114        if (dimv.length == 1)
    106115            return getRowMajor(Fixnum.getValue(index));
    107116        StringBuffer sb = new StringBuffer("AREF: ");
Note: See TracChangeset for help on using the changeset viewer.