在Lisp中的注释和多行注释
多行注释LISP:
- #|
- 您的意见在这里
- |#
当然,你可以有单行注释,但每行注释前面必须用分号。 一个注释行的分号标题可能是一个或多达4个。 它取决于范围注释。
Comment and Multiline Comment in Lisp
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:
- #|
- your comments here
- |#
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.
- ;;;; Four semicolons used for a file header comment
- ;;; comment with 3 semicolons usually be a paragraph
- (defun foo (x)
- (dotimes (ix)
- ;; Two semicolons indicate this comment applies
- ;; to the code that follows.
- (some-function-call)
- (another i) ; for this line only
- (and-another) ; for this line only
- (baz)))