Block Comments in Clojure
我如何评论Clojure中的多行?
Actually, there is a way!
(comment
(defn hey []
("Hey there!"))
Check me out!
)
Just wrap your comments in (comment ..) :)
Have fun!
Clojure supports a #_
reader macro which completely skips the next form. This is mentioned on the page about the Clojure Reader. There is also the comment macro which has a similar effect, but is implemented differently.
Both the above require that the thing that you're commenting out is otherwise a syntactically correct S-expression.
Some Lisp dialects have a multi-line comment that can contain arbitrary text, but I don't see one for Clojure.
双引号(字符串文字)允许添加任意文本(不仅适当的S形式):
(comment "
public class HelloWorld {
public static void main(String[] args) {
System.out.print("Hello, World");
System.out.println();
}
}
")
链接地址: http://www.djcxy.com/p/25666.html
下一篇: 阻止在Clojure中的评论