From 298d0534004c26eb5a6881ea34658f59e180b63b Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 4 May 2003 14:52:10 +0000 Subject: [PATCH] r4801: Auto commit for Debian build --- debian/changelog | 6 ++++++ package.lisp | 3 ++- seqs.lisp | 3 +-- strings.lisp | 12 +++++++++++- tests.lisp | 11 ++++++++++- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0f9e739..05f0590 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-kmrcl (1.38-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Sun, 4 May 2003 08:43:14 -0600 + cl-kmrcl (1.37-1) unstable; urgency=low * New upstream diff --git a/package.lisp b/package.lisp index 120d39b..5f6ec8f 100644 --- a/package.lisp +++ b/package.lisp @@ -7,7 +7,7 @@ ;;;; 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 ;;;; @@ -40,6 +40,7 @@ #:mapcar-append-string #:mapcar2-append-string #:delimited-string-to-list + #:ndelimited-string-to-list #:list-to-delimited-string #:flatten #:indent-spaces diff --git a/seqs.lisp b/seqs.lisp index 92a4aa0..b86d5ec 100644 --- a/seqs.lisp +++ b/seqs.lisp @@ -7,7 +7,7 @@ ;;;; 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 ;;;; @@ -59,7 +59,6 @@ (cdr lb) (concatenate 'string accum (funcall func a b))) accum))) - (defun nsubseq (sequence start &optional (end (length sequence))) diff --git a/strings.lisp b/strings.lisp index 7e9be34..028d978 100644 --- a/strings.lisp +++ b/strings.lisp @@ -7,7 +7,7 @@ ;;;; 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 ;;;; @@ -59,6 +59,16 @@ 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)) diff --git a/tests.lisp b/tests.lisp index a84404c..d5c079f 100644 --- a/tests.lisp +++ b/tests.lisp @@ -7,7 +7,7 @@ ;;;; 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 ;;;; @@ -45,6 +45,15 @@ (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*))) -- 2.34.1