How do you comment out all or part of a Lisp s-exp using Paredit?

后端 未结 4 1955
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 09:30

When editing Lisp code, occasionally it\'s useful to entirely comment out a top-level definition, like this:

;(defun some-fn-which-is-broken (x)
;  ...)
         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 09:41

    Just a side note:

    The #+ and #- reader macros are pretty nice for commenting out sexps. They allow ignoring the following sexp, if the given symbol isn't/is found in *FEATURES*. Just pick a symbol not in *FEATURES*, and use it with #+ like this:

    #+nil
    (defun foo ()
      ...)
    

    Now, the function definition will be ignored (unless NIL is in *FEATURES*, which is not very likely).

提交回复
热议问题