This comparison ofprogramming languagescompares the features oflanguage syntax(format) for over 50 computer programming languages.
Expressions
editProgramming languageexpressionscan be broadly classified into four syntax structures:
- prefix notation
- Lisp
(* (+ 2 3) (expt 4 5))
- infix notation
- Fortran
(2 + 3) * (4 ** 5)
- suffix, postfix, orReverse Polish notation
- Forth
2 3 + 4 5 ** *
- math-like notation
- TUTOR
(2 + 3)(45) $$ note implicit multiply operator
Statements
editWhen a programming languages hasstatements,they typically have conventions for:
- statement separators;
- statement terminators; and
- line continuation
A statement separator demarcates the boundary between two separate statements. A statement terminator defines the end of an individual statement. Languages that interpret the end of line to be the end of a statement are called "line-oriented" languages.
"Line continuation" is a convention in line-oriented languages where the newline character could potentially be misinterpreted as a statement terminator. In such languages, it allows a single statement to span more than just one line.
Language | Statement separator-terminator | Secondary separator-terminator[1] |
---|---|---|
ABAP | period separated | |
Ada | semicolon terminated | |
ALGOL | semicolon separated | |
ALGOL 68 | semicolon and comma separated[2] | |
APL | newline terminated | [Direct_function ⋄] separated Secondary
|
AppleScript | newline terminated | |
AutoHotkey | newline terminated | |
BASIC | newline terminated | colon separated |
Boo | newline terminated | |
C | semicolon terminates statements | comma separates expressions |
C++ | semicolon terminates statements | comma separates expressions |
C# | semicolon terminated | |
COBOL | whitespace separated, sometimes period separated, optionally separated with commas and semi-colons. | |
Cobra | newline terminated | |
CoffeeScript | newline terminated | |
CSS | semicolon terminated | |
D | semicolon terminated | |
Eiffel | newline terminated | semicolon |
Erlang | colon separated, period terminated | |
F# | newline terminated | semicolon |
Fortran | newline terminated | semicolon |
Forth | semicolons terminate word definitions. space terminates word use | |
GFA BASIC | newline terminated | |
Go | semicolon separated (inserted by compiler) | |
Haskell(in do-notation) | newline separated | |
Haskell(in do-notation, when braces are used) | semicolon separated | |
Java | semicolon terminated | |
JavaScript | semicolon separated (but often inserted as statement terminator) | |
Kotlin | semicolon separated (but sometimes implicitly inserted on newlines) | |
Lua | whitespace separated (semicolon optional) | |
Mathematica also calledWolfram |
semicolon separated | |
MATLAB | newline terminated | semicolon or comma[3] |
MUMPS also calledM |
newline terminates line-scope, the closest to a "statement" that M has | a space separates/terminates a command, allowing another command to follow |
Nim | newline terminated | |
Object Pascal(Delphi) | semicolon separated | |
Objective-C | semicolon terminated | |
OCaml | semicolon separated | |
Pascal | semicolon separated | |
Perl | semicolon separated | |
PHP | semicolon terminated | |
Pick Basic | newline terminated | semicolon separated |
PowerShell | newline terminated | semicolon separated |
Prolog | comma separated (conjunction), semicolon separated (disjunction), period terminated (clause) | |
Python | newline terminated | semicolon |
R | newline terminated[4] | semicolon[4] |
Raku | semicolon separated | |
Red | whitespace separated | |
Ruby | newline terminated | semicolon |
Rust | semicolon terminated | comma separates expressions |
Scala | newline terminated (semicolon optional) | semicolon |
Seed7 | semicolon separated (semicolon termination is allowed) | |
Simula | semicolon separated | |
S-Lang | semicolon separated | |
Smalltalk | period separated | |
Standard ML | semicolon separated | |
Swift | semicolon separated (inserted by compiler) | |
V (Vlang) | newline terminated | comma or semicolon separated |
Visual Basic | newline terminated | colon separated |
Visual Basic.NET | newline terminated | colon separated |
Wolfram Language | semicolon separated | |
Xojo | newline terminated | |
Zig | semicolon terminated | |
Language | Statement separator-terminator | Secondary separator-terminator[1] |
Line continuation
editLine continuation is generally done as part oflexical analysis:a newline normally results in a token being added to the token stream, unless line continuation is detected.
- Whitespace– Languages that do not need continuations
- Ada– Lines terminate with semicolon
- C#– Lines terminate with semicolon
- JavaScript– Lines terminate with semicolon (which may be inferred)
- Lua
- OCaml
- Ampersandas last character of line
- Backslashas last character of line
- bash[5]and other Unix shells
- C,C++preprocessor
- Mathematica,Wolfram Language
- Python[6]
- Ruby
- JavaScript– only within single- or double-quoted strings
- Backtickas last character of line
- Hyphenas last character of line
- Underscoreas last character of line
- Ellipsis(as three periods–not one special character)
- MATLAB:The ellipsis token need not be the last characters on the line, but any following it will be ignored.[7](In essence, it begins a comment that extendsthrough(i.e. including) the first subsequent newline character. Contrast this with an inline comment, which extendsuntilthe first subsequent newline.)
- Comma delimiteras last character of line
- Ruby (comment may follow delimiter)
- Left bracket delimiteras last character of line
- Batch file:starting a parenthetical block can allow line continuation[8]
- Ruby:left parenthesis, left square bracket, or left curly bracket
- Operatoras last object of line
- Ruby (comment may follow operator)
- Operatoras first character of continued line
- AutoHotkey:Any expression operators except ++ and --, and a comma or a period[9]
- Backslashas first character of continued line
- Some form ofinline commentserves as line continuation
- Turbo Assembler:
\
- m4:
dnl
- TeX:
%
- Character position
- Fortran 77:A non-comment line is a continuation of the prior non-comment line if any non-space character appears in column 6. Comment lines cannot be continued.
- COBOL:String constants may be continued by not ending the original string in a PICTURE clause with
'
,then inserting a-
in column 7 (same position as the*
for comment is used.) - TUTOR:Lines starting with a tab (after any indentation required by the context) continue the prior command.
- [End and Begin] using normal quotes
Libraries
editThis sectionneeds expansion.You can help byadding to it.(December 2009) |
Toimportalibraryis a way to read external, possibly compiled, routines, programs or packages. Imports can be classified by level (module, package, class, procedure,...) and by syntax (directive name, attributes,...)
- File import
addpath(directory)
MATLAB[10]COPYfilename.
COBOL:-include( "filename").
Prolog#include file= "filename"
ASP#include "filename"
,AutoHotkey,AutoIt,C,C++#include <filename>
AutoHotkey,AutoIt,C,C++#import "filename"
,Objective-C#import <filename>
Objective-CImport["filename"]
Mathematica,Wolfram Languageinclude'filename'
Fortraninclude "filename";
PHPinclude [filename] program
,Pick Basic#include [filename] program
Pick Basicinclude!( "filename");
Rustload "filename"
Rubyload%filename
Redrequire('filename')
Luarequire "filename";
Perl,PHPrequire"filename"
Rubysource(""filename"")
R@import( "filename");
Zig
- Package import
#includefilename
C,C++#[path = "filename"] modaltname;
,Rust@importmodule;
Objective-C<<name
Mathematica,Wolfram Language:-use_module(module).
Prolog:frommoduleimport *
Pythonextern cratelibname;
,Rustextern cratelibnameasaltname;
Rustmodmodname;
,Rustlibrary( "package")
R:IMPORTmodule
Oberonimportaltname"package/name"
Go:importpackage.module;
,Dimportaltname=package.module;
DimportModule
,Haskellimport qualifiedModuleasM
Haskellimportpackage.*
Java,MATLAB,Kotlinimport "modname";
JavaScript:importaltnamefrom "modname";
,JavaScript:importpackage
Scalaimportpackage._
,Scalaimportmodule
Swiftimportmodule
V (Vlang)importmodule
,Pythonrequire('modname')
Lua:require"gem"
,Rubyusemodule
,Fortran 90+usemodule,only:identifier
Fortran 90+useModule;
,Perluse Module qw(import options);
PerlusePackage.Name
Cobrausesunit
Pascalwithpackage
Ada@import( "pkgname");
Zig
- Class import
frommoduleimportClass
Pythonimportpackage.class
Java,MATLAB,kotlinimportclassfrom "modname";
,JavaScriptimport {class} from "modname";
,JavaScriptimport {classasaltname} from "modname";
JavaScriptimportpackage.class
,Scalaimportpackage.{class1=>alternativeName,class2}
,Scalaimportpackage._
ScalauseNamespace\ClassName;
,PHPuseNamespace\ClassName as AliasName;
PHP
- Procedure/function import
frommoduleimportfunction
Python:importpackage.module:symbol;
,D:importpackage.module:altsymbolname=symbol;
D:importModule(function)
Haskell:importfunctionfrom "modname";
,JavaScript:import {function} from "modname";
,JavaScript:import {functionasaltname} from "modname";
JavaScript:importpackage.function
MATLAB:importpackage.class.function
,Scala:importpackage.class.{function=>alternativeName,otherFunction}
Scala:useModule('symbol');
Perl:use functionNamespace\function_name;
,PHP:useNamespace\function_name as function_alias_name;
PHP:usemodule::submodule::symbol;
,Rust:usemodule::submodule::{symbol1,symbol2};
,Rust:usemodule::submodule::symbolasaltname;
Rust:
- Constant import
use constNamespace\CONST_NAME;
PHP
The above statements can also be classified by whether they are a syntactic convenience (allowing things to be referred to by a shorter name, but they can still be referred to by some fully qualified name without import), or whether they are actually required to access the code (without which it is impossible to access the code, even with fully qualified names).
- Syntactic convenience
- Required to access code
import altname "package/name"
Goimportaltnamefrom "modname";
JavaScriptimportmodule
Python
Blocks
editAblockis a notation for a group of two or more statements, expressions or other units of code that are related in such a way as to comprise a whole.
- Braces (a.k.a. curly brackets)
{
...}
- Curly bracket programming languages:C,C++,Objective-C,Go,Java,JavaScript/ECMAScript,V (Vlang),C#,D,Perl,PHP(
for
&loop
loops, or pass a block as argument),R,Rust,Scala,S-Lang,Swift,PowerShell,Haskell(in do-notation),AutoHotkey,Zig
- Parentheses
(
...)
- Square brackets
[
...]
begin
...end
do
...end
do
...done
- Bash(
for
&while
loops),F#(verbose syntax)[11]Visual Basic,Fortran,TUTOR(with mandatory indenting of block body),Visual Prolog
do
...end
- X...
end
(e.g.if
...end
):
- Ruby(
if
,while
,until
,def
,class
,module
statements),OCaml(for
&while
loops),MATLAB(if
&switch
conditionals,for
&while
loops,try
clause,package
,classdef
,properties
,methods
,events
,&function
blocks),Lua(then
/else
&function
)
- (
begin
...)
- (progn...)
- (
do
...)
- Indentation
- Off-side rule languages:Boo,Cobra,CoffeeScript,F#,Haskell(in do-notation when braces are omitted),LiveScript,occam,Python,Nemerle(Optional; the user may use white-space sensitive syntax instead of the curly-brace syntax if they so desire),Nim,Scala(Optional, as in Nemerle)
- Free-form languages:most descendants fromALGOL(includingC,Pascal,andPerl);Lisplanguages
- Others
- Ada,Visual Basic,Seed7:
if
...end if
- APL:
:If
...:EndIf
or:If
...:End
- Bash,sh,andksh:
if
...fi
,do
...done
,case
...esac
; - ALGOL 68:
begin
...end
,(
...)
,if
...fi
,do
...od
- Lua,Pascal,Modula-2,Seed7:
repeat
...until
- COBOL:
IF
...END-IF
,PERFORM
...END-PERFORM
,etc. for statements;....
for sentences. - Visual Basic.Net:
If
...End If
,For
...Next
,Do
...Loop
- Small Basic:
If
...EndIf
,For
...EndFor
,While
...EndWhile
Comments
editCommentscan be classified by:
- style (inline/block)
- parse rules (ignored/interpolated/stored in memory)
- recursivity (nestable/non-nestable)
- uses (docstrings/throwaway comments/other)
Inline comments
editInline comments are generally those that use anewlinecharacter to indicate the end of a comment, and an arbitrarydelimiteror sequence oftokensto indicate the beginning of a comment.
Examples:
Block comments
editBlock comments are generally those that use a delimiter to indicate the beginning of a comment, and another delimiter to indicate the end of a comment. In this context,whitespaceandnewlinecharacters are not counted as delimiters. In the examples, the symbol ~ represents the comment; and, the symbols surrounding it are understood by the interpreters/compilers as the delimiters.
Examples:
Symbol | Languages |
---|---|
comment ~;
|
ALGOL 60,SIMULA |
¢ ~¢ ,# ~# ,co ~co ,comment ~comment
|
ALGOL 68[14][15] |
/* ~*/
|
ActionScript,AutoHotkey,C, C++, C#, D,[16]Go,Java,JavaScript,Kotlin,Objective-C,PHP,PL/I,Prolog,Rexx,Rust(can be nested), Scala (can be nested),SAS,SASS, SQL, Swift (can be nested),V (Vlang),Visual Prolog,CSS |
#cs ~#ce
|
AutoIt[17] |
/+ ~+/
|
D (can be nested)[16] |
/# ~#/
|
Cobra(can be nested) |
<# ~#>
|
PowerShell |
<!-- ~-->
|
HTML,XML |
=begin ~=cut
|
Perl (Plain Old Documentation) |
#`( ~)
|
Raku(bracketing characters can be (), <>, {}, [], any Unicode characters with BiDi mirrorings, or Unicode characters with Ps/Pe/Pi/Pf properties) |
=begin ~=end
|
Ruby |
#<TAG> ~#</TAG> ,#stop ~EOF ,#iffalse ~#endif ,#ifntrue ~#endif ,#if false ~#endif ,#if!true ~#endif
|
S-Lang[18] |
{- ~-}
|
Haskell(can be nested) |
(* ~*)
|
Delphi,ML,Mathematica,Object Pascal,Pascal,Seed7,AppleScript,OCaml(can be nested),Standard ML(can be nested),Maple,Newspeak,F# |
{ ~}
|
Delphi, Object Pascal, Pascal,PGN,Red |
{# ~#}
|
Nunjucks,Twig |
{{! ~}}
|
Mustache,Handlebars |
{{!-- ~--}}
|
Handlebars (cannot be nested, but may contain{{ and}} )
|
|# ~#|
|
Curl |
%{ ~%}
|
MATLAB[13](the symbols must be in a separate line) |
#| ~|#
|
Lisp,Scheme,Racket(can be nested in all three). |
#= ~=#
|
Julia[19] |
#[ ~]#
|
Nim[20] |
--[[ ~]] ,--[=[ ~]=] ,--[= ...=[ ~]= ...=]
|
Lua(brackets can have any number of matching = characters; can be nested within non-matching delimiters) |
" ~"
|
Smalltalk |
(comment ~)
|
Clojure |
#If COMMENT Then ~#End If [a]
|
Visual Basic.NET |
#if COMMENT ~#endif [b]
|
C# |
' comment _ orREM comment _ [c]
|
Classic Visual Basic,VBA,VBScript |
Unique variants
edit- Fortran
- Indenting lines inFortran66/77 is significant. The actual statement is in columns 7 through 72 of a line. Any non-space character in column 6 indicates that this line is a continuation of the prior line. A '
C
' in column 1 indicates that this entire line is a comment. Columns 1 though 5 may contain a number which serves as a label. Columns 73 though 80 are ignored and may be used for comments; in thedays of punched cards,these columns often contained a sequence number so that the deck of cards could be sorted into the correct order if someone accidentally dropped the cards. Fortran 90 removed the need for the indentation rule and added inline comments, using the!
character as the comment delimiter.
- COBOL
- In fixed format code, line indentation is significant. Columns 1–6 and columns from 73 onwards are ignored. If a
*
or/
is in column 7, then that line is a comment. Until COBOL 2002, if aD
ord
was in column 7, it would define a "debugging line" which would be ignored unless the compiler was instructed to compile it.
- Cobra
- Cobra supports block comments with "
/#
...#/
"which is like the"/*
...*/
"often found in C-based languages, but with two differences. The#
character is reused from the single-line comment form "#
... ", and the block comments can be nested which is convenient for commenting out large blocks of code.
- Curl
- Curl supports block comments with user-defined tags as in
|foo#... #foo|
.
- Lua
- Like raw strings, there can be any number of equals signs between the square brackets, provided both the opening and closing tags have a matching number of equals signs; this allows nesting as long as nested block comments/raw strings use a different number of equals signs than their enclosing comment:
--[[comment --[=[ nested comment ]=] ]]
.Lua discards the first newline (if present) that directly follows the opening tag.
- Perl
- Block comments in Perl are considered part of the documentation, and are given the namePlain Old Documentation(POD). Technically, Perl does not have a convention for including block comments in source code, but POD is routinely used as a workaround.
- PHP
- PHP supports standard C/C++ style comments, but supports Perl style as well.
- Python
- The use of the triple-quotes to comment-out lines of source, does not actually form a comment.[21]The enclosed text becomes a string literal, which Python usually ignores (except when it is the first statement in the body of a module, class or function; seedocstring).
- Elixir
- The above trick used in Python also works in Elixir, but the compiler will throw a warning if it spots this. To suppress the warning, one would need to prepend the sigil
~S
(which prevents string interpolation) to the triple-quoted string, leading to the final construct~S "" "..." ""
.In addition, Elixir supports a limited form of block comments as an official language feature, but as in Perl, this construct is entirely intended to write documentation. Unlike in Perl, it cannot be used as a workaround, being limited to certain parts of the code and throwing errors or even suppressing functions if used elsewhere.[22]
- Raku
- Rakuuses
#`(...)
to denote block comments.[23]Raku actually allows the use of any "right" and "left" paired brackets after#`
(i.e.#`(...)
,#`[...]
,#`{...}
,#`<...>
,and even the more complicated#`{{...}}
are all valid block comments). Brackets are also allowed to be nested inside comments (i.e.#`{ a { b } c }
goes to the last closing brace).
- Ruby
- Block comment in Ruby opens at
=begin
line and closes at=end
line.
- S-Lang
- The region of lines enclosed by the
#<tag>
and#</tag>
delimiters are ignored by the interpreter. The tag name can be any sequence of alphanumeric characters that may be used to indicate how the enclosed block is to be deciphered. For example,#<latex>
could indicate the start of a block of LaTeX formatted documentation.
- Scheme and Racket
- The next complete syntactic component (s-expression) can be commented out with
#;
.
- ABAP
ABAP supports two different kinds of comments. If the first character of a line, including indentation, is an asterisk (*
) the whole line is considered as a comment, while a single double quote ("
) begins an in-line comment which acts until the end of the line. ABAP comments are not possible between the statementsEXEC SQL
andENDEXEC
because Native SQL has other usages for these characters. In the most SQL dialects the double dash (--
) can be used instead.
- Esoteric languages
- Manyesoteric programming languagesfollow the convention that any text not executed by theinstruction pointer(e.g.,Befunge) or otherwise assigned a meaning (e.g.,Brainfuck), is considered a "comment".
Comment comparison
editThere is a wide variety of syntax styles for declaring comments in source code.
BlockComment
in italics is used here to indicate block comment style.
InlineComment
in italics is used here to indicate inline comment style.
Language | In-line comment | Block comment |
---|---|---|
Ada,Eiffel,Euphoria,Occam,SPARK,ANSISQL,andVHDL | --InlineComment
|
|
ALGOL 60 | commentBlockComment;
| |
ALGOL 68 | ¢BlockComment¢
| |
APL | ⍝InlineComment
|
|
AppleScript | --InlineComment
|
(*BlockComment*)
|
Assembly language(varies) | ;InlineComment one example (most assembly languages use line comments only)
|
|
AutoHotkey | ;InlineComment
|
/*BlockComment*/
|
AWK,Bourne shell,C shell,Maple,PowerShell | #InlineComment
|
<#BlockComment#>
|
Bash | #InlineComment
|
<<EOF :'
|
BASIC(various dialects): | 'InlineComment (not all dialects)
|
|
C(K&R, ANSI/C89/C90),CHILL,PL/I,REXX | /*BlockComment*/
| |
C (C99),C++,Go,Swift,JavaScript,V (Vlang) | //InlineComment
|
/*BlockComment*/
|
C# | //InlineComment ///InlineComment (XML documentation comment)
|
/*BlockComment*/ /**BlockComment*/ (XML documentation comment)#if COMMENT (Compiler directive)[b]
|
COBOLI to COBOL 85 | *InlineComment (* in column 7)
|
|
COBOL 2002 | *>InlineComment
|
|
Curl | ||InlineComment
|
|#BlockComment#|
|
Cobra | #InlineComment
|
/#BlockComment#/ (nestable)
|
D | //InlineComment /// DocumentationInlineComment (ddoccomments)
|
/*BlockComment*/ /** DocumentationBlockComment*/ (ddoccomments)
|
DCL | $!InlineComment
|
|
ECMAScript(JavaScript,ActionScript,etc.) | //InlineComment
|
/*BlockComment*/
|
Elixir | #InlineComment
|
~S "" " @doc "" " (Documentation, only works in modules)@moduledoc (Module documentation)@typedoc (Type documentation)
|
Forth | \InlineComment
|
(BlockComment) (single line and multiline)
|
FORTRANI to FORTRAN 77 | CInlineComment (C in column 1)
|
|
Fortran 90and later | !InlineComment
|
#if 0 [d]
|
Haskell | --InlineComment
|
{-BlockComment-}
|
J | NB.
|
|
Java | //InlineComment
|
/*BlockComment*/
|
Julia | #InlineComment
|
#=BlockComment=#
|
Lisp,Scheme | ;InlineComment
|
#|BlockComment|#
|
Lua | --InlineComment
|
--[==[BlockComment]==] (variable number of = signs, nestable with delimiters with different numbers of = signs)
|
Maple | #InlineComment
|
(*BlockComment*)
|
Mathematica | (*BlockComment*)
| |
Matlab | %InlineComment
|
%{ Note: Both percent–bracket symbols must be the only non-whitespace characters on their respective lines. |
Nim | #InlineComment
|
#[BlockComment]#
|
Object Pascal | //InlineComment
|
(*BlockComment*) {BlockComment}
|
OCaml | (*BlockComment (* nestable *)*)
| |
Pascal,Modula-2,Modula-3,Oberon,ML: | (*BlockComment*)
| |
Perl,Ruby | #InlineComment
|
=begin (=end in Ruby) (PODdocumentation comment)
|
PGN,Red | ;InlineComment
|
{BlockComment}
|
PHP | #InlineComment //InlineComment
|
/*BlockComment*/ /** DocumentationBlockComment*/ (PHP Doc comments)
|
PILOT | R:InlineComment
|
|
PLZ/SYS | !BlockComment!
| |
PL/SQL,TSQL | --InlineComment
|
/*BlockComment*/
|
Prolog | %InlineComment
|
/*BlockComment*/
|
Python | #InlineComment
|
'''BlockComment''' (Documentation stringwhen first line of module, class, method, or function) |
R | #InlineComment
|
|
Raku | #InlineComment
|
#`{
|
Rust | //InlineComment
|
/*BlockComment*/ (nestable)
|
SAS | *BlockComment; /*BlockComment*/
| |
Seed7 | #InlineComment
|
(*BlockComment*)
|
Simula | commentBlockComment; !BlockComment;
| |
Smalltalk | "BlockComment"
| |
Smarty | {*BlockComment*}
| |
Standard ML | (*BlockComment*)
| |
TeX,LaTeX,PostScript,Erlang,S-Lang | %InlineComment
|
|
Texinfo | @cInlineComment
|
|
TUTOR | *InlineComment command$$InlineComment
|
|
Visual Basic | 'InlineComment RemInlineComment
|
'BlockComment_ RemBlockComment_ [c]
|
Visual Basic.NET | 'InlineComment
|
#If COMMENT Then
|
Visual Prolog | %InlineComment
|
/*BlockComment*/
|
Wolfram Language | (*BlockComment*)
| |
Xojo | 'InlineComment //InlineComment remInlineComment
| |
Zig | //InlineComment ///InlineComment //!InlineComment
|
See also
edit- C syntax
- C++ syntax
- Curly bracket programming languages,a broad family of programming language syntaxes
- Java syntax
- JavaScript syntax
- PHP syntax and semantics
- Python syntax and semantics
References
edit- ^abFor multiple statements on one line
- ^Three different kinds of clauses, each separates phrases and the units differently:
- serial-clause usinggo-on-token(viz. semicolon):begina; b; cend– units are executed in order.
- collateral-clause usingand-also-token(viz. "," ):begina, b, cend– order of execution is to be optimised by the compiler.
- parallel-clause usingand-also-token(viz. "," ):par begina, b, cend– units must be run in parallel threads.
- ^semicolon – result of receding statement hidden, comma – result displayed
- ^abFrom theR Language Definition,section 3.2 Control structures: "A semicolon always indicates the end of a statement while a new line may indicate the end of a statement. If the current statement is not syntactically complete new lines are simply ignored by the evaluator."
- ^Bash Reference Manual,3.1.2.1 Escape Character
- ^Python Documentation,2. Lexical analysis:2.1.5. Explicit line joining
- ^"Mathworks.com".Archived fromthe originalon 7 February 2010.
- ^"Parenthesis/Brackets - Windows CMD - SS64.com".ss64.com.
- ^"Scripts - Definition & Usage | AutoHotkey".
- ^For an M-file (MATLAB source) to be accessible by name, its parent directory must be in the search path (or current directory).
- ^abc"Verbose Syntax - F# | Microsoft Learn".Microsoft Learn.5 November 2021.Retrieved17 November2022.
- ^"Nim Manual".nim-lang.org.
- ^ab"Mathworks.com".Archived fromthe originalon 21 November 2013.Retrieved25 June2013.
- ^"Algol68_revised_report-AB.pdf on PDF pp. 61–62, original document pp. 121–122"(PDF).Retrieved27 May2014.
- ^"HTML Version of the Algol68 Revised Report AB".Archived fromthe originalon 17 March 2013.Retrieved27 May2014.
- ^ab"DLang.org, Lexical".Retrieved27 May2014.
- ^"AutoItScript.com Keyword Reference, #comments-start".Retrieved27 May2014.
- ^"slang-2.2.4/src/slprepr.c – line 43 to 113".Retrieved28 May2014.
- ^"Punctuation · The Julia Language".
- ^"Nim Manual".nim-lang.org.
- ^"Python tip: You can use multi-line strings as multi-line comments",11 September 2011, Guido van Rossum
- ^"Writing Documentation — Elixir v1.12.3".Retrieved28 July2023.
- ^"Perl 6 Documentation (Syntax)".docs.perl6.org. Comments.Retrieved5 April2017.
- ^"Using the FPP Preprocessor".Archived fromthe originalon 18 November 2022.Retrieved18 November2022.
- ^"Perl 6 POD Comments".25 May 2023.
- ^"Perl 6 POD (Abbreviated Blocks)".25 May 2023.
Notes
edit- ^Visual Basic.NETdoes not support traditional multi-line comments, but they can be emulated through compiler directives.
- ^abWhile C# supports traditional block comments
/*... */
,compiler directives can be used to mimic them just as in VB.NET. - ^abThe line continuation character
_
can be used to extend a single-line comment to the next line without needing to type'
orREM
again. This can be done up to 24 times in a row. - ^Fortrandoes not support traditional block comments, but some compilers support preprocessor directives in the style ofC/C++,allowing a programmer to emulate multi-line comments.[24]