Changeset 7952


Ignore:
Timestamp:
Dec 26, 2007, 8:02:34 AM (12 years ago)
Author:
gb
Message:

CHAR/SET-CHAR: define in terms of SCHAR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-1/sysutils.lisp

    r7855 r7952  
    441441  the string, returns the character object representing the character at
    442442  that position in the string."
    443  (if (stringp string)
    444   (aref string index)
    445   (report-bad-arg string 'string)))
     443  (if (typep string 'simple-string)
     444    (schar (the simple-string string) index)
     445    (if (stringp string)
     446      (multiple-value-bind (data offset) (array-data-and-offset string)
     447        (schar (the simple-string data) (+ index offset)))
     448      (report-bad-arg string 'string))))
    446449
    447450(defun set-char (string index new-el)
    448   (if (stringp string)
    449     (aset string index new-el)
    450     (report-bad-arg string 'string)))
     451  (if (typep string 'simple-string)
     452    (setf (schar string index) new-el)
     453    (if (stringp string)
     454      (multiple-value-bind (data offset) (array-data-and-offset string)
     455        (setf (schar (the simple-string data) (+ index offset)) new-el))
     456      (report-bad-arg string 'string))))
    451457
    452458(defun equalp (x y)
Note: See TracChangeset for help on using the changeset viewer.