Changeset 5929


Ignore:
Timestamp:
02/24/04 14:05:00 (17 years ago)
Author:
piso
Message:

Moved SCHAR and %SET-SCHAR to SimpleString?.java.

File:
1 edited

Legend:

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

    r5908 r5929  
    33 *
    44 * Copyright (C) 2003-2004 Peter Graves
    5  * $Id: StringFunctions.java,v 1.20 2004-02-23 19:56:58 piso Exp $
     5 * $Id: StringFunctions.java,v 1.21 2004-02-24 14:05:00 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    810810    };
    811811
    812     // ### schar
    813     private static final Primitive2 SCHAR = new Primitive2("schar", "string index")
    814     {
    815         public LispObject execute(LispObject first, LispObject second)
    816             throws ConditionThrowable
    817         {
    818             try {
    819                 return ((SimpleString)first).get(((Fixnum)second).value);
    820             }
    821             catch (ClassCastException e) {
    822                 if (first instanceof SimpleString)
    823                     return signal(new TypeError(second, Symbol.FIXNUM));
    824                 else
    825                     return signal(new TypeError(first, Symbol.SIMPLE_STRING));
    826             }
    827         }
    828     };
    829 
    830     // ### %set-schar
    831     private static final Primitive3 _SET_SCHAR =
    832         new Primitive3("%set-schar", PACKAGE_SYS, false)
    833     {
    834         public LispObject execute(LispObject first, LispObject second,
    835                                   LispObject third) throws ConditionThrowable
    836         {
    837             try {
    838                 ((SimpleString)first).set(((Fixnum)second).value, third);
    839                 return third;
    840             }
    841             catch (ClassCastException e) {
    842                 if (first instanceof SimpleString)
    843                     return signal(new TypeError(second, Symbol.FIXNUM));
    844                 else
    845                     return signal(new TypeError(first, Symbol.SIMPLE_STRING));
    846             }
    847         }
    848     };
    849 
    850812    // ### string-position
    851813    private static final Primitive3 STRING_POSITION =
Note: See TracChangeset for help on using the changeset viewer.