Skip to content

Commit 14ed12f

Browse files
committed
Fix: char-code for *whitespaces* characters
Use `char-code` for `*whitespaces*` characters. This should prevent future problems with some implementations that do not support specific characters in the reader.
1 parent fc79d7d commit 14ed12f

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

str.lisp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,21 @@
132132
(defparameter *pad-side* :right
133133
"The side of the string to add padding characters to. Can be one of :right, :left and :center.")
134134

135-
(defvar *whitespaces* (list #\Backspace #\Tab #\Linefeed #\Newline #\Vt #\Page
136-
#\Return #\Space #\Rubout
137-
#+sbcl #\Next-Line #-sbcl (code-char 133)
138-
#+(or abcl gcl lispworks) (code-char 12288) #-(or abcl gcl lispworks) #\Ideographic_space
139-
#+lispworks #\no-break-space #-lispworks #\No-break_space)
140-
"On some implementations, linefeed and newline represent the same character (code).")
135+
(defvar *whitespaces*
136+
(mapcar (function code-char)
137+
(list 8 ;; #\Backspace
138+
9 ;; #\Tab
139+
10 ;; #\Linefeed #\Newline
140+
11 ;; #\Vt
141+
12 ;; #\Page
142+
13 ;; #\Return
143+
32 ;; #\Space
144+
127 ;; #\Rubout
145+
133 ;; #\Next-Line
146+
160 ;; #\No-break_space
147+
12288 ;; #\Ideographic_space
148+
))
149+
"List of whitespace-like characters.")
141150

142151
(defvar +version+ (asdf:component-version (asdf:find-system "str")))
143152

0 commit comments

Comments
 (0)