4 ms·
A single-semicolon comment is intended to be very terse and to-the-point. Longer inline comments are supposed to be double-semicolon dedicated to their own line
by reikonomusha 3y ago
A single-semicolon comment is intended to be very terse and to-the-point. Longer inline comments are supposed to be double-semicolon dedicated to their own lines.
(let* ((head (cons nil nil))
(tail head))
;; This is a longer expository comment on the following
;; segment of code. Here, we efficiently append to a list by
;; keeping track of the tail node at all times.
(dotimes (i 10) ; RPLACD+SETF is an O(1) append
(rplacd tail (cons i nil))
(setf tail (cdr tail)))
(cdr head)) ; discard dummy cons
I don't think this style of commenting is acceptable because of my editor, but just that an editor like Emacs keeps it very easy to edit, organize, and reflow them. I have no shame in saying that I use my editor as an integral part to my programming workflow. :)