Changeset 8273


Ignore:
Timestamp:
12/20/04 01:52:56 (17 years ago)
Author:
piso
Message:

AREF(int index)

Location:
trunk/j/src/org/armedbear/lisp
Files:
3 edited

Legend:

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

    r8244 r8273  
    33 *
    44 * Copyright (C) 2002-2004 Peter Graves
    5  * $Id: ComplexVector.java,v 1.16 2004-12-12 18:32:03 piso Exp $
     5 * $Id: ComplexVector.java,v 1.17 2004-12-20 01:52:56 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    145145            badIndex(index, limit);
    146146        return getRowMajor(index);
     147    }
     148
     149    // Ignores fill pointer.
     150    public LispObject AREF(int index) throws ConditionThrowable
     151    {
     152        if (elements != null) {
     153            try {
     154                return elements[index];
     155            }
     156            catch (ArrayIndexOutOfBoundsException e) {
     157                badIndex(index, elements.length);
     158                return NIL; // Not reached.
     159            }
     160        } else
     161            return array.getRowMajor(index + displacement);
    147162    }
    148163
  • trunk/j/src/org/armedbear/lisp/LispObject.java

    r8271 r8273  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: LispObject.java,v 1.109 2004-12-19 18:33:44 piso Exp $
     5 * $Id: LispObject.java,v 1.110 2004-12-20 01:51:41 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    388388    }
    389389
     390    public LispObject AREF(int index) throws ConditionThrowable
     391    {
     392        return AREF(new Fixnum(index));
     393    }
     394
    390395    public LispObject AREF(LispObject index) throws ConditionThrowable
    391396    {
  • trunk/j/src/org/armedbear/lisp/SimpleVector.java

    r8084 r8273  
    33 *
    44 * Copyright (C) 2002-2004 Peter Graves
    5  * $Id: SimpleVector.java,v 1.17 2004-11-03 15:27:23 piso Exp $
     5 * $Id: SimpleVector.java,v 1.18 2004-12-20 01:52:07 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    123123
    124124    // Ignores fill pointer.
     125    public LispObject AREF(int index) throws ConditionThrowable
     126    {
     127        try {
     128            return elements[index];
     129        }
     130        catch (ArrayIndexOutOfBoundsException e) {
     131            badIndex(index, elements.length);
     132            return NIL; // Not reached.
     133        }
     134    }
     135
     136    // Ignores fill pointer.
    125137    public LispObject AREF(LispObject index) throws ConditionThrowable
    126138    {
Note: See TracChangeset for help on using the changeset viewer.