Comment (computer programming): Difference between revisions

Content deleted Content added
Examples: Merge Ada and Haskell into group section
Examples: Merge D into curly brace languages section
Line 344:
 
===Curly brace languages===
Many of the [[curly brace language]]s such as C, C++ and their many derivatives delimit a line comment with {{code|//}} and a block comment with {{code|/*}} and {{code|*/}}. Originally, C lacked the line comment, but it was added in [[C99]]. Notable languages include: C, C++, [[C# (programming language)|C#]], [[D (programming language)|D]], [[Java (programming language)|Java]], [[Javascript]] and [[Swift (programming language)|Swift]]. For example:
 
<syntaxhighlight lang="c">
Line 363:
/* This is the nested comment. */
This is the end of the outer comment. */
</syntaxhighlight>
 
====Nested block in D====
D uses C++-style comments with additional syntax for nestable blocks delimited by <code>/+</code> and <code>+/</code>.
 
<syntaxhighlight lang="d">
// line comment +/
/*
block comment
*/
/+ start of outer block
/+ nestedinner block +/
end of outer block +/
</syntaxhighlight>
 
Line 599 ⟶ 612:
Hello World<br />
</cfoutput>
</syntaxhighlight>
 
====D====
[[D (programming language)|D]] uses C++-style comments, as well as nestable D-style multiline comments, which start with '/+' and end with '+/'.
 
<syntaxhighlight lang="d">
// This is a single-line comment.
/* This is a multiline comment.
 
*/
/+ This is a
/+ nested +/
comment +/
</syntaxhighlight>