Lisp 的单行注释和多行注释

在Lisp中的注释和多行注释

多行注释LISP:

  1. #|
  2. 您的意见在这里
  3. |#

当然,你可以有单行注释,但每行注释前面必须用分号。 一个注释行的分号标题可能是一个或多达4个。 它取决于范围注释。

Comment and Multiline Comment in Lisp

February 5th, 2009

I was a little surprised to find there's so little resource on the Internet about Lisp.Is it really too old to get people interested?

As a beginner, after writing some code, I wanted to find a way to comment out several lines of code to do an A/B test.But surprisingly, I couldn't find any document saying how to do it.Thanks to an email fromZach , I finally know how to do it. So, Multiline comment in LISP:

  1. #|
  2. your comments here
  3. |#

Of course, you could have single-line comments, but each line of comment must be prefaced with semicolon(s).The semicolons heading a line of comment could be one or up to 4.It depends on the scope of the comment.You will understand what scope is from the following example.

  1. ;;;; Four semicolons used for a file header comment

  2. ;;; comment with 3 semicolons usually be a paragraph
  3. (defun foo (x)
  4. (dotimes (ix)
  5. ;; Two semicolons indicate this comment applies
  6. ;; to the code that follows.
  7. (some-function-call)
  8. (another i) ; for this line only
  9. (and-another) ; for this line only
  10. (baz)))
(原文链接在这里 )
原文地址:https://www.cnblogs.com/leonxyzh/p/7289186.html