/[cmucl]/src/code/string.lisp
ViewVC logotype

Diff of /src/code/string.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12.30.24 by rtoy, Wed May 27 11:31:38 2009 UTC revision 1.12.30.25 by rtoy, Wed May 27 17:39:51 2009 UTC
# Line 850  Line 850 
850          (values (subseq string n index) (and (> n 0) n))          (values (subseq string n index) (and (> n 0) n))
851          (values (subseq string index n) (and (< n (length string)) n)))))          (values (subseq string index n) (and (< n (length string)) n)))))
852    
853    #+unicode
854    (defun string-reverse* (sequence)
855      (declare #+(or)(optimize (speed 3) (space 0) (safety 0) (debug 0))
856               (type string sequence))
857      (with-string sequence
858        (let* ((length (- end start))
859               (string (make-string length))
860               (j length))
861          (declare (type kernel:index length j))
862          (loop for i = start then n as n = (%glyph-f sequence i) do
863                (replace string sequence :start1 (decf j (- n i)) :start2 i :end2 n)
864                while (< n end))
865          string)))
866    
867    #+unicode
868    (defun string-nreverse* (sequence)
869      (declare #+(or)(optimize (speed 3) (space 0) (safety 0) (debug 0))
870               (type string sequence))
871      (with-string sequence
872        (flet ((rev (start end)
873                 (do ((i start (1+ i))
874                      (j (1- end) (1- j)))
875                     ((>= i j))
876                   (declare (type kernel:index i j))
877                   (rotatef (schar sequence i) (schar sequence j)))))
878          (let ((len end))
879            (loop for i = start then n as n = (%glyph-f sequence i) do
880              (rev i n) while (< n len))
881            (rev start end))))
882      sequence)
883    
884    
885    
886    
887  (defun decompose (string &optional (compatibility t))  (defun decompose (string &optional (compatibility t))
888    (declare (type string string))    (declare (type string string))
889    (let ((result (make-string (cond ((< (length string) 40)    (let ((result (make-string (cond ((< (length string) 40)

Legend:
Removed from v.1.12.30.24  
changed lines
  Added in v.1.12.30.25

  ViewVC Help
Powered by ViewVC 1.1.5