Ticket #1034 (closed defect: invalid)
#" reader error
|Reported by:||lysseus||Owned by:|
Description (last modified by gb) (diff)
The sharp-double-quote example in Let Over Lisp requires the addition of an extra " at the end of the expression in order to allow return to evaluate the expression in the REPL. The following code:
(defun |#"-reader| (stream sub-char numarg) (declare (ignore sub-char numarg)) (let (chars) (do ((prev (read-char stream) curr) (curr (read-char stream) (read-char stream))) ((and (char= prev #\") (char= curr #\#))) (push prev chars)) (coerce (nreverse chars) 'string))) (set-dispatch-macro-character #\# #\" #'|#"-reader|)
should produce a the following:
? #"contains " and \."# "contains \" and \\."
However, to produce that result you'll have to add an additional " to the end of the expression, which shouldn't be required.