Coerced *spaces* to a string.

Pascal J. Bourguignon [2013-07-28 20:33]
Coerced *spaces* to a string.
Filename
common-lisp/parser/scanner.lisp
diff --git a/common-lisp/parser/scanner.lisp b/common-lisp/parser/scanner.lisp
index e279180..162536b 100644
--- a/common-lisp/parser/scanner.lisp
+++ b/common-lisp/parser/scanner.lisp
@@ -153,12 +153,14 @@ License:


 ;; Note: the features are defined in .cesarum.characters
-(defvar *spaces*  '(#\Space
-                    #+has-newline #\Newline
-                    #+has-tab #\Tab
-                    #+(and has-return (not newline-is-return)) #\return
-                    #+(and has-linefeed (not newline-is-linefeed)) #\linefeed
-                    #+has-page #\page))
+(defvar *spaces*  (coerce (remove-duplicates
+                           '(#\Space
+                             #+has-newline #\Newline
+                             #+has-tab #\Tab
+                             #+(and has-return (not newline-is-return)) #\return
+                             #+(and has-linefeed (not newline-is-linefeed)) #\linefeed
+                             #+has-page #\page))
+                          'string))


 ;; Note we copy some fields in the condition from the scanner, so that
@@ -329,13 +331,8 @@ RETURN:       (scanner-current-token scanner).


 (defmethod print-object ((self scanner) out)
-  (print-unreadable-object (self out :type t :identity t)
-    (format out "~{~S~^ ~}"
-            (list :line          (slot-value self          'line)
-                  :column        (slot-value self          'column)
-                  :current-token (slot-value self          'current-token)
-                  :source        (slot-value self          'source))))
-  self)
+  (print-parseable-object (self out :type t :identity t)
+                          line column current-token source))


ViewGit