Commit 752ebd9e authored by Tobias C. Rittweiler's avatar Tobias C. Rittweiler
Browse files

Add custom PRINT-OBJECT method for named readtables.

parent b80f87ba
......@@ -221,3 +221,21 @@
collect (cons subchar disp-fn)))
(error () nil))
(return (values t char fn disp? alist)))))))))
;;;; Specialized PRINT-OBJECT for named readtables.
;;; As per #19 in CLHS defining a method for PRINT-OBJECT
;;; that specializes on READTABLE is actually forbidden. It's quite
;;; likely to work on most implementations, though.
;;; We don't need this on Allegro CL's as we hook into their
;;; named-readtable facility, and they provide such a method already.
(defmethod print-object :around ((rt readtable) stream)
(let ((name (readtable-name rt)))
(if name
(print-unreadable-object (rt stream :type nil :identity t)
(format stream "~A ~S" (string :named-readtable) name))
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment