Changeset 3770


Ignore:
Timestamp:
09/14/03 16:46:20 (19 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

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

    r3757 r3770  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: DisplacedArray.java,v 1.6 2003-09-14 13:07:22 piso Exp $
     5 * $Id: DisplacedArray.java,v 1.7 2003-09-14 16:46:20 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4747    public LispObject typeOf()
    4848    {
    49         if (getRank() == 1) {
     49        if (dimv.length == 1) {
    5050            if (array instanceof LispString)
    5151                return Symbol.STRING;
     52            if (array instanceof BitVector)
     53                return Symbol.BIT_VECTOR;
    5254            return list3(Symbol.VECTOR, T, new Fixnum(size));
    5355        }
     
    6062            return T;
    6163        if (typeSpecifier == Symbol.VECTOR)
    62             return getRank() == 1 ? T : NIL;
     64            return VECTORP();
    6365        if (typeSpecifier == Symbol.BIT_VECTOR)
    6466            return BIT_VECTOR_P();
     
    7577    public LispObject BIT_VECTOR_P()
    7678    {
    77         if (getRank() == 1)
     79        if (dimv.length == 1)
    7880            return array.BIT_VECTOR_P();
    7981        return NIL;
     
    8284    public LispObject STRINGP()
    8385    {
    84         if (getRank() == 1)
     86        if (dimv.length == 1)
    8587            return array.STRINGP();
    8688        return NIL;
     89    }
     90
     91    public boolean vectorp()
     92    {
     93        return dimv.length == 1;
    8794    }
    8895
Note: See TracChangeset for help on using the changeset viewer.