Conventions for Nyquist Plug-ins

A few, hopefully useful, examples:

;; Line up the bindings in LET special form
(let* ((symbols (mapcar #'compute-symbol l))
       (spaces (mapcar #'compute-space symbols (cdr symbols))))
  (when (verify-spacing symbols spaces)
    (make-spacing permanent spaces)))



;;; Three semicolons often used to explain a function.
(defun f (x)
  (when (< (g x) 3)
    (h x 2)))



;; Line up the bindings in DO special form
;; and line up the test expression with the first binding
(do ((i 1 (1+ i))               ; first binding
     (j (length l) (/ j 2)))    ; second binding
    ((= j 0) i)                 ; test expression and result value
  (iterate i j)                 ; body of DO loop
  (when (= (f x) 4)
    (setf *level-number* 0)))   ; end of DO loop



;; Put test expression on same line as WHEN or UNLESS special forms.
;; If multiple expressions, indent and align.
(when (= (f x) 4)
  (setf *level-number* 0)
  (unless *do-not-reinitialize*
    (reinitialize-global-information x)
    (reinitialize-local-information))
  (top-level x))



;; Indenting and commenting an IF statement.
(if (< (g x) 2)       ; is it sufficiently small?
    (top-level x)     ; if so, abandon everything
    (h y))            ; otherwise try again