X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=strings.lisp;h=af477bba105de8d2784fd0df16e9a7e63d51d0d0;hb=eefe5a5cc364731f05c560c8837895cbd97f7015;hp=a6db99b655ddde6af58900eab8b8d289167a3bcf;hpb=8d831065b8e830ea8b257aa7befd53bee7f49d5d;p=kmrcl.git diff --git a/strings.lisp b/strings.lisp index a6db99b..af477bb 100644 --- a/strings.lisp +++ b/strings.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: strings.lisp,v 1.18 2003/05/05 19:54:14 kevin Exp $ +;;;; $Id: strings.lisp,v 1.20 2003/05/05 21:49:48 kevin Exp $ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -66,23 +66,16 @@ my algorithm. Does allegro use assembly?" (output '()) (pos 0) (end (position separator string :start pos :end len) - (position separator string :start pos :end len)) - (previous nil)) + (position separator string :start pos :end len))) ((null end) - (cond - ((null previous) - (list string)) - (t - (incf previous) - (if (< previous len) - (push (subseq string previous) output) - (unless skip-terminal - (push "" output))) - (nreverse output)))) + (if (< pos len) + (push (subseq string pos) output) + (when (or (not skip-terminal) (zerop len)) + (push "" output))) + (nreverse output)) (declare (type fixnum pos len) - (type (or null fixnum) end previous)) + (type (or null fixnum) end)) (push (subseq string pos end) output) - (setq previous end) (setq pos (1+ end))))