+cl-kmrcl (1.38-1) unstable; urgency=low
+
+ * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org> Sun, 4 May 2003 08:43:14 -0600
+
cl-kmrcl (1.37-1) unstable; urgency=low
* New upstream
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: package.lisp,v 1.24 2003/05/02 22:30:26 kevin Exp $
+;;;; $Id: package.lisp,v 1.25 2003/05/04 14:52:10 kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
#:mapcar-append-string
#:mapcar2-append-string
#:delimited-string-to-list
+ #:ndelimited-string-to-list
#:list-to-delimited-string
#:flatten
#:indent-spaces
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: seqs.lisp,v 1.1 2003/04/29 00:26:21 kevin Exp $
+;;;; $Id: seqs.lisp,v 1.2 2003/05/04 14:52:10 kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(cdr lb)
(concatenate 'string accum (funcall func a b)))
accum)))
-
(defun nsubseq (sequence start &optional (end (length sequence)))
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: strings.lisp,v 1.16 2003/04/30 02:16:21 kevin Exp $
+;;;; $Id: strings.lisp,v 1.17 2003/05/04 14:52:10 kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
do
(setf start (1+ end))))
+(defun ndelimited-string-to-list (sequence &optional (separator #\space))
+ "Split a string by a delimitor"
+ (loop
+ with start = 0
+ for end = (position separator sequence :start start)
+ collect (nsubseq sequence start end)
+ until (null end)
+ do
+ (setf start (1+ end))))
+
#+excl
(defun list-to-delimited-string (list &optional (separator #\space))
(excl:list-to-delimited-string list separator))
;;;; Author: Kevin M. Rosenberg
;;;; Date Started: Apr 2003
;;;;
-;;;; $Id: tests.lisp,v 1.5 2003/04/29 01:55:26 kevin Exp $
+;;;; $Id: tests.lisp,v 1.6 2003/05/04 14:52:10 kevin Exp $
;;;;
;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg
;;;;
(deftest str.16 (nstring-trim-last-character "a") "")
(deftest str.17 (nstring-trim-last-character "ab") "a")
+(deftest str.18 (delimited-string-to-list "ab|cd|ef") '("ab" "cd" "ef"))
+(deftest str.19 (ndelimited-string-to-list "ab|cd|ef") '("ab" "cd" "ef"))
+(deftest str.20 (delimited-string-to-list "") nil)
+(deftest str.21 (ndelimited-string-to-list "") nil)
+(deftest str.22 (delimited-string-to-list "ab") '("ab"))
+(deftest str.23 (ndelimited-string-to-list "ab") '("ab"))
+(deftest str.24 (delimited-string-to-list "ab|") '("ab" ""))
+(deftest str.25 (ndelimited-string-to-list "ab|") '("ab" ""))
+
(eval-when (:compile-toplevel :load-toplevel :execute)
(when (find-package '#:kmr-mop)
(pushnew :kmrtest-mop cl:*features*)))