リーダーマクロを定義する:クォート型 - lisp-cookbook-ja/common-lisp GitHub Wiki
標準のリーダーマクロである「'」と同じタイプの例です。
(defun read-quote (stream ignore)
(declare (ignore ignore))
(list 'quote (read stream t nil t)))
リーダーがマクロ文字に遭遇すると、その文字は読み捨て、代わりに、(quote 次の一つの式)というフォームに展開します。
(let ((*readtable* (copy-readtable nil))) ;新しい標準のリードテーブル
(set-macro-character #\% #'read-quote) ;%をquoteに展開
(with-input-from-string (in "%(foo bar baz)")
(read in)))
;=> '(FOO BAR BAZ)