From: MedTermServer Date: Thu, 14 Feb 2008 05:30:10 +0000 (-0700) Subject: Merge branch 'master' of ssh://git.b9.com/home/gitpub/kmrcl X-Git-Tag: v1.101~5 X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=commitdiff_plain;h=e54afedd9e96a83521d3eb023e1a22051f387ded;hp=59263366c02989bb87cf7efe338d46de26677059 Merge branch 'master' of ssh://git.b9.com/home/gitpub/kmrcl --- diff --git a/ChangeLog b/ChangeLog index 17bb1ff..e07a5f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,15 @@ +28 Jan 2008 Kevin Rosenberg + * Version 1.98 + * {datetime,strings,tests}.lisp: Add remove-char-string + +18 Sep 2007 Kevin Rosenberg + * Version 1.97 + * datetime.lisp: Improve output format for date-string + 10 Sep 2007 Kevin Rosenberg * Version 1.96 * byte-stream.lisp: Use without-package-locks as suggested - by Daniel Gackle. + by Daniel Gackle. 01 Jun 2007 Kevin Rosenberg * Version 1.95 diff --git a/datetime.lisp b/datetime.lisp index dd813c4..30c815c 100644 --- a/datetime.lisp +++ b/datetime.lisp @@ -40,7 +40,7 @@ (multiple-value-bind (sec min hr dy mn yr) (decode-universal-time tm) (pretty-date yr mn dy hr min sec))) -(defun date-string (ut) +(defun date-string (&optional (ut (get-universal-time))) (if (typep ut 'integer) (multiple-value-bind (sec min hr day mon year dow daylight-p zone) (decode-universal-time ut) diff --git a/debian/changelog b/debian/changelog index d9e5a19..f9ef78f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +cl-kmrcl (1.98-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Wed, 30 Jan 2008 18:58:37 -0700 + +cl-kmrcl (1.97-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Tue, 18 Sep 2007 23:54:44 -0600 + cl-kmrcl (1.96-1) unstable; urgency=low * New upstream diff --git a/debian/control b/debian/control index ca0ec22..831a0b1 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: devel Priority: optional Maintainer: Kevin M. Rosenberg Build-Depends: debhelper (>= 4.0.0) -Standards-Version: 3.7.2.2 +Standards-Version: 3.7.3.0 Package: cl-kmrcl Architecture: all diff --git a/debian/rules b/debian/rules index 9abb12a..2bc2c46 100755 --- a/debian/rules +++ b/debian/rules @@ -49,10 +49,6 @@ install: build # Build architecture-independent files here. binary-indep: build install - - -# Build architecture-dependent files here. -binary-arch: build install dh_testdir dh_testroot # dh_installdebconf @@ -79,6 +75,9 @@ binary-arch: build install dh_md5sums dh_builddeb +# Build architecture-dependent files here. +binary-arch: build install + binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/package.lisp b/package.lisp index 8ab57ab..14ca9d6 100644 --- a/package.lisp +++ b/package.lisp @@ -76,6 +76,7 @@ #:string->list #:trim-non-alphanumeric #:binary-sequence-to-hex-string + #:remove-char-string ;; io.lisp #:indent-spaces @@ -319,6 +320,3 @@ #:set-signal-handler #:remove-signal-handler )) - - - diff --git a/strings.lisp b/strings.lisp index 1178b5d..9a9f42d 100644 --- a/strings.lisp +++ b/strings.lisp @@ -44,7 +44,6 @@ (setq in-word t)) (setq in-word nil))))) -;; From Larry Hunter with modifications (defun position-char (char string start max) (declare (optimize (speed 3) (safety 0) (space 0)) (fixnum start max) (simple-string string)) @@ -567,6 +566,23 @@ for characters in a string" str))) +(defun remove-char-string (char str) + (declare (character char) + (string str)) + (do* ((len (length str)) + (out (make-string len)) + (pos 0 (1+ pos)) + (opos 0)) + ((= pos len) (subseq out 0 opos)) + (declare (fixnum pos opos len) + (simple-string out)) + (let ((c (char str pos))) + (declare (character c)) + (when (char/= c char) + (setf (schar out opos) c) + (incf opos))))) + + (defun string-strip-ending (str endings) (if (stringp endings) (setq endings (list endings))) diff --git a/tests.lisp b/tests.lisp index 4cbc915..0b0daa2 100644 --- a/tests.lisp +++ b/tests.lisp @@ -202,6 +202,15 @@ (deftest :sse.4 (string-strip-ending "abc" '("ab")) "abc") (deftest :sse.5 (string-strip-ending "abcd" '("a" "cd")) "ab") +(deftest :rcs.1 (remove-char-string #\space "") "") +(deftest :rcs.2 (remove-char-string #\space "a") "a") +(deftest :rcs.3 (remove-char-string #\space "ab") "ab") +(deftest :rcs.4 (remove-char-string #\space "a b") "ab") +(deftest :rcs.5 (remove-char-string #\space " a b") "ab") +(deftest :rcs.6 (remove-char-string #\space "a b ") "ab") +(deftest :rcs.7 (remove-char-string #\space "a b c ") "abc") +(deftest :rcs.8 (remove-char-string #\space "a b c d") "abcd") + (defun test-color-conversion () (dotimes (ih 11)