Changeset 8271


Ignore:
Timestamp:
12/19/04 18:33:44 (17 years ago)
Author:
piso
Message:

SCHAR(int index)

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

Legend:

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

    r8269 r8271  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: LispObject.java,v 1.108 2004-12-19 15:16:25 piso Exp $
     5 * $Id: LispObject.java,v 1.109 2004-12-19 18:33:44 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    373373    }
    374374
     375    public LispObject SCHAR(int index) throws ConditionThrowable
     376    {
     377        return signal(new TypeError(this, Symbol.SIMPLE_STRING));
     378    }
     379
    375380    public LispObject elt(int index) throws ConditionThrowable
    376381    {
  • trunk/j/src/org/armedbear/lisp/SimpleString.java

    r8198 r8271  
    33 *
    44 * Copyright (C) 2004 Peter Graves
    5  * $Id: SimpleString.java,v 1.25 2004-11-28 15:43:50 piso Exp $
     5 * $Id: SimpleString.java,v 1.26 2004-12-19 18:33:06 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    193193        return substring(start, capacity);
    194194    }
    195    
     195
    196196    public final SimpleString substring(int start, int end)
    197197        throws ConditionThrowable
     
    215215        return substring(start, end);
    216216    }
    217    
     217
    218218    public void fill(LispObject obj) throws ConditionThrowable
    219219    {
     
    329329    {
    330330        return capacity;
     331    }
     332
     333    public LispObject SCHAR(int index) throws ConditionThrowable
     334    {
     335        try {
     336            return LispCharacter.getInstance(chars[index]);
     337        }
     338        catch (ArrayIndexOutOfBoundsException e) {
     339            badIndex(index, capacity);
     340            return NIL; // Not reached.
     341        }
    331342    }
    332343
Note: See TracChangeset for help on using the changeset viewer.