4 ms·
I'm quite thankful that we don't have to worry about the syntactic position of comments, and the wise folks of CL, as you may know, made it so that saving comme
by nibbula 9y ago
I'm quite thankful that we don't have to worry about the syntactic position of comments, and the wise folks of CL, as you may know, made it so that saving comment text can be as easy as:
(defparameter *comments* nil)
(defun comment-saver (stream char)
(declare (ignore char))
(push
(list
*load-pathname*
(stream-file-position stream)
(with-output-to-string (str)
(loop :with c :while (char/= #\newline (setf c (read-char stream)))
:do (write-char c str))))
*comments*)
(values))
(set-macro-character #\; #'comment-saver)
With apologies for boring the non-Lisp infatuated.
- mikelevins 9y agoI think that after 30 years of lively interaction, my relationship with Lisp can be considered to have gone beyond infatuation. Whether that's a good thing is debatable, of course.