Added remove-all-macro-characters.

Pascal J. Bourguignon [2015-06-23 01:27]
Added remove-all-macro-characters.
Filename
tools/reader-macro.lisp
diff --git a/tools/reader-macro.lisp b/tools/reader-macro.lisp
index e74e1f3..9765073 100644
--- a/tools/reader-macro.lisp
+++ b/tools/reader-macro.lisp
@@ -33,9 +33,21 @@
 ;;;;**************************************************************************
 (defpackage "COM.INFORMATIMAGO.TOOLS.RAEDER-MACRO"
   (:use "COMMON-LISP")
-  (:export "ALL-MACRO-CHARACTERS"))
+  (:export "ALL-MACRO-CHARACTERS"
+           "REMOVE-ALL-MACRO-CHARACTERS"))
 (in-package  "COM.INFORMATIMAGO.TOOLS.RAEDER-MACRO")

+(defun remove-all-macro-characters (readtable)
+  "DO: Removes all the reader macros and dispatching reader macros from the READTABLE.
+RETURN: READTABLE."
+  (loop
+    :for code :below char-code-limit
+    :for ch = (code-char code)
+    :when (and ch (get-macro-character ch readtable))
+      :do (set-macro-character  ch nil t readtable)
+          (set-syntax-from-char ch #\a   readtable))
+  readtable)
+
 (defun all-macro-characters (&optional (*readtable* *readtable*))
   (loop
     :with result = '()
ViewGit