From 82efc2a44fb513bdd8f05d9aeb3f7667f9310ce9 Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau <tunes@google.com> Date: Mon, 30 Sep 2013 12:48:57 -0400 Subject: [PATCH] Oops, the standard names for #\cr and #\newline are #\Return and #\Linefeed respectively. Also, don't use *earmuffs*, but a $ prefix for $cr, $lf, $crlf, for these are not "variables" but "constants", except that defconstant won't work portably on strings, so no +glitter+. --- uiop/utility.lisp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uiop/utility.lisp b/uiop/utility.lisp index 91153626..d2bb8aed 100644 --- a/uiop/utility.lisp +++ b/uiop/utility.lisp @@ -254,9 +254,9 @@ starting the separation from the end, e.g. when called with arguments (incf words) (setf end start)))))) - (defvar *cr* (coerce #(#\cr) 'string)) - (defvar *lf* (coerce #(#\newline) 'string)) - (defvar *crlf* (coerce #(#\cr #\newline) 'string)) + (defvar $cr (coerce #(#\Return) 'string)) + (defvar $lf (coerce #(#\Linefeed) 'string)) + (defvar $crlf (coerce #(#\Return #\Linefeed) 'string)) (defun stripln (x) "Strip a string X from any ending CR, LF or CRLF. @@ -267,9 +267,9 @@ Return two values, the stripped string and the strip that was stripped" (endcrlfp (and endlfp (<= 2 len) (eql (char x (- len 2)) #\return))) (endcrp (equal (last-char x) #\return))) (cond - (endlfp (values (subseq x 0 (- len 1)) *lf*)) - (endcrp (values (subseq x 0 (- len 1)) *cr*)) - (endcrlfp (values (subseq x 0 (- len 2)) *crlf*)) + (endlfp (values (subseq x 0 (- len 1)) $lf)) + (endcrp (values (subseq x 0 (- len 1)) $cr)) + (endcrlfp (values (subseq x 0 (- len 2)) $crlf)) (t (values x nil))))) (defun string-prefix-p (prefix string) -- GitLab