From 304923f7e8704b4d5d88a0e9e8d6dadb2a8a941a Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau <tunes@google.com> Date: Tue, 19 Mar 2013 20:52:30 -0400 Subject: [PATCH] 2.32.25: make strcat accept characters as string designators. --- asdf.asd | 2 +- header.lisp | 2 +- test/test-utilities.script | 5 +++-- uiop/utility.lisp | 15 +++++++++------ upgrade.lisp | 2 +- version.lisp-expr | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/asdf.asd b/asdf.asd index f3064643..52baf5b0 100644 --- a/asdf.asd +++ b/asdf.asd @@ -74,7 +74,7 @@ :licence "MIT" :description "Another System Definition Facility" :long-description "ASDF builds Common Lisp software organized into defined systems." - :version "2.32.24" ;; to be automatically updated by make bump-version + :version "2.32.25" ;; to be automatically updated by make bump-version :depends-on () #+asdf3 :encoding #+asdf3 :utf-8 ;; For most purposes, asdf itself specially counts as a builtin system. diff --git a/header.lisp b/header.lisp index 9c6c4755..47a69dc2 100644 --- a/header.lisp +++ b/header.lisp @@ -1,5 +1,5 @@ ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- -;;; This is ASDF 2.32.24: Another System Definition Facility. +;;; This is ASDF 2.32.25: Another System Definition Facility. ;;; ;;; Feedback, bug reports, and patches are all welcome: ;;; please mail to <asdf-devel@common-lisp.net>. diff --git a/test/test-utilities.script b/test/test-utilities.script index c581576b..0ce8eb37 100644 --- a/test/test-utilities.script +++ b/test/test-utilities.script @@ -216,7 +216,8 @@ (assert (not (base-string-p (make-string 10 :element-type 'character)))) (assert (not (base-string-p "abc"))) (assert (base-string-p (basify "abc"))) - (assert (not (base-string-p (strcat "a" NIL "b" "cd")))) + (assert (not (base-string-p (strcat "a" NIL #\b "cd")))) (assert (base-string-p (reduce/strcat (mapcar 'basify '("a" "b" NIL "cd"))))) (assert (base-string-p (strcat (basify "ab") (basify "cd")))) - (assert (not (base-string-p (strcat (basify "ab") "cd"))))) + (assert (not (base-string-p (strcat (basify "ab") #\c "d")))) + (assert (base-string-p (strcat (basify "ab") #\c #\d)))) diff --git a/uiop/utility.lisp b/uiop/utility.lisp index 433c89bf..825a48f7 100644 --- a/uiop/utility.lisp +++ b/uiop/utility.lisp @@ -201,19 +201,22 @@ Returns two values: \(A B C\) and \(1 2 3\)." (declare (ignorable strings)) #-non-base-chars-exist-p 'character #+non-base-chars-exist-p - (if (loop :for s :in strings :always (or (null s) (base-string-p s))) + (if (loop :for s :in strings :always (or (null s) (typep s 'base-char) (base-string-p s))) 'base-char 'character)) (defun reduce/strcat (strings &key key start end) - "Reduce a list as if by STRCAT, accepting KEY START and END keywords like REDUCE" + "Reduce a list as if by STRCAT, accepting KEY START and END keywords like REDUCE. +NIL is interpreted as an empty string. A character is interpreted as a string of length one." (when (or start end) (setf strings (subseq strings start end))) (when key (setf strings (mapcar key strings))) - (loop :with output = (make-string (loop :for s :in strings :sum (length s)) + (loop :with output = (make-string (loop :for s :in strings :sum (if (characterp s) 1 (length s))) :element-type (strings-common-element-type strings)) + :with pos = 0 :for input :in strings - :for pos = 0 :then (+ pos l) - :for l = (length input) - :do (replace output input :start1 pos) + :do (etypecase input + (null) + (character (setf (char output pos) input) (incf pos)) + (string (replace output input :start1 pos) (incf pos (length input)))) :finally (return output))) (defun strcat (&rest strings) diff --git a/upgrade.lisp b/upgrade.lisp index bccbdfd6..1eb8df3a 100644 --- a/upgrade.lisp +++ b/upgrade.lisp @@ -52,7 +52,7 @@ You can compare this string with e.g.: (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSIO ;; "3.4.5.67" would be a development version in the official upstream of 3.4.5. ;; "3.4.5.0.8" would be your eighth local modification of official release 3.4.5 ;; "3.4.5.67.8" would be your eighth local modification of development version 3.4.5.67 - (asdf-version "2.32.24") + (asdf-version "2.32.25") (existing-version (asdf-version))) (setf *asdf-version* asdf-version) (when (and existing-version (not (equal asdf-version existing-version))) diff --git a/version.lisp-expr b/version.lisp-expr index b5719bf3..86ba54c0 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -1 +1 @@ -"2.32.24" +"2.32.25" -- GitLab