(set-dispatch-macro-character #\# #\· ...)
Sometimes is quite difficult to include source code within html because "double quotes" have to be escaped with a slash \ that sometimes has to be escaped too. So I created this little hack.
(defun read-double-quoted (stream sub-char n-args)
(declare (ignore sub-char n-args))
(let* ((char (read-char stream nil nil))
(next-char (read-char stream nil nil))
(str (make-string-output-stream)))
(loop while (not (and (eql char #\·) (eql next-char #\#))) do
(write-char char str)
(setf char next-char
next-char (read-char stream nil nil))
finally (return (get-output-stream-string str)))))
(set-dispatch-macro-character #\# #\· #'read-double-quoted)
If you look at the source of this page (link at the bottom) you will not see the pointy-square nor the funny-dot because when the code reachs the compiler it already has been transformed by the macro. But you can take a look at this sample.