Comments: Difference between revisions
Add CMake examples of single- and multi-line comments.
Langurmonkey (talk | contribs) |
AlexReinking (talk | contribs) (Add CMake examples of single- and multi-line comments.) |
||
Line 734:
<syntaxhighlight lang="lisp">(+ 1 (comment "foo") 3) ;; Throws an exception, because it tries to add nil to an integer
(+ 1 #_"foo" 3) ;; Returns 4</syntaxhighlight>
=={{header|CMake}}==
Line comments use the common <code>#</code> syntax:
<syntaxhighlight lang="cmake"># A single-line comment</syntaxhighlight>
Multi-line comments use a Lua-like square-bracket syntax.
<syntaxhighlight lang="cmake">
#[[A multi-line
comment ]]
#[==[A multi-line comment
with [[nested brackets]]. ]==]</syntaxhighlight>
The number of equals signs (<code>=</code>) in the opening bracket determines the number expected in the closing bracket.
=={{header|COBOL}}==
|