Examine individual changes
This page allows you to examine the variables generated by the Edit Filter for an individual change.
Variables generated for this change
Variable | Value |
---|---|
Whether or not the edit is marked as minor (no longer in use) (minor_edit ) | false |
Edit count of the user (user_editcount ) | null |
Name of the user account (user_name ) | '145.101.82.124' |
Age of the user account (user_age ) | 0 |
Groups (including implicit) the user is in (user_groups ) | [
0 => '*'
] |
Rights that the user has (user_rights ) | [
0 => 'createaccount',
1 => 'read',
2 => 'edit',
3 => 'createtalk',
4 => 'writeapi',
5 => 'viewmywatchlist',
6 => 'editmywatchlist',
7 => 'viewmyprivateinfo',
8 => 'editmyprivateinfo',
9 => 'editmyoptions',
10 => 'abusefilter-view',
11 => 'abusefilter-log',
12 => 'abusefilter-log-detail',
13 => 'centralauth-merge',
14 => 'vipsscaler-test',
15 => 'ep-bereviewer'
] |
Whether or not a user is editing through the mobile interface (user_mobile ) | false |
Page ID (page_id ) | 14513019 |
Page namespace (page_namespace ) | 0 |
Page title without namespace (page_title ) | 'Comparison of programming languages (basic instructions)' |
Full page title (page_prefixedtitle ) | 'Comparison of programming languages (basic instructions)' |
Last ten users to contribute to the page (page_recent_contributors ) | [
0 => '2001:8B0:181:1:E59B:6E02:6B48:EF4E',
1 => 'Pauli133',
2 => 'Jarble',
3 => '217.72.217.144',
4 => 'InternetArchiveBot',
5 => 'Myconix',
6 => '213.192.104.22',
7 => 'Mild Bill Hiccup',
8 => 'Unready',
9 => 'Jwmwalrus'
] |
Action (action ) | 'edit' |
Edit summary/reason (summary ) | '' |
Old content model (old_content_model ) | 'wikitext' |
New content model (new_content_model ) | 'wikitext' |
Old page wikitext, before the edit (old_wikitext ) | '{{Refimprove|date=February 2009}}
{{ProgLangCompare}}
'''Comparison of programming languages''' is a common topic of discussion among [[software engineer]]s. Basic instructions of several [[programming language]]s are compared here.
__TOC__
== Conventions of this article ==
The '''bold''' is the literal code. The non-bold is interpreted by the reader. Statements in [[guillemets]] (« … ») are optional. {{keypress|Tab}} indicates a necessary indent (with whitespace).
{{Clear}}
== Type identifiers ==
=== [[Integer (computer science)|Integer]]s ===
{| class="wikitable"
! rowspan=2|
! colspan=2| 8 bit ([[byte]])
! colspan=2| 16 bit ([[short integer]])
! colspan=2| 32 bit
! colspan=2| 64 bit ([[long integer]])
! colspan=2| Word size
! rowspan=2| Arbitrarily precise ([[Arbitrary-precision arithmetic|bignum]])
|-
! Signed
! Unsigned
! Signed
! Unsigned
! Signed
! Unsigned
! Signed
! Unsigned
! Signed
! Unsigned
|-
| [[Ada (programming language)|Ada]]<ref name=Ada_RM_2012>Ada Reference Manual - Language and Standard Libraries; ISO/IEC 8652:201x (E), {{cite web |url=http://www.ada-auth.org/standards/12rm/RM-Final.pdf |title=Archived copy |accessdate=2013-07-19 |deadurl=yes |archiveurl=https://web.archive.org/web/20110427190723/http://www.ada-auth.org/standards/12rm/RM-Final.pdf |archivedate=2011-04-27 |df= }}</ref>
| <tt>range -2**7 .. 2**7 - 1</tt>{{ref|Ada_range|[j]}}
| <tt>range 0 .. 2**8 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**8</tt>{{ref|Ada_mod|[k]}}
| <tt>range -2**15 .. 2**15 - 1</tt>{{ref|Ada_range|[j]}}
| <tt>range 0 .. 2**16 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**16</tt>{{ref|Ada_mod|[k]}}
| <tt>range -2**31 .. 2**31 - 1</tt>{{ref|Ada_range|[j]}}
| <tt>range 0 .. 2**32 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**32</tt>{{ref|Ada_mod|[k]}}
| <tt>range -2**63 .. 2**63 - 1</tt>{{ref|Ada_range|[j]}}
| <tt>mod 2**64</tt>{{ref|Ada_mod|[k]}}
| <tt>Integer</tt>{{ref|Ada_range|[j]}}
| <tt>range 0 .. 2**Integer'<wbr/>Size - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod Integer'<wbr/>Size</tt>{{ref|Ada_mod|[k]}}
| {{n/a}}
|-
| rowspan=2| [[ALGOL 68]] (variable-width)
| rowspan=2| <tt>short short int</tt>{{ref|CInt|[c]}}
| rowspan=2 {{n/a}}
| rowspan=2| <tt>short int</tt>{{ref|CInt|[c]}}
| rowspan=2 {{n/a}}
| rowspan=2| <tt>int</tt>{{ref|CInt|[c]}}
| rowspan=2 {{n/a}}
| rowspan=2| <tt>long int</tt>{{ref|CInt|[c]}}
| rowspan=2 {{n/a}}
| <tt>int</tt>{{ref|CInt|[c]}}
| {{n/a}}
| rowspan=2| <tt>long long int</tt> {{ref|a68|[a]}}{{ref|a68g|[g]}}
|-
| colspan=2 align=center|<tt>bytes</tt> & <tt>bits</tt>
|-
| [[C (programming language)|C]] ([[C99]] fixed-width)
| rowspan=2| <tt>int8_t</tt>
| rowspan=2| <tt>uint8_t</tt>
| rowspan=2| <tt>int16_t</tt>
| rowspan=2| <tt>uint16_t</tt>
| rowspan=2| <tt>int32_t</tt>
| rowspan=2| <tt>uint32_t</tt>
| rowspan=2| <tt>int64_t</tt>
| rowspan=2| <tt>uint64_t</tt>
| rowspan=4| <tt>int</tt>
| rowspan=4| <tt>unsigned int</tt>
| rowspan=5 {{n/a}}
|-
| [[C++]] ([[C++11]] fixed-width)
|-
| [[C (programming language)|C]] ([[C99]] variable-width)
| rowspan=2| <tt>signed char</tt>
| rowspan=2| <tt>unsigned char</tt>
| rowspan=2| <tt>short</tt>{{ref|CInt|[c]}}
| rowspan=2| <tt>unsigned short</tt>{{ref|CInt|[c]}}
| rowspan=2| <tt>long</tt>{{ref|CInt|[c]}}
| rowspan=2| <tt>unsigned long</tt>{{ref|CInt|[c]}}
| rowspan=2| <tt>long long</tt>{{ref|CInt|[c]}}
| rowspan=2| <tt>unsigned long long</tt>{{ref|CInt|[c]}}
|-
| [[C++]] ([[C++11]] variable-width)
|-
| [[Objective-C]] ([[Cocoa (API)|Cocoa]])
| <tt>signed char''' <br>or<br> '''int8_t</tt>
| <tt>unsigned char''' <br>or<br> '''uint8_t</tt>
| <tt>short''' <br>or<br> '''int16_t</tt>
| <tt>unsigned short''' <br>or<br> '''uint16_t</tt>
| <tt>int''' <br>or<br> '''int32_t</tt>
| <tt>unsigned int''' <br>or<br> '''uint32_t</tt>
| <tt>long long''' <br>or<br> '''int64_t</tt>
| <tt>unsigned long long''' <br>or<br> '''uint64_t</tt>
| <tt>NSInteger''' <br>or<br> '''long</tt>
| <tt>NSUInteger''' <br>or<br> '''unsigned long</tt>
|-
| [[C Sharp (programming language)|C#]]
| <tt>sbyte</tt>
| <tt>byte</tt>
| rowspan=2| <tt>short</tt>
| <tt>ushort</tt>
| rowspan=2| <tt>int</tt>
| <tt>uint</tt>
| rowspan=2| <tt>long</tt>
| <tt>ulong</tt>
| <tt>IntPtr</tt>
| <tt>UIntPtr</tt>
| <tt>System.Numerics<wbr/>.BigInteger</tt><br/>(.NET 4.0)
|-
| [[Java (programming language)|Java]]
| <tt>byte</tt>
| {{n/a}}
| <tt>char</tt>{{ref|Java char|[b]}}
| {{n/a}}
| {{n/a}}
| {{n/a}}
| {{n/a}}
| <tt>java.math<wbr/>.BigInteger</tt>
|-
| [[Go (programming language)|Go]]
| <tt>int8</tt>
| <tt>uint8</tt> or <tt>byte</tt>
| <tt>int16</tt>
| <tt>uint16</tt>
| <tt>int32</tt>
| <tt>uint32</tt>
| <tt>int64</tt>
| <tt>uint64</tt>
| <tt>int</tt>
| <tt>uint</tt>
| <tt>big.Int</tt>
|-
| [[Swift (programming language)|Swift]]
| <tt>Int8</tt>
| <tt>UInt8</tt>
| <tt>Int16</tt>
| <tt>UInt16</tt>
| <tt>Int32</tt>
| <tt>UInt32</tt>
| <tt>Int64</tt>
| <tt>UInt64</tt>
| <tt>Int</tt>
| <tt>UInt</tt>
|
|-
| [[D (programming language)|D]]
| <tt>byte</tt>
| <tt>ubyte</tt>
| <tt>short</tt>
| <tt>ushort</tt>
| <tt>int</tt>
| <tt>uint</tt>
| <tt>long</tt>
| <tt>ulong</tt>
|{{n/a}}
|{{n/a}}
| <tt>BigInt</tt>
|-
| [[Common Lisp]]<ref name=HyperSpec>{{cite web|url=http://www.lispworks.com/documentation/HyperSpec/Front/index.htm|title=Common Lisp HyperSpec (TM)|author=|date=|work=lispworks.com|accessdate=30 January 2017}}</ref>
| <tt>(integer -128 127)</tt>
| <tt>(integer 0 255)</tt>
| <tt>(integer -32768 32767)</tt>
| <tt>(integer 0 65536)</tt>
| <tt>(integer -2147483648 2147483647)</tt>
| <tt>(integer 0 4294967296)</tt>
| <tt>(integer -9223372036854775808 9223372036854775807)</tt>
| <tt>(integer 0 18446744073709551616)</tt>
|
|
| <tt>bignum</tt>
|-
| [[Scheme (programming language)|Scheme]]
|
|
|
|
|
|
|
|
|
|
|
|-
| [[ISLISP]]<ref name=Specification>{{cite web|url=http://www.islisp.info/specification.html|title=www.islisp.info: Specification|author=|date=|work=islisp.info|accessdate=30 January 2017}}</ref>
|
|
|
|
|
|
|
|
|
|
| <tt>bignum</tt>
|-
| [[Pascal (programming language)|Pascal]] ([[Free Pascal|FPC]])
| <tt>shortint</tt>
| <tt>byte</tt>
| <tt>smallint</tt>
| <tt>word</tt>
| <tt>longint</tt>
| <tt>longword</tt>
| <tt>int64</tt>
| <tt>qword</tt>
| <tt>integer</tt>
| <tt>cardinal</tt>
| {{n/a}}
|-
| [[Visual Basic]]
| {{n/a}}
| rowspan=2|<tt>Byte</tt>
| <tt>Integer</tt>
| {{n/a}}
| <tt>Long</tt>
| {{n/a}}
| colspan=2 {{n/a}}
| rowspan=2 colspan=2 {{n/a}}
| rowspan=1 {{n/a}}
|-
| [[Visual Basic .NET]]
| <tt>SByte</tt>
| <tt>Short</tt>
| <tt>UShort</tt>
| <tt>Integer</tt>
| <tt>UInteger</tt>
| <tt>Long</tt>
| <tt>ULong</tt>
| <tt>System.Numerics<wbr/>.BigInteger</tt><br/>(.NET 4.0)
|-
| [[FreeBasic]]
| <tt>Byte</tt> or <tt>Integer<8></tt>
| <tt>UByte</tt> or <tt>UInteger<8></tt>
| <tt>Short</tt> or <tt>Integer<16></tt>
| <tt>UShort</tt> or <tt>UInteger<16></tt>
| <tt>Long</tt> or <tt>Integer<32></tt>
| <tt>ULong</tt> or <tt>UInteger<32></tt>
| <tt>LongInt</tt> or <tt>Integer<64></tt>
| <tt>ULongInt</tt> or <tt>UInteger<64></tt>
| <tt>Integer</tt>
| <tt>UInteger</tt>
| {{n/a}}
|-
| [[Python (programming language)|Python]] 2.x
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| <tt>int</tt>
| {{n/a}}
| <tt>long</tt>
|-
| Python 3.x
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| <tt>int</tt>
|-
| [[S-Lang (programming language)|S-Lang]]
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| {{n/a}}
|-
| [[Fortran]]
| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}
| {{n/a}}
| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}
| {{n/a}}
| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}
| {{n/a}}
| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}
| {{n/a}}
|
|
|
|-
| [[PHP]]
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| <tt>int</tt> {{ref|PHP 32/64 bit long|[m]}}
| {{n/a}}
| <tt>int</tt> {{ref|PHP 32/64 bit long|[m]}}
| {{n/a}}
| colspan=2 {{n/a}}
| {{ref|PHP bignum|[e]}}
|-
| [[Perl]] 5
| colspan=2 {{n/a}}{{ref|scalars|[d]}}
| colspan=2 {{n/a}}{{ref|scalars|[d]}}
| colspan=2 {{n/a}}{{ref|scalars|[d]}}
| colspan=2 {{n/a}}{{ref|scalars|[d]}}
| colspan=2 {{n/a}}{{ref|scalars|[d]}}
| <tt>Math::BigInt</tt>
|-
| [[Perl 6]]
| <tt>int8</tt>
| <tt>uint8</tt>
| <tt>int16</tt>
| <tt>uint16</tt>
| <tt>int32</tt>
| <tt>uint32</tt>
| <tt>int64</tt>
| <tt>uint64</tt>
| <tt>Int</tt>
| colspan=2 {{n/a}}
|-
| [[Ruby (programming language)|Ruby]]
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| <tt>Fixnum</tt>
| {{n/a}}
| <tt>Bignum</tt>
|-
| [[Erlang (programming language)|Erlang]]{{ref|Erlang_int|[n]}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| integer()
| {{n/a}}
| integer(){{ref|Erlang_arb|[o]}}
|-
| [[Scala (programming language)|Scala]]
| <tt>Byte</tt>
| {{n/a}}
| <tt>Short</tt>
| <tt>Char</tt>{{ref|Scala Char|[l]}}
| <tt>Int</tt>
| {{n/a}}
| <tt>Long</tt>
| {{n/a}}
| {{n/a}}
| {{n/a}}
| <tt>scala.math.BigInt</tt>
|-
| [[Seed7]]
| {{n/a}}
| {{n/a}}
| {{n/a}}
| {{n/a}}
| {{n/a}}
| {{n/a}}
| <tt>integer</tt>
| {{n/a}}
| {{n/a}}
| {{n/a}}
| <tt>bigInteger</tt>
|-
| [[Smalltalk]]
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| <tt>SmallInteger</tt>{{ref|Smalltalk|[i]}}
| {{n/a}}
| <tt>LargeInteger</tt>{{ref|Smalltalk|[i]}}
|-
| [[Windows PowerShell]]
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| {{n/a}}
|-
| [[OCaml]]
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| <tt>int32</tt>
| {{n/a}}
| rowspan=2| <tt>int64</tt>
| {{n/a}}
| <tt>int''' <br/> or <br/> '''nativeint</tt>
|
| <tt>open Big_int;; <br/> big_int</tt>
|-
| [[F Sharp (programming language)|F#]]
| <tt>sbyte</tt>
| <tt>byte</tt>
| <tt>int16</tt>
| <tt>uint16</tt>
| <tt>int32</tt> or <tt>int</tt>
| <tt>uint32</tt>
| <tt>uint64</tt>
| <tt>nativeint</tt>
| <tt>unativeint</tt>
| <tt>bigint</tt>
|-
| [[Standard ML]]
| {{n/a}}
| <tt>Word8.word</tt>
| colspan=2 {{n/a}}
| <tt>Int32.int</tt>
| <tt>Word32.word</tt>
| <tt>Int64.int</tt>
| <tt>Word64.word</tt>
| <tt>int</tt>
| <tt>word</tt>
| <tt>LargeInt.int</tt> or <br/> <tt>IntInf.int</tt>
|-
| [[Haskell (programming language)|Haskell]] ([[Glasgow Haskell Compiler|GHC]])
| «<tt>import Int</tt>» <br/> <tt>Int8</tt>
| «<tt>import Word</tt>» <br/> <tt>Word8</tt>
| «<tt>import Int</tt>» <br/> <tt>Int16</tt>
| «<tt>import Word</tt>» <br/> <tt>Word16</tt>
| «<tt>import Int</tt>» <br/> <tt>Int32</tt>
| «<tt>import Word</tt>» <br/> <tt>Word32</tt>
| «<tt>import Int</tt>» <br/> <tt>Int64</tt>
| «<tt>import Word</tt>» <br/> <tt>Word64</tt>
| <tt>Int</tt>
| «<tt>import Word</tt>» <br/> <tt>Word</tt>
| <tt>Integer</tt>
|-
| [[Eiffel (programming language)|Eiffel]]
| <tt>INTEGER_8</tt>
| <tt>NATURAL_8</tt>
| <tt>INTEGER_16</tt>
| <tt>NATURAL_16</tt>
| <tt>INTEGER_32</tt>
| <tt>NATURAL_32</tt>
| <tt>INTEGER_64</tt>
| <tt>NATURAL_64</tt>
| <tt>INTEGER</tt>
| <tt>NATURAL</tt>
| {{n/a}}
|-
| [[COBOL]]{{ref|Cobol|[h]}}
| <tt>BINARY-CHAR «SIGNED»</tt>
| <tt>BINARY-CHAR UNSIGNED</tt>
| <tt>BINARY-SHORT «SIGNED»</tt>
| <tt>BINARY-SHORT UNSIGNED</tt>
| <tt>BINARY-LONG «SIGNED»</tt>
| <tt>BINARY-LONG UNSIGNED</tt>
| <tt>BINARY-DOUBLE «SIGNED»</tt>
| <tt>BINARY-DOUBLE UNSIGNED</tt>
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| [[Mathematica]]
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| <tt>Integer</tt>
|-
| [[Wolfram Language]]
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| colspan=2 {{n/a}}
| <tt>Integer</tt>
|}
{{note|a68|a}} The <u>standard</u> constants <tt>int shorts</tt> and <tt>int lengths</tt> can be used to determine how many '<tt>short</tt>'s and '<tt>long</tt>'s can be usefully prefixed to '<tt>short int</tt>' and '<tt>long int</tt>'. The actually size of the '<tt>short int</tt>', '<tt>int</tt>' and '<tt>long int</tt>' is available as constants <tt>short max int</tt>, <tt>max int</tt> and <tt>long max int</tt> etc.
<br/>{{note|Java char|b}} Commonly used for characters.
<br/>{{note|CInt|c}} The ALGOL 68, C and C++ languages do not specify the exact width of the integer types <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and (C99, C++11) <tt>long long</tt>, so they are implementation-dependent. In C and C++ <tt>short</tt>, <tt>long</tt>, and <tt>long long</tt> types are required to be at least 16, 32, and 64 bits wide, respectively, but can be more. The <tt>int</tt> type is required to be at least as wide as <tt>short</tt> and at most as wide as <tt>long</tt>, and is typically the width of the word size on the processor of the machine (i.e. on a 32-bit machine it is often 32 bits wide; on 64-bit machines it is often 64 bits wide). C99 and C++11{{citation needed|date=December 2011}} also define the <tt>[u]intN_t</tt> exact-width types in the [[stdint.h]] header. See[[C syntax#Integral types]] for more information.
<br/>{{note|scalars|d}} Perl 5 does not have distinct types. Integers, floating point numbers, strings, etc. are all considered "scalars".
<br/>{{note|PHP bignum|e}} PHP has two arbitrary-precision libraries. The BCMath library just uses strings as datatype. The GMP library uses an internal "resource" type.
<br/>{{note|Kinds|f}} The value of "n" is provided by the <tt>SELECTED_INT_KIND</tt><ref name="fortranwiki.org">{{cite web|url=http://fortranwiki.org/fortran/show/selected_int_kind|title=selected_int_kind in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref> intrinsic function.
<br/>{{note|a68g|g}} [[ALGOL 68]]G's run time option ''<tt>--precision "number"</tt>'' can set precision for <tt>long long int</tt>s to the required "number" significant digits. The <u>standard</u> constants ''<tt>long long int width</tt>'' and ''<tt>long long max int</tt>'' can be used to determine actual precision.
<br/>{{note|Cobol|h}} [[COBOL]] allows the specification of a required precision and will automatically select an available type capable of representing the specified precision. "<tt>PIC S9999</tt>", for example, would require a signed variable of four decimal digits precision. If specified as a binary field, this would select a 16-bit signed type on most platforms.
<br/>{{note|Smalltalk|i}} [[Smalltalk]] automatically chooses an appropriate representation for integral numbers. Typically, two representations are present, one for integers fitting the native word size minus any tag bit (SmallInteger) and one supporting arbitrary sized integers (LargeInteger). Arithmetic operations support polymorphic arguments and return the result in the most appropriate compact representation.
<br/>{{note|Ada_range|j}} [[Ada (programming language)|Ada]] range types are checked for boundary violations at run-time (as well as at compile-time for static expressions). Run-time boundary violations raise a "constraint error" exception. Ranges are not restricted to powers of two. Commonly predefined Integer subtypes are: Positive (<tt>range 1 .. Integer'Last</tt>) and Natural (<tt>range 0 .. Integer'Last</tt>). <tt>Short_Short_Integer</tt> (8 bits), <tt>Short_Integer</tt> (16 bits) and <tt>Long_Integer</tt> (64 bits) are also commonly predefined, but not required by the Ada standard. Run time checks can be disabled if performance is more important than integrity checks.
<br/>{{note|Ada_mod|k}} [[Ada (programming language)|Ada]] modulo types implement modulo arithmetic in all operations, i.e. no range violations are possible. Modulos are not restricted to powers of two.
<br/>{{note|Scala char|l}} Commonly used for characters like Java's char.
<br/>{{note|PHP 32/64 bit long|m}} <tt>int</tt> in PHP has the same width as <tt>long</tt> type in C has on that system {{ref|CInt|[c]}}.
<br/>{{note|Erlang_int|n}} [[Erlang (programming language)|Erlang]] is dynamically typed. The type identifiers are usually used to specify types of record fields and the argument and return types of functions.<ref>{{cite web|url=http://www.erlang.org/doc/reference_manual/typespec.html|title=Erlang -- Types and Function Specifications|author=|date=|work=erlang.org|accessdate=30 January 2017}}</ref>
<br/>{{note|Erlang_arb|o}} When it exceeds one word.<ref>{{cite web|url=http://www.erlang.org/doc/efficiency_guide/advanced.html|title=Erlang -- Advanced|author=|date=|work=erlang.org|accessdate=30 January 2017}}</ref>
=== [[Floating point]] ===
{| class="wikitable"
!
! [[Single precision]]
! [[Double precision]]
! Other precision
! Processor dependent
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>Float</tt>
| <tt>Long_Float</tt>
| {{n/a}}
|-
| ALGOL 68
| <tt>real</tt>{{ref|a68|[a]}}
| <tt>long real</tt>{{ref|a68|[a]}}
| <tt>short real</tt>, <tt>long long real</tt>, etc.{{ref|a68g|[d]}}
|-
| C
| rowspan=3| <tt>float</tt>{{ref|lax floats|[b]}}
| rowspan=5| <tt>double</tt>
| rowspan=3| <tt>long double</tt>{{ref|C-long-double|[f]}}
|-
| C++ (STL)
|-
| Objective-C (Cocoa)
| <tt>CGFloat</tt>
|-
| C#
| rowspan=2| <tt>float</tt>
| rowspan=3 {{n/a}}
|-
| Java
|-
| Go
| <tt>float32</tt>
| <tt>float64</tt>
|-
| Swift
| <tt>Float'''<br/>'''Float32</tt>
| <tt>Double'''<br/>'''Float64</tt>
| <tt>Float80</tt>{{ref|Swift-long-double|[g]}}
| <tt>CGFloat</tt>
|-
| D
| <tt>float</tt>
| <tt>double</tt>
|
| <tt>real</tt>
|-
| Common Lisp
| <tt>single-float</tt>
| <tt>double-float</tt>
| <tt>float, short-float, long-float</tt>
|-
| Scheme
|
|
|
|-
| ISLISP
|
|
|
|-
| Pascal (Free Pascal)
| <tt>single</tt>
| <tt>double</tt>
|
| <tt>real</tt>
|-
| Visual Basic
| rowspan=3| <tt>Single</tt>
| rowspan=3| <tt>Double</tt>
| rowspan=3 {{n/a}}
|-
| Visual Basic .NET
|-
| Xojo
|-
| Python
| rowspan=2 {{n/a}}
| <tt>float</tt>
|
|-
| JavaScript
| <tt>Number</tt><ref name="Javascript numbers">[http://www.mozilla.org/js/language/E262-3.pdf 8.5 The Number Type]</ref>
| {{n/a}}
|-
| S-Lang
| <!-- '''x =''' value'''f;''' -->
| <!-- '''x =''' value''';''' -->
|
|-
| Fortran
| colspan=2|<tt>REAL(KIND = n)</tt>{{ref|real inds|[c]}}
|
|-
| PHP
|
| <tt>float</tt>
|
|-
| Perl
|
|
|
|-
| Perl 6
| <tt>num32</tt>
| <tt>num64</tt>
|
| <tt>Num</tt>
|-
| Ruby
| {{n/a}}
| <tt>Float</tt>
| rowspan=4 {{n/a}}
|-
| Scala
| <tt>Float</tt>
| <tt>Double</tt>
|-
| Seed7
| {{n/a}}
| <tt>float</tt>
|-
| Smalltalk
| <tt>Float</tt>
| <tt>Double</tt>
|-
| Windows PowerShell
|
|
|-
| OCaml
| {{n/a}}
| rowspan=2| <tt>float</tt>
| rowspan=3 {{n/a}}
|-
| F#
| <tt>float32</tt>
|-
| Standard ML
| {{n/a}}
|
| <tt>real</tt>
|-
| Haskell (GHC)
| <tt>Float</tt>
| <tt>Double</tt>
|
|-
| Eiffel
| <tt>REAL_32</tt>
| <tt>REAL_64</tt>
|
|-
| COBOL
| <tt>FLOAT-BINARY-7</tt>{{ref|Cobol_ieee|[e]}}
| <tt>FLOAT-BINARY-34</tt>{{ref|Cobol_ieee|[e]}}
| <tt>FLOAT-SHORT</tt>, <tt>FLOAT-LONG</tt>, <tt>FLOAT-EXTENDED</tt>
|-
| Mathematica
| {{n/a}}
| {{n/a}}
|
| <tt>Real</tt>
|}
{{note|a68_real|a}} The <u>standard</u> constants <tt>real shorts</tt> and <tt>real lengths</tt> can be used to determine how many '<tt>short</tt>'s and '<tt>long</tt>'s can be usefully prefixed to '<tt>short real</tt>' and '<tt>long real</tt>'. The actually size of the '<tt>short real</tt>', '<tt>real</tt>' and '<tt>long real</tt>' is available as constants <tt>short max real</tt>, <tt>max real</tt> and <tt>long max real</tt> etc. With the constants <tt>short small real</tt>, <tt>small real</tt> and <tt>long small real</tt> available for each type's [[machine epsilon]].
<br/>{{note|lax floats|b}} declarations of single precision often are not honored
<br/>{{note|real kinds|c}} The value of "n" is provided by the <tt>SELECTED_REAL_KIND</tt><ref name="ReferenceA">{{cite web|url=http://fortranwiki.org/fortran/show/selected_real_kind|title=selected_real_kind in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref> intrinsic function.
<br/>{{note|a68g-real|d}} [[ALGOL 68]]G's run time option ''<tt>--precision "number"</tt>'' can set precision for <tt>long long real</tt>s to the required "number" significant digits. The <u>standard</u> constants <tt>long long real width</tt> and '<tt>long long max real</tt> can be used to determine actual precision.
<br/>{{note|Cobol-ieee|e}} These IEEE floating-point types will be introduced in the next COBOL standard.
<br/>{{note|C-long-double|f}} Same size as '<tt>double</tt>' on many implementations.
<br/>{{note|Swift-long-double|g}} Swift supports 80-bit [[Extended precision#Language support|extended precision]] floating point type, equivalent to <tt>long double</tt> in C languages.
=== [[Complex number]]s ===
{|class="wikitable"
!
! Integer
! Single precision
! Double precision
! Half and Quadruple precision etc.
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| {{n/a}}
| <tt>Complex</tt>{{ref|generic type|[b]}}
| <tt>Complex</tt>{{ref|generic type|[b]}}
| <tt>Complex</tt>{{ref|generic type|[b]}}
|-
| ALGOL 68
| {{n/a}}
| <tt>compl</tt>
| <tt>long compl</tt> etc.
| <tt>short compl</tt> etc. & <tt>long long compl</tt> etc.
|-
| C (C99) <ref>{{cite web|url=https://www.gnu.org/software/libc/manual/html_node/Complex-Numbers.html#Complex-Numbers|title=The GNU C Library: Complex Numbers|author=|date=|work=gnu.org|accessdate=30 January 2017}}</ref>
| {{n/a}}
| <tt>float complex</tt>
| <tt>double complex</tt>
| rowspan=7 {{n/a}}
|-
| C++ (STL)
| {{n/a}}<!-- No std::complex<int>. See C++ standard section 26.2 paragraph 2 -->
| <tt>std::complex<float></tt>
| <tt>std::complex<double></tt>
|-
| C#
| {{n/a}}
| {{n/a}}
| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)
|-
| Java
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| Go
| {{n/a}}
| <tt>complex64</tt>
| <tt>complex128</tt>
|-
| D
| {{n/a}}
| <tt>cfloat</tt>
| <tt>cdouble</tt>
|-
| Objective-C
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| Common Lisp
| (complex integer)
| (complex single-float)
| (complex double-float)
| complex
|-
| Scheme
|
|
|
| rowspan=4 {{n/a}}
|-
| Pascal
| {{n/a}}
| {{n/a}}
|
|-
| Visual Basic
| {{n/a}}
| {{n/a}}
|
|-
| Visual Basic .NET
| {{n/a}}
| {{n/a}}
| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)
|-
| Perl
|
|
| <tt>Math::Complex</tt>
|
|-
| Perl 6
|
| <tt>complex64</tt>
| <tt>complex128</tt>
| <tt>Complex</tt>
|-
| Python
|
|
| <tt>complex</tt>
| rowspan=15 {{n/a}}
|-
| JavaScript
| {{n/a}}
| {{n/a}}
|
|-
| S-Lang
| {{n/a}}
| {{n/a}}
|
|-
| Fortran
|
| colspan=2|<tt>COMPLEX(KIND = n)</tt>{{ref|complex kinds|[a]}}
|-
| Ruby
| <tt>Complex</tt>
| {{n/a}}
| <tt>Complex</tt>
|-
| Scala
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| Seed7
| {{n/a}}
| {{n/a}}
| <tt>complex</tt>
|-
| Smalltalk
| <tt>Complex</tt>
| <tt>Complex</tt>
| <tt>Complex</tt>
|-
| Windows PowerShell
| {{n/a}}
| {{n/a}}
|
|-
| OCaml
| {{n/a}}
| {{n/a}}
| <tt>Complex.t</tt>
|-
| F#
|
|
| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)
|-
| Standard ML
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| Haskell (GHC)
| {{n/a}}
| <tt>Complex{{Not a typo|.}}Complex Float</tt>
| <tt>Complex{{Not a typo|.}}Complex Double</tt>
|-
| Eiffel
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| COBOL
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| Mathematica
| <tt>Complex</tt>
| {{n/a}}
| {{n/a}}
| <tt>Complex</tt>
|}
{{note|complex kinds|a}} The value of "n" is provided by the <tt>SELECTED_REAL_KIND</tt><ref name="ReferenceA"/> intrinsic function.
{{note|generic type|b}} Generic type which can be instantiated with any base floating point type.
=== Other variable types ===
{|class="wikitable"
! rowspan=2|
! colspan=2| Text
! rowspan=2| [[Boolean datatype|Boolean]]
! rowspan=2| [[Enumerated type|Enumeration]]
! rowspan=2| [[Object (computer science)|Object]]/[[Top type|Universal]]
|-
! [[Character (computing)|Character]]
! [[String (computer science)|String]]{{ref|string|[a]}}
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>Character</tt>
| <tt>String''' & '''Bounded_String''' & '''Unbounded_String</tt>
| <tt>Boolean</tt>
| <tt>('''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ...''')</tt>
| <tt>tagged null record</tt>
|-
| ALGOL 68
| <tt>char</tt>
| <tt>string''' & '''bytes</tt>
| <tt>bool''' & '''bits</tt>
| {{n/a}} - [http://rosettacode.org/wiki/Enumerations#ALGOL_68 User defined]
| {{n/a}}
|-
| C (C99)
| rowspan=2| <tt>char'''<br/>'''wchar_t</tt>
| {{n/a}}
| rowspan=2| <tt>bool</tt>{{ref|int bool|[b]}}
| rowspan=3|<tt>'''enum''' «name» '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''};</tt>
| rowspan=2| <tt>[[void type|void]] [[pointer (computer programming)|*]]</tt>
|-
| C++ (STL)
| <code>[[std::string|</code>«<tt>std::'''»'''<code>string]]</code></tt>
|-
| Objective-C
| <tt>unichar</tt>
| <tt>NSString *</tt>
| <tt>BOOL</tt>
| <tt>id</tt>
|-
| C#
| rowspan=2| <tt>char</tt>
| <tt>string</tt>
| <tt>bool</tt>
| rowspan=2| <tt>'''enum''' name '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}'''</tt>
| <tt>object</tt>
|-
| Java
| <tt>String</tt>
| <tt>boolean</tt>
| <tt>Object</tt>
|-
| Go
| <tt>byte'''<br/>'''rune</tt>
| <tt>string</tt>
| <tt>bool</tt>
| <tt>const (<dl><dd>'''item<sub>1</sub>''' = iota'''<br/>item<sub>2</sub><br/> ... '''</dd></dl>)</tt>
| <tt>interface{}</tt>
|-
| Swift
| <tt>Character</tt>
| <tt>String</tt>
| <tt>Bool</tt>
| <tt>'''enum''' name '''{ case''' item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}'''</tt>
| <tt>Any</tt>
|-
| D
| <tt>char</tt>
| <tt>string</tt>
| <tt>bool</tt>
| <tt>enum''' name '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}</tt>
| <tt>std.variant.Variant</tt>
|-
| Common Lisp
|
|
|
|
|
|-
| Scheme
|
|
|
|
|
|-
| ISLISP
|
|
|
|
|
|-
| Pascal (ISO)
| rowspan=2| <tt>char</tt>
| {{n/a}}
| rowspan=2| <tt>boolean</tt>
| rowspan=2| <tt>('''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ...''')</tt>
| {{n/a}}
|-
| Object Pascal (Delphi)
| <tt>string</tt>
| <tt>variant</tt>
|-
| Visual Basic
| {{n/a}}
| rowspan=3| <tt>String</tt>
| rowspan=3| <tt>Boolean</tt>
| rowspan=3| <tt>Enum''' name <dl><dd> item<sub>1</sub> <br /> item<sub>2</sub> <br /> ... </dd></dl> '''End Enum</tt>
| <tt>[[Variant type|Variant]]</tt>
|-
| Visual Basic .NET
| <tt>Char</tt>
| <tt>Object</tt>
|-
| Xojo
| {{n/a}}
| <tt>Object or Variant</tt>
|-
| Python
| {{n/a}}{{ref|string as char|[d]}}
| <tt>str</tt>
| <tt>bool</tt>
|
| <tt>object</tt>
|-
| JavaScript
| {{n/a}}{{ref|string as char|[d]}}
| <tt>String</tt>
| <tt>Boolean</tt>
|
| <tt>Object</tt>
|-
| S-Lang
|
|
|
|
|
|-
| Fortran
| <tt>CHARACTER(LEN = *)</tt>
| <tt>CHARACTER(LEN = :), allocatable </tt>
| <tt>LOGICAL(KIND = n)</tt>{{ref|logical kinds|[f]}}
|
| <tt>CLASS(*)</tt>
|-
| PHP
| {{n/a}}{{ref|string as char|[d]}}
| <tt>string</tt>
| <tt>bool</tt>
|
| (type declaration omitted)
|-
| Perl
| {{n/a}}{{ref|string as char|[d]}}
|
|
|
| <tt>UNIVERSAL</tt>
|-
| Perl 6
| <tt>Char</tt>
| <tt>Str</tt>
| <tt>Bool</tt>
| <tt>enum''' name '''<'''item<sub>1</sub> item<sub>2</sub> ...'''>''' or<br /> '''enum''' name '''<<:'''item<sub>1</sub>'''('''value''')''' ''':'''item<sub>2</sub>'''('''value''')''' ...'''>></tt>
| <tt>Mu</tt>
|-
| Ruby
| {{n/a}}{{ref|string as char|[d]}}
| <tt>String</tt>
| <tt>Object</tt>{{ref|Ruby's bool|[c]}}
|
| <tt>Object</tt>
|-
| Scala
| <tt>Char</tt>
| <tt>String</tt>
| <tt>Boolean</tt>
| <tt>object''' name '''extends Enumeration {'''<dl><dd>'''val''' item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''= Value'''</dd></dl>'''}</tt>
| <tt>Any</tt>
|-
| Seed7
| <tt>char</tt>
| <tt>string</tt>
| <tt>boolean</tt>
| <tt>'''const type''': name '''is new enum'''<dl><dd> item<sub>1</sub>''','''<br /> item<sub>2</sub>''','''<br /> ... </dd></dl>'''end enum;'''</tt>
|
|-
| Windows PowerShell
|
|
|
|
|
|-
| OCaml
| rowspan=3| <tt>char</tt>
| rowspan=3| <tt>string</tt>
| rowspan=3| <tt>bool</tt>
| {{n/a}}{{ref|enum|[e]}}
| {{n/a}}
|-
| F#
| <tt>type''' name '''=''' item<sub>1</sub> '''=''' value '''<nowiki>|</nowiki>''' item<sub>2</sub> = value '''<nowiki>|</nowiki></tt> ...
| <tt>obj</tt>
|-
| Standard ML
| {{n/a}}{{ref|enum|[e]}}
| {{n/a}}
|-
| Haskell (GHC)
| <tt>Char</tt>
| <tt>String</tt>
| <tt>Bool</tt>
| {{n/a}}{{ref|enum|[e]}}
| {{n/a}}
|-
| Eiffel
| <tt>CHARACTER</tt>
| <tt>STRING</tt>
| <tt>BOOLEAN</tt>
| {{n/a}}
| <tt>ANY</tt>
|-
| COBOL
| <tt>PIC X</tt>
| <tt>PIC X('''string length''') '''or''' PIC X«X...»</tt>
| <tt>PIC 1«('''number of digits''')» '''or''' PIC 1«1...»</tt>
| {{n/a}}
| <tt>OBJECT REFERENCE</tt>
|-
| Mathematica
| {{n/a}}{{ref|string as char|[d]}}
| <tt>String</tt>
|
|
| {{n/a}}
|}
{{note|string|a}} specifically, strings of arbitrary length and automatically managed.
<br/>{{note|int bool|b}} This language represents a boolean as an integer where false is represented as a value of zero and true by a non-zero value.
<br/>{{note|Ruby's bool|c}} All values evaluate to either true or false. Everything in '''<tt>TrueClass</tt>''' evaluates to true and everything in '''<tt>FalseClass</tt>''' evaluates to false.
<br/>{{note|string as char|d}}This language does not have a separate character type. Characters are represented as strings of length 1.
<br/>{{note|enum|e}} Enumerations in this language are algebraic types with only nullary constructors
<br/>{{note|logical kinds|f}} The value of "n" is provided by the <tt>SELECTED_INT_KIND</tt><ref name="fortranwiki.org"/> intrinsic function.
== Derived types ==
=== [[Array data type|Array]] ===
{{further|Comparison of programming languages (array)}}
{| class="wikitable"
|- valign="top"
! rowspan=2|
! colspan=2| fixed size array
! colspan=2| dynamic size array
|- valign="top"
! one-dimensional array
! [[Array data structure|multi-dimensional array]]
! one-dimensional array
! [[Array data structure|multi-dimensional array]]
|- valign="top"
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>'''array ('''<first>''' .. '''<last>''') of '''<type></tt><br>or<br>'''array ('''<discrete_type>''') of '''<type></tt>
| <tt>'''array ('''<first<sub>1</sub>>''' .. '''<last<sub>1</sub>>''', '''<first<sub>2</sub>>''' .. '''<last<sub>2</sub>>''',''' ...''') of '''<type><br>or<br>'''array ('''<discrete_type<sub>1</sub>>''', '''<discrete_type<sub>2</sub>>''', '''...''') of '''<type></tt>
| <tt>'''array ('''<discrete_type>''' range <>) of '''<type></tt>
| <tt>'''array ('''<discrete_type<sub>1</sub>>''' range <>, '''<discrete_type<sub>2</sub>>''' range <>,''' ...''') of '''<type></tt>
|- valign="top"
| ALGOL 68
| <tt>[''first'':''last'']'''<wbr/>«modename»'''</tt><br/>or simply:<br/><tt>[''size'']'''<wbr/>«modename»'''</tt>
| <tt>[''first<sub>1</sub>'':''last<sub>1</sub>'', ''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>or<br><tt>[''first<sub>1</sub>'':''last<sub>1</sub>''][''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>etc.
| <tt>'''flex'''[''first'':''last'']'''<wbr/>«modename»'''</tt><br/>or simply:<br/><tt>'''flex'''[''size'']'''<wbr/>«modename»'''</tt>
| <tt>'''flex'''[''first<sub>1</sub>'':''last<sub>1</sub>'', ''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>or<br/><tt>'''flex'''[''first<sub>1</sub>'':''last<sub>1</sub>'']<wbr/>'''flex'''[''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»''' etc.</tt>
|- valign="top"
| C (C99)
| <tt>type name'''['''size''']'''{{ref|C's array|[a]}}</tt>
| <tt>type name'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''{{ref|C's array|[a]}}</tt>
| <tt>type '''*'''name</tt><br/>or within a block:<br/><tt>int n = ...; type name'''['''n''']'''</tt>
|
|- valign="top"
| C++ (STL)
| colspan=1| <tt>'''[[std::array|«std::»array]]<'''type, size'''>'''</tt>(C++11)
|
| colspan=2| <tt>'''[[std::vector|«std::»vector]]<'''type'''>'''</tt>
|- valign="top"
| C#
| <tt>type'''[]'''</tt>
| <tt>type'''[{{Not a typo|,,}}'''...''']'''</tt>
| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/><'''type'''>'''</tt>
|
|- valign="top"
| Java
| <tt>type'''[]'''{{ref|Java's array|[b]}}</tt>
| <tt>type'''[][]'''...{{ref|Java's array|[b]}}</tt>
| <tt>'''ArrayList''' or '''ArrayList<'''type'''>'''</tt>
|
|- valign="top"
| D
| <tt>type'''['''size''']'''</tt>
| <tt>type'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''</tt>
| <tt>type'''[]'''</tt>
|
|- valign="top"
| Go
| <tt>'''['''size''']'''type</tt>
| <tt>'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''...type</tt>
| <tt>'''[]type'''</tt>
| <tt>'''[][]type'''</tt>
|
|- valign="top"
| Swift
|
|
| <tt>'''['''type''']'''</tt> or <tt>'''Array<'''type'''>'''</tt>
| <tt>'''<nowiki>[[</nowiki>'''type'''<nowiki>]]</nowiki>'''</tt> or <tt>'''Array<Array<'''type'''>>'''</tt>
|
|- valign="top"
| Objective-C
| <tt>'''NSArray'''</tt>
|
| <tt>'''NSMutableArray'''</tt>
|
|- valign="top"
| JavaScript
| {{n/a}}
| {{n/a}}
| colspan=2|<tt>'''Array'''</tt>{{ref|JavaScript's array|[d]}}
|- valign="top"
| Common Lisp
|
|
|
|
|- valign="top"
| Scheme
|
|
|
|
|- valign="top"
| ISLISP
|
|
|
|
|- valign="top"
| Pascal
| rowspan=2|<tt>'''array['''first'''..'''last'''] of''' type{{ref|subrange|[c]}}</tt>
| rowspan=2|<tt>'''array['''first<sub>1</sub>'''..'''last<sub>1</sub>'''] of array['''first<sub>2</sub>'''..'''last<sub>2</sub>'''] ''' ... '''of''' type {{ref|subrange|[c]}}<br/></tt>
or<br/>
<tt>''' array['''first<sub>1</sub>'''..'''last<sub>1</sub>''', '''first<sub>2</sub>'''..'''last<sub>2</sub>''', '''...'''] of''' type </tt>{{ref|subrange|[c]}}
| {{n/a}}
| {{n/a}}
|- valign="top"
| Object Pascal (Delphi)
|<tt>'''array of''' type</tt>
|<tt>'''array of array''' ... '''of''' type</tt>
|- valign="top"
| Visual Basic
| <tt><!-- '''Dim x('''last''') As '''type''' --></tt>
| <tt><!-- '''Dim x('''last<sub>1</sub>''', '''last<sub>2</sub>''','''...''') As '''type''' --></tt>
|
|
|- valign="top"
| Visual Basic .NET
|
|
| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/>(Of''' type''')'''</tt>
|
|- valign="top"
| Python
|
|
| <tt>'''list'''</tt>
|
|- valign="top"
| S-Lang
| <tt><!-- '''x = '''type'''['''size'''];''' --></tt>
| <tt><!-- '''x = '''type'''['''size<sub>1</sub>''', '''size<sub>2</sub>''', '''...'''];''' --></tt>
|
|
|- valign="top"
| Fortran
| <tt>''' '''type''' :: '''name'''('''size''')'''</tt>
| <tt>''' '''type''' :: '''name'''('''size'''<sub>1</sub>, '''size'''<sub>2</sub>,...)'''</tt>
| <tt>''' '''type''', ALLOCATABLE :: '''name'''(:)'''</tt>
| <tt>''' '''type''', ALLOCATABLE :: '''name'''(:,:,...)'''</tt>
|- valign="top"
| PHP
|
|
| <tt>'''array'''</tt>
|
|- valign="top"
| Perl
|
|
|
|
|- valign="top"
| Perl 6
|
|
| <tt>'''Array['''type''']''' or '''Array of''' type</tt>
|
|- valign="top"
| Ruby
|
| <tt><!-- '''x = Array.new('''size<sub>1</sub>'''){ Array.new('''size<sub>2</sub>''') }''' --></tt>
| <tt>'''Array'''</tt>
|
|- valign="top"
| Scala
| <tt>'''Array['''type''']'''</tt>
| <tt>'''Array['''...'''[Array['''type''']]'''...''']'''</tt>
| <tt>'''ArrayBuffer['''type''']'''</tt>
|
|- valign="top"
| Seed7
| <tt>'''array''' type<br />or<br />'''array ['''idxType''']''' type</tt>
| <tt>'''array array''' type<br />or<br />'''array ['''idxType'''] array ['''idxType''']''' type</tt>
| <tt>'''array''' type<br />or<br />'''array ['''idxType''']''' type</tt>
| <tt>'''array array''' type<br />or<br />'''array ['''idxType'''] array ['''idxType''']''' type</tt>
|- valign="top"
| Smalltalk
| <tt>'''Array'''</tt>
|
| <tt>'''OrderedCollection'''</tt>
|
|- valign="top"
| Windows PowerShell
| <tt>type'''[]'''</tt>
|<tt>type'''[{{Not a typo|,,}}'''...''']'''</tt>
|
|
|- valign="top"
| OCaml
| <tt>type '''array'''</tt>
| <tt>type '''array''' ... '''array'''</tt>
|
|
|- valign="top"
| F#
| <tt>type '''[]''' or type '''array'''</tt>
| <tt>type '''[{{Not a typo|,,}}'''...''']'''</tt>
| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/><'''type'''>'''</tt>
|
|- valign="top"
| Standard ML
| <tt>type '''vector''' or type '''array'''</tt>
|
|
|
|- valign="top"
| Haskell (GHC)
| <tt><!-- '''x = Array.array (0, '''size'''-1)''' list_of_association_pairs --></tt>
| <tt><!-- '''x = Array.array ((0, 0,'''...'''), ('''size<sub>1</sub>'''-1, '''size<sub>2</sub>'''-1,'''...'''))''' list_of_association_pairs --></tt>
|
|
|- valign="top"
| COBOL
| <tt>level-number type '''OCCURS''' size «'''TIMES'''»'''.'''
| <tt>one-dimensional array definition...</tt>
| <tt>level-number type '''OCCURS''' min-size '''TO''' max-size «'''TIMES'''» '''DEPENDING''' «'''ON'''» size'''.'''</tt>{{ref|COBOL DEPENDING ON clause|[e]}}
| {{n/a}}
|}
{{note|C's array|a}}In most expressions (except the <tt>sizeof</tt> and <tt>&</tt> operators), values of array types in C are automatically converted to a pointer of its first argument. See [[C syntax#Arrays]] for further details of syntax and pointer operations.
<br/>{{note|Java's array|b}} The C-like "type '''<tt>x[]</tt>'''" works in Java, however "type'''<tt>[] x</tt>'''" is the preferred form of array declaration.
<br/>{{note|subrange|c}} Subranges are used to define the bounds of the array.
<br/>{{note|JavaScript's array|d}} JavaScript's array are a special kind of object. <!-- explain array(size) thing -->
<br/>{{note|COBOL DEPENDING ON clause|e}} The <code>DEPENDING ON</code> clause in COBOL does not create a 'true' variable length array and will always allocate the maximum size of the array.
=== Other types ===
{| class="wikitable"
! rowspan=2|
! colspan=2|Simple composite types
! rowspan=2|[[Algebraic data type]]s
! rowspan=2|[[Union (computer science)|Unions]]
|-
! [[Record (computer science)|Records]]
! [[Tuple]] expression
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>'''type''' identifier '''is''' «'''abstract'''» «'''tagged'''» «'''limited'''» ['''record'''
<dl><dd>fieldname<sub>1</sub> ''':''' type''';'''</dd>
<dd>fieldname<sub>2</sub> ''':''' type''';'''</dd></dl>...<br>
'''end record''' <nowiki>|</nowiki>
'''null record''']</tt>
| {{n/a}}
| Any combination of records, unions and enumerations (as well as references to those, enabling recursive types).
| <tt>'''type''' identifier '''('''variation ''':''' discrete_type''') is record'''
<dl><dd>'''case''' variation '''is'''
<dl><dd>'''when''' choice_list<sub>1</sub> '''<nowiki>=></nowiki>'''
<dl><dd>fieldname<sub>1</sub> ''':''' type''';'''</dd>
<dd>...</dd></dl></dd></dl>
<dl><dd>'''when''' choice_list<sub>2</sub> '''<nowiki>=></nowiki>'''
<dl><dd>fieldname<sub>2</sub> ''':''' type''';'''</dd>
<dd>...</dd></dl></dd></dl>
<dl><dd>...</dd></dl>
'''end case;'''</dd></dl>'''end record'''</tt>
|-
| ALGOL 68
| <tt>'''struct''' ('''modename''' ''«fieldname»'', '''...''');</tt>
| colspan=2 align=center| Required types and operators can be [[User-defined function|user defined]]
| <tt>'''union''' ('''modename''', '''...''');</tt>
|-
| C (C99)
| rowspan=2| <tt>'''struct''' «name» '''{'''type name''';'''...'''};'''</tt>
| rowspan=2 {{n/a}}
| rowspan=3 {{n/a}}
| rowspan=3| <tt>'''union {'''type name''';'''...'''};'''</tt>
|-
| Objective-C
|-
| C++
| <tt>'''struct''' «name» '''{'''type name''';'''...'''};'''{{ref|C++'s struct|[b]}}</tt>
| <tt>[[C++11#Tuple_types|«std::»tuple]]<type<sub>1</sub>..type<sub>n</sub>></tt>
|-
| C#
| <tt>'''struct''' name '''{'''type name''';'''...'''}'''</tt>
|
|
| rowspan=3 {{n/a}}
|-
| Java
| {{n/a}}{{ref|just classes|[a]}}
|
|
|-
| JavaScript
|
| {{n/a}}
|
|-
| D
| <tt>'''struct''' name '''{'''type name''';'''...'''}'''</tt>
|
| <tt>'''std.variant.Algebraic'''!(type,...)</tt>
| <tt>'''union {'''type name''';'''...'''}'''</tt>
|-
| Go
| <tt>'''struct {<dl><dd>'''«name» type'''<br/>'''...'''</dd></dl>}'''</tt>
|
|
|
|-
| Swift
| <tt>'''struct''' name '''{<dl><dd>var '''name «''': '''type»'''<br/>'''...'''</dd></dl>}'''</tt>
| <tt>'''('''«name<sub>1</sub>''':'''» val<sub>1</sub>''',''' «name<sub>2</sub>''':'''» val<sub>2</sub>''',''' «name<sub>3</sub>''':'''» val<sub>3</sub>''',''' ... ''')'''</tt>
| <tt>'''enum''' name '''{ case''' Foo«'''('''types''')'''»''' case''' Bar «'''('''types''')'''» ... '''}'''</tt>
|
|-
| Common Lisp
|
| rowspan=3| <tt>'''(cons '''val<sub>1</sub> val<sub>2</sub>''')'''{{ref|pair only|[c]}}</tt>
|
|
|-
| Scheme
| {{n/a}}
|
|
|-
| ISLISP
|
|
|
|-
| Pascal
| <tt>'''record'''<dl><dd>name''':''' type''';'''<br/>...</dd></dl>'''end'''</tt>
| {{n/a}}
| {{n/a}}
| <tt>'''record'''<dl><dd>'''case''' type '''of''' <br/>value''': ('''types''');'''<br/>...</dd></dl>'''end'''</tt>
|-
| Visual Basic
|
|
|
|
|-
| Visual Basic .NET
| <tt>'''Structure''' name <dl><dd> '''Dim''' name '''As''' type <br/> ... </dd></dl>''' End Structure'''</tt>
|
|
|
|-
| Python
| {{n/a}}{{ref|just classes|[a]}}
| <tt>«'''('''»val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... «''')'''»</tt>
|
| {{n/a}}
|-
| S-Lang
| <tt>'''struct {'''name [=value], ...'''}'''</tt>
|
|
|
|-
| Fortran
|'''TYPE''' name <dl><dd> ''' '''type''' :: ''' name <br/> ... </dd></dl>''' END TYPE'''
|
|
|
|-
| PHP
| {{n/a}}{{ref|just classes|[a]}}
|
|
|
|-
| Perl
| {{n/a}}{{ref|Perl's records|[d]}}
|
|
| rowspan=3 {{n/a}}
|-
| Perl 6
| {{n/a}}{{ref|just classes|[a]}}
|
|
|-
| Ruby
| {{code|lang=ruby|1=OpenStruct.new({:name => value})}}
|
|
|-
| Scala
| <tt>'''case class''' name'''('''«'''var'''» name''':''' type''',''' ...''')'''</tt>
| <tt>'''('''val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... ''')'''</tt>
| <tt>'''abstract class''' name<br/>
'''case class''' Foo'''('''«parameters»''') extends''' name<br/>
'''case class''' Bar'''('''«parameters»''') extends''' name<br/>
...<br /></tt>
or<br />
<tt>'''abstract class''' name<br/>
'''case object''' Foo '''extends''' name<br/>
'''case object''' Bar '''extends''' name<br/>
...<br /></tt>
or combination of case classes and case objects
|
|-
| Windows PowerShell
|
|
|
|
|-
| OCaml
| rowspan=2| <tt>'''type''' name '''= {'''«'''mutable'''» name ''':''' type''';'''...'''}'''</tt>
| rowspan=2| <tt>«'''('''»val<sub>1</sub>''',''' val<sub>2</sub>''',''' val<sub>3</sub>''',''' ... «''')'''»</tt>
| rowspan=2| <tt>'''type''' name '''=''' Foo «'''of''' type»''' <nowiki>|</nowiki>''' Bar «'''of''' type»''' <nowiki>|</nowiki>''' ...</tt>
| rowspan=4 {{n/a}}
|-
| F#
|-
| Standard ML
| <tt>'''type''' name '''= {'''name ''':''' type''','''...'''}'''</tt>
| rowspan=2| <tt>'''('''val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... ''')'''</tt>
| <tt>'''datatype''' name '''=''' Foo «'''of''' type»''' <nowiki>|</nowiki>''' Bar «'''of''' type»''' <nowiki>|</nowiki>''' ...</tt>
|-
| Haskell
| <tt>'''data''' Name '''=''' Constr '''{'''name '''::''' type''','''...'''}'''</tt>
| <tt>'''data''' Name '''=''' Foo «types»''' <nowiki>|</nowiki>''' Bar «types»''' <nowiki>|</nowiki>''' ...</tt>
|-
| COBOL
| <tt>level-number name type clauses'''.'''<br/>
level-number+n name type clauses'''.'''<br/>
...</tt>
| {{n/a}}
| {{n/a}}
| <tt>name '''REDEFINES''' variable type'''.'''</tt>
|}
{{note|just classes|a}} Only classes are supported.
<br />{{note|C++'s struct|b}} <code>struct</code>s in C++ are actually classes, but have default public visibility and ''are'' also [[Plain old data structure|POD]] objects. C++11 extended this further, to make classes act identically to POD objects in many more cases.
<br />{{note|pair only|c}} pair only
<br />{{note|Perl's records|d}} Although Perl doesn't have records, because Perl's type system allows different data types to be in an array, "hashes" (associative arrays) that don't have a variable index would effectively be the same as records.
<br />{{note|enum|e}} Enumerations in this language are algebraic types with only nullary constructors
== Variable and constant declarations ==
{| class="wikitable"
!
! variable
! constant
! type synonym
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>identifier ''':''' type «''':=''' initial_value»{{ref|Ada declaration|[e]}}</tt>
| <tt>identifier ''': constant''' type ''':=''' final_value</tt>
| <tt>'''subtype''' identifier '''is''' type</tt>
|-
| [[ALGOL 68]]
|<tt>'''modename''' ''name'' «''':=''' initial_value»;</tt>
|<tt>'''modename''' ''name'' '''=''' value;</tt>
|<tt>'''[[typedef|mode]]''' '''synonym''' = '''modename''';</tt>
|-
| C (C99)
| rowspan=3| <tt>type name «'''=''' initial_value»''';'''</tt>
| rowspan=2| <tt>'''enum{''' name '''=''' value '''};'''</tt>
| rowspan=3| <tt>'''[[typedef]]''' type synonym''';'''</tt>
|-
| Objective-C
|-
| C++
| <tt>'''const''' type name '''=''' value''';'''</tt>
|-
| C#
| <tt>type name «'''=''' initial_value»''';''' or <br/> '''var''' name '''=''' value''';'''</tt>
| <tt>'''const''' type name '''=''' value''';''' or <br/> '''readonly''' type name '''=''' value''';'''</tt>
| <tt>'''using''' synonym '''=''' type''';'''</tt>
|-
| D
| <tt>type name «'''=''' initial_value»''';''' or <br/> '''auto''' name '''=''' value''';'''</tt>
| <tt>'''const''' type name '''=''' value''';''' or <br/> '''immutable''' type name '''=''' value''';'''</tt>
| <tt>'''alias''' type synonym''';'''</tt>
|-
| Java
| <tt>type name «'''=''' initial_value»''';'''</tt>
| <tt>'''final''' type name '''=''' value''';'''</tt>
| rowspan=2 {{n/a}}
|-
| JavaScript
| <tt>'''var''' name «'''=''' initial_value»''';'''</tt>
| <tt>'''const''' name '''=''' value''';'''</tt>
|-
| Go
| <tt>'''var''' name type «'''=''' initial_value» or <br/> name ''':=''' initial_value</tt>
| <tt>'''const''' name «type» '''=''' value</tt>
| <tt>'''type''' synonym type</tt>
|-
| Swift
| <tt>'''var''' name «''': '''type» «'''=''' initial_value»</tt>
| <tt>'''let''' name «''': '''type» '''=''' value</tt>
| <tt>'''typealias''' synonym '''=''' type</tt>
|-
| Common Lisp
| <tt>'''(defparameter''' name initial_value''')''' or <br/> '''(defvar''' name initial_value''')''' or <br/> '''(setf (symbol-value <nowiki>'</nowiki>'''symbol''')''' initial_value''')'''</tt>
| <tt>'''(defconstant''' name value''')'''</tt>
| <tt>'''(deftype '''synonym''' () <nowiki>'</nowiki>'''type''')'''</tt>
|-
| Scheme
| <tt>'''(define''' name initial_value''')'''</tt>
|
|
|-
| ISLISP
| <tt>'''(defglobal''' name initial_value''')''' or <br/> '''(defdynamic''' name initial_value''')'''</tt>
| <tt>'''(defconstant''' name value''')'''</tt>
| {{n/a}}
|-
| <tt>Pascal{{ref|Pascal's declarations|[a]}}</tt>
| <tt>name''':''' type «'''=''' initial_value»</tt>
| <tt>name '''=''' value</tt>
| <tt>synonym '''=''' type</tt>
|-
| Visual Basic
| <tt>'''Dim''' name '''As''' type</tt>
| rowspan=3| <tt>'''Const''' name '''As''' type '''=''' value</tt>
|
|-
| Visual Basic .NET
| <tt>'''Dim''' name '''As''' type«'''=''' initial_value»'''</tt>
| <tt>'''Imports''' synonym '''=''' type</tt>
|-
| Xojo
| <tt>'''Dim''' name '''As''' type«'''=''' initial_value»'''</tt>
| {{n/a}}
|-
| Python
| rowspan=2| <tt>name '''=''' initial_value</tt>
| rowspan=2 {{n/a}}
| <tt>synonym '''=''' type{{ref|variable types|[b]}}</tt>
|-
| [[CoffeeScript]]
| {{n/a}}
|-
| S-Lang
| <tt>name '''=''' initial_value''';'''</tt>
|
| <tt>'''typedef struct {...}''' typename</tt>
|-
| Fortran
| type name
| <tt>type''', PARAMETER :: ''' name '''=''' value</tt>
|
|-
| PHP
| <tt>'''$'''name '''=''' initial_value''';'''</tt>
| <tt>'''define("'''name'''", '''value''');''' <br /> '''const '''name''' = '''value (5.3+)</tt>
| rowspan=2 {{n/a}}
|-
| Perl
| <tt>«'''my'''» '''$'''name «'''=''' initial_value'''»;'''{{ref|Perl's my keyword|[c]}}</tt>
| <tt>'''use constant''' name '''=>''' value''';'''</tt>
|-
| Perl 6
| <tt>«'''my''' «type»» $name «'''=''' initial_value'''»;'''{{ref|Perl's my keyword|[c]}}</tt>
| <tt>«'''my''' «type»» '''constant''' name '''=''' value''';'''</tt>
| <tt>'''::'''synonym '''::=''' type</tt>
|-
| Ruby
| <tt>name '''=''' initial_value</tt>
| <tt>Name '''=''' value</tt>
| <tt>synonym '''=''' type{{ref|variable types|[b]}}</tt>
|-
| Scala
| <tt>'''var''' name«''':''' type» '''=''' initial_value</tt>
| <tt>'''val''' name«''':''' type» '''=''' value</tt>
| <tt>'''type''' synonym '''=''' type</tt>
|-
| Windows PowerShell
| <tt>«'''['''type''']'''»''' $'''name '''=''' initial_value</tt>
| {{n/a}}
| {{n/a}}
|-
| Bash shell
| <tt>name'''='''initial_value</tt>
| {{n/a}}
| {{n/a}}
|-
| OCaml
| <tt>'''let''' name «''':''' type '''ref'''» '''= ref''' value{{ref|ML ref|[d]}}</tt>
| rowspan=2| <tt>'''let''' name «''':''' type» '''=''' value</tt>
| rowspan=3| <tt>'''type''' synonym '''=''' type</tt>
|-
| F#
| <tt>'''let mutable''' name «''':''' type» '''=''' value</tt>
|-
| Standard ML
| <tt>'''val''' name «''':''' type '''ref'''» '''= ref''' value{{ref|ML ref|[d]}}</tt>
| <tt>'''val''' name «''':''' type» '''=''' value</tt>
|-
| Haskell
|
| <tt>«name'''::'''type''';'''» name '''=''' value</tt>
| <tt>'''type''' Synonym '''=''' type</tt>
|-
| [[Forth (programming language)|Forth]]
| <tt>'''VARIABLE''' name</tt> (in some systems use <tt>value '''VARIABLE''' name</tt> instead)
| <tt>value '''CONSTANT''' name</tt>
|
|-
| COBOL
| <tt>level-number name type clauses'''.'''</tt>
| <tt>«'''0'''»'''1''' name '''CONSTANT''' «'''AS'''» value'''.'''</tt>
| <tt>level-number name type clauses «'''IS'''» '''TYPEDEF.'''</tt>
|-
| Mathematica
| <tt>name'''='''initialvalue</tt>
| {{n/a}}
| {{n/a}}
|}
{{note|Pascal's declarations|a}} Pascal has declaration blocks. See [[Comparison of programming languages (basic instructions)#Functions]].
<br/>{{note|variable types|b}}Types are just regular objects, so you can just assign them.
<br/>{{note|Perl's my keyword|c}} In Perl, the "my" keyword scopes the variable into the block.
<br/>{{note|ML ref|d}} Technically, this does not declare ''name'' to be a mutable variable—in ML, all names can only be bound once; rather, it declares ''name'' to point to a "reference" data structure, which is a simple mutable cell. The data structure can then be read and written to using the <tt>!</tt> and <tt>:=</tt> operators, respectively.
<br/>{{note|Ada declaration|[e]}} If no initial value is given, an invalid value is automatically assigned (which will trigger a run-time exception if it used before a valid value has been assigned). While this behaviour can be suppressed it is recommended in the interest of predictability. If no invalid value can be found for a type (for example in case of an unconstraint integer type), a valid, yet predictable value is chosen instead.
== [[Control flow]] ==
=== [[Conditional (programming)|Conditional]] statements ===
{| class="wikitable"
|- valign="top"
!
! if
! else if
! [[switch statement|select case]]
! [[Conditional (programming)#If expressions|conditional expression]]
|- valign="top"
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| rowspan=2| <tt>'''if''' condition '''then''' <dl><dd>statements</dd></dl> «'''else''' <dl><dd>statements»</dd></dl> '''end if'''</tt>
| rowspan=2| <tt>'''if''' condition<sub>1</sub> '''then''' <dl><dd>statements</dd></dl> '''elsif''' condition<sub>2</sub> '''then''' <dl><dd>statements</dd></dl>...<br>«'''else''' <dl><dd>statements»</dd></dl> '''end if'''</tt>
| <tt>'''case''' expression '''is'''<dl><dd>'''when''' value_list<sub>1</sub> '''<nowiki>=></nowiki>''' statements</dd><dd>'''when''' value_list<sub>2</sub> '''=>''' statements</dd></dl>...<dl><dd>«'''when others <nowiki>=></nowiki>''' statements» </dd></dl>'''end case'''</tt>
| <tt>'''(if''' condition<sub>1</sub> '''then''' <dl><dd>expression<sub>1</sub></dd></dl> «'''elsif''' condition<sub>2</sub> '''then''' <dl><dd>expression<sub>2</sub>»</dd></dl> ... <br> '''else''' <dl><dd>expression<sub>n</sub></dd></dl>''')'''<br>'''(case''' expression '''is''' <dl><dd>'''when''' value_list<sub>1</sub> '''<nowiki>=></nowiki>''' expression<sub>1</sub></dd><dd>'''when''' value_list<sub>2</sub> '''=>''' expression<sub>2</sub></dd></dl> ... <dl><dd> «'''when others <nowiki>=></nowiki>''' expression<sub>n</sub>» </dd></dl>''')'''</tt>
|- valign="top"
| [[Seed7]]
| <tt>'''case''' expression '''of'''<br />'''when''' set1 ''':''' statements<br/>...<br/>«'''otherwise:''' statements» <br />'''end case'''</tt>
|
|- valign="top"
| [[Modula-2]]
| <tt>'''if''' condition '''then''' <dl><dd>statements</dd></dl> «'''else''' <dl><dd>statements»</dd></dl> '''end'''</tt>
| <tt>'''if''' condition<sub>1</sub> '''then''' <dl><dd>statements</dd></dl> '''elsif''' condition<sub>2</sub> '''then''' <dl><dd>statements</dd></dl>...<br>«'''else''' <dl><dd>statements»</dd></dl> '''end'''</tt>
| rowspan=1 | <tt>'''case''' expression '''of'''<br />caseLabelList ''':''' statements '''<nowiki>|</nowiki>'''<br/>...<br/>«'''else''' statements» <br />'''end'''</tt>
|
|- valign="top"
| rowspan=2 |[[ALGOL 68]] & "brief form"
| <tt>'''if''' condition '''then ''' statements «'''else''' statements» '''fi'''</tt>
| <tt>'''if''' condition '''then''' statements '''elif''' condition '''then''' statements '''fi'''</tt>
| <tt>'''case''' switch '''in''' statements, statements«,... '''out''' statements» '''esac'''</tt>
| rowspan=2 | <pre>( condition | valueIfTrue | valueIfFalse )</pre>
|- valign="top"
|<pre>( condition | statements «| statements» )</pre>
|<pre>( condition | statements |: condition | statements )</pre>
|<pre>( variable | statements,... «| statements» )</pre>
|- valign="top"
| [[APL (programming language)|APL]]
| <tt>''':If''' condition <dl><dd>instructions</dd></dl> «''':Else''' <dl><dd>instructions»</dd></dl>''':EndIf'''</tt>
| <tt>''':If''' condition <dl><dd>instructions</dd></dl> ''':ElseIf''' condition <dl><dd>instructions</dd></dl> ... <br/>«''':Else''' <dl><dd>instructions»</dd></dl> ''':EndIf'''</tt>
| <tt>''':Select''' expression <br/> ''':Case''' case1 <br/> <dl><dd>instructions</dd></dl> ... <br/> «''':Else'''<dl><dd>instructions»</dd></dl>''':EndSelect'''</tt>
| <tt>'''{'''condition''':'''valueIfTrue''' ⋄ '''valueIfFalse'''}'''</tt>
|- valign="top"
| C (C99)
| rowspan=9|<tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
| rowspan=8|<tt>'''if ('''condition''') {'''instructions'''}<br/>else if ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>
| rowspan=7|<tt>'''switch ('''variable''') {<dl><dd>case''' case1''':''' instructions «'''break;'''»<br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>
| rowspan=8| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>
|- valign="top"
| Objective-C
|- valign="top"
| C++ (STL)
|- valign="top"
| D
|- valign="top"
| Java
|- valign="top"
| JavaScript
|- valign="top"
| PHP
|- valign="top"
| C#
| <tt>'''switch ('''variable''') {<dl><dd>case''' case1''':''' instructions'''; '''«jump statement''';'''»<br/>...<br/>«'''default:''' instructions''';''' «jump statement''';'''»» </dd></dl> '''}'''</tt>
|- valign="top"
| Windows PowerShell
| <tt>'''if ('''condition''') { '''instructions''' }<br/>elseif ('''condition''') { '''instructions''' }'''<br/>...<br/>«'''else { '''instructions''' }'''»</tt>
| <tt>'''switch ('''variable''') { '''case1''' { '''instructions «'''break;'''» '''}''' ... «'''default { '''instructions''' }'''»'''}'''</tt>
|
|- valign="top"
| Go
| <tt>'''if '''condition''' {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
| <tt>'''if '''condition''' {'''instructions'''}<br/>else if '''condition''' {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/> or <br/> '''switch {<dl><dd>case''' condition''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>
| <tt>'''switch '''variable''' {<dl><dd>case''' case1''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>
|
|- valign="top"
| Swift
| <tt>'''if '''condition''' {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
| <tt>'''if '''condition''' {'''instructions'''}<br/>else if '''condition''' {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/></tt>
| <tt>'''switch '''variable''' {<dl><dd>case''' case1''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>
|
|- valign="top"
| Perl
| <tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless ('''notcondition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
| <tt>'''if ('''condition''') {'''instructions'''}<br/>elsif ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless ('''notcondition''') {'''instructions'''}<br/>elsif ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>
| <tt>'''use feature "switch";'''<br/>...<br/>'''given ('''variable''') {<dl><dd>when ('''case1''') { '''instructions''' }'''<br/>...<br/>«'''default { '''instructions''' }'''»</dd></dl>'''}'''</tt>
| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>
|- valign="top"
| Perl 6
| <tt>'''if''' condition '''{'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless''' notcondition '''{'''instructions'''}'''</tt>
| <tt>'''if''' condition''' {'''instructions'''}<br/>elsif''' condition '''{'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''</tt>
| <tt>'''given''' variable '''{<dl><dd>when''' case1 '''{ '''instructions''' }'''<br/>...<br/>«'''default { '''instructions''' }'''»</dd></dl>'''}'''</tt>
| <tt>condition '''[[?:|??]]''' valueIfTrue '''!!''' valueIfFalse</tt>
|- valign="top"
| Ruby
| <tt>'''if''' condition <dl><dd>instructions</dd></dl> «'''else''' <dl><dd>instructions»</dd></dl> </tt>
| <tt>'''if''' condition <dl><dd>instructions</dd></dl> '''elsif''' condition <dl><dd>instructions</dd></dl> ... <br/>«'''else''' <dl><dd>instructions»</dd></dl> '''end'''</tt>
| <tt>'''case''' variable <br/> '''when''' case1 <br/> <dl><dd>instructions</dd></dl> ... <br/> «'''else'''<dl><dd>instructions»</dd></dl>'''end'''</tt>
| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>
|- valign="top"
| Scala
| <tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
| <tt>'''if ('''condition''') {'''instructions'''}<br/>else if ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>
| <tt>expression '''match {'''<dl><dd>'''case''' pattern1 '''=>''' expression<br/>'''case''' pattern2 '''=>''' expression<br/>...<br/>«'''case _ =>''' expression»</dd></dl>'''}'''{{ref|pattern matching|[b]}}</tt>
| <tt>'''if ('''condition''')''' valueIfTrue '''else''' valueIfFalse</tt>
|- valign="top"
| Smalltalk
| <tt>condition '''ifTrue:''' <dl><dd>trueBlock</dd></dl> «'''ifFalse:''' <dl><dd>falseBlock»</dd></dl> '''end'''</tt>
|
|
| <tt>condition '''ifTrue:''' trueBlock '''ifFalse:''' falseBlock</tt>
|- valign="top"
| Common Lisp
| <tt>'''(when '''condition<br/> <dl><dd>instructions''')'''</dd></dl> or<br/> '''(unless '''condition<br/> <dl><dd>instructions''')'''</dd></dl> or<br/> '''(if '''condition'''<br/><dl><dd>(progn '''instructions''')</dd><dd>'''«'''(progn '''instructions''')'''»''')'''</dd></dl></tt>
| <tt>'''(cond ('''condition1 instructions''')<br/><dl><dd>('''condition2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>
| <tt>'''(case '''expression'''<dl><dd>('''case1 instructions''')</dd><dd>('''case2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(otherwise '''instructions''')'''»''')'''</dd></dl></tt>
| rowspan=2| <tt>'''(if '''condition valueIfTrue valueIfFalse''')'''</tt>
|- valign="top"
| Scheme
| <tt>'''(when '''conditioninstructions''')''' or <br/> '''(if '''condition''' (begin '''instructions''') '''«'''(begin '''instructions''')'''»''')'''</tt>
| <tt>'''(cond ('''condition1 instructions''') ('''condition2 instructions''') '''...''' '''«'''(else '''instructions''')'''»''')'''</tt>
| <tt>'''(case ('''variable''') (('''case1''')''' instructions''') (('''case2''')''' instructions''') '''...''' '''«'''(else '''instructions''')'''»''')'''</tt>
|- valign="top"
| ISLISP
| <tt>'''(if '''condition'''<br/><dl><dd>(progn '''instructions''')</dd><dd>'''«'''(progn '''instructions''')'''»''')'''</dd></dl></tt>
| <tt>'''(cond ('''condition1 instructions''')<br/><dl><dd>('''condition2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>
| <tt>'''(case '''expression'''<dl><dd>('''case1 instructions''')</dd><dd>('''case2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>
| <tt>'''(if '''condition valueIfTrue valueIfFalse''')'''</tt>
|- valign="top"
| Pascal
| <tt>'''if''' condition '''then begin''' <dl><dd>instructions</dd></dl> '''end''' <br/> «'''else begin'''<dl><dd>instructions</dd></dl>'''end'''»{{ref|pascal semicolon|[c]}}</tt>
| <tt>'''if''' condition '''then begin''' <dl><dd>instructions</dd></dl> '''end <br/> else if''' condition '''then begin'''<dl><dd>instructions</dd></dl> '''end'''<br/>...<br/>«'''else begin'''<dl><dd>instructions</dd></dl> '''end'''»{{ref|pascal semicolon|[c]}}</tt>
| <tt>'''case '''variable''' of''' <dl><dd>case1''':''' instructions <br/> ... <br/> «'''else:''' instructions»</dd></dl>'''end'''{{ref|pascal semicolon|[c]}}</tt>
|- valign="top"
| Visual Basic
| rowspan=3| <tt>'''If''' condition '''Then''' <dl><dd>instructions</dd></dl> «'''Else''' <dl><dd>instructions»</dd></dl>'''End If'''</tt>
| rowspan=3| <tt>'''If''' condition '''Then''' <dl><dd>instructions</dd></dl> '''ElseIf''' condition '''Then''' <dl><dd>instructions</dd></dl> ... <br/> «'''Else''' <dl><dd>instructions»</dd></dl>'''End If'''</tt>
| rowspan=3| <tt>'''Select Case''' variable <br/> '''Case''' case1 <dl><dd>instructions</dd></dl> ... <br/> «'''Case Else''' <dl><dd>instructions»</dd></dl> '''End Select'''</tt>
| <tt>'''[[IIf]]('''condition''', '''valueIfTrue''', '''valueIfFalse''')'''</tt>
|- valign="top"
| Visual Basic .NET
| rowspan=2| <tt>'''If('''condition''', '''valueIfTrue''', '''valueIfFalse''')'''</tt>
|- valign="top"
| Xojo
|- valign="top"
| Python {{ref|python indent|[a]}}
| <tt>'''if''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>
| <tt>'''if''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> '''elif''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> ... <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>
|
| <tt>valueIfTrue '''if''' condition '''else''' valueIfFalse</tt><br/>(Python 2.5+)
|- valign="top"
| S-Lang
| <tt>'''if ('''condition''') { '''instructions''' } '''«'''else { '''instructions''' }'''»</tt>
| <tt>'''if ('''condition''') { '''instructions''' } else if ('''condition''') {''' instructions '''}''' ... «'''else { '''instructions '''}'''»</tt>
| <tt>'''switch ('''variable''') { case '''case1''': '''instructions''' } { case '''case2''': '''instructions''' }''' ...</tt>
|
|- valign="top"
| Fortran
| <tt>'''IF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ELSE <dl><dd> '''instructions''' </dd></dl> ENDIF'''</tt>
| <tt>'''IF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ELSEIF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ... <br/> ELSE <dl><dd> '''instructions''' </dd></dl> ENDIF'''</tt>
| <tt>'''SELECT CASE('''variable''')<dl><dd> CASE ('''case1''') <dl><dd> '''instructions''' </dd></dl> ... <br/> CASE DEFAULT <dl><dd> '''instructions''' </dd></dl> </dd></dl> END SELECT</tt>
|
|- valign="top"
| Forth
| <tt>condition''' IF '''instructions «''' ELSE '''instructions»''' THEN'''</tt>
| <tt>condition''' IF '''instructions ''' ELSE '''condition''' IF '''instructions''' THEN THEN'''</tt>
| <tt>value''' CASE'''<br/>case''' OF '''instructions''' ENDOF'''<br/>case''' OF '''instructions''' ENDOF'''<br/> default instructions<br/>'''ENDCASE'''</tt>
| <tt>condition''' IF '''valueIfTrue''' ELSE '''valueIfFalse''' THEN'''</tt>
|- valign="top"
| OCaml
| <tt>'''if''' condition '''then begin''' instructions '''end''' «'''else begin''' instructions '''end'''»</tt>
| <tt>'''if''' condition '''then begin''' instructions '''end else if''' condition '''then begin''' instructions '''end''' ... «'''else begin''' instructions '''end'''»</tt>
| rowspan=2| <tt>'''match''' value '''with <dl><dd>'''pattern1''' <nowiki>-></nowiki> '''expression'''<br/><nowiki>|</nowiki> '''pattern2''' <nowiki>-></nowiki> '''expression<br/> ... <br/>«'''<nowiki>| _ -></nowiki> '''expression»{{ref|pattern matching|[b]}}</dd></dl></tt>
| rowspan=4| <tt>'''if''' condition '''then''' valueIfTrue '''else''' valueIfFalse</tt>
|- valign="top"
| F#
| <tt>'''if''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> «'''else''' <br/>{{keypress|Tab}} instructions»</tt>
| <tt>'''if''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> '''elif''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> ... <br/> «'''else''' <br/>{{keypress|Tab}} instructions»</tt>
|- valign="top"
| Standard ML
| <tt>'''if''' condition '''then''' «'''('''»instructions «''')'''»<br/>'''else''' «'''('''» instructions «''')'''»</tt>
| <tt>'''if''' condition '''then''' «'''('''»instructions «''')'''»<br/>'''else if''' condition '''then''' «'''('''» instructions «''')'''»<br/>...<br/>'''else''' «'''('''» instructions «''')'''»</tt>
| <tt>'''case''' value '''of<dl><dd>'''pattern1''' <nowiki>=></nowiki> '''expression'''<br/> <nowiki>|</nowiki> '''pattern2''' => '''expression<br/> ...<br/> «'''<nowiki>| _ =></nowiki> '''expression»{{ref|pattern matching|[b]}}</dd></dl></tt>
|- valign="top"
| Haskell (GHC)
| <tt>'''if''' condition '''then''' expression '''else''' expression</tt><br/>or<br/><tt>'''when''' condition '''(do''' instructions''')'''</tt><br/>or<br/><tt>'''unless''' notcondition '''(do''' instructions''')'''</tt>
| <tt>result '''<nowiki>|</nowiki>''' condition '''=''' expression <dl><dd>'''<nowiki>|</nowiki>''' condition '''=''' expression <br/>'''<nowiki>|</nowiki> otherwise =''' expression</dd></dl></tt>
| <tt>'''case''' value '''of {<dl><dd>'''pattern1''' <nowiki>-></nowiki> '''expression''';<br/>'''pattern2''' <nowiki>-></nowiki>'''expression''';'''<br/> ... <br/>«'''<nowiki>_ -></nowiki> '''expression»</dd></dl>'''}'''{{ref|pattern matching|[b]}}</tt>
|- valign="top"
| Bash shell
| <poem><tt>'''if''' condition-command; '''then'''
{{space|4}}expression
«'''else'''
{{space|4}}expression»
'''fi'''</tt></poem>
| <poem><tt>'''if''' condition-command; '''then'''
{{space|4}}expression
'''elif''' condition-command; '''then'''
{{space|4}}expression
«'''else'''
{{space|4}}expression»
'''fi'''</tt></poem>
| <poem><tt>'''case''' "$variable" '''in'''
"$condition1" )
{{space|4}}command...
;;
"$condition2" )
{{space|4}}command...
;;
'''esac'''</tt></poem>
|
|- valign="top"
| rowspan=5| CoffeeScript
| <tt>'''if''' condition '''then''' expression «'''else''' expression»</tt>
| <tt>'''if''' condition '''then''' expression '''else if''' condition '''then''' expression «'''else''' expression»</tt>
| rowspan=2| <tt>'''switch''' expression <dl><dd>'''when''' condition '''then''' expression</dd></dl> <dl><dd>'''else''' expression</dd></dl></tt>
| rowspan=5| ''All conditions are expressions''
|- valign="top"
| <tt>'''if''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>
| <tt>'''if''' condition <dl><dd>expression</dd></dl> '''else if''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>
|- valign="top"
| <tt>expression '''if''' condition</tt>
| rowspan=3| <tt>'''unless''' condition <dl><dd>expression</dd></dl> '''else unless''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>
| rowspan=3| <tt>'''switch''' expression <dl><dd>'''when''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></dd></dl></tt>
|- valign="top"
| <tt>'''unless''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>
|- valign="top"
| <tt>expression '''unless''' condition</tt>
|- valign="top"
| COBOL
| <tt>'''IF''' condition «'''THEN'''» <dl><dd> expression </dd></dl> «'''ELSE''' <dl><dd> expression»'''.''' </dd></dl></tt>{{ref|COBOL END-IF|[d]}}
|
| <tt>'''EVALUATE''' expression «'''ALSO''' expression...» <dl><dd> '''WHEN''' case-or-condition «'''ALSO''' case-or-condition...» <dl><dd> expression </dd></dl></dd></dl> <dl><dd> ... </dd></dl> <dl><dd>«'''WHEN OTHER''' <dl><dd> expression» </dd></dl></dd></dl> '''END-EVALUATE'''</tt>
|
|- valign="top"
!
! if
! else if
! [[switch statement|select case]]
! [[Conditional (programming)#If expressions|conditional expression]]
|}
{{note|python indent|a}} A single instruction can be written on the same line following the colon. Multiple instructions are grouped together in a [[block (programming)|block]] which starts on a newline (The indentation is required). The conditional expression syntax does not follow this rule.
<br/>
{{note|pattern matching|b}} This is [[pattern matching]] and is similar to select case but not the same. It is usually used to deconstruct [[algebraic data type]]s.
<br/>
{{note|pascal semicolon|c}} In languages of the Pascal family, the semicolon is not part of the statement. It is a separator between statements, not a terminator.
<br/>
{{note|COBOL END-IF|d}} <tt>'''END-IF'''</tt> may be used instead of the period at the end.
=== [[Control flow#Loops|Loop statements]] ===
{| class="wikitable"
|-
!
! [[while loop|while]]
! [[do while loop|do while]]
! [[for loop|for i = first to last]]
! [[foreach]]
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>'''while''' condition '''loop''' <dl><dd>statements</dd></dl> '''end loop'''</tt>
| <tt>'''loop''' <dl><dd>statements</dd><dd>'''exit when not''' condition</dd></dl> '''end loop'''</tt>
| <tt>'''for''' index '''in''' «'''reverse'''» [first '''..''' last <nowiki>|</nowiki> discrete_type] '''loop''' <dl><dd>statements</dd></dl> '''end loop'''</tt>
| <tt>'''for''' item '''of''' «'''reverse'''» iterator '''loop''' <dl><dd>statements</dd></dl> '''end loop''' <br><br> '''(for''' ['''all''' <nowiki>|</nowiki> '''some'''] ['''in''' <nowiki>|</nowiki> '''of'''] [first '''..''' last <nowiki>|</nowiki> discrete_type <nowiki>|</nowiki> iterator] '''=>''' predicate''')'''{{ref|Ada_quantifiers|[b]}}</tt>
|-
|rowspan=2| [[ALGOL 68]] ||colspan=3 align=center| <tt>«'''for''' index» «'''from''' first» «'''by''' increment» «'''to''' last» «'''while''' condition» '''do''' statements '''od'''</tt> ||rowspan=2| <tt>'''for''' ''key'' «'''to''' '''upb''' ''list''» '''do''' «'''typename''' ''val''=''list''[''key''];» statements '''od'''</tt>
|-
| <tt>«'''while''' condition»</tt>
'''do''' statements '''od'''
| <tt>«'''while''' statements; condition»</tt>
'''do''' statements '''od'''
| <tt>«'''for''' index» «'''from''' first» «'''by''' increment» «'''to''' last» '''do''' statements '''od'''</tt>
|-
| [[APL (programming language)|APL]]
| <tt>''':While''' condition<dl><dd>statements</dd></dl> ''':EndWhile'''</tt>
| <tt>''':Repeat''' <dl><dd>statements</dd></dl>''':Until''' condition</tt>
| <tt>''':For''' var«s» ''':In''' list<dl><dd>statements</dd></dl> ''':EndFor'''</tt>
| <tt>''':For''' var«s» ''':InEach''' list<dl><dd>statements</dd></dl> ''':EndFor'''</tt>
|-
| C (C99)
| rowspan=9|<tt>'''while ('''condition''')''' '''{''' instructions '''}'''</tt>
| rowspan=9|<tt>'''do {''' instructions '''} while ('''condition''')'''</tt>
| rowspan=5|<tt>'''for ('''«type» i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; ++'''i''') {''' instructions '''}'''</tt>
| {{n/a}}
|-
| Objective-C
| <tt>'''for ('''type item '''in''' set''') {''' instructions '''}'''</tt>
|-
| C++ (STL)
| <tt>«'''std::'''»'''for_each('''start''',''' end''',''' function''')'''</tt>
([[C++11]]) <tt>'''for ('''type item ''':''' set''') {''' instructions '''}'''</tt>
|-
| C#
| <tt>'''foreach ('''type item '''in''' set''') {''' instructions '''}'''</tt>
|-
| Java
| <tt>'''for ('''type item ''':''' set''') {''' instructions '''}'''</tt>
|-
| JavaScript
|<tt>'''for (var''' i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last''';''' i'''++) {''' instructions '''}'''</tt>
|<tt>'''for (var''' index '''in''' set''') {''' instructions '''}''' <br/> or <br/> '''for each (var''' item '''in''' set''') {''' instructions '''}'''</tt> (JS 1.6+, deprecated<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/for_each...in|title=for each...in|author=|date=|work=mozilla.org|accessdate=30 January 2017}}</ref>)<br/>or<br/><tt>'''for (var''' item '''of''' set''') {''' instructions '''}'''</tt> ([[EcmaScript 6]] proposal, supported in Firefox<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/for...of|title=for...of|author=|date=|work=mozilla.org|accessdate=30 January 2017}}</ref>)
|-
| PHP
| <tt>'''foreach (range('''first''', '''last''') as $i) {''' instructions '''}''' or <br/> '''for ($i = '''first'''; $i <= '''last'''; $i++) {''' instructions '''}'''</tt>
| <tt>'''foreach ('''set '''as''' item''') {''' instructions '''}''' <br/> or <br/> '''foreach ('''set '''as '''key''' =>''' item''') {''' instructions '''}'''</tt>
|-
| Windows PowerShell
| <tt>'''for ($i = '''first'''; $i -le '''last'''; $i++) {''' instructions '''}'''</tt>
| <tt>'''foreach ('''item '''in''' set''') {''' instructions using item '''}'''</tt>
|-
| D
| <tt>'''foreach''' (i; '''first''' ... '''last''') '''{''' instructions '''}'''</tt>
| <tt>'''foreach''' («type» item; set) '''{''' instructions '''}'''</tt>
|-
| Go
| <tt>'''for '''condition''' {''' instructions '''}'''</tt>
|
| <tt>'''for '''i ''':=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; '''i'''++ {''' instructions '''}'''</tt>
| <tt>'''for '''key''', '''item''' := range '''set''' {''' instructions '''}'''</tt>
|-
| Swift
| <tt>'''while '''condition''' {''' instructions '''}'''</tt>
| <tt>'''repeat {''' instructions '''} while '''condition</tt> (2.x)<br /> <tt>'''do {''' instructions '''} while '''condition</tt> (1.x)
| <tt>'''for''' i '''=''' first '''...''' last {''' instructions '''}</tt> or <br/> <tt>'''for''' i '''=''' first '''..<''' last+1 {''' instructions '''}</tt> or <br/> <tt>'''for var''' i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; '''i'''++ {''' instructions '''}'''</tt>
| <tt>'''for '''item''' in '''set''' {''' instructions '''}'''</tt>
|-
| Perl
| <tt>'''while ('''condition''')''' '''{''' instructions '''}''' or <br/> '''until ('''notcondition''')''' '''{''' instructions '''}'''</tt>
| <tt>'''do {''' instructions '''} while ('''condition''')''' or <br/> '''do {''' instructions '''} until ('''notcondition''')'''</tt>
| <tt>'''for'''«'''each'''»''' '''«'''$i'''»''' ('''first''' .. '''last''') {''' instructions '''}''' or <br/> '''for ($i = '''first'''; $i <= '''last'''; $i++) {''' instructions '''}'''</tt>
| <tt>'''for'''«'''each'''» «$item» '''('''set''') {''' instructions '''}'''</tt>
|-
| Perl 6
| <tt>'''while''' condition '''{''' instructions '''}''' or <br/> '''until''' notcondition '''{''' instructions '''}'''</tt>
| <tt>'''repeat {''' instructions '''} while '''condition or <br/> '''repeat {''' instructions '''} until''' notcondition</tt>
| <tt>'''for''' first'''..'''last '''<nowiki>-></nowiki> $i {''' instructions '''}''' or <br/> '''loop ($i = '''first'''; $i <nowiki><=</nowiki>'''last'''; $i++) {''' instructions '''}'''</tt>
| <tt>'''for''' set« '''<nowiki>-></nowiki>''' $item» '''{''' instructions '''}'''</tt>
|-
| Ruby
| <tt>'''while''' condition <dl><dd>instructions</dd></dl>'''end''' <br/> or <br/> '''until''' notcondition <dl><dd>instructions</dd></dl> '''end'''</tt>
| <tt>'''begin''' <dl><dd>instructions</dd></dl> '''end while''' condition <br/> or <br/> '''begin''' <dl><dd>instructions</dd></dl> '''end until''' notcondition</tt>
| <tt>'''for i in '''first'''..'''last <dl><dd>instructions</dd></dl> '''end''' </tt><br/> or <br/> <tt>'''for i in '''first'''...'''last+1 <dl><dd>instructions</dd></dl> '''end''' <br/> or <br/> first'''.{{not a typo|upto}}('''last''') { <nowiki>|i|</nowiki> '''instructions '''}'''</tt>
| <tt>'''for''' item '''in''' set <dl><dd>instructions</dd></dl> '''end''' <br/> or <br/> set'''.each { <nowiki>|</nowiki>'''item'''<nowiki>|</nowiki> '''instructions '''}'''</tt>
|-
| Bash shell
| <tt>'''while''' condition ;'''do'''<dl><dd>instructions</dd></dl>'''done''' <br/> or <br/> '''until''' notcondition ;'''do'''<dl><dd>instructions</dd></dl> '''done'''</tt>
| {{n/a}}
| <tt>'''for (('''i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; ++'''i''')) ; do'''
<dl><dd>instructions</dd></dl>
'''done'''
</tt>
| <tt>'''for''' item '''in''' set ;'''do'''<dl><dd>instructions</dd></dl> '''done'''</tt>
|-
| Scala
| <tt>'''while ('''condition''')''' '''{''' instructions '''}'''</tt>
| <tt>'''do {''' instructions '''} while ('''condition''')'''</tt>
| <tt>'''for ('''i '''<nowiki><-</nowiki>''' first '''to''' last «'''by 1'''»''') {''' instructions '''}'''<br/>or<br/>first '''to''' last «'''by 1'''» '''foreach ('''i '''<nowiki>=></nowiki> {''' instructions '''})'''</tt>
| <tt>'''for ('''item '''<nowiki><-</nowiki>''' set''') {''' instructions '''}'''<br/>or<br/>set '''foreach ('''item '''=> {''' instructions '''})'''</tt>
|-
| Smalltalk
| <tt>conditionBlock '''whileTrue:''' <dl><dd>loopBlock</dd></dl></tt>
| <tt>loopBlock '''doWhile:''' <dl><dd>conditionBlock</dd></dl></tt>
| <tt>first '''to:''' last '''do:''' <dl><dd>loopBlock</dd></dl></tt>
| <tt>collection '''do:''' <dl><dd>loopBlock</dd></dl></tt>
|-
| Common Lisp
| <tt>'''(loop<dl><dd>while '''condition'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(do () ('''notcondition''')<dl><dd>'''instructions''')'''</dd></dl></tt>
| <tt>'''(loop<dl><dd>do</dd><dd>'''instructions'''</dd><dd>while '''condition''')'''</dd></dl></tt>
| <tt>'''(loop<dl><dd>for i from '''first''' to '''last''' «by 1»</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(dotimes (i N)'''<dl><dd>instructions''')'''</dd></dl> or<br/> '''(do ((i '''first''' (1+ i))) ((<nowiki>>=</nowiki> i '''last'''))<dl><dd>'''instructions''')'''</dd></dl></tt>
| <tt>'''(loop<dl><dd>for '''item''' in '''list'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(loop<dl><dd>for '''item''' across '''vector'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(dolist ('''item list''')<dl><dd>'''instructions''')'''</dd></dl> or <br/>'''(mapc '''function list''')''' or <br/> '''(map <nowiki>'</nowiki>'''type function sequence''')'''</tt>
|-
| Scheme
| <tt>'''(do () ('''notcondition''') '''instructions''')''' or <br/> '''(let loop () (if '''condition''' (begin '''instructions''' (loop))))'''</tt>
| <tt>'''(let loop () ('''instructions''' (if '''condition''' (loop))))'''</tt>
| <tt>'''(do ((i '''first''' (+ i 1))) ((<nowiki>>=</nowiki> i '''last''')) '''instructions''')''' or <br/> '''(let loop ((i '''first''')) (if (< i '''last''') (begin '''instructions''' (loop (+ i 1)))))'''</tt>
| <tt>'''(for-each (lambda ('''item''') '''instructions''') '''list''')'''</tt>
|-
| ISLISP
| <tt>'''(while '''condition''' '''instructions''')'''</tt>
| <tt>'''(tagbody loop''' instructions '''(if''' condition '''(go loop))'''</tt>
| <tt>'''(for ((i '''first''' (+ i 1))) ((<nowiki>>=</nowiki> i '''last''')) '''instructions''')'''</tt>
| <tt>'''(mapc (lambda ('''item''') '''instructions''') '''list''')'''</tt>
|-
| Pascal
| <tt>'''while''' condition '''do begin''' <dl><dd>instructions</dd></dl> '''end'''</tt>
| <tt>'''repeat''' <dl><dd>instructions</dd></dl> '''until''' notcondition''';'''</tt>
| <tt>'''for''' i ''':=''' first «'''step 1'''» '''to''' last '''do begin''' <dl><dd>instructions</dd></dl> '''end;'''{{ref|step|[a]}}</tt>
| <tt>'''for''' item '''in''' set '''do''' ...</tt>
|-
| Visual Basic
| rowspan=2| <tt>'''Do While''' condition <dl><dd>instructions</dd></dl>'''Loop''' <br/> or <br/>'''Do Until''' notcondition <dl><dd>instructions</dd></dl>'''Loop'''</tt>
| rowspan=2| <tt>'''Do''' <dl><dd>instructions</dd></dl> '''Loop While''' condition <br/> or <br/>'''Do''' <dl><dd>instructions</dd></dl> '''Loop Until''' notcondition</tt>
| <tt>'''For''' i '''=''' first '''To''' last «'''Step 1'''» <dl><dd>instructions</dd></dl> '''Next i'''</tt>
| <tt>'''For Each''' item '''In''' set <dl><dd>instructions</dd></dl> '''Next''' item</tt>
|-
| Visual Basic .NET
| rowspan=2| <tt>'''For i '''«'''As '''type» '''=''' first '''To''' last «'''Step 1'''» <dl><dd>instructions</dd></dl>'''Next i'''{{ref|step|[a]}}</tt>
| rowspan=2| <tt>'''For Each''' item '''As '''type''' In''' set <dl><dd>instructions</dd></dl> '''Next''' item</tt>
|-
| Xojo
| <tt>'''While''' condition <dl><dd>instructions</dd></dl>'''Wend'''</tt>
| <tt>'''Do Until''' notcondition <dl><dd>instructions</dd></dl>'''Loop''' <br/> or <br/>'''Do''' <dl><dd>instructions</dd></dl> '''Loop Until''' notcondition</tt>
|-
| Python
| <tt>'''while''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>
| {{n/a}}
| <tt>'''for i in range('''first''', '''last+1'''):''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>(Python 3.x)<br/>
<tt>'''for i in xrange('''first''', '''last+1'''):''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}}instructions»</tt>(Python 2.x)
| <tt>'''for''' item '''in''' set''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>
|-
| S-Lang
| <tt>'''while ('''condition''') {''' instructions '''}''' «'''then''' optional-block»</tt>
| <tt>'''do {''' instructions '''} while ('''condition''')''' «'''then''' optional-block»</tt>
| <tt>'''for (i = '''first'''; i <nowiki><=</nowiki> '''last'''; i++) {''' instructions '''}''' «'''then''' optional-block»</tt>
| <tt>'''foreach''' item'''('''set''')''' «'''using ('''what''')'''» '''{''' instructions '''}''' «'''then''' optional-block»</tt>
|-
| Fortran
| <tt>'''DO WHILE ('''condition''') <dl><dd> '''instructions'''</dd></dl> ENDDO'''</tt>
| <tt>'''DO <dl><dd> '''instructions''' <br/> IF ('''condition''') EXIT </dd></dl> ENDDO'''</tt>
| <tt>'''DO '''I''' = '''first''','''last''' <dl><dd> '''instructions''' </dd></dl> ENDDO'''</tt>
| {{n/a}}
|-
| Forth
| <tt>'''BEGIN '''« instructions » condition''' WHILE '''instructions''' REPEAT'''</tt>
| <tt>'''BEGIN ''' instructions condition''' UNTIL'''</tt>
| <tt>limit start''' DO '''instructions''' LOOP'''</tt>
| {{n/a}}
|-
| OCaml
| <tt>'''while''' condition '''do''' instructions '''done'''</tt>
| {{n/a}}
| <tt>'''for i = '''first''' to '''last''' do''' instructions '''done'''</tt>
| <tt>'''Array.iter (fun '''item''' <nowiki>-></nowiki> '''instructions''') '''array <br/> '''List.iter (fun '''item''' -> '''instructions''') '''list</tt>
|-
| F#
| <tt>'''while''' condition '''do''' <br/> {{keypress|Tab}} instructions</tt>
| {{n/a}}
| <tt>'''for i = '''first''' to '''last''' do''' <br/> {{keypress|Tab}} instructions</tt>
| <tt>'''for '''item''' in '''set''' do''' <br/> {{keypress|Tab}} instructions <br/> or <br/> '''Seq.iter (fun '''item''' -> '''instructions''') '''set</tt>
|-
| Standard ML
| <tt>'''while''' condition '''do (''' instructions ''')'''</tt>
| colspan=2 {{n/a}}
| <tt>'''Array.app (fn '''item''' <nowiki>=></nowiki> '''instructions''') '''array <br/> '''app (fn '''item''' => '''instructions''') '''list</tt>
|-
| Haskell (GHC)
| colspan=2 {{n/a}}
| <tt>'''Control.Monad.forM_ ['''first'''..'''last'''] (\i <nowiki>-></nowiki> do '''instructions''')'''</tt>
| <tt>'''Control.Monad.forM_ '''list '''(\item <nowiki>-></nowiki> do '''instructions''')'''</tt>
|-
| Eiffel
| colspan=4| <tt>'''from''' <dl><dd>setup</dd></dl> '''until''' <dl><dd>condition</dd></dl> '''loop''' <dl><dd>instructions</dd></dl> '''end'''</tt>
|-
| rowspan=6| CoffeeScript
| <tt>'''while''' condition <dl><dd>expression</dd></dl></tt>
| rowspan=6 {{n/a}}
| rowspan=4| <tt>'''for''' i '''in''' [first..last] <dl><dd>expression</dd></dl></tt>
| rowspan=4| <tt>'''for''' item '''in''' set <dl><dd>expression</dd></dl></tt>
|-
| <tt>expression '''while''' condition</tt>
|-
| <tt>'''while''' condition '''then''' expression</tt>
|-
| <tt>'''until''' condition <dl><dd>expression</dd></dl></tt>
|-
| <tt>expression '''until''' condition</tt>
| <tt>'''for''' i '''in''' [first..last] '''then''' expression</tt>
| <tt>'''for''' item '''in''' set '''then''' expression</tt>
|-
| <tt>'''until''' condition '''then''' expression</tt>
| <tt>expression '''for''' i '''in''' [first..last]</tt>
| <tt>expression '''for''' item '''in''' set</tt>
|-
| rowspan=2 | COBOL
| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» ««'''WITH'''» '''TEST BEFORE'''» '''UNTIL''' condition{{ref|COBOL THRU|[c]}}</tt>
| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» «'''WITH'''» '''TEST AFTER UNTIL''' condition{{ref|COBOL THRU|[c]}}</tt>
| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» '''VARYING''' i '''FROM''' first '''BY''' increment '''UNTIL''' i '''>''' last{{ref|COBOL GREATER THAN|[d]}}</tt>
| rowspan=2 {{n/a}}
|-
| <tt>'''PERFORM''' ««'''WITH'''» '''TEST BEFORE'''» '''UNTIL''' condition <dl><dd> expression </dd></dl> '''END-PERFORM'''</tt>
| <tt>'''PERFORM''' «'''WITH'''» '''TEST AFTER UNTIL''' condition <dl><dd> expression </dd></dl> '''END-PERFORM'''</tt>
| <tt>'''PERFORM VARYING''' i '''FROM''' first '''BY''' increment '''UNTIL''' i '''>''' last <dl><dd> expression </dd></dl> '''END-PERFORM'''{{ref|COBOL GREATER THAN|[d]}}</tt>
|}
{{note|step|a}} "<tt>'''step'''</tt> n" is used to change the loop interval. If "<tt>'''step'''</tt>" is omitted, then the loop interval is 1.
{{note|Ada_quantifiers|b}} This implements the universal quantifier ("for all" or "∀") as well as the existential quantifier ("there exists" or "∃").
{{note|COBOL THRU|c}} <tt>'''THRU'''</tt> may be used instead of <tt>'''THROUGH'''</tt>.
{{note|COBOL GREATER THAN|d}} <tt>«'''IS'''» '''GREATER''' «'''THAN'''»</tt> may be used instead of <tt>'''>'''</tt>.
=== [[Exception handling|Exceptions]] ===
{{further|Exception handling syntax}}
{| class="wikitable"
|-
!
! throw
! handler
! assertion
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>'''raise''' exception_name «'''with''' string_expression»</tt>
| <tt>'''begin'''<dl><dd>statements</dd></dl>'''exception'''<dl><dd>'''when''' exception_list<sub>1</sub> '''<nowiki>=></nowiki>''' statements;</dd><dd>'''when''' exception_list<sub>2</sub> '''<nowiki>=></nowiki>''' statements;</dd></dl>...<br><dl><dd>«'''when others <nowiki>=></nowiki>''' statements;»</dd></dl>'''end'''{{ref|Ada_uncaught_exceptions|[b]}}</tt>
| <tt>'''pragma Assert ('''«'''Check <nowiki>=></nowiki>'''» boolean_expression ««'''Message =>'''» string_expression»''')'''<br><br>[function <nowiki>|</nowiki> procedure <nowiki>|</nowiki> entry] '''with'''<dl><dd>'''Pre <nowiki>=></nowiki>''' boolean_expression</dd><dd>'''Post <nowiki>=></nowiki>''' boolean_expression</dd></dl><br>any_type '''with Type_Invariant <nowiki>=></nowiki>''' boolean_expression</tt>
|-
| [[APL (programming language)|APL]]
| <tt>«string_expression» '''⎕SIGNAL''' number_expression</tt>
| <tt>''':Trap''' number«s»_expression<dl><dd>statements</dd></dl>«''':Case''' number«s»_expression<dl><dd>statements»</dd></dl>...<br>«''':Else''' number«s»_expression<dl><dd>statements»</dd></dl>''':EndTrap'''</tt>
| <tt>«string_expression» '''⎕SIGNAL 98/⍨~'''condition</tt>
|-
| C (C99)
| <tt>'''[[longjmp]]('''state''',''' exception''');'''</tt>
| <tt>'''switch ([[setjmp]]('''state''')) { case 0: '''instructions''' break; case '''exception''': '''instructions''' ... }'''</tt>
| rowspan=2|<tt>'''assert('''condition''');'''</tt>
|-
| C++
| rowspan=8|<tt>'''throw''' exception''';'''</tt>
| <tt>'''try { '''instructions''' } catch''' «'''('''exception''')'''» '''{ '''instructions''' }''' ...</tt>
|-
| C#
| <tt>'''try { '''instructions''' } catch''' «'''('''exception''')'''» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
| <tt>'''Debug.Assert('''condition''');'''</tt>
|-
| Java
| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
| <tt>'''assert '''condition''' «: '''description'''»;'''</tt>
|-
| JavaScript
| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' «'''finally { '''instructions''' }'''»</tt>
| {{dunno}}
|-
| D
| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
| <tt>'''assert('''condition''');'''</tt>
|-
| PHP
| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
| <tt>'''assert('''condition''');'''</tt>
|-
| S-Lang
| <tt>'''try { '''instructions''' } catch''' «exception» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
| {{dunno}}
|-
| Windows PowerShell
| <tt>'''trap''' «'''['''exception''']'''» '''{ '''instructions''' }''' ... instructions or '''try { '''instructions''' } catch''' «'''['''exception''']'''» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
| <tt>'''[Debug]::Assert('''condition''')'''</tt>
|-
| Objective-C
| <tt>'''@throw''' exception''';'''</tt>
| <tt>'''@try { '''instructions''' } @catch ('''exception''') { '''instructions''' }''' ... «'''@finally { '''instructions''' }'''»</tt>
| <tt>'''NSAssert('''condition''', '''description''');'''</tt>
|-
| Swift
| <tt>'''throw''' exception</tt> (2.x)
| <tt>'''do { try '''expression''' ... '''instructions''' } catch '''exception''' { '''instructions''' }''' ...</tt> (2.x)
| <tt>'''assert('''condition'''«, '''description'''»)'''</tt>
|-
| Perl
| rowspan=2| <tt>'''die''' exception''';'''</tt>
| <tt>'''eval { '''instructions''' }; if ($@) { '''instructions''' }'''</tt>
| {{dunno}}
|-
| Perl 6
| <tt>'''try { '''instructions''' CATCH { when '''exception''' { '''instructions''' } '''...'''}}'''</tt>
| {{dunno}}
|-
| Ruby
| <tt>'''raise''' exception</tt>
| <tt>'''begin''' <dl><dd>instructions</dd></dl> '''rescue''' exception <dl><dd>instructions</dd></dl>... <br/> «'''else''' <dl><dd>instructions»</dd></dl> «'''ensure''' <dl><dd>instructions»</dd></dl> '''end'''</tt>
|
|-
| Smalltalk
| <tt>exception '''raise'''</tt>
| <tt>instructionBlock '''on:''' exception '''do:''' handlerBlock</tt>
| <tt>'''assert:''' conditionBlock</tt>
|-
| Common Lisp
| <tt>'''(error '''"exception"''')''' or <br/> '''(error <dl><dd>'''type</dd><dd>arguments''')'''</dd></dl> or <br/> '''(error (make-condition<dl><dd>'''type</dd><dd>arguments'''))'''</dd></dl></tt>
| <tt>'''(handler-case<dl><dd>(progn '''instructions''')</dd><dd>('''exception instructions''')</dd><dd>'''...''')'''</dd></dl> or <br/>'''(handler-bind<dl><dd>('''condition <dl><dd>'''(lambda</dd><dd>'''instructions</dd><dd>«'''invoke-restart''' restart args»'''))'''</dd></dl>...''')'''{{ref|a|[a]}}</dd></dl></tt>
| <tt>'''(assert '''condition''')''' or <br/>'''(assert '''condition<dl><dd>«'''('''place''')'''</dd><dd>«error»»''')'''</dd></dl> or <br/>'''(check-type '''var type''')'''</tt>
|-
| Scheme (R<sup>6</sup>RS)
| <tt>'''(raise '''exception''')'''</tt>
| <tt>'''(guard (con ('''condition''' '''instructions''') '''...''') '''instructions''')'''</tt>
| {{dunno}}
|-
| ISLISP
| <tt>'''(error '''"error-string" objects''')''' or <br/> '''(signal-condition '''condition continuable''')'''</tt>
| <tt>'''(with-handler<dl><dd>'''handler form*''')'''</tt>
| {{dunno}}
|-
| Pascal
| <tt>'''raise''' Exception.Create()</tt>
| <tt>'''try''' Except '''on''' E: exception '''do begin ''' instructions ''' end; end;'''</tt>
| {{dunno}}
|-
| Visual Basic
| <tt>'''Err.Raise''' ERRORNUMBER</tt>
| <tt>'''With New '''Try''': On Error Resume Next''' <dl><dd>OneInstruction</dd></dl> .Catch''': On Error GoTo 0: Select Case '''.Number <dl><dd>'''Case''' ERRORNUMBER</dd></dl> <dl><dd><dl><dd>instructions</dd></dl></dd></dl> '''End Select: End With'''</tt>
<syntaxhighlight lang="vbnet" enclose="div">
'*** Try class ***
Private mstrDescription As String
Private mlngNumber As Long
Public Sub Catch()
mstrDescription = Err.Description
mlngNumber = Err.Number
End Sub
Public Property Get Number() As Long
Number = mlngNumber
End Property
Public Property Get Description() As String
Description = mstrDescription
End Property
</syntaxhighlight><ref>{{cite web|url=https://sites.google.com/site/truetryforvisualbasic/|title=Try-Catch for VB|author=|date=|work=google.com|accessdate=30 January 2017}}</ref>
| <tt>'''Debug.Assert''' condition</tt>
|-
| Visual Basic .NET
| <tt>'''Throw''' exception</tt>
| <tt>'''Try''' <dl><dd>instructions</dd></dl> '''Catch''' «exception» «'''When''' condition» <dl><dd>instructions</dd></dl> ... <br/> «'''Finally''' <dl><dd>instructions»</dd></dl> '''End Try'''</tt>
| <tt>'''Debug.Assert('''condition''')'''</tt>
|-
| Xojo
| <tt>'''Raise''' exception</tt>
| <tt>'''Try''' <dl><dd>instructions</dd></dl> '''Catch''' «exception»<dl><dd>instructions</dd></dl> ... <br/> «'''Finally''' <dl><dd>instructions»</dd></dl> '''End Try'''</tt>
| {{n/a}}
|-
| Python
| <tt>'''raise''' exception</tt>
| <tt>'''try:''' <br/> {{keypress|Tab}} instructions <br/> '''except''' «exception»''':''' <br/> {{keypress|Tab}} instructions <br/> ... <br/> «'''else:''' <br/> {{keypress|Tab}} instructions» <br/> «'''finally:''' <br/> {{keypress|Tab}} instructions»</tt>
| <tt>'''assert '''condition</tt>
|-
| Fortran
| colspan=3 {{n/a}}
|-
| Forth
| <tt>code''' THROW'''</tt>
| <tt>xt''' CATCH''' ( code or 0 )</tt>
| {{n/a}}
|-
| OCaml
| rowspan=2| <tt>'''raise''' exception</tt>
| <tt>'''try''' expression '''with''' pattern '''->''' expression ...</tt>
| rowspan=2| <tt>'''assert''' condition</tt>
|-
| F#
| <tt>'''try''' expression '''with''' pattern '''->''' expression ... <br/> or <br/>'''try''' expression '''finally''' expression</tt>
|-
| Standard ML
| <tt>'''raise''' exception «arg»</tt>
| <tt>expression '''handle''' pattern '''=>''' expression ...</tt>
|
|-
| Haskell (GHC)
| <tt>'''throw''' exception <br/> ''or'' <br/> '''throwError''' expression</tt>
| <tt>'''catch''' tryExpression catchExpression <br/> ''or'' <br/> '''catchError''' tryExpression catchExpression</tt>
| <tt>'''assert''' condition expression</tt>
|-
| COBOL
| <tt>'''RAISE''' «'''EXCEPTION'''» exception</tt>
| <tt>'''USE''' «'''AFTER'''» '''EXCEPTION OBJECT''' class-name'''.''' or<br/>
'''USE''' «'''AFTER'''» '''EO''' class-name'''.''' or<br/>
'''USE''' «'''AFTER'''» '''EXCEPTION CONDITION''' exception-name «'''FILE''' file-name»'''.''' or<br/>
'''USE''' «'''AFTER'''» '''EC''' exception-name «'''FILE''' file-name»'''.'''</tt>
| {{n/a}}
|}
{{note|common lisp restarts|a}} Common Lisp allows <code>with-simple-restart</code>, <code>restart-case</code> and <code>restart-bind</code> to define restarts for use with <code>invoke-restart</code>. Unhandled conditions may cause the implementation to show a restarts menu to the user before unwinding the stack.
{{note|Ada_uncaught_exceptions|b}} Uncaught exceptions are propagated to the innermost dynamically enclosing execution. Exceptions are not propagated across tasks (unless these tasks are currently synchronised in a rendezvous).
=== Other control flow statements ===
{| class="wikitable"
|-
!
! exit block(break)
! continue
! [[Label (programming language)|label]]
! branch ([[goto]])
! return value from generator
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>'''exit''' «loop_name» «'''when''' condition»</tt>
| {{n/a}}
| <tt>label''':'''</tt>
| <tt>'''goto''' label</tt>
| {{n/a}}
|-
| ALGOL 68
| <tt>value '''exit''';</tt> ...
| <tt>'''do''' statements; '''skip exit'''; label: statements '''od'''</tt>
| <tt>label:</tt> ...
| <tt>'''go to''' label; ...<br>
'''goto''' label; ...<br>
label; ...</tt>
| <tt>''yield''(''value'')</tt>
([[Callback (computer science)|Callback]])<ref>{{cite web|url=http://rosettacode.org/wiki/Prime_decomposition#ALGOL_68|title=Prime decomposition - Rosetta Code|author=|date=|work=rosettacode.org|accessdate=30 January 2017}}</ref>
|-
| [[APL (programming language)|APL]]
| <tt>''':Leave'''</tt>
| <tt>''':Continue'''</tt>
| <tt>label''':'''</tt>
| <tt>'''→'''label<br>or<br>
''':GoTo''' label</tt>
| {{n/a}}
|-
| C (C99)
| rowspan=5| <tt>'''break;'''</tt>
| rowspan=5| <tt>'''continue;'''</tt>
| rowspan=12| <tt>label''':'''</tt>
| rowspan=5| <tt>'''goto''' label''';'''</tt>
| rowspan=4 {{n/a}}
|-
| Objective-C
|-
| C++ (STL)
|-
| D
|-
| C#
| <tt>'''yield return''' value''';'''</tt>
|-
| Java
| rowspan=2| <tt>'''break''' «label»''';'''</tt>
| rowspan=2| <tt>'''continue''' «label»''';'''</tt>
| rowspan=2 {{n/a}}
|
|-
| JavaScript
| <tt>'''yield''' value«;»</tt>
|-
| PHP
| <tt>'''break''' «levels»''';'''</tt>
| <tt>'''continue''' «levels»''';'''</tt>
| rowspan=3| <tt>'''goto''' label''';'''</tt>
| <tt>'''yield''' «key <nowiki>=></nowiki>» value;</tt>
|-
| Perl
| rowspan=2| <tt>'''last''' «label»''';'''</tt>
| rowspan=2| <tt>'''next''' «label»''';'''</tt>
|
|-
| Perl 6
|
|-
| Go
| <tt>'''break''' «label»</tt>
| <tt>'''continue''' «label»</tt>
| <tt>'''goto''' label</tt>
|
|-
| Swift
| <tt>'''break''' «label»</tt>
| <tt>'''continue''' «label»</tt>
| {{n/a}}
|
|-
| Bash shell
| <tt>'''break''' «levels»</tt>
| <tt>'''continue''' «levels»</tt>
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| Common Lisp
| <tt>'''(return)''' or <br/> '''(return-from '''block''')''' or <br/> '''(loop-finish)'''</tt>
|
| <tt>'''(tagbody '''tag<dl><dd><dl><dd>...</dd><dd>tag</dd></dl>...''')'''</tt>
| <tt>'''(go '''tag''')'''</tt>
|
|-
| Scheme
|
|
|
|
|
|-
| ISLISP
| <tt>'''(return-from '''block''')'''</tt>
|
| <tt>'''(tagbody '''tag<dl><dd><dl><dd>...</dd><dd>tag</dd></dl>...''')'''</tt>
| <tt>'''(go '''tag''')'''</tt>
|
|-
| Pascal(ISO)
| colspan=2 {{n/a}}
| rowspan=2| <tt>label''':'''</tt>{{ref|Pascal's declarations|[a]}}
| rowspan=2| <tt>'''goto''' label''';'''</tt>
| rowspan=5 {{n/a}}
|-
| Pascal(FPC)
| <tt>'''break;'''</tt>
| <tt>'''continue;'''</tt>
|-
| Visual Basic
| rowspan=3| <tt>'''Exit''' block</tt>
| {{n/a}}
| rowspan=3| <tt>label''':'''</tt>
| rowspan=3| <tt>'''GoTo''' label</tt>
|-
| Visual Basic .NET
| rowspan=2| <tt>'''Continue''' block</tt>
|-
| Xojo
|-
| Python
| <tt>'''break'''</tt>
| <tt>'''continue'''</tt>
| colspan=2 {{n/a}}
| <tt>'''yield '''value</tt>
|-
| RPG IV
| <tt>'''LEAVE;'''</tt>
| <tt>'''ITER;'''</tt>
|
|
|
|-
| S-Lang
| <tt>'''break;'''</tt>
| <tt>'''continue;'''</tt>
|
|
|
|-
| Fortran
| <tt>'''EXIT'''</tt>
| <tt>'''CYCLE'''</tt>
| <tt>label</tt>{{ref|Fortran label|[b]}}
| <tt>'''GOTO''' label</tt>
| {{n/a}}
|-
| Ruby
| <tt>'''break'''</tt>
| <tt>'''next'''</tt>
|
|
|
|-
| Windows PowerShell
| <tt>'''break''' «label»</tt>
| <tt>'''continue'''</tt>
|
|
|
|-
| OCaml
| rowspan=4 colspan=4 {{n/a}}
|
|-
| F#
|
|-
| Standard ML
|
|-
| Haskell (GHC)
|
|-
| COBOL
| <tt>'''EXIT PERFORM''' or '''EXIT PARAGRAPH''' or '''EXIT SECTION''' or '''EXIT.'''</tt>
| <tt>'''EXIT PERFORM CYCLE'''</tt>
| <tt>label «'''SECTION'''»'''.'''</tt>
| <tt>'''GO TO''' label</tt>
| {{n/a}}
|-
| Ya
| <tt>'''break''' «from where»''';'''</tt> f.e.<br>
<tt>'''break for switch;'''</tt>
| <tt>'''continue''' «to where»''';'''</tt> f.e.<br>
<tt>'''continue for switch;'''</tt>
| <tt>''':'''label</tt>
| <tt>'''goto :'''label''';'''</tt>
| {{n/a}}
|}
{{note|Pascal's declarations|a}} Pascal has declaration blocks. See [[Comparison of programming languages (basic instructions)#Functions]].
<br/>{{note|Fortran label|b}} label must be a number between 1 and 99999.
== [[Subroutine|Functions]] ==
See [[Reflection (computer science)|reflection]] for calling and declaring functions by strings.
{| class="wikitable"
|- valign="top"
!
! calling a function
! basic/void function
! value-returning function
! required [[main function]]
|- valign="top"
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>''foo'' «(parameters)»</tt>
| <tt>'''procedure''' ''foo'' «(parameters)» '''is begin''' statements '''end''' foo</tt>
| <tt>'''function''' ''foo'' «(parameters)» '''return''' type '''is begin''' statements '''end''' foo</tt>
| {{n/a}}
|- valign="top"
| [[ALGOL 68]]
|<tt>''foo''«(parameters)»;</tt>
|<tt>'''proc''' ''foo'' = «(parameters)» [[void type|void]]: ( ''instructions'' );</tt>
|<tt>'''proc''' ''foo'' = «(parameters)» '''rettype''': ( ''instructions ...; retvalue'' );</tt>
| {{n/a}}
|- valign="top"
| [[APL (programming language)|APL]]
| <tt>«parameters» ''foo'' parameters</tt>
| <tt>''foo''←'''{''' statements '''}'''</tt>
| <tt>''foo''←'''{''' statements '''}'''</tt>
| {{n/a}}
|- valign="top"
| C (C99)
| rowspan=9| <tt>'''foo('''«parameters»''')'''</tt>
| rowspan=6| <tt>'''[[void type|void]] foo('''«parameters»''') { '''instructions''' }'''</tt>
| rowspan=6| <tt>type '''foo('''«parameters»''') { '''instructions ... '''return''' value'''; }'''</tt>
| rowspan=3| <tt>«global declarations» <br/> '''int main('''«'''int argc, char *argv[]'''»''') { <dl><dd>'''instructions'''</dd></dl> }'''</tt>
|- valign="top"
| Objective-C
|- valign="top"
| C++ (STL)
|- valign="top"
| C#
| <tt>'''static void Main('''«'''string[] args'''»''') { '''instructions''' }''' or<br/> '''static int Main('''«'''string[] args'''»''') { '''instructions''' }'''</tt>
|- valign="top"
| Java
| <tt>'''public static void main(String[] args) { '''instructions''' }''' or<br/> '''public static void main(String[[variadic function|...]] args) { '''instructions''' }'''</tt>
|- valign="top"
| D
| <tt>'''int main('''«'''char[][] args'''»''') { '''instructions'''}''' or<br /> '''int main('''«'''string[] args'''»''') { '''instructions'''}''' or<br /> '''void main('''«'''char[][] args'''»''') { '''instructions'''}''' or<br /> '''void main('''«'''string[] args'''»''') { '''instructions'''}'''</tt>
|- valign="top"
| JavaScript
| <tt>'''function foo('''«parameters»''') { '''instructions''' }''' or<br/> '''var foo = function ('''«parameters»''') {'''instructions''' }''' or<br/> '''var foo = new Function ('''«'''"'''parameter'''",''' ... ''',"'''last parameter'''"'''»''' "'''instructions'''");'''</tt>
| <tt>'''function foo('''«parameters»''') { '''instructions ... '''return''' value'''; }'''</tt>
| {{n/a}}
|- valign="top"
| Go
| <tt>'''func foo('''«parameters»''') { '''instructions''' }'''</tt>
| <tt>'''func foo('''«parameters»''') '''type''' { '''instructions ... '''return''' value''' }'''</tt>
| <tt>'''func main() { '''instructions''' }'''</tt>
|- valign="top"
| Swift
| <tt>'''func foo('''«parameters»''') { '''instructions''' }'''</tt>
| <tt>'''func foo('''«parameters»''') -> '''type''' { '''instructions ... '''return''' value''' }'''</tt>
| {{n/a}}
|- valign="top"
| Common Lisp
| rowspan=3| <tt>'''(foo '''«parameters»''')'''</tt>
| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>instructions''')'''</dd></dl> or <br/>'''(setf (symbol-function <nowiki>'</nowiki>'''symbol''')'''<dl><dd>lambda''')'''</dd></dl></tt>
| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>...</dd><dd>value''')'''</dd></dl></tt>
| rowspan=3 {{n/a}}
|- valign="top"
| Scheme
| <tt>'''(define (foo '''parameters''')''' instructions''')''' or <br/> '''(define foo ([[anonymous function|lambda]] ('''parameters''')''' instructions'''))'''</tt>
| <tt>'''(define (foo '''parameters''')''' instructions... return_value''')''' or <br/> '''(define foo ([[anonymous function|lambda]] ('''parameters''')''' instructions... return_value'''))'''</tt>
|- valign="top"
| ISLISP
| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>instructions''')'''</dd></dl></tt>
| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>...</dd><dd>value''')'''</dd></dl></tt>
|- valign="top"
| Pascal
| <tt>'''foo'''«'''('''parameters''')'''»</tt>
| <tt>'''procedure foo'''«'''('''parameters''')'''»''';''' «'''forward;'''»{{ref|forward declaration|[a]}}<br/>
«'''label'''<dl><dd>label declarations»</dd></dl>
«'''const'''<dl><dd>constant declarations»</dd></dl>
«'''type'''<dl><dd>type declarations»</dd></dl>
«'''var'''<dl><dd>variable declarations»</dd></dl>
«local function declarations»<br/>'''begin'''<dl><dd>instructions</dd></dl>'''end;'''</tt>
| <tt>'''function foo'''«'''('''parameters''')'''»''': '''type'''; '''«'''forward;'''»{{ref|forward declaration|[a]}}<br/>
«'''label'''<dl><dd>label declarations»</dd></dl>
«'''const'''<dl><dd>constant declarations»</dd></dl>
«'''type'''<dl><dd>type declarations»</dd></dl>
«'''var'''<dl><dd>variable declarations»</dd></dl>
«local function declarations»<br/>'''begin'''<dl><dd> instructions'''; <br/> foo := '''value</dd></dl>'''end;'''</tt>
| <tt>'''program''' name''';'''<br/>
«'''label'''<dl><dd>label declarations»</dd></dl>
«'''const'''<dl><dd>constant declarations»</dd></dl>
«'''type'''<dl><dd>type declarations»</dd></dl>
«'''var'''<dl><dd>variable declarations»</dd></dl>
«function declarations»<br/>'''begin'''<dl><dd>instructions</dd></dl> '''end.'''</tt> <!--somewhat of a technicality-->
|- valign="top"
| Visual Basic
| rowspan=3| <tt>'''Foo('''«parameters»''')'''</tt>
| rowspan=3| <tt>'''Sub Foo('''«parameters»''') <dl><dd> '''instructions''' </dd></dl> End Sub'''</tt>
| <tt>'''Function Foo('''«parameters»''') As '''type <dl><dd>instructions<br/> '''Foo = '''value</dd></dl>'''End Function'''</tt>
| <tt>'''Sub Main()'''<dl><dd>instructions</dd></dl>'''End Sub'''</tt>
|- valign="top"
| Visual Basic .NET
| rowspan=2| <tt>'''Function Foo('''«parameters»''') As '''type <dl><dd>instructions<br/>'''Return '''value</dd></dl>'''End Function'''</tt>
| rowspan=2| <tt>'''Sub Main('''«'''ByVal CmdArgs() As String'''»''') <dl><dd>'''instructions'''</dd></dl> End Sub'''<br/>or<br/> '''Function Main('''«'''ByVal CmdArgs() As String'''»''') As Integer <dl><dd>'''instructions'''</dd></dl>End Function'''</tt>
|- valign="top"
| Xojo
|- valign="top"
| Python
| <tt>'''foo('''«parameters»''')'''</tt>
| <tt>'''def foo('''«parameters»'''):''' <br/> {{keypress|Tab}} instructions </tt>
| <tt>'''def foo('''«parameters»'''):''' <br/> {{keypress|Tab}} instructions <br/> {{keypress|Tab}} '''return''' value</tt>
| {{n/a}}
|- valign="top"
| S-Lang
| <tt>'''foo('''«parameters» «;qualifiers»''')'''</tt>
| <tt>'''define foo ('''«parameters»''') { '''instructions''' }'''</tt>
| <tt>'''define foo ('''«parameters»''') { '''instructions ... '''return '''value'''; }'''</tt>
| <tt>'''public define slsh_main () { '''instructions''' }'''</tt>
|- valign="top"
| Fortran
| <tt>'''foo ('''«arguments»''') <br> CALL sub_foo ('''«arguments»''')'''{{ref|Fortran arguments|[c]}}</tt>
| <tt>'''SUBROUTINE sub_foo ('''«arguments»''') <dl><dd> '''instructions''' </dd></dl> END SUBROUTINE'''{{ref|Fortran arguments|[c]}}</tt>
| <tt>type''' FUNCTION foo ('''«arguments»''') <dl><dd> '''instructions''' <br/> ... <br/> foo '''= value''' </dd></dl> END FUNCTION'''{{ref|Fortran arguments|[c]}}</tt>
| <tt>'''PROGRAM '''main''' <dl><dd> '''instructions''' </dd></dl> END PROGRAM'''</tt>
|- valign="top"
| Forth
| <tt>«parameters»''' FOO'''</tt>
| <tt>''': FOO ''' « ''stack effect comment:'' '''( '''before '''-- )''' » ''' <dl><dd> '''instructions''' </dd></dl> ;'''</tt>
| <tt>''': FOO ''' « ''stack effect comment:'' '''( '''before '''--''' after ''')''' » ''' <dl><dd> '''instructions''' </dd></dl> ;'''</tt>
| {{n/a}}
|- valign="top"
| PHP
| <tt>'''foo('''«parameters»''')'''</tt>
| <tt>'''function foo('''«parameters»''') { '''instructions''' }'''</tt>
| <tt>'''function foo('''«parameters»''') { '''instructions''' ... return '''value'''; }'''</tt>
| rowspan=4 {{n/a}}
|- valign="top"
| Perl
| <tt>'''foo('''«parameters»''')''' or <br/> '''&foo'''«'''('''parameters''')'''»</tt>
| <tt>'''sub foo { '''«'''my ('''parameters''') = @_;'''»''' '''instructions''' }'''</tt>
| <tt>'''sub foo { '''«'''my ('''parameters''') = @_;'''»''' '''instructions'''... '''«'''return'''»''' '''value'''; }'''</tt>
|- valign="top"
| Perl 6
| <tt>'''foo('''«parameters»''')''' or <br/> '''&foo'''«'''('''parameters''')'''»</tt>
| <tt>«'''multi''' »'''sub foo('''parameters''') { '''instructions''' }'''</tt>
| <tt>«'''our''' «type» »«'''multi''' »'''sub foo('''parameters''') { '''instructions'''... '''«'''return'''»''' '''value'''; }'''</tt>
|- valign="top"
| Ruby
| rowspan=2| <tt>'''foo'''«'''('''parameters''')'''»</tt>
| <tt>'''def foo'''«'''('''parameters''')'''» <dl><dd>instructions </dd></dl> '''end'''</tt>
| <tt>'''def foo'''«'''('''parameters''')'''» <dl><dd>instructions <br/> «'''return'''» value </dd></dl> '''end'''</tt>
|- valign="top"
| Scala
| <tt>'''def foo'''«'''('''parameters''')'''»«''': Unit ='''» '''{''' instructions '''}'''</tt>
| <tt>'''def foo'''«'''('''parameters''')'''»«''':''' type» '''= {''' instructions ... «'''return'''» value '''}'''</tt>
| <tt>'''def main(args: Array[String]) {''' instructions '''}'''</tt>
|- valign="top"
| Windows PowerShell
| <tt>'''foo''' «parameters»</tt>
| <tt>'''function foo ''' { '''instructions''' };'''<br/>or<br/>'''function foo { '''«'''param('''parameters''')'''»''' '''instructions''' }'''</tt>
| <tt>'''function foo '''«'''('''parameters''')'''» ''' { '''instructions''' ''' … '''return '''value''' };''' or<br/>'''function foo { '''«'''param('''parameters''')'''» '''instructions''' …''' return '''value''' }'''</tt>
| rowspan=4 {{n/a}}
|- valign="top"
| rowspan=2|Bash shell
| rowspan=2|<tt>'''foo''' «parameters»</tt>
| <poem><tt>'''function foo {'''
{{space|4}}instructions
'''}'''
</tt>or<tt>
'''foo () {'''
{{space|4}}instructions
''' }'''</tt></poem>
| <poem><tt>'''function foo {'''
{{space|4}}instructions
{{space|4}}'''return''' «exit_code»
'''}'''
</tt>or<tt>
'''foo () {'''
{{space|4}}instructions
{{space|4}}'''return''' «exit_code»
''' }'''</tt></poem>
|- valign="top"
| colspan=2|
* parameters
** <tt>'''$'''n</tt> ('''$1''', '''$2''', '''$3''', ...)
** <tt>'''$@'''</tt> (all parameters)
** <tt>'''$#'''</tt> (the number of parameters)
** <tt>'''$0'''</tt> (this function name)
|- valign="top"
| OCaml
| rowspan=4| <tt>'''foo '''parameters</tt>
| rowspan=2| <tt>'''let''' «'''rec'''» '''foo''' parameters '''=''' instructions</tt>
| rowspan=2| <tt>'''let''' «'''rec'''» '''foo''' parameters '''=''' instructions... return_value</tt>
|- valign="top"
| F#
| <tt>'''[<EntryPoint>] let main args =''' instructions</tt>
|- valign="top"
| Standard ML
| <tt>'''fun foo''' parameters '''= (''' instructions ''')'''</tt>
| <tt>'''fun foo''' parameters '''= (''' instructions... return_value ''')'''</tt>
|
|- valign="top"
| Haskell
| <tt>'''foo''' parameters '''= do'''<br/>{{keypress|Tab}} instructions</tt>
| <tt>'''foo''' parameters '''=''' return_value <br/> or <br/> '''foo''' parameters '''= do'''<br/>{{keypress|Tab}} instructions<br/>{{keypress|Tab}} '''return''' value</tt>
| <tt>«'''main :: IO ()'''» <br/> '''main = do''' instructions</tt>
|- valign="top"
| Eiffel
| <tt>'''foo ('''«parameters»''')'''</tt>
| <tt>'''foo ('''«parameters»''')'''<br/><dl><dd>'''require''' <dl><dd>preconditions</dd></dl> '''do''' <dl><dd>instructions</dd></dl> '''ensure''' <dl><dd>postconditions</dd></dl> '''end'''</dd></dl></tt>
| <tt>'''foo ('''«parameters»''')''': type<br/><dl><dd>'''require''' <dl><dd>preconditions</dd></dl> '''do''' <dl><dd>instructions</dd><dd>'''Result''' := value</dd></dl> '''ensure''' <dl><dd>postconditions</dd></dl> '''end'''</dd></dl></tt>
| {{ref|root class and feature|[b]}}
|- valign="top"
| rowspan=2| CoffeeScript
| <tt>'''foo()'''</tt>
| <tt>'''foo = <nowiki>-></nowiki>'''</tt>
| <tt>'''foo = <nowiki>-></nowiki>''' value</tt>
| rowspan=2 {{n/a}}
|- valign="top"
| <tt>'''foo''' parameters</tt>
| <tt>'''foo = <nowiki>() -></nowiki>'''</tt>
| <tt>'''foo = (''' parameters ''') <nowiki>-></nowiki>''' value</tt>
|- valign="top"
| rowspan=2 | COBOL
| <tt>'''CALL''' '''"'''foo'''"''' «'''USING''' parameters» <dl><dd> «exception-handling» </dd></dl> «'''END-CALL'''»</tt>{{ref|COBOL calling programs|[d]}}
| <tt>«'''IDENTIFICATION DIVISION.'''»<br/>
'''PROGRAM-ID.''' foo'''.'''<br/>
«other divisions...»<br/>
'''PROCEDURE DIVISION''' «'''USING''' parameters»'''.'''<br/>
<dl><dd> instructions'''.'''</dd></dl> </tt>
| rowspan=2 | <tt>«'''IDENTIFICATION DIVISION.'''»<br/>
'''PROGRAM-ID'''/'''FUNCTION-ID.''' foo'''.'''<br/>
«other divisions...»<br/>
'''DATA DIVISION.'''<br/>
«other sections...»<br/>
'''LINKAGE SECTION.'''<br/>
«parameter definitions...»<br/>
variable-to-return definition<br/>
«other sections...»<br/>
'''PROCEDURE DIVISION''' «'''USING''' parameters» '''RETURNING''' variable-to-return'''.'''<br/>
<dl><dd> instructions'''.'''</dd></dl></tt>
| rowspan=2 {{n/a}}
|-
|<tt>«'''FUNCTION'''» foo«(«parameters»)»</tt>
| {{n/a}}
|}
{{note|forward declaration|a}} Pascal requires "<tt>forward;</tt>" for [[forward declaration]]s.<br/>
{{note|root class and feature|b}} Eiffel allows the specification of an application's root class and feature.<br/>
{{note|Fortran arguments|c}} In Fortran, function/subroutine parameters are called arguments (since <tt>PARAMETER</tt> is a language keyword); the <tt>CALL</tt> keyword is required for subroutines.<br/>
{{note|COBOL calling programs|d}} Instead of using <tt>"foo"</tt>, a string variable may be used instead containing the same value.
== [[Type conversion]]s{{anchor|Data conversions}} ==
Where ''string'' is a signed decimal number:
{| class="wikitable"
|-
!
! string to integer
! string to long integer
! string to floating point
! integer to string
! floating point to string
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt> '''Integer'Value ('''string_expression''')'''</tt>
| <tt> '''Long_Integer'Value ('''string_expression''')'''</tt>
| <tt> '''Float'Value ('''string_expression''')'''</tt>
| <tt> '''Integer'Image ('''integer_expression''')'''</tt>
| <tt> '''Float'Image ('''float_expression''')'''</tt>
|-
| rowspan=3 | [[ALGOL 68]] with general, and then specific formats
| colspan=5 align=center| With prior declarations and association of: <tt>'''string''' buf := "12345678.9012e34 "; '''file''' proxy; associate(proxy, buf);</tt>
|-
| <pre>get(proxy, ivar);</pre>
| <pre>get(proxy, livar);</pre>
| <pre>get(proxy, rvar);</pre>
| <pre>put(proxy, ival);</pre>
| <pre>put(proxy, rval);</pre>
|-
| <pre>getf(proxy, ($g$, ivar));</pre><br/>orv
<pre>getf(proxy, ($dddd$, ivar));</pre>
| <pre>getf(proxy, ($g$, livar));</pre><br/>or<br/>
<pre>getf(proxy, ($8d$, livar));</pre>
| <pre>getf(proxy, ($g$, rvar));</pre><br/>or<br/>
<pre>getf(proxy, ($8d.4dE2d$, rvar));</pre>
| <pre>putf(proxy, ($g$, ival));</pre><br/>or<br/>
<pre>putf(proxy, ($4d$, ival));</pre>
| <pre>putf(proxy, ($g(width, places, exp)$, rval));</pre><br/>or<br/>
<pre>putf(proxy, ($8d.4dE2d$, rval));</pre><br/>etc.
|-
| [[APL (programming language)|APL]]
| <tt> '''⍎'''string_expression</tt>
| <tt> '''⍎'''string_expression</tt>
| <tt> '''⍎'''string_expression</tt>
| <tt> '''⍕'''integer_expression</tt>
| <tt> '''⍕'''float_expression</tt>
|-
| C (C99)
| <tt> integer '''= [[atoi]]('''string''');'''</tt>
| <tt> long '''= [[atol (programming)|atol]]('''string''');'''</tt>
| <tt> float '''= [[atof]]('''string''');'''</tt>
| <tt> '''[[sprintf]]('''string''', "%i", '''integer''');'''</tt>
| <tt> '''[[sprintf]]('''string''', "%f", '''float''');'''</tt>
|-
| Objective-C
| <tt> integer '''= ['''string''' intValue];'''</tt>
| <tt> long '''= ['''string''' longLongValue];'''</tt>
| <tt> float '''= ['''string''' doubleValue];'''</tt>
| <tt> string '''= [NSString stringWithFormat<wbr/>:@"%i", '''integer'''];'''</tt>
| <tt> string '''= [NSString stringWithFormat<wbr/>:@"%f", '''float'''];'''</tt>
|-
| C++ (STL)
| colspan=3| <tt>«'''std::'''»'''istringstream('''string''') >> '''number;</tt>
| colspan=2| <tt>«'''std::'''»'''ostringstream '''o''';''' o''' << '''number'''; '''string '''= '''o'''.str();'''</tt>
|-
| C++11
| <tt> integer '''= «'''std::'''»stoi('''string''');'''</tt>
| <tt> long '''= «'''std::'''»stol('''string''');'''</tt>
| <tt> float '''= «'''std::'''»stof('''string''');'''
double '''= «'''std::'''»stod('''string''');''' </tt>
| colspan=2| <tt>string '''= «'''std::'''»to_string('''number''');'''</tt>
|-
| C#
| <tt> integer '''= int.Parse<wbr/>('''string''');'''</tt>
| <tt> long '''= long.Parse<wbr/>('''string''');'''</tt>
| <tt> float '''= float.Parse<wbr/>('''string''');''' or<br/> double '''= double.Parse<wbr/>('''string''');'''</tt>
| colspan=2| <tt>string '''= '''number'''<wbr/>.ToString();'''</tt>
|-
| D
| <tt> integer '''= std.conv.to!int<wbr/>('''string''')'''</tt>
| <tt> long '''= std.conv.to!long<wbr/>('''string''')'''</tt>
| <tt> float '''= std.conv.to!float<wbr/>('''string''')''' or<br/> double '''= std.conv.to!double<wbr/>('''string''')'''</tt>
| colspan=2| <tt> string '''= std.conv.to!string<wbr/>('''number''')'''</tt>
|-
| Java
| <tt> integer '''= Integer.parseInt<wbr/>('''string''');'''</tt>
| <tt> long''' = Long.parseLong<wbr/>('''string''');'''</tt>
| <tt> float''' = Float.parseFloat<wbr/>('''string''');''' or<br/> double '''= Double.parseDouble<wbr/>('''string''');'''</tt>
| <tt> string''' = Integer.toString<wbr/>('''integer''');''' or<br/> string''' = String.valueOf<wbr/>('''integer''');'''</tt>
| <tt> string''' = Float.toString<wbr/>('''float''');''' or<br/> string''' = Double.toString<wbr/>('''double''');'''</tt>
|-
| <tt> JavaScript{{ref|JavaScript's technicalities|[a]}}</tt>
| colspan=2| <tt> integer '''= parseInt('''string''');'''</tt>
| <tt> float '''= parseFloat('''string''');''' or<br/> float''' = new Number ('''string''')''' or<br/> float''' = Number ('''string''')''' or<br/> float '''= +'''string</tt>
| colspan=2| <tt> string''' = '''number'''.toString ();''' or<br/> string '''= new String ('''number''');''' or<br/> string '''= String ('''number''');''' or<br/> string''' = '''number'''+"";'''</tt>
|-
| Go
| <tt> integer''',''' error '''= strconv.Atoi('''string''')''' or<br /> integer''',''' error '''= strconv.ParseInt<wbr/>('''string''', 10, 0)'''</tt>
| <tt> long''',''' error '''= strconv.ParseInt<wbr/>('''string''', 10, 64)'''</tt>
| <tt> float''',''' error '''= strconv.ParseFloat<wbr/>('''string''', 64)'''</tt>
| <tt> string '''= strconv.Itoa('''integer''')''' or<br/> string '''= strconv.FormatInt<wbr/>('''integer''', 10)''' or<br/> string '''= fmt.Sprint('''integer''')'''</tt>
| <tt> string '''= strconv.FormatFloat<wbr/>('''float''')''' or<br/> string '''= fmt.Sprint<wbr/>('''float''')'''</tt>
|-
| Common Lisp
| colspan=2| <tt>'''(setf''' integer '''(parse-integer '''string'''))'''</tt>
| <tt> '''(setf''' float '''(read-from-string '''string'''))'''</tt>
| colspan=2| <tt>'''(setf''' string '''(princ-to-string '''number'''))'''</tt>
|-
| Scheme
| colspan=3| <tt>'''(define''' number '''(string->number '''string'''))'''</tt>
| colspan=2| <tt>'''(define''' string '''(number->string '''number'''))'''</tt>
|-
| ISLISP
| colspan=2| <tt>'''(setf''' integer '''(convert '''string''' <integer>))'''</tt>
| <tt> '''(setf''' float '''(convert '''string''' <float>))'''</tt>
| colspan=2| <tt>'''(setf''' string '''(convert '''number''' <string>))'''</tt>
|-
| Pascal <!-- Pascal or Delphi? -->
| <tt> integer ''':= StrToInt('''string''');'''</tt>
|
| <tt> float ''':= StrToFloat('''string''');'''</tt>
| <tt> string ''':= IntToStr('''integer''');'''</tt>
| <tt> string ''':= FloatToStr('''float''');'''</tt>
|-
| Visual Basic
| rowspan=2| <tt>integer''' = CInt('''string''')'''</tt>
| rowspan=2| <tt>long''' = CLng('''string''')'''</tt>
| rowspan=2| <tt>float''' = CSng('''string''')''' or<br/> double''' = CDbl('''string''')'''</tt>
| <tt> rowspan=2 colspan=2|string''' = CStr('''number''')'''</tt>
|-
| Visual Basic .NET
|-
| Xojo
| <tt>integer''' = Val('''string''')'''</tt>
| <tt>long''' = Val('''string''')'''</tt>
| <tt>double''' = Val('''string''')''' or<br/> double''' = CDbl('''string''')'''</tt>
| colspan=2| <tt> string''' = CStr('''number''')''' or<br/> string''' = Str('''number''')</tt>
|-
| Python
| <tt> integer''' = int('''string''')'''</tt>
| <tt> long''' = long('''string''')'''</tt>
| <tt> float''' = float('''string''')'''</tt>
| colspan=2| <tt>string''' = str('''number''')'''</tt>
|-
| S-Lang
| <tt> integer''' = [[atoi]]('''string''');'''</tt>
| <tt> long''' = [[atol (programming)|atol]]('''string''');'''</tt>
| <tt> float''' = [[atof]]('''string''');'''</tt>
| colspan=2| <tt>string''' = string('''number''');'''</tt>
|-
| Fortran
| colspan=3| <tt>'''READ('''string''','''format''') '''number</tt>
| colspan=2| <tt>'''WRITE('''string''','''format''') '''number</tt>
|-
| PHP
| colspan=2| <tt> integer '''= intval('''string''');''' or<br/> integer '''= (int)'''string''';'''</tt>
| <tt> float '''= floatval('''string''');''' or<br/> float '''= (float)'''string''';'''</tt>
| colspan=2| <tt> string '''= "'''number'''";''' or<br/> string '''= strval('''number''');''' or<br/> string '''= (string)'''number''';'''</tt>
|-
| Perl{{ref|Perl's technicalities|[b]}}
| colspan=3| <tt> number '''= 0 +''' string;</tt>
| colspan=2| <tt> string '''= "'''number'''";'''</tt>
|-
| Perl 6
| colspan=3| <tt> number '''= +'''string;</tt>
| colspan=2| <tt> string '''= ~'''number''';'''</tt>
|-
| Ruby
| colspan=2| <tt> integer '''=''' string'''.to_i''' or<br/>integer '''= Integer('''string''')'''</tt>
| <tt> float '''=''' string'''.to_f''' or<br/>float '''= Float('''string''')'''</tt>
| colspan=2| <tt> string '''=''' number'''.to_s'''</tt>
|-
| Scala
| <tt> integer '''=''' string'''.toInt'''</tt>
| <tt> long '''=''' string'''.toLong'''</tt>
| <tt> float '''=''' string'''.toFloat''' or<br/> double '''=''' string'''.toDouble'''</tt>
| colspan=2| <tt>string '''= '''number'''.toString'''</tt>
|-
| Smalltalk
| colspan=2| <tt> integer := Integer '''readFrom:''' string</tt>
| <tt> float := Float '''readFrom:''' string</tt>
| colspan=2| <tt> string := number '''asString'''</tt>
|-
| Windows PowerShell
| <tt> integer''' = [int]'''string</tt>
| <tt> long''' = [long]'''string</tt>
| <tt> float''' = [float]'''string</tt>
| colspan=2| <tt>string''' = [string]'''number''';''' or<br/>string''' = "'''number'''";''' or<br/>string''' = ('''number''').ToString()'''</tt>
|-
| OCaml
| <tt> '''let''' integer''' = int_<wbr/>of_string '''string</tt>
|
| <tt> '''let''' float''' = float_<wbr/>of_string '''string</tt>
| <tt> '''let''' string''' = string_<wbr/>of_int '''integer</tt>
| <tt> '''let''' string''' = string_<wbr/>of_float '''float</tt>
|-
| F#
| <tt> '''let''' integer''' = int '''string</tt>
| <tt> '''let''' integer''' = int64 '''string</tt>
| <tt> '''let''' float''' = float '''string</tt>
| colspan=2| <tt> '''let''' string''' = string '''number</tt>
|-
| Standard ML
| <tt> '''val''' integer''' = Int<wbr/>.fromString '''string</tt>
|
| <tt> '''val''' float''' = Real<wbr/>.fromString '''string</tt>
| <tt> '''val''' string''' = Int<wbr/>.toString '''integer</tt>
| <tt> '''val''' string''' = Real<wbr/>.toString '''float</tt>
|-
| Haskell (GHC)
| colspan=3| <tt> number '''= read '''string</tt>
| colspan=2| <tt> string '''= show '''number</tt>
|-
| COBOL
| colspan=3 | <code>'''MOVE''' «'''FUNCTION'''» '''NUMVAL('''string''')'''{{ref|COBOL's NUMVAL alternatives|[c]}} '''TO''' number</code>
| colspan=2 | <code>'''MOVE''' number '''TO''' numeric-edited</code>
|-
|}
{{note|JavaScript's technicalities|a}} JavaScript only uses floating point numbers so there are some technicalities.<ref name="Javascript numbers"/>
<br/>{{note|Perl's technicalities|b}} Perl doesn't have separate types. Strings and numbers are interchangeable.
<br/>{{note|COBOL's NUMVAL alternatives|c}} <code>NUMVAL-C</code> or <code>NUMVAL-F</code> may be used instead of <code>NUMVAL</code>.
== [[Standard streams|Standard stream I/O]] ==
{| class="wikitable"
|-
! rowspan=2|
! read from
! colspan=2| write to
|-
! [[stdin]]
! [[stdout]]
! [[stderr]]
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>'''Get ('''x''')'''</tt>
| <tt>'''Put ('''x''')'''</tt>
| <tt>'''Put (Standard_Error, '''x''')'''</tt>
|-
| [[ALGOL 68]]
| <tt>'''readf(('''$format$''', '''x'''));''' or <br/> '''getf(stand in, ('''$format$''', '''x'''));'''</tt>
| <tt>'''[[printf]](('''$format$''', '''x'''));''' or <br/> '''putf(stand out, ('''$format$''', '''x'''));''' </tt>
| <tt>'''putf(stand error, ('''$format$''', '''x'''));'''{{ref|ALGOL Unformatted|[a]}}</tt>
|-
| [[APL (programming language)|APL]]
| <tt>x←'''⎕'''</tt>
| <tt>'''⎕←'''x</tt>
| <tt>'''⍞←'''x</tt>
|-
| C (C99)
| <tt>'''[[scanf]]('''format''', &'''x''');''' or <br/> '''[[fscanf]](stdin, '''format''', &'''x''');''' {{ref|more c input|[b]}}</tt>
| <tt>'''[[printf]]( '''format''', '''x''');''' or <br/> '''[[fprintf]](stdout, '''format''', '''x''');''' {{ref|more c output|[c]}}</tt>
| <tt>'''[[fprintf]](stderr, '''format''', '''x''' );'''{{ref|more c error output|[d]}}</tt>
|-
| Objective-C
| <tt>data = '''[[NSFileHandle fileHandleWithStandardInput] readDataToEndOfFile];'''</tt>
| <tt>'''[[NSFileHandle fileHandleWithStandardOutput] writeData:'''data'''];'''</tt>
| <tt>'''[[NSFileHandle fileHandleWithStandardError] writeData:'''data'''];'''</tt>
|-
| C++
| <tt>[[iostream|«'''std::'''»'''cin''']] '''>>''' x''';''' or <br/> «'''std::'''»'''getline('''«'''std::'''»'''cin, '''str''');'''</tt>
| <tt>[[iostream|«'''std::'''»'''cout''']] '''<<''' x''';'''</tt>
| <tt>[[iostream|«'''std::'''»'''cerr''']] '''<<''' x''';''' or<br/> [[iostream|«'''std::'''»'''clog''']] '''<<''' x''';'''</tt>
|-
| C#
| <tt>x ''' = Console.Read();''' or <br/> x '''= Console.ReadLine();'''</tt>
| <tt>'''Console.Write('''«format''', '''»x''');''' or <br/> '''Console.WriteLine('''«format''', '''»x''');'''</tt>
| <tt>'''Console.Error<wbr/>.Write('''«format''', '''»x''');''' or <br/> '''Console.Error<wbr/>.WriteLine('''«format''', '''»x''');'''</tt>
|-
| D
| <tt>x = '''std.stdio.readln()'''</tt>
| <tt>'''std.stdio.write('''x''')''' or <br /> '''std.stdio.writeln('''x''')''' or <br /> '''std.stdio.writef('''format''', '''x''')''' or <br /> '''std.stdio.writefln('''format''', '''x''')'''</tt>
| <tt>'''stderr.write('''x''')''' or <br /> '''stderr.writeln('''x''')''' or <br /> '''std.stdio<wbr/>.writef(stderr, '''format''', '''x''')''' or <br /> '''std.stdio<wbr/>.writefln(stderr, '''format''', '''x''')'''</tt>
|-
| Java
| <tt>x '''= System.in.read();''' or <br/> x '''= new Scanner(System.in)<wbr/>.nextInt();''' or <br/> x '''= new Scanner(System.in)<wbr/>.nextLine();'''</tt>
| <tt>'''System.out.print('''x''');''' or <br/> '''System.out.[[printf]]('''format''', '''x''');''' or <br/> '''System.out.println('''x''');'''</tt>
| <tt>'''System.err.print('''x''');''' or <br/> '''System.err.[[printf]]('''format''', '''x''');''' or <br/> '''System.err.println('''x''');'''</tt>
|-
| Go
| <tt>'''fmt.Scan(&'''x''')''' or <br/> '''fmt.[[Scanf]]('''format''', &'''x''')''' or <br/> x = '''bufio.NewReader(os.Stdin)<wbr/>.ReadString('\n')'''</tt>
| <tt>'''fmt.Println('''x''')''' or<br/> '''fmt.[[Printf]]('''format''', '''x''')'''</tt>
| <tt>'''fmt.Fprintln(os{{Not a typo|.}}Stderr, '''x''')''' or<br/> '''fmt.[[Fprintf]](os{{Not a typo|.}}Stderr, '''format''', '''x''')'''</tt>
|-
| Swift
| <tt>x = '''readLine()'''</tt> (2.x)
| <tt>'''print('''x''')'''</tt> (2.x)<br /> <tt>'''println('''x''')'''</tt> (1.x)
|
|-
| JavaScript<br/><small>[[Client-side JavaScript|Web Browser implementation]]</small>
|
| <tt>'''document.write('''x''')'''</tt>
|
|-
| JavaScript<br/><small>[[Active Server Pages]]</small>
|
| <tt>'''Response.Write('''x''')'''</tt>
|
|-
| JavaScript<br/><small>[[Windows Script Host]]</small>
| <tt>x '''= WScript.StdIn.Read('''chars''')''' or<br/> x '''= WScript.StdIn.ReadLine()'''</tt>
| <tt>'''WScript.Echo('''x''')''' or<br/> '''WScript.StdOut.Write('''x''')''' or<br/> '''WScript.StdOut.WriteLine('''x''')'''</tt>
| <tt>'''WScript.StdErr.Write('''x''')''' or<br/> '''WScript.StdErr.WriteLine('''x''')'''</tt>
|-
| Common Lisp
| <tt>'''(setf''' x '''(read-line))'''</tt>
| <tt>'''(princ''' x''')''' or<br/> '''(format t '''format x''')'''</tt>
| <tt>'''(princ''' x''' *error-output*)''' or<br/> '''(format *error-output* '''format x''')'''</tt>
|-
| Scheme (R<sup>6</sup>RS)
| <tt>'''(define''' x''' (read-line))'''</tt>
| <tt>'''(display''' x''')''' or<br/> '''(format #t '''format x''')'''</tt>
| <tt>'''(display''' x''' (current-error-port))''' or<br/> '''(format (current-error-port) '''format x''')'''</tt>
|-
| ISLISP
| <tt>'''(setf''' x '''(read-line))'''</tt>
| <tt>'''(format (standard-output) '''format x''')'''</tt>
| <tt>'''(format (error-output) '''format x''')'''</tt>
|-
| Pascal
| <tt>'''read('''x''');''' or <br/> '''readln('''x''');'''</tt>
| <tt>'''write('''x''');''' or <br/> '''writeln('''x''');'''</tt>
| rowspan=2 {{n/a}}
|-
| Visual Basic
| <tt>'''Input'''« prompt''','''»''' '''x'''</tt>
| <tt>'''Print '''x or <br/> '''? '''x'''</tt>
|-
| Visual Basic .NET
| <tt>x ''' = Console.Read()''' or <br/> x '''= Console.ReadLine()'''</tt>
| <tt>'''Console.Write('''«format''', '''»x''')''' or <br/> '''Console.WriteLine('''«format''', '''»x''')'''</tt>
| <tt>'''Console.Error<wbr/>.Write('''«format''', '''»x''')''' or <br/> '''Console.Error<wbr/>.WriteLine('''«format''', '''»x''')'''</tt>
|-
| Xojo
| <tt>x ''' = StandardInputStream.Read()''' or <br/> x '''= StandardInputStreame.ReadLine()'''</tt>
| <tt>'''StandardOutputStream.Write('''x''')''' or <br/> '''StandardOutputStream.WriteLine('''x''')'''</tt>
| <tt>'''StdErr.Write('''x''')''' or <br/> '''StdErr.WriteLine('''x''')'''</tt>
|-
| Python 2.x
| <tt>x '''= raw_input('''«prompt»''')'''</tt>
| <tt>'''print''' x or <br/> '''sys.stdout.write('''x''')'''</tt>
| <tt>'''print >> sys.stderr,''' x or <br/> '''sys.stderr.write('''x''')'''</tt>
|-
| Python 3.x
| <tt>x '''= input('''«prompt»''')'''</tt>
| <tt>'''print('''x«''', end=""'''»''')'''</tt>
| <tt>'''print('''x«''', end=""'''»''', file=sys.stderr)'''</tt>
|-
| S-Lang
| <tt>'''[[fgets]] (&'''x''', stdin)'''</tt>
| <tt>'''[[fputs]] ('''x''', stdout)'''</tt>
| <tt>'''[[fputs]] ('''x''', stderr)'''</tt>
|-
| Fortran
| <tt>'''READ(*,'''format''') '''variable names''' or <br/> READ(INPUT_UNIT,'''format''') '''variable names'''{{ref|Fortran standard units|[e]}}</tt>
| <tt>'''WRITE(*,'''format''') '''expressions''' or <br/>WRITE(OUTPUT_UNIT,'''format''') '''expressions'''{{ref|Fortran standard units|[e]}}</tt>
| <tt>'''WRITE(ERROR_UNIT,'''format''') '''expressions{{ref|Fortran standard units|[e]}}</tt>
|-
| Forth
| <tt>buffer length''' ACCEPT''' ( # chars read ) <br/>'''KEY''' ( char )</tt>
| <tt>buffer length''' TYPE'''<br/>char''' EMIT'''</tt>
| {{n/a}}
|-
| PHP
| <tt>$x '''= [[fgets]](STDIN);''' or <br/> $x '''= [[fscanf]](STDIN, '''format''');'''</tt>
| <tt>'''print '''x''';''' or <br/> '''[[echo (command)|echo]] '''x''';''' or <br/> '''[[printf]]('''format''', '''x''');'''</tt>
| <tt>'''[[fprintf]](STDERR, '''format''', '''x''');'''</tt>
|-
| Perl
| <tt>$x '''= <>;''' or <br/> $x '''= <STDIN>;'''</tt>
| <tt>'''print '''x''';''' or <br/> '''[[printf]] '''format''', '''x''';'''</tt>
| <tt>'''print STDERR '''x''';''' or <br/> '''[[printf]] STDERR '''format''', '''x''';'''</tt>
|-
| Perl 6
| <tt>$x '''= $*IN.get;'''</tt>
| <tt>x'''.print''' or<br/> x'''.say'''</tt>
| <tt>x'''.note''' or<br/> '''$*ERR.print('''x''')''' or<br/> '''$*ERR.say('''x''')'''</tt>
|-
| Ruby
| <tt>x '''= gets'''</tt>
| <tt>'''puts''' x or<br/> '''[[printf]]('''format''', '''x''')'''</tt>
| <tt>'''$stderr.puts('''x''')''' or<br/> '''$stderr.[[printf]]('''format''', '''x''')'''</tt>
|-
| Windows PowerShell
| <tt>$x '''= Read-Host'''««''' -Prompt'''» text»''';''' or <br/> $x '''= [Console]::Read();''' or <br/> $x '''= [Console]::ReadLine()'''</tt>
| <tt>x''';''' or <br/> '''Write-Output '''x''';''' or <br/> '''echo '''x</tt>
| <tt>'''Write-Error '''x</tt>
|-
| OCaml
| <tt>'''let''' x '''= read_int ()''' or <br/> '''let''' str '''= read_line ()''' or <br/> '''Scanf.[[scanf]]''' format '''(fun '''x ...''' <nowiki>-></nowiki> '''...''')'''</tt>
| <tt>'''print_int''' x or <br/> '''print_endline''' str or <br/> '''Printf.[[printf]]''' format x ...</tt>
| <tt>'''prerr_int''' x or <br/> '''prerr_endline''' str or <br/> '''Printf.[[fprintf|eprintf]]''' format x ...</tt>
|-
| F#
| <tt>'''let''' x '''= System.Console<wbr/>.ReadLine()'''</tt>
| <tt>'''[[printf]]''' format x ... or <br/> '''[[printf]]n''' format x ...</tt>
| <tt>'''[[fprintf|eprintf]]''' format x ... or <br/>'''[[fprintf|eprintf]]n''' format x ...</tt>
|-
| Standard ML
| <tt>'''val''' str '''= TextIO.inputLIne TextIO.stdIn'''</tt>
| <tt>'''print''' str</tt>
| <tt>'''TextIO.output (TextIO.stdErr, '''str''')'''</tt>
|-
| Haskell (GHC)
| <tt>x '''<- readLn''' or <br/> str '''<nowiki><-</nowiki> getLine'''</tt>
| <tt>'''print '''x or <br/> '''putStrLn''' str</tt>
| <tt>'''hPrint stderr '''x or <br/> '''hPutStrLn stderr''' str</tt>
|-
| COBOL
| <code>'''ACCEPT''' x</code>
| <code>'''DISPLAY''' x</code>
|
|-
|}
<br>{{note|ALGOL Unformatted|a}} ALGOL 68 additionally as the "unformatted" [[transput]] routines: <tt>''read'', ''write'', ''get''</tt> and <tt>''put''</tt>.
<br>{{note|more c input|b}} <tt>'''[[gets()|gets]](x)'''</tt> and <tt>'''[[fgets]](x,''' length''', stdin)'''</tt> read unformatted text from stdin. Use of gets is not recommended.
<br/>{{note|more c input|c}} <tt>'''[[puts (C)|puts]](x)'''</tt> and <tt>'''[[fputs]](x, stdout)'''</tt> write unformatted text to stdout.
<br/>{{note|more c error output|d}} <tt>'''fputs(x, stderr)'''</tt> writes unformatted text to stderr
<br/>{{note|Fortran standard units|e}} <tt>'''INPUT_UNIT''', '''OUTPUT_UNIT''', '''ERROR_UNIT'''</tt> are defined in the <tt>ISO_FORTRAN_ENV</tt> module.<ref>{{cite web|url=http://fortranwiki.org/fortran/show/iso_fortran_env|title=iso_fortran_env in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref>
== Reading [[command-line argument]]s ==
{| class="wikitable"
|-
!
! Argument values
! Argument counts
! Program name / Script name
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| <tt>'''Argument ('''n''')'''</tt>
| <tt>'''Argument_Count'''</tt>
| <tt>'''Command_Name'''</tt>
|-
| C (C99)
| rowspan=3| <tt>'''argv['''n''']'''</tt>
| rowspan=3| <tt>'''argc'''</tt>
| rowspan=3| first argument
|-
| Objective-C
|-
| C++
|-
| C#
| rowspan=3| <tt>'''args['''n''']'''</tt>
| <tt>'''args.Length'''</tt>
| <tt>'''Assembly.GetEntryAssembly()<wbr/>.Location;'''</tt>
|-
| Java
| rowspan=2| <tt>'''args.length'''</tt>
| <!-- same as name of class containing '''main()''' --> <!-- not sure if that would yield the name of the exe/binary file of the program -->
|-
| D
| first argument
|-
| JavaScript <br/><small>[[Windows Script Host]] implementation</small>
| <tt>'''WScript.Arguments('''n''')'''</tt>
| <tt>'''WScript.Arguments.length'''</tt>
| <tt>'''WScript.ScriptName''' or '''WScript.ScriptFullName'''</tt>
|-
| Go
| <tt>'''os.Args['''n''']'''</tt>
| <tt>'''len(os.Args)'''</tt>
| first argument
|-
| Swift
| <tt>'''Process.arguments['''n''']'''</tt> or <br /> <tt>'''Process.unsafeArgv['''n''']'''</tt>
| <tt>'''Process.arguments.count'''</tt> or <br /> <tt>'''Process.argc'''</tt>
| first argument
|-
| Common Lisp
| {{dunno}}
| {{dunno}}
| {{dunno}}
|-
| Scheme (R<sup>6</sup>RS)
| <tt>'''(list-ref (command-line) '''n''')'''</tt>
| <tt>'''(length (command-line))'''</tt>
| first argument
|-
| ISLISP
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| Pascal
| <tt>'''ParamStr('''n''')'''</tt>
| <tt>'''ParamCount'''</tt>
| first argument
|-
| Visual Basic
| <tt>'''Command'''</tt>{{ref|unseparated|[a]}}
| {{n/a}}
| <tt>'''App.Path'''</tt>
|-
| Visual Basic .NET
| <tt>'''CmdArgs('''n''')'''</tt>
| <tt>'''CmdArgs.Length'''</tt>
| <tt>'''[Assembly].GetEntryAssembly().Location'''</tt>
|-
| Xojo
| <tt>'''System.CommandLine'''</tt>
| (string parsing)
| '''Application.ExecutableFile.Name'''
|-
| Python
| <tt>'''sys.argv['''n''']'''</tt>
| <tt>'''len(sys.argv)'''</tt>
| first argument
|-
| S-Lang
| <tt>'''__argv['''n''']'''</tt>
| <tt>'''__argc'''</tt>
| first argument
|-
| Fortran
| <tt>'''DO '''i''' = '''1''','''argc''' <dl><dd> CALL GET_COMMAND_ARGUMENT ('''i''','''argv(i)''') </dd></dl> ENDDO'''</tt>
| <tt>argc''' = COMMAND_ARGUMENT_COUNT ()'''</tt>
| <tt>'''CALL GET_COMMAND_ARGUMENT ('''0''','''progname''')'''</tt>
|-
| PHP
| <tt>'''$argv['''n''']'''</tt>
| <tt>'''$argc'''</tt>
| first argument
|-
| Bash shell
| <tt>'''$'''n ('''$1''', '''$2''', '''$3''', ...)</tt><br/><tt>'''$@'''</tt> (all arguments)
| <tt>'''$#'''</tt>
| <tt>'''$0'''</tt>
|-
| Perl
| <tt>'''$ARGV['''n''']'''</tt>
| <tt>'''scalar(@ARGV)'''</tt>
| <tt>'''$0'''</tt>
|-
| Perl 6
| <tt>'''@*ARGS['''n''']'''</tt>
| <tt>'''@*ARGS.elems'''</tt>
| <tt>'''$PROGRAM_NAME'''</tt>
|-
| Ruby
| <tt>'''ARGV['''n''']'''</tt>
| <tt>'''ARGV.size'''</tt>
| <tt>'''$0'''</tt>
|-
| Windows PowerShell
| <tt>'''$args['''n''']'''</tt>
| <tt>'''$args.Length'''</tt>
| <tt>'''$MyInvocation.MyCommand<wbr/>.Name'''</tt>
|-
| OCaml
| <tt>'''Sys.argv.('''n''')'''</tt>
| <tt>'''Array.length Sys.argv'''</tt>
| first argument
|-
| F#
| <tt>'''args.['''n''']'''</tt>
| <tt>'''args.Length'''</tt>
| <tt>'''Assembly.GetEntryAssembly()<wbr/>.Location'''</tt>
|-
| Standard ML
| <tt>'''List.nth (CommandLine<wbr/>.arguments (), '''n''')'''</tt>
| <tt>'''length (CommandLine<wbr/>.arguments ())'''</tt>
| <tt>'''CommandLine.name ()'''</tt>
|-
| Haskell (GHC)
| {{code|lang=haskell|do { args <- System.getArgs; return length args !! n }}}
| {{code|lang=haskell|do { args <- System.getArgs; return length args }}}
| <tt>'''System.getProgName'''</tt>
|-
| COBOL
| colspan=2 | {{ref|COBOL Arguments|[b]}}
| {{n/a}}
|}
* {{note|unseparated|a}} In Visual Basic, command-line arguments are not separated. Separating them requires a split function <code>'''Split('''string''')'''</code>.
* {{note|COBOL Arguments|b}} The COBOL standard includes no means to access command-line arguments, but common compiler extensions to access them include defining parameters for the main program or using <code>ACCEPT</code> statements.
== Execution of commands ==
{| class="wikitable"
!
!Shell command
!Execute program
![[exec (operating system)|Replace current program with new executed program]]
|-
| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
| colspan=3 align="center"| Not part of the language standard. Commonly done by compiler provided packages or by interfacing to C or [[POSIX]].<ref name=Ada_Execute_Command>{{cite web|url=http://rosettacode.org/wiki/Execute_a_system_command#Ada|title=Execute a system command - Rosetta Code|author=|date=|work=rosettacode.org|accessdate=30 January 2017}}</ref>
|-
| C
| rowspan=3| <tt>'''[[system (C standard library)|system]]("'''command'''");'''</tt>
|
| rowspan=2| <tt>'''[[Exec (operating system)|execl]]('''path''',''' args''');''' or<br/> '''[[Exec (operating system)|execv]]('''path''',''' arglist''');'''</tt>
|-
| C++
|
|-
| Objective-C
| <tt>'''[NSTask launchedTaskWithLaunchPath:(NSString *)'''path''' arguments:(NSArray *)'''arguments'''];'''</tt>
|
|-
| C#
|
| rowspan=2| <tt>'''System.Diagnostics<wbr/>.Process.Start('''path''',''' argstring''');'''</tt>
|
|-
| F#
|
|
|-
| Go
|
| <tt>'''exec.Run('''path''',''' argv''',''' envv''',''' dir''', exec.DevNull, exec.DevNull, exec.DevNull)'''</tt>
| <tt>'''os.Exec('''path''',''' argv''',''' envv''')'''</tt>
|-
| Visual Basic
| <tt>'''Interaction.Shell('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''')'''</tt>
|
|
|-
| Visual Basic .NET
| <tt>'''Microsoft.VisualBasic<wbr/>.Interaction.Shell('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''')'''</tt>
| <tt>'''System.Diagnostics<wbr/>.Process.Start('''path''',''' argstring''')'''</tt>
|
|-
| Xojo
| <tt>'''Shell.Execute('''command «''', '''Parameters»''')'''</tt>
| <tt>'''FolderItem.Launch('''parameters''',''' activate''')'''</tt>
| {{n/a}}
|-
| D
| <tt>'''std.process.system("'''command'''");'''</tt>
|
| <tt>'''std.process.execv('''path''',''' arglist''');'''</tt>
|-
| Java
|
| <tt>'''Runtime.exec('''command''');''' or<br/> '''new ProcessBuilder('''command''').start();'''</tt>
|
|-
| JavaScript <br/> <small>[[Windows Script Host]] implementation</small>
| <tt>'''WScript.CreateObject ("WScript.Shell").Run('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''');'''</tt>
| <tt>'''WshShell.Exec(command)'''</tt>
|
|-
| Common Lisp
| <tt>'''(shell '''command''')'''</tt>
|
|
|-
| Scheme
| <tt>'''(system '''command''')'''</tt>
|
|
|-
| ISLISP
| {{n/a}}
| {{n/a}}
| {{n/a}}
|-
| Pascal
| <tt>'''system('''command''');'''</tt>
|
|
|-
| OCaml
| <tt>'''Sys.command '''command, '''Unix.open_process_full''' command env (stdout, stdin, stderr),...</tt>
| <tt>'''Unix.create_process''' prog args new_stdin new_stdout new_stderr, ...</tt>
| <tt>'''Unix.execv''' prog args or <br/> '''Unix.execve''' prog args env</tt>
|-
| Standard ML
| <tt>'''OS.Process.system '''command</tt>
| <tt>'''Unix.execute ('''path''', '''args''')'''</tt>
| <tt>'''Posix.Process.exec ('''path''', '''args''')'''</tt>
|-
| Haskell (GHC)
| <tt>'''System.system '''command</tt>
| <tt>'''System.Process<wbr/>.runProcess '''path''' '''args''' ...</tt>
| <tt>'''Posix.Process<wbr/>.executeFile '''path''' True '''args''' ...</tt>
|-
| Perl
| <tt>'''system('''command''')''' or <br/>$output '''= `'''command'''`''' or<br/>$output '''= qx('''command''')'''</tt>
|
| <tt>'''exec('''path''',''' args''')'''</tt>
|-
| Ruby
| <tt>'''system('''command''')''' or <br/> output '''= `'''command'''`'''</tt>
|
| <tt>'''exec('''path''',''' args''')'''</tt>
|-
| PHP
| <tt>'''system('''command''')''' or <br/> $output '''= `'''command'''`''' or <br/> '''exec('''command''')''' or <br/> '''passthru('''command''')'''</tt>
|
|
|-
| Python
| <tt>'''os.system('''command''')''' or <br/> '''subprocess.Popen('''command''')''' </tt>
| <tt>'''subprocess.call('''["program", "arg1", "arg2", …]''')''' </tt>
| <tt>'''os.execv('''path''',''' args''')'''</tt>
|-
| S-Lang
| <tt>'''system('''command''')'''</tt>
|
|
|-
| Fortran
| <tt>'''CALL EXECUTE_COMMAND_LINE ('''COMMAND''' «, '''WAIT'''» «, '''EXITSTAT'''» «, '''CMDSTAT'''» «, '''CMDMSG'''») {{ref|Fortran 2008|[a]}}</tt>
|
|
|-
| Windows PowerShell
| <tt>'''[Diagnostics.Process]::Start('''command''')'''</tt>
| <tt>«'''Invoke-Item''' »program arg1 arg2 …</tt>
|
|-
| Bash shell
| <tt>output'''=`'''command'''`'''</tt> or
<tt>output'''=$('''command''')'''</tt>
| <tt>program arg1 arg2 …</tt>
|
|}
{{note|Fortran 2008|a}} Fortran 2008 or newer.<ref>{{cite web|url=https://gcc.gnu.org/onlinedocs/gfortran/EXECUTE_005fCOMMAND_005fLINE.html|title=EXECUTE_COMMAND_LINE - The GNU Fortran Compiler|author=|date=|work=gnu.org|accessdate=30 January 2017}}</ref>
== References ==
{{Reflist}}
[[Category:Programming constructs]]
[[Category:Programming language comparisons|*Basic instructions]]' |
New page wikitext, after the edit (new_wikitext ) | '' |
Unified diff of changes made by edit (edit_diff ) | '@@ -1,3561 +1,1 @@
-{{Refimprove|date=February 2009}}
-{{ProgLangCompare}}
-'''Comparison of programming languages''' is a common topic of discussion among [[software engineer]]s. Basic instructions of several [[programming language]]s are compared here.
-__TOC__
-== Conventions of this article ==
-The '''bold''' is the literal code. The non-bold is interpreted by the reader. Statements in [[guillemets]] (« … ») are optional. {{keypress|Tab}} indicates a necessary indent (with whitespace).
-{{Clear}}
-
-== Type identifiers ==
-
-=== [[Integer (computer science)|Integer]]s ===
-{| class="wikitable"
-! rowspan=2|
-! colspan=2| 8 bit ([[byte]])
-! colspan=2| 16 bit ([[short integer]])
-! colspan=2| 32 bit
-! colspan=2| 64 bit ([[long integer]])
-! colspan=2| Word size
-! rowspan=2| Arbitrarily precise ([[Arbitrary-precision arithmetic|bignum]])
-|-
-! Signed
-! Unsigned
-! Signed
-! Unsigned
-! Signed
-! Unsigned
-! Signed
-! Unsigned
-! Signed
-! Unsigned
-|-
-| [[Ada (programming language)|Ada]]<ref name=Ada_RM_2012>Ada Reference Manual - Language and Standard Libraries; ISO/IEC 8652:201x (E), {{cite web |url=http://www.ada-auth.org/standards/12rm/RM-Final.pdf |title=Archived copy |accessdate=2013-07-19 |deadurl=yes |archiveurl=https://web.archive.org/web/20110427190723/http://www.ada-auth.org/standards/12rm/RM-Final.pdf |archivedate=2011-04-27 |df= }}</ref>
-| <tt>range -2**7 .. 2**7 - 1</tt>{{ref|Ada_range|[j]}}
-| <tt>range 0 .. 2**8 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**8</tt>{{ref|Ada_mod|[k]}}
-| <tt>range -2**15 .. 2**15 - 1</tt>{{ref|Ada_range|[j]}}
-| <tt>range 0 .. 2**16 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**16</tt>{{ref|Ada_mod|[k]}}
-| <tt>range -2**31 .. 2**31 - 1</tt>{{ref|Ada_range|[j]}}
-| <tt>range 0 .. 2**32 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**32</tt>{{ref|Ada_mod|[k]}}
-| <tt>range -2**63 .. 2**63 - 1</tt>{{ref|Ada_range|[j]}}
-| <tt>mod 2**64</tt>{{ref|Ada_mod|[k]}}
-| <tt>Integer</tt>{{ref|Ada_range|[j]}}
-| <tt>range 0 .. 2**Integer'<wbr/>Size - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod Integer'<wbr/>Size</tt>{{ref|Ada_mod|[k]}}
-| {{n/a}}
-|-
-| rowspan=2| [[ALGOL 68]] (variable-width)
-| rowspan=2| <tt>short short int</tt>{{ref|CInt|[c]}}
-| rowspan=2 {{n/a}}
-| rowspan=2| <tt>short int</tt>{{ref|CInt|[c]}}
-| rowspan=2 {{n/a}}
-| rowspan=2| <tt>int</tt>{{ref|CInt|[c]}}
-| rowspan=2 {{n/a}}
-| rowspan=2| <tt>long int</tt>{{ref|CInt|[c]}}
-| rowspan=2 {{n/a}}
-| <tt>int</tt>{{ref|CInt|[c]}}
-| {{n/a}}
-| rowspan=2| <tt>long long int</tt> {{ref|a68|[a]}}{{ref|a68g|[g]}}
-|-
-| colspan=2 align=center|<tt>bytes</tt> & <tt>bits</tt>
-|-
-| [[C (programming language)|C]] ([[C99]] fixed-width)
-| rowspan=2| <tt>int8_t</tt>
-| rowspan=2| <tt>uint8_t</tt>
-| rowspan=2| <tt>int16_t</tt>
-| rowspan=2| <tt>uint16_t</tt>
-| rowspan=2| <tt>int32_t</tt>
-| rowspan=2| <tt>uint32_t</tt>
-| rowspan=2| <tt>int64_t</tt>
-| rowspan=2| <tt>uint64_t</tt>
-| rowspan=4| <tt>int</tt>
-| rowspan=4| <tt>unsigned int</tt>
-| rowspan=5 {{n/a}}
-|-
-| [[C++]] ([[C++11]] fixed-width)
-|-
-| [[C (programming language)|C]] ([[C99]] variable-width)
-| rowspan=2| <tt>signed char</tt>
-| rowspan=2| <tt>unsigned char</tt>
-| rowspan=2| <tt>short</tt>{{ref|CInt|[c]}}
-| rowspan=2| <tt>unsigned short</tt>{{ref|CInt|[c]}}
-| rowspan=2| <tt>long</tt>{{ref|CInt|[c]}}
-| rowspan=2| <tt>unsigned long</tt>{{ref|CInt|[c]}}
-| rowspan=2| <tt>long long</tt>{{ref|CInt|[c]}}
-| rowspan=2| <tt>unsigned long long</tt>{{ref|CInt|[c]}}
-|-
-| [[C++]] ([[C++11]] variable-width)
-|-
-| [[Objective-C]] ([[Cocoa (API)|Cocoa]])
-| <tt>signed char''' <br>or<br> '''int8_t</tt>
-| <tt>unsigned char''' <br>or<br> '''uint8_t</tt>
-| <tt>short''' <br>or<br> '''int16_t</tt>
-| <tt>unsigned short''' <br>or<br> '''uint16_t</tt>
-| <tt>int''' <br>or<br> '''int32_t</tt>
-| <tt>unsigned int''' <br>or<br> '''uint32_t</tt>
-| <tt>long long''' <br>or<br> '''int64_t</tt>
-| <tt>unsigned long long''' <br>or<br> '''uint64_t</tt>
-| <tt>NSInteger''' <br>or<br> '''long</tt>
-| <tt>NSUInteger''' <br>or<br> '''unsigned long</tt>
-|-
-| [[C Sharp (programming language)|C#]]
-| <tt>sbyte</tt>
-| <tt>byte</tt>
-| rowspan=2| <tt>short</tt>
-| <tt>ushort</tt>
-| rowspan=2| <tt>int</tt>
-| <tt>uint</tt>
-| rowspan=2| <tt>long</tt>
-| <tt>ulong</tt>
-| <tt>IntPtr</tt>
-| <tt>UIntPtr</tt>
-| <tt>System.Numerics<wbr/>.BigInteger</tt><br/>(.NET 4.0)
-|-
-| [[Java (programming language)|Java]]
-| <tt>byte</tt>
-| {{n/a}}
-| <tt>char</tt>{{ref|Java char|[b]}}
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-| <tt>java.math<wbr/>.BigInteger</tt>
-|-
-| [[Go (programming language)|Go]]
-| <tt>int8</tt>
-| <tt>uint8</tt> or <tt>byte</tt>
-| <tt>int16</tt>
-| <tt>uint16</tt>
-| <tt>int32</tt>
-| <tt>uint32</tt>
-| <tt>int64</tt>
-| <tt>uint64</tt>
-| <tt>int</tt>
-| <tt>uint</tt>
-| <tt>big.Int</tt>
-|-
-| [[Swift (programming language)|Swift]]
-| <tt>Int8</tt>
-| <tt>UInt8</tt>
-| <tt>Int16</tt>
-| <tt>UInt16</tt>
-| <tt>Int32</tt>
-| <tt>UInt32</tt>
-| <tt>Int64</tt>
-| <tt>UInt64</tt>
-| <tt>Int</tt>
-| <tt>UInt</tt>
-|
-|-
-| [[D (programming language)|D]]
-| <tt>byte</tt>
-| <tt>ubyte</tt>
-| <tt>short</tt>
-| <tt>ushort</tt>
-| <tt>int</tt>
-| <tt>uint</tt>
-| <tt>long</tt>
-| <tt>ulong</tt>
-|{{n/a}}
-|{{n/a}}
-| <tt>BigInt</tt>
-|-
-| [[Common Lisp]]<ref name=HyperSpec>{{cite web|url=http://www.lispworks.com/documentation/HyperSpec/Front/index.htm|title=Common Lisp HyperSpec (TM)|author=|date=|work=lispworks.com|accessdate=30 January 2017}}</ref>
-| <tt>(integer -128 127)</tt>
-| <tt>(integer 0 255)</tt>
-| <tt>(integer -32768 32767)</tt>
-| <tt>(integer 0 65536)</tt>
-| <tt>(integer -2147483648 2147483647)</tt>
-| <tt>(integer 0 4294967296)</tt>
-| <tt>(integer -9223372036854775808 9223372036854775807)</tt>
-| <tt>(integer 0 18446744073709551616)</tt>
-|
-|
-| <tt>bignum</tt>
-|-
-| [[Scheme (programming language)|Scheme]]
-|
-|
-|
-|
-|
-|
-|
-|
-|
-|
-|
-|-
-| [[ISLISP]]<ref name=Specification>{{cite web|url=http://www.islisp.info/specification.html|title=www.islisp.info: Specification|author=|date=|work=islisp.info|accessdate=30 January 2017}}</ref>
-|
-|
-|
-|
-|
-|
-|
-|
-|
-|
-| <tt>bignum</tt>
-|-
-| [[Pascal (programming language)|Pascal]] ([[Free Pascal|FPC]])
-| <tt>shortint</tt>
-| <tt>byte</tt>
-| <tt>smallint</tt>
-| <tt>word</tt>
-| <tt>longint</tt>
-| <tt>longword</tt>
-| <tt>int64</tt>
-| <tt>qword</tt>
-| <tt>integer</tt>
-| <tt>cardinal</tt>
-| {{n/a}}
-|-
-| [[Visual Basic]]
-| {{n/a}}
-| rowspan=2|<tt>Byte</tt>
-| <tt>Integer</tt>
-| {{n/a}}
-| <tt>Long</tt>
-| {{n/a}}
-| colspan=2 {{n/a}}
-| rowspan=2 colspan=2 {{n/a}}
-| rowspan=1 {{n/a}}
-|-
-| [[Visual Basic .NET]]
-| <tt>SByte</tt>
-| <tt>Short</tt>
-| <tt>UShort</tt>
-| <tt>Integer</tt>
-| <tt>UInteger</tt>
-| <tt>Long</tt>
-| <tt>ULong</tt>
-| <tt>System.Numerics<wbr/>.BigInteger</tt><br/>(.NET 4.0)
-|-
-| [[FreeBasic]]
-| <tt>Byte</tt> or <tt>Integer<8></tt>
-| <tt>UByte</tt> or <tt>UInteger<8></tt>
-| <tt>Short</tt> or <tt>Integer<16></tt>
-| <tt>UShort</tt> or <tt>UInteger<16></tt>
-| <tt>Long</tt> or <tt>Integer<32></tt>
-| <tt>ULong</tt> or <tt>UInteger<32></tt>
-| <tt>LongInt</tt> or <tt>Integer<64></tt>
-| <tt>ULongInt</tt> or <tt>UInteger<64></tt>
-| <tt>Integer</tt>
-| <tt>UInteger</tt>
-| {{n/a}}
-|-
-| [[Python (programming language)|Python]] 2.x
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| <tt>int</tt>
-| {{n/a}}
-| <tt>long</tt>
-|-
-| Python 3.x
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| <tt>int</tt>
-|-
-| [[S-Lang (programming language)|S-Lang]]
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| {{n/a}}
-|-
-| [[Fortran]]
-| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}
-| {{n/a}}
-| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}
-| {{n/a}}
-| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}
-| {{n/a}}
-| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}
-| {{n/a}}
-|
-|
-|
-|-
-| [[PHP]]
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| <tt>int</tt> {{ref|PHP 32/64 bit long|[m]}}
-| {{n/a}}
-| <tt>int</tt> {{ref|PHP 32/64 bit long|[m]}}
-| {{n/a}}
-| colspan=2 {{n/a}}
-| {{ref|PHP bignum|[e]}}
-|-
-| [[Perl]] 5
-| colspan=2 {{n/a}}{{ref|scalars|[d]}}
-| colspan=2 {{n/a}}{{ref|scalars|[d]}}
-| colspan=2 {{n/a}}{{ref|scalars|[d]}}
-| colspan=2 {{n/a}}{{ref|scalars|[d]}}
-| colspan=2 {{n/a}}{{ref|scalars|[d]}}
-| <tt>Math::BigInt</tt>
-|-
-| [[Perl 6]]
-| <tt>int8</tt>
-| <tt>uint8</tt>
-| <tt>int16</tt>
-| <tt>uint16</tt>
-| <tt>int32</tt>
-| <tt>uint32</tt>
-| <tt>int64</tt>
-| <tt>uint64</tt>
-| <tt>Int</tt>
-| colspan=2 {{n/a}}
-|-
-| [[Ruby (programming language)|Ruby]]
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| <tt>Fixnum</tt>
-| {{n/a}}
-| <tt>Bignum</tt>
-|-
-| [[Erlang (programming language)|Erlang]]{{ref|Erlang_int|[n]}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| integer()
-| {{n/a}}
-| integer(){{ref|Erlang_arb|[o]}}
-|-
-| [[Scala (programming language)|Scala]]
-| <tt>Byte</tt>
-| {{n/a}}
-| <tt>Short</tt>
-| <tt>Char</tt>{{ref|Scala Char|[l]}}
-| <tt>Int</tt>
-| {{n/a}}
-| <tt>Long</tt>
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-| <tt>scala.math.BigInt</tt>
-|-
-| [[Seed7]]
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-| <tt>integer</tt>
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-| <tt>bigInteger</tt>
-|-
-| [[Smalltalk]]
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| <tt>SmallInteger</tt>{{ref|Smalltalk|[i]}}
-| {{n/a}}
-| <tt>LargeInteger</tt>{{ref|Smalltalk|[i]}}
-|-
-| [[Windows PowerShell]]
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| {{n/a}}
-|-
-| [[OCaml]]
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| <tt>int32</tt>
-| {{n/a}}
-| rowspan=2| <tt>int64</tt>
-| {{n/a}}
-| <tt>int''' <br/> or <br/> '''nativeint</tt>
-|
-| <tt>open Big_int;; <br/> big_int</tt>
-|-
-| [[F Sharp (programming language)|F#]]
-| <tt>sbyte</tt>
-| <tt>byte</tt>
-| <tt>int16</tt>
-| <tt>uint16</tt>
-| <tt>int32</tt> or <tt>int</tt>
-| <tt>uint32</tt>
-| <tt>uint64</tt>
-| <tt>nativeint</tt>
-| <tt>unativeint</tt>
-| <tt>bigint</tt>
-|-
-| [[Standard ML]]
-| {{n/a}}
-| <tt>Word8.word</tt>
-| colspan=2 {{n/a}}
-| <tt>Int32.int</tt>
-| <tt>Word32.word</tt>
-| <tt>Int64.int</tt>
-| <tt>Word64.word</tt>
-| <tt>int</tt>
-| <tt>word</tt>
-| <tt>LargeInt.int</tt> or <br/> <tt>IntInf.int</tt>
-|-
-| [[Haskell (programming language)|Haskell]] ([[Glasgow Haskell Compiler|GHC]])
-| «<tt>import Int</tt>» <br/> <tt>Int8</tt>
-| «<tt>import Word</tt>» <br/> <tt>Word8</tt>
-| «<tt>import Int</tt>» <br/> <tt>Int16</tt>
-| «<tt>import Word</tt>» <br/> <tt>Word16</tt>
-| «<tt>import Int</tt>» <br/> <tt>Int32</tt>
-| «<tt>import Word</tt>» <br/> <tt>Word32</tt>
-| «<tt>import Int</tt>» <br/> <tt>Int64</tt>
-| «<tt>import Word</tt>» <br/> <tt>Word64</tt>
-| <tt>Int</tt>
-| «<tt>import Word</tt>» <br/> <tt>Word</tt>
-| <tt>Integer</tt>
-|-
-| [[Eiffel (programming language)|Eiffel]]
-| <tt>INTEGER_8</tt>
-| <tt>NATURAL_8</tt>
-| <tt>INTEGER_16</tt>
-| <tt>NATURAL_16</tt>
-| <tt>INTEGER_32</tt>
-| <tt>NATURAL_32</tt>
-| <tt>INTEGER_64</tt>
-| <tt>NATURAL_64</tt>
-| <tt>INTEGER</tt>
-| <tt>NATURAL</tt>
-| {{n/a}}
-|-
-| [[COBOL]]{{ref|Cobol|[h]}}
-| <tt>BINARY-CHAR «SIGNED»</tt>
-| <tt>BINARY-CHAR UNSIGNED</tt>
-| <tt>BINARY-SHORT «SIGNED»</tt>
-| <tt>BINARY-SHORT UNSIGNED</tt>
-| <tt>BINARY-LONG «SIGNED»</tt>
-| <tt>BINARY-LONG UNSIGNED</tt>
-| <tt>BINARY-DOUBLE «SIGNED»</tt>
-| <tt>BINARY-DOUBLE UNSIGNED</tt>
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| [[Mathematica]]
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| <tt>Integer</tt>
-|-
-| [[Wolfram Language]]
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| colspan=2 {{n/a}}
-| <tt>Integer</tt>
-|}
-{{note|a68|a}} The <u>standard</u> constants <tt>int shorts</tt> and <tt>int lengths</tt> can be used to determine how many '<tt>short</tt>'s and '<tt>long</tt>'s can be usefully prefixed to '<tt>short int</tt>' and '<tt>long int</tt>'. The actually size of the '<tt>short int</tt>', '<tt>int</tt>' and '<tt>long int</tt>' is available as constants <tt>short max int</tt>, <tt>max int</tt> and <tt>long max int</tt> etc.
-<br/>{{note|Java char|b}} Commonly used for characters.
-<br/>{{note|CInt|c}} The ALGOL 68, C and C++ languages do not specify the exact width of the integer types <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and (C99, C++11) <tt>long long</tt>, so they are implementation-dependent. In C and C++ <tt>short</tt>, <tt>long</tt>, and <tt>long long</tt> types are required to be at least 16, 32, and 64 bits wide, respectively, but can be more. The <tt>int</tt> type is required to be at least as wide as <tt>short</tt> and at most as wide as <tt>long</tt>, and is typically the width of the word size on the processor of the machine (i.e. on a 32-bit machine it is often 32 bits wide; on 64-bit machines it is often 64 bits wide). C99 and C++11{{citation needed|date=December 2011}} also define the <tt>[u]intN_t</tt> exact-width types in the [[stdint.h]] header. See[[C syntax#Integral types]] for more information.
-<br/>{{note|scalars|d}} Perl 5 does not have distinct types. Integers, floating point numbers, strings, etc. are all considered "scalars".
-<br/>{{note|PHP bignum|e}} PHP has two arbitrary-precision libraries. The BCMath library just uses strings as datatype. The GMP library uses an internal "resource" type.
-<br/>{{note|Kinds|f}} The value of "n" is provided by the <tt>SELECTED_INT_KIND</tt><ref name="fortranwiki.org">{{cite web|url=http://fortranwiki.org/fortran/show/selected_int_kind|title=selected_int_kind in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref> intrinsic function.
-<br/>{{note|a68g|g}} [[ALGOL 68]]G's run time option ''<tt>--precision "number"</tt>'' can set precision for <tt>long long int</tt>s to the required "number" significant digits. The <u>standard</u> constants ''<tt>long long int width</tt>'' and ''<tt>long long max int</tt>'' can be used to determine actual precision.
-<br/>{{note|Cobol|h}} [[COBOL]] allows the specification of a required precision and will automatically select an available type capable of representing the specified precision. "<tt>PIC S9999</tt>", for example, would require a signed variable of four decimal digits precision. If specified as a binary field, this would select a 16-bit signed type on most platforms.
-<br/>{{note|Smalltalk|i}} [[Smalltalk]] automatically chooses an appropriate representation for integral numbers. Typically, two representations are present, one for integers fitting the native word size minus any tag bit (SmallInteger) and one supporting arbitrary sized integers (LargeInteger). Arithmetic operations support polymorphic arguments and return the result in the most appropriate compact representation.
-<br/>{{note|Ada_range|j}} [[Ada (programming language)|Ada]] range types are checked for boundary violations at run-time (as well as at compile-time for static expressions). Run-time boundary violations raise a "constraint error" exception. Ranges are not restricted to powers of two. Commonly predefined Integer subtypes are: Positive (<tt>range 1 .. Integer'Last</tt>) and Natural (<tt>range 0 .. Integer'Last</tt>). <tt>Short_Short_Integer</tt> (8 bits), <tt>Short_Integer</tt> (16 bits) and <tt>Long_Integer</tt> (64 bits) are also commonly predefined, but not required by the Ada standard. Run time checks can be disabled if performance is more important than integrity checks.
-<br/>{{note|Ada_mod|k}} [[Ada (programming language)|Ada]] modulo types implement modulo arithmetic in all operations, i.e. no range violations are possible. Modulos are not restricted to powers of two.
-<br/>{{note|Scala char|l}} Commonly used for characters like Java's char.
-<br/>{{note|PHP 32/64 bit long|m}} <tt>int</tt> in PHP has the same width as <tt>long</tt> type in C has on that system {{ref|CInt|[c]}}.
-<br/>{{note|Erlang_int|n}} [[Erlang (programming language)|Erlang]] is dynamically typed. The type identifiers are usually used to specify types of record fields and the argument and return types of functions.<ref>{{cite web|url=http://www.erlang.org/doc/reference_manual/typespec.html|title=Erlang -- Types and Function Specifications|author=|date=|work=erlang.org|accessdate=30 January 2017}}</ref>
-<br/>{{note|Erlang_arb|o}} When it exceeds one word.<ref>{{cite web|url=http://www.erlang.org/doc/efficiency_guide/advanced.html|title=Erlang -- Advanced|author=|date=|work=erlang.org|accessdate=30 January 2017}}</ref>
-
-=== [[Floating point]] ===
-{| class="wikitable"
-!
-! [[Single precision]]
-! [[Double precision]]
-! Other precision
-! Processor dependent
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>Float</tt>
-| <tt>Long_Float</tt>
-| {{n/a}}
-|-
-| ALGOL 68
-| <tt>real</tt>{{ref|a68|[a]}}
-| <tt>long real</tt>{{ref|a68|[a]}}
-| <tt>short real</tt>, <tt>long long real</tt>, etc.{{ref|a68g|[d]}}
-|-
-| C
-| rowspan=3| <tt>float</tt>{{ref|lax floats|[b]}}
-| rowspan=5| <tt>double</tt>
-| rowspan=3| <tt>long double</tt>{{ref|C-long-double|[f]}}
-|-
-| C++ (STL)
-|-
-| Objective-C (Cocoa)
-| <tt>CGFloat</tt>
-|-
-| C#
-| rowspan=2| <tt>float</tt>
-| rowspan=3 {{n/a}}
-|-
-| Java
-|-
-| Go
-| <tt>float32</tt>
-| <tt>float64</tt>
-|-
-| Swift
-| <tt>Float'''<br/>'''Float32</tt>
-| <tt>Double'''<br/>'''Float64</tt>
-| <tt>Float80</tt>{{ref|Swift-long-double|[g]}}
-| <tt>CGFloat</tt>
-|-
-| D
-| <tt>float</tt>
-| <tt>double</tt>
-|
-| <tt>real</tt>
-|-
-| Common Lisp
-| <tt>single-float</tt>
-| <tt>double-float</tt>
-| <tt>float, short-float, long-float</tt>
-|-
-| Scheme
-|
-|
-|
-|-
-| ISLISP
-|
-|
-|
-|-
-| Pascal (Free Pascal)
-| <tt>single</tt>
-| <tt>double</tt>
-|
-| <tt>real</tt>
-|-
-| Visual Basic
-| rowspan=3| <tt>Single</tt>
-| rowspan=3| <tt>Double</tt>
-| rowspan=3 {{n/a}}
-|-
-| Visual Basic .NET
-|-
-| Xojo
-|-
-| Python
-| rowspan=2 {{n/a}}
-| <tt>float</tt>
-|
-|-
-| JavaScript
-| <tt>Number</tt><ref name="Javascript numbers">[http://www.mozilla.org/js/language/E262-3.pdf 8.5 The Number Type]</ref>
-| {{n/a}}
-|-
-| S-Lang
-| <!-- '''x =''' value'''f;''' -->
-| <!-- '''x =''' value''';''' -->
-|
-|-
-| Fortran
-| colspan=2|<tt>REAL(KIND = n)</tt>{{ref|real inds|[c]}}
-|
-|-
-| PHP
-|
-| <tt>float</tt>
-|
-|-
-| Perl
-|
-|
-|
-|-
-| Perl 6
-| <tt>num32</tt>
-| <tt>num64</tt>
-|
-| <tt>Num</tt>
-|-
-| Ruby
-| {{n/a}}
-| <tt>Float</tt>
-| rowspan=4 {{n/a}}
-|-
-| Scala
-| <tt>Float</tt>
-| <tt>Double</tt>
-|-
-| Seed7
-| {{n/a}}
-| <tt>float</tt>
-|-
-| Smalltalk
-| <tt>Float</tt>
-| <tt>Double</tt>
-|-
-| Windows PowerShell
-|
-|
-|-
-| OCaml
-| {{n/a}}
-| rowspan=2| <tt>float</tt>
-| rowspan=3 {{n/a}}
-|-
-| F#
-| <tt>float32</tt>
-|-
-| Standard ML
-| {{n/a}}
-|
-| <tt>real</tt>
-|-
-| Haskell (GHC)
-| <tt>Float</tt>
-| <tt>Double</tt>
-|
-|-
-| Eiffel
-| <tt>REAL_32</tt>
-| <tt>REAL_64</tt>
-|
-|-
-| COBOL
-| <tt>FLOAT-BINARY-7</tt>{{ref|Cobol_ieee|[e]}}
-| <tt>FLOAT-BINARY-34</tt>{{ref|Cobol_ieee|[e]}}
-| <tt>FLOAT-SHORT</tt>, <tt>FLOAT-LONG</tt>, <tt>FLOAT-EXTENDED</tt>
-|-
-| Mathematica
-| {{n/a}}
-| {{n/a}}
-|
-| <tt>Real</tt>
-|}
-{{note|a68_real|a}} The <u>standard</u> constants <tt>real shorts</tt> and <tt>real lengths</tt> can be used to determine how many '<tt>short</tt>'s and '<tt>long</tt>'s can be usefully prefixed to '<tt>short real</tt>' and '<tt>long real</tt>'. The actually size of the '<tt>short real</tt>', '<tt>real</tt>' and '<tt>long real</tt>' is available as constants <tt>short max real</tt>, <tt>max real</tt> and <tt>long max real</tt> etc. With the constants <tt>short small real</tt>, <tt>small real</tt> and <tt>long small real</tt> available for each type's [[machine epsilon]].
-<br/>{{note|lax floats|b}} declarations of single precision often are not honored
-<br/>{{note|real kinds|c}} The value of "n" is provided by the <tt>SELECTED_REAL_KIND</tt><ref name="ReferenceA">{{cite web|url=http://fortranwiki.org/fortran/show/selected_real_kind|title=selected_real_kind in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref> intrinsic function.
-<br/>{{note|a68g-real|d}} [[ALGOL 68]]G's run time option ''<tt>--precision "number"</tt>'' can set precision for <tt>long long real</tt>s to the required "number" significant digits. The <u>standard</u> constants <tt>long long real width</tt> and '<tt>long long max real</tt> can be used to determine actual precision.
-<br/>{{note|Cobol-ieee|e}} These IEEE floating-point types will be introduced in the next COBOL standard.
-<br/>{{note|C-long-double|f}} Same size as '<tt>double</tt>' on many implementations.
-<br/>{{note|Swift-long-double|g}} Swift supports 80-bit [[Extended precision#Language support|extended precision]] floating point type, equivalent to <tt>long double</tt> in C languages.
-
-=== [[Complex number]]s ===
-
-{|class="wikitable"
-!
-! Integer
-! Single precision
-! Double precision
-! Half and Quadruple precision etc.
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| {{n/a}}
-| <tt>Complex</tt>{{ref|generic type|[b]}}
-| <tt>Complex</tt>{{ref|generic type|[b]}}
-| <tt>Complex</tt>{{ref|generic type|[b]}}
-|-
-| ALGOL 68
-| {{n/a}}
-| <tt>compl</tt>
-| <tt>long compl</tt> etc.
-| <tt>short compl</tt> etc. & <tt>long long compl</tt> etc.
-|-
-| C (C99) <ref>{{cite web|url=https://www.gnu.org/software/libc/manual/html_node/Complex-Numbers.html#Complex-Numbers|title=The GNU C Library: Complex Numbers|author=|date=|work=gnu.org|accessdate=30 January 2017}}</ref>
-| {{n/a}}
-| <tt>float complex</tt>
-| <tt>double complex</tt>
-| rowspan=7 {{n/a}}
-|-
-| C++ (STL)
-| {{n/a}}<!-- No std::complex<int>. See C++ standard section 26.2 paragraph 2 -->
-| <tt>std::complex<float></tt>
-| <tt>std::complex<double></tt>
-|-
-| C#
-| {{n/a}}
-| {{n/a}}
-| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)
-|-
-| Java
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| Go
-| {{n/a}}
-| <tt>complex64</tt>
-| <tt>complex128</tt>
-|-
-| D
-| {{n/a}}
-| <tt>cfloat</tt>
-| <tt>cdouble</tt>
-|-
-| Objective-C
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| Common Lisp
-| (complex integer)
-| (complex single-float)
-| (complex double-float)
-| complex
-|-
-| Scheme
-|
-|
-|
-| rowspan=4 {{n/a}}
-|-
-| Pascal
-| {{n/a}}
-| {{n/a}}
-|
-|-
-| Visual Basic
-| {{n/a}}
-| {{n/a}}
-|
-|-
-| Visual Basic .NET
-| {{n/a}}
-| {{n/a}}
-| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)
-|-
-| Perl
-|
-|
-| <tt>Math::Complex</tt>
-|
-|-
-| Perl 6
-|
-| <tt>complex64</tt>
-| <tt>complex128</tt>
-| <tt>Complex</tt>
-|-
-| Python
-|
-|
-| <tt>complex</tt>
-| rowspan=15 {{n/a}}
-|-
-| JavaScript
-| {{n/a}}
-| {{n/a}}
-|
-|-
-| S-Lang
-| {{n/a}}
-| {{n/a}}
-|
-|-
-| Fortran
-|
-| colspan=2|<tt>COMPLEX(KIND = n)</tt>{{ref|complex kinds|[a]}}
-|-
-| Ruby
-| <tt>Complex</tt>
-| {{n/a}}
-| <tt>Complex</tt>
-|-
-| Scala
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| Seed7
-| {{n/a}}
-| {{n/a}}
-| <tt>complex</tt>
-|-
-| Smalltalk
-| <tt>Complex</tt>
-| <tt>Complex</tt>
-| <tt>Complex</tt>
-|-
-| Windows PowerShell
-| {{n/a}}
-| {{n/a}}
-|
-|-
-| OCaml
-| {{n/a}}
-| {{n/a}}
-| <tt>Complex.t</tt>
-|-
-| F#
-|
-|
-| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)
-|-
-| Standard ML
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| Haskell (GHC)
-| {{n/a}}
-| <tt>Complex{{Not a typo|.}}Complex Float</tt>
-| <tt>Complex{{Not a typo|.}}Complex Double</tt>
-|-
-| Eiffel
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| COBOL
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| Mathematica
-| <tt>Complex</tt>
-| {{n/a}}
-| {{n/a}}
-| <tt>Complex</tt>
-|}
-
-{{note|complex kinds|a}} The value of "n" is provided by the <tt>SELECTED_REAL_KIND</tt><ref name="ReferenceA"/> intrinsic function.
-
-{{note|generic type|b}} Generic type which can be instantiated with any base floating point type.
-
-=== Other variable types ===
-
-{|class="wikitable"
-! rowspan=2|
-! colspan=2| Text
-! rowspan=2| [[Boolean datatype|Boolean]]
-! rowspan=2| [[Enumerated type|Enumeration]]
-! rowspan=2| [[Object (computer science)|Object]]/[[Top type|Universal]]
-|-
-! [[Character (computing)|Character]]
-! [[String (computer science)|String]]{{ref|string|[a]}}
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>Character</tt>
-| <tt>String''' & '''Bounded_String''' & '''Unbounded_String</tt>
-| <tt>Boolean</tt>
-| <tt>('''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ...''')</tt>
-| <tt>tagged null record</tt>
-|-
-| ALGOL 68
-| <tt>char</tt>
-| <tt>string''' & '''bytes</tt>
-| <tt>bool''' & '''bits</tt>
-| {{n/a}} - [http://rosettacode.org/wiki/Enumerations#ALGOL_68 User defined]
-| {{n/a}}
-|-
-| C (C99)
-| rowspan=2| <tt>char'''<br/>'''wchar_t</tt>
-| {{n/a}}
-| rowspan=2| <tt>bool</tt>{{ref|int bool|[b]}}
-| rowspan=3|<tt>'''enum''' «name» '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''};</tt>
-| rowspan=2| <tt>[[void type|void]] [[pointer (computer programming)|*]]</tt>
-|-
-| C++ (STL)
-| <code>[[std::string|</code>«<tt>std::'''»'''<code>string]]</code></tt>
-|-
-| Objective-C
-| <tt>unichar</tt>
-| <tt>NSString *</tt>
-| <tt>BOOL</tt>
-| <tt>id</tt>
-|-
-| C#
-| rowspan=2| <tt>char</tt>
-| <tt>string</tt>
-| <tt>bool</tt>
-| rowspan=2| <tt>'''enum''' name '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}'''</tt>
-| <tt>object</tt>
-|-
-| Java
-| <tt>String</tt>
-| <tt>boolean</tt>
-| <tt>Object</tt>
-|-
-| Go
-| <tt>byte'''<br/>'''rune</tt>
-| <tt>string</tt>
-| <tt>bool</tt>
-| <tt>const (<dl><dd>'''item<sub>1</sub>''' = iota'''<br/>item<sub>2</sub><br/> ... '''</dd></dl>)</tt>
-| <tt>interface{}</tt>
-|-
-| Swift
-| <tt>Character</tt>
-| <tt>String</tt>
-| <tt>Bool</tt>
-| <tt>'''enum''' name '''{ case''' item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}'''</tt>
-| <tt>Any</tt>
-|-
-| D
-| <tt>char</tt>
-| <tt>string</tt>
-| <tt>bool</tt>
-| <tt>enum''' name '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}</tt>
-| <tt>std.variant.Variant</tt>
-|-
-| Common Lisp
-|
-|
-|
-|
-|
-|-
-| Scheme
-|
-|
-|
-|
-|
-|-
-| ISLISP
-|
-|
-|
-|
-|
-|-
-| Pascal (ISO)
-| rowspan=2| <tt>char</tt>
-| {{n/a}}
-| rowspan=2| <tt>boolean</tt>
-| rowspan=2| <tt>('''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ...''')</tt>
-| {{n/a}}
-|-
-| Object Pascal (Delphi)
-| <tt>string</tt>
-| <tt>variant</tt>
-|-
-| Visual Basic
-| {{n/a}}
-| rowspan=3| <tt>String</tt>
-| rowspan=3| <tt>Boolean</tt>
-| rowspan=3| <tt>Enum''' name <dl><dd> item<sub>1</sub> <br /> item<sub>2</sub> <br /> ... </dd></dl> '''End Enum</tt>
-| <tt>[[Variant type|Variant]]</tt>
-|-
-| Visual Basic .NET
-| <tt>Char</tt>
-| <tt>Object</tt>
-|-
-| Xojo
-| {{n/a}}
-| <tt>Object or Variant</tt>
-|-
-| Python
-| {{n/a}}{{ref|string as char|[d]}}
-| <tt>str</tt>
-| <tt>bool</tt>
-|
-| <tt>object</tt>
-|-
-| JavaScript
-| {{n/a}}{{ref|string as char|[d]}}
-| <tt>String</tt>
-| <tt>Boolean</tt>
-|
-| <tt>Object</tt>
-|-
-| S-Lang
-|
-|
-|
-|
-|
-|-
-| Fortran
-| <tt>CHARACTER(LEN = *)</tt>
-| <tt>CHARACTER(LEN = :), allocatable </tt>
-| <tt>LOGICAL(KIND = n)</tt>{{ref|logical kinds|[f]}}
-|
-| <tt>CLASS(*)</tt>
-|-
-| PHP
-| {{n/a}}{{ref|string as char|[d]}}
-| <tt>string</tt>
-| <tt>bool</tt>
-|
-| (type declaration omitted)
-|-
-| Perl
-| {{n/a}}{{ref|string as char|[d]}}
-|
-|
-|
-| <tt>UNIVERSAL</tt>
-|-
-| Perl 6
-| <tt>Char</tt>
-| <tt>Str</tt>
-| <tt>Bool</tt>
-| <tt>enum''' name '''<'''item<sub>1</sub> item<sub>2</sub> ...'''>''' or<br /> '''enum''' name '''<<:'''item<sub>1</sub>'''('''value''')''' ''':'''item<sub>2</sub>'''('''value''')''' ...'''>></tt>
-| <tt>Mu</tt>
-|-
-| Ruby
-| {{n/a}}{{ref|string as char|[d]}}
-| <tt>String</tt>
-| <tt>Object</tt>{{ref|Ruby's bool|[c]}}
-|
-| <tt>Object</tt>
-|-
-| Scala
-| <tt>Char</tt>
-| <tt>String</tt>
-| <tt>Boolean</tt>
-| <tt>object''' name '''extends Enumeration {'''<dl><dd>'''val''' item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''= Value'''</dd></dl>'''}</tt>
-| <tt>Any</tt>
-|-
-| Seed7
-| <tt>char</tt>
-| <tt>string</tt>
-| <tt>boolean</tt>
-| <tt>'''const type''': name '''is new enum'''<dl><dd> item<sub>1</sub>''','''<br /> item<sub>2</sub>''','''<br /> ... </dd></dl>'''end enum;'''</tt>
-|
-|-
-| Windows PowerShell
-|
-|
-|
-|
-|
-|-
-| OCaml
-| rowspan=3| <tt>char</tt>
-| rowspan=3| <tt>string</tt>
-| rowspan=3| <tt>bool</tt>
-| {{n/a}}{{ref|enum|[e]}}
-| {{n/a}}
-|-
-| F#
-| <tt>type''' name '''=''' item<sub>1</sub> '''=''' value '''<nowiki>|</nowiki>''' item<sub>2</sub> = value '''<nowiki>|</nowiki></tt> ...
-| <tt>obj</tt>
-|-
-| Standard ML
-| {{n/a}}{{ref|enum|[e]}}
-| {{n/a}}
-|-
-| Haskell (GHC)
-| <tt>Char</tt>
-| <tt>String</tt>
-| <tt>Bool</tt>
-| {{n/a}}{{ref|enum|[e]}}
-| {{n/a}}
-|-
-| Eiffel
-| <tt>CHARACTER</tt>
-| <tt>STRING</tt>
-| <tt>BOOLEAN</tt>
-| {{n/a}}
-| <tt>ANY</tt>
-|-
-| COBOL
-| <tt>PIC X</tt>
-| <tt>PIC X('''string length''') '''or''' PIC X«X...»</tt>
-| <tt>PIC 1«('''number of digits''')» '''or''' PIC 1«1...»</tt>
-| {{n/a}}
-| <tt>OBJECT REFERENCE</tt>
-|-
-| Mathematica
-| {{n/a}}{{ref|string as char|[d]}}
-| <tt>String</tt>
-|
-|
-| {{n/a}}
-|}
-{{note|string|a}} specifically, strings of arbitrary length and automatically managed.
-<br/>{{note|int bool|b}} This language represents a boolean as an integer where false is represented as a value of zero and true by a non-zero value.
-<br/>{{note|Ruby's bool|c}} All values evaluate to either true or false. Everything in '''<tt>TrueClass</tt>''' evaluates to true and everything in '''<tt>FalseClass</tt>''' evaluates to false.
-<br/>{{note|string as char|d}}This language does not have a separate character type. Characters are represented as strings of length 1.
-<br/>{{note|enum|e}} Enumerations in this language are algebraic types with only nullary constructors
-<br/>{{note|logical kinds|f}} The value of "n" is provided by the <tt>SELECTED_INT_KIND</tt><ref name="fortranwiki.org"/> intrinsic function.
-
-== Derived types ==
-
-=== [[Array data type|Array]] ===
-
-{{further|Comparison of programming languages (array)}}
-{| class="wikitable"
-|- valign="top"
-! rowspan=2|
-! colspan=2| fixed size array
-! colspan=2| dynamic size array
-|- valign="top"
-! one-dimensional array
-! [[Array data structure|multi-dimensional array]]
-! one-dimensional array
-! [[Array data structure|multi-dimensional array]]
-|- valign="top"
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>'''array ('''<first>''' .. '''<last>''') of '''<type></tt><br>or<br>'''array ('''<discrete_type>''') of '''<type></tt>
-| <tt>'''array ('''<first<sub>1</sub>>''' .. '''<last<sub>1</sub>>''', '''<first<sub>2</sub>>''' .. '''<last<sub>2</sub>>''',''' ...''') of '''<type><br>or<br>'''array ('''<discrete_type<sub>1</sub>>''', '''<discrete_type<sub>2</sub>>''', '''...''') of '''<type></tt>
-| <tt>'''array ('''<discrete_type>''' range <>) of '''<type></tt>
-| <tt>'''array ('''<discrete_type<sub>1</sub>>''' range <>, '''<discrete_type<sub>2</sub>>''' range <>,''' ...''') of '''<type></tt>
-|- valign="top"
-| ALGOL 68
-| <tt>[''first'':''last'']'''<wbr/>«modename»'''</tt><br/>or simply:<br/><tt>[''size'']'''<wbr/>«modename»'''</tt>
-| <tt>[''first<sub>1</sub>'':''last<sub>1</sub>'', ''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>or<br><tt>[''first<sub>1</sub>'':''last<sub>1</sub>''][''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>etc.
-| <tt>'''flex'''[''first'':''last'']'''<wbr/>«modename»'''</tt><br/>or simply:<br/><tt>'''flex'''[''size'']'''<wbr/>«modename»'''</tt>
-| <tt>'''flex'''[''first<sub>1</sub>'':''last<sub>1</sub>'', ''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>or<br/><tt>'''flex'''[''first<sub>1</sub>'':''last<sub>1</sub>'']<wbr/>'''flex'''[''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»''' etc.</tt>
-|- valign="top"
-| C (C99)
-| <tt>type name'''['''size''']'''{{ref|C's array|[a]}}</tt>
-| <tt>type name'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''{{ref|C's array|[a]}}</tt>
-| <tt>type '''*'''name</tt><br/>or within a block:<br/><tt>int n = ...; type name'''['''n''']'''</tt>
-|
-|- valign="top"
-| C++ (STL)
-| colspan=1| <tt>'''[[std::array|«std::»array]]<'''type, size'''>'''</tt>(C++11)
-|
-| colspan=2| <tt>'''[[std::vector|«std::»vector]]<'''type'''>'''</tt>
-|- valign="top"
-| C#
-| <tt>type'''[]'''</tt>
-| <tt>type'''[{{Not a typo|,,}}'''...''']'''</tt>
-| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/><'''type'''>'''</tt>
-|
-|- valign="top"
-| Java
-| <tt>type'''[]'''{{ref|Java's array|[b]}}</tt>
-| <tt>type'''[][]'''...{{ref|Java's array|[b]}}</tt>
-| <tt>'''ArrayList''' or '''ArrayList<'''type'''>'''</tt>
-|
-|- valign="top"
-| D
-| <tt>type'''['''size''']'''</tt>
-| <tt>type'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''</tt>
-| <tt>type'''[]'''</tt>
-|
-|- valign="top"
-| Go
-| <tt>'''['''size''']'''type</tt>
-| <tt>'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''...type</tt>
-| <tt>'''[]type'''</tt>
-| <tt>'''[][]type'''</tt>
-|
-|- valign="top"
-| Swift
-|
-|
-| <tt>'''['''type''']'''</tt> or <tt>'''Array<'''type'''>'''</tt>
-| <tt>'''<nowiki>[[</nowiki>'''type'''<nowiki>]]</nowiki>'''</tt> or <tt>'''Array<Array<'''type'''>>'''</tt>
-|
-|- valign="top"
-| Objective-C
-| <tt>'''NSArray'''</tt>
-|
-| <tt>'''NSMutableArray'''</tt>
-|
-|- valign="top"
-| JavaScript
-| {{n/a}}
-| {{n/a}}
-| colspan=2|<tt>'''Array'''</tt>{{ref|JavaScript's array|[d]}}
-|- valign="top"
-| Common Lisp
-|
-|
-|
-|
-|- valign="top"
-| Scheme
-|
-|
-|
-|
-|- valign="top"
-| ISLISP
-|
-|
-|
-|
-|- valign="top"
-| Pascal
-| rowspan=2|<tt>'''array['''first'''..'''last'''] of''' type{{ref|subrange|[c]}}</tt>
-| rowspan=2|<tt>'''array['''first<sub>1</sub>'''..'''last<sub>1</sub>'''] of array['''first<sub>2</sub>'''..'''last<sub>2</sub>'''] ''' ... '''of''' type {{ref|subrange|[c]}}<br/></tt>
-or<br/>
-<tt>''' array['''first<sub>1</sub>'''..'''last<sub>1</sub>''', '''first<sub>2</sub>'''..'''last<sub>2</sub>''', '''...'''] of''' type </tt>{{ref|subrange|[c]}}
-| {{n/a}}
-| {{n/a}}
-|- valign="top"
-| Object Pascal (Delphi)
-|<tt>'''array of''' type</tt>
-|<tt>'''array of array''' ... '''of''' type</tt>
-|- valign="top"
-| Visual Basic
-| <tt><!-- '''Dim x('''last''') As '''type''' --></tt>
-| <tt><!-- '''Dim x('''last<sub>1</sub>''', '''last<sub>2</sub>''','''...''') As '''type''' --></tt>
-|
-|
-|- valign="top"
-| Visual Basic .NET
-|
-|
-| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/>(Of''' type''')'''</tt>
-|
-|- valign="top"
-| Python
-|
-|
-| <tt>'''list'''</tt>
-|
-|- valign="top"
-| S-Lang
-| <tt><!-- '''x = '''type'''['''size'''];''' --></tt>
-| <tt><!-- '''x = '''type'''['''size<sub>1</sub>''', '''size<sub>2</sub>''', '''...'''];''' --></tt>
-|
-|
-|- valign="top"
-| Fortran
-| <tt>''' '''type''' :: '''name'''('''size''')'''</tt>
-| <tt>''' '''type''' :: '''name'''('''size'''<sub>1</sub>, '''size'''<sub>2</sub>,...)'''</tt>
-| <tt>''' '''type''', ALLOCATABLE :: '''name'''(:)'''</tt>
-| <tt>''' '''type''', ALLOCATABLE :: '''name'''(:,:,...)'''</tt>
-|- valign="top"
-| PHP
-|
-|
-| <tt>'''array'''</tt>
-|
-|- valign="top"
-| Perl
-|
-|
-|
-|
-|- valign="top"
-| Perl 6
-|
-|
-| <tt>'''Array['''type''']''' or '''Array of''' type</tt>
-|
-|- valign="top"
-| Ruby
-|
-| <tt><!-- '''x = Array.new('''size<sub>1</sub>'''){ Array.new('''size<sub>2</sub>''') }''' --></tt>
-| <tt>'''Array'''</tt>
-|
-|- valign="top"
-| Scala
-| <tt>'''Array['''type''']'''</tt>
-| <tt>'''Array['''...'''[Array['''type''']]'''...''']'''</tt>
-| <tt>'''ArrayBuffer['''type''']'''</tt>
-|
-|- valign="top"
-| Seed7
-| <tt>'''array''' type<br />or<br />'''array ['''idxType''']''' type</tt>
-| <tt>'''array array''' type<br />or<br />'''array ['''idxType'''] array ['''idxType''']''' type</tt>
-| <tt>'''array''' type<br />or<br />'''array ['''idxType''']''' type</tt>
-| <tt>'''array array''' type<br />or<br />'''array ['''idxType'''] array ['''idxType''']''' type</tt>
-|- valign="top"
-| Smalltalk
-| <tt>'''Array'''</tt>
-|
-| <tt>'''OrderedCollection'''</tt>
-|
-|- valign="top"
-| Windows PowerShell
-| <tt>type'''[]'''</tt>
-|<tt>type'''[{{Not a typo|,,}}'''...''']'''</tt>
-|
-|
-|- valign="top"
-| OCaml
-| <tt>type '''array'''</tt>
-| <tt>type '''array''' ... '''array'''</tt>
-|
-|
-|- valign="top"
-| F#
-| <tt>type '''[]''' or type '''array'''</tt>
-| <tt>type '''[{{Not a typo|,,}}'''...''']'''</tt>
-| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/><'''type'''>'''</tt>
-|
-|- valign="top"
-| Standard ML
-| <tt>type '''vector''' or type '''array'''</tt>
-|
-|
-|
-|- valign="top"
-| Haskell (GHC)
-| <tt><!-- '''x = Array.array (0, '''size'''-1)''' list_of_association_pairs --></tt>
-| <tt><!-- '''x = Array.array ((0, 0,'''...'''), ('''size<sub>1</sub>'''-1, '''size<sub>2</sub>'''-1,'''...'''))''' list_of_association_pairs --></tt>
-|
-|
-|- valign="top"
-| COBOL
-| <tt>level-number type '''OCCURS''' size «'''TIMES'''»'''.'''
-| <tt>one-dimensional array definition...</tt>
-| <tt>level-number type '''OCCURS''' min-size '''TO''' max-size «'''TIMES'''» '''DEPENDING''' «'''ON'''» size'''.'''</tt>{{ref|COBOL DEPENDING ON clause|[e]}}
-| {{n/a}}
-|}
-{{note|C's array|a}}In most expressions (except the <tt>sizeof</tt> and <tt>&</tt> operators), values of array types in C are automatically converted to a pointer of its first argument. See [[C syntax#Arrays]] for further details of syntax and pointer operations.
-<br/>{{note|Java's array|b}} The C-like "type '''<tt>x[]</tt>'''" works in Java, however "type'''<tt>[] x</tt>'''" is the preferred form of array declaration.
-<br/>{{note|subrange|c}} Subranges are used to define the bounds of the array.
-<br/>{{note|JavaScript's array|d}} JavaScript's array are a special kind of object. <!-- explain array(size) thing -->
-<br/>{{note|COBOL DEPENDING ON clause|e}} The <code>DEPENDING ON</code> clause in COBOL does not create a 'true' variable length array and will always allocate the maximum size of the array.
-
-=== Other types ===
-{| class="wikitable"
-! rowspan=2|
-! colspan=2|Simple composite types
-! rowspan=2|[[Algebraic data type]]s
-! rowspan=2|[[Union (computer science)|Unions]]
-|-
-! [[Record (computer science)|Records]]
-! [[Tuple]] expression
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>'''type''' identifier '''is''' «'''abstract'''» «'''tagged'''» «'''limited'''» ['''record'''
-<dl><dd>fieldname<sub>1</sub> ''':''' type''';'''</dd>
-<dd>fieldname<sub>2</sub> ''':''' type''';'''</dd></dl>...<br>
-'''end record''' <nowiki>|</nowiki>
-'''null record''']</tt>
-| {{n/a}}
-| Any combination of records, unions and enumerations (as well as references to those, enabling recursive types).
-| <tt>'''type''' identifier '''('''variation ''':''' discrete_type''') is record'''
-<dl><dd>'''case''' variation '''is'''
-<dl><dd>'''when''' choice_list<sub>1</sub> '''<nowiki>=></nowiki>'''
-<dl><dd>fieldname<sub>1</sub> ''':''' type''';'''</dd>
-<dd>...</dd></dl></dd></dl>
-<dl><dd>'''when''' choice_list<sub>2</sub> '''<nowiki>=></nowiki>'''
-<dl><dd>fieldname<sub>2</sub> ''':''' type''';'''</dd>
-<dd>...</dd></dl></dd></dl>
-<dl><dd>...</dd></dl>
-'''end case;'''</dd></dl>'''end record'''</tt>
-|-
-| ALGOL 68
-| <tt>'''struct''' ('''modename''' ''«fieldname»'', '''...''');</tt>
-| colspan=2 align=center| Required types and operators can be [[User-defined function|user defined]]
-| <tt>'''union''' ('''modename''', '''...''');</tt>
-|-
-| C (C99)
-| rowspan=2| <tt>'''struct''' «name» '''{'''type name''';'''...'''};'''</tt>
-| rowspan=2 {{n/a}}
-| rowspan=3 {{n/a}}
-| rowspan=3| <tt>'''union {'''type name''';'''...'''};'''</tt>
-|-
-| Objective-C
-|-
-| C++
-| <tt>'''struct''' «name» '''{'''type name''';'''...'''};'''{{ref|C++'s struct|[b]}}</tt>
-| <tt>[[C++11#Tuple_types|«std::»tuple]]<type<sub>1</sub>..type<sub>n</sub>></tt>
-|-
-| C#
-| <tt>'''struct''' name '''{'''type name''';'''...'''}'''</tt>
-|
-|
-| rowspan=3 {{n/a}}
-|-
-| Java
-| {{n/a}}{{ref|just classes|[a]}}
-|
-|
-|-
-| JavaScript
-|
-| {{n/a}}
-|
-|-
-| D
-| <tt>'''struct''' name '''{'''type name''';'''...'''}'''</tt>
-|
-| <tt>'''std.variant.Algebraic'''!(type,...)</tt>
-| <tt>'''union {'''type name''';'''...'''}'''</tt>
-|-
-| Go
-| <tt>'''struct {<dl><dd>'''«name» type'''<br/>'''...'''</dd></dl>}'''</tt>
-|
-|
-|
-|-
-| Swift
-| <tt>'''struct''' name '''{<dl><dd>var '''name «''': '''type»'''<br/>'''...'''</dd></dl>}'''</tt>
-| <tt>'''('''«name<sub>1</sub>''':'''» val<sub>1</sub>''',''' «name<sub>2</sub>''':'''» val<sub>2</sub>''',''' «name<sub>3</sub>''':'''» val<sub>3</sub>''',''' ... ''')'''</tt>
-| <tt>'''enum''' name '''{ case''' Foo«'''('''types''')'''»''' case''' Bar «'''('''types''')'''» ... '''}'''</tt>
-|
-|-
-| Common Lisp
-|
-| rowspan=3| <tt>'''(cons '''val<sub>1</sub> val<sub>2</sub>''')'''{{ref|pair only|[c]}}</tt>
-|
-|
-|-
-| Scheme
-| {{n/a}}
-|
-|
-|-
-| ISLISP
-|
-|
-|
-|-
-| Pascal
-| <tt>'''record'''<dl><dd>name''':''' type''';'''<br/>...</dd></dl>'''end'''</tt>
-| {{n/a}}
-| {{n/a}}
-| <tt>'''record'''<dl><dd>'''case''' type '''of''' <br/>value''': ('''types''');'''<br/>...</dd></dl>'''end'''</tt>
-|-
-| Visual Basic
-|
-|
-|
-|
-|-
-| Visual Basic .NET
-| <tt>'''Structure''' name <dl><dd> '''Dim''' name '''As''' type <br/> ... </dd></dl>''' End Structure'''</tt>
-|
-|
-|
-|-
-| Python
-| {{n/a}}{{ref|just classes|[a]}}
-| <tt>«'''('''»val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... «''')'''»</tt>
-|
-| {{n/a}}
-|-
-| S-Lang
-| <tt>'''struct {'''name [=value], ...'''}'''</tt>
-|
-|
-|
-|-
-| Fortran
-|'''TYPE''' name <dl><dd> ''' '''type''' :: ''' name <br/> ... </dd></dl>''' END TYPE'''
-|
-|
-|
-|-
-| PHP
-| {{n/a}}{{ref|just classes|[a]}}
-|
-|
-|
-|-
-| Perl
-| {{n/a}}{{ref|Perl's records|[d]}}
-|
-|
-| rowspan=3 {{n/a}}
-|-
-| Perl 6
-| {{n/a}}{{ref|just classes|[a]}}
-|
-|
-|-
-| Ruby
-| {{code|lang=ruby|1=OpenStruct.new({:name => value})}}
-|
-|
-|-
-| Scala
-| <tt>'''case class''' name'''('''«'''var'''» name''':''' type''',''' ...''')'''</tt>
-| <tt>'''('''val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... ''')'''</tt>
-| <tt>'''abstract class''' name<br/>
-'''case class''' Foo'''('''«parameters»''') extends''' name<br/>
-'''case class''' Bar'''('''«parameters»''') extends''' name<br/>
-...<br /></tt>
-or<br />
-<tt>'''abstract class''' name<br/>
-'''case object''' Foo '''extends''' name<br/>
-'''case object''' Bar '''extends''' name<br/>
-...<br /></tt>
-or combination of case classes and case objects
-|
-|-
-| Windows PowerShell
-|
-|
-|
-|
-|-
-| OCaml
-| rowspan=2| <tt>'''type''' name '''= {'''«'''mutable'''» name ''':''' type''';'''...'''}'''</tt>
-| rowspan=2| <tt>«'''('''»val<sub>1</sub>''',''' val<sub>2</sub>''',''' val<sub>3</sub>''',''' ... «''')'''»</tt>
-| rowspan=2| <tt>'''type''' name '''=''' Foo «'''of''' type»''' <nowiki>|</nowiki>''' Bar «'''of''' type»''' <nowiki>|</nowiki>''' ...</tt>
-| rowspan=4 {{n/a}}
-|-
-| F#
-|-
-| Standard ML
-| <tt>'''type''' name '''= {'''name ''':''' type''','''...'''}'''</tt>
-| rowspan=2| <tt>'''('''val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... ''')'''</tt>
-| <tt>'''datatype''' name '''=''' Foo «'''of''' type»''' <nowiki>|</nowiki>''' Bar «'''of''' type»''' <nowiki>|</nowiki>''' ...</tt>
-|-
-| Haskell
-| <tt>'''data''' Name '''=''' Constr '''{'''name '''::''' type''','''...'''}'''</tt>
-| <tt>'''data''' Name '''=''' Foo «types»''' <nowiki>|</nowiki>''' Bar «types»''' <nowiki>|</nowiki>''' ...</tt>
-|-
-| COBOL
-| <tt>level-number name type clauses'''.'''<br/>
- level-number+n name type clauses'''.'''<br/>
- ...</tt>
-| {{n/a}}
-| {{n/a}}
-| <tt>name '''REDEFINES''' variable type'''.'''</tt>
-|}
-{{note|just classes|a}} Only classes are supported.
-<br />{{note|C++'s struct|b}} <code>struct</code>s in C++ are actually classes, but have default public visibility and ''are'' also [[Plain old data structure|POD]] objects. C++11 extended this further, to make classes act identically to POD objects in many more cases.
-<br />{{note|pair only|c}} pair only
-<br />{{note|Perl's records|d}} Although Perl doesn't have records, because Perl's type system allows different data types to be in an array, "hashes" (associative arrays) that don't have a variable index would effectively be the same as records.
-<br />{{note|enum|e}} Enumerations in this language are algebraic types with only nullary constructors
-
-== Variable and constant declarations ==
-{| class="wikitable"
-!
-! variable
-! constant
-! type synonym
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>identifier ''':''' type «''':=''' initial_value»{{ref|Ada declaration|[e]}}</tt>
-| <tt>identifier ''': constant''' type ''':=''' final_value</tt>
-| <tt>'''subtype''' identifier '''is''' type</tt>
-|-
-| [[ALGOL 68]]
-|<tt>'''modename''' ''name'' «''':=''' initial_value»;</tt>
-|<tt>'''modename''' ''name'' '''=''' value;</tt>
-|<tt>'''[[typedef|mode]]''' '''synonym''' = '''modename''';</tt>
-|-
-| C (C99)
-| rowspan=3| <tt>type name «'''=''' initial_value»''';'''</tt>
-| rowspan=2| <tt>'''enum{''' name '''=''' value '''};'''</tt>
-| rowspan=3| <tt>'''[[typedef]]''' type synonym''';'''</tt>
-|-
-| Objective-C
-|-
-| C++
-| <tt>'''const''' type name '''=''' value''';'''</tt>
-|-
-| C#
-| <tt>type name «'''=''' initial_value»''';''' or <br/> '''var''' name '''=''' value''';'''</tt>
-| <tt>'''const''' type name '''=''' value''';''' or <br/> '''readonly''' type name '''=''' value''';'''</tt>
-| <tt>'''using''' synonym '''=''' type''';'''</tt>
-|-
-| D
-| <tt>type name «'''=''' initial_value»''';''' or <br/> '''auto''' name '''=''' value''';'''</tt>
-| <tt>'''const''' type name '''=''' value''';''' or <br/> '''immutable''' type name '''=''' value''';'''</tt>
-| <tt>'''alias''' type synonym''';'''</tt>
-|-
-| Java
-| <tt>type name «'''=''' initial_value»''';'''</tt>
-| <tt>'''final''' type name '''=''' value''';'''</tt>
-| rowspan=2 {{n/a}}
-|-
-| JavaScript
-| <tt>'''var''' name «'''=''' initial_value»''';'''</tt>
-| <tt>'''const''' name '''=''' value''';'''</tt>
-|-
-| Go
-| <tt>'''var''' name type «'''=''' initial_value» or <br/> name ''':=''' initial_value</tt>
-| <tt>'''const''' name «type» '''=''' value</tt>
-| <tt>'''type''' synonym type</tt>
-|-
-| Swift
-| <tt>'''var''' name «''': '''type» «'''=''' initial_value»</tt>
-| <tt>'''let''' name «''': '''type» '''=''' value</tt>
-| <tt>'''typealias''' synonym '''=''' type</tt>
-|-
-| Common Lisp
-| <tt>'''(defparameter''' name initial_value''')''' or <br/> '''(defvar''' name initial_value''')''' or <br/> '''(setf (symbol-value <nowiki>'</nowiki>'''symbol''')''' initial_value''')'''</tt>
-| <tt>'''(defconstant''' name value''')'''</tt>
-| <tt>'''(deftype '''synonym''' () <nowiki>'</nowiki>'''type''')'''</tt>
-|-
-| Scheme
-| <tt>'''(define''' name initial_value''')'''</tt>
-|
-|
-|-
-| ISLISP
-| <tt>'''(defglobal''' name initial_value''')''' or <br/> '''(defdynamic''' name initial_value''')'''</tt>
-| <tt>'''(defconstant''' name value''')'''</tt>
-| {{n/a}}
-|-
-| <tt>Pascal{{ref|Pascal's declarations|[a]}}</tt>
-| <tt>name''':''' type «'''=''' initial_value»</tt>
-| <tt>name '''=''' value</tt>
-| <tt>synonym '''=''' type</tt>
-|-
-| Visual Basic
-| <tt>'''Dim''' name '''As''' type</tt>
-| rowspan=3| <tt>'''Const''' name '''As''' type '''=''' value</tt>
-|
-|-
-| Visual Basic .NET
-| <tt>'''Dim''' name '''As''' type«'''=''' initial_value»'''</tt>
-| <tt>'''Imports''' synonym '''=''' type</tt>
-|-
-| Xojo
-| <tt>'''Dim''' name '''As''' type«'''=''' initial_value»'''</tt>
-| {{n/a}}
-|-
-| Python
-| rowspan=2| <tt>name '''=''' initial_value</tt>
-| rowspan=2 {{n/a}}
-| <tt>synonym '''=''' type{{ref|variable types|[b]}}</tt>
-|-
-| [[CoffeeScript]]
-| {{n/a}}
-|-
-| S-Lang
-| <tt>name '''=''' initial_value''';'''</tt>
-|
-| <tt>'''typedef struct {...}''' typename</tt>
-|-
-| Fortran
-| type name
-| <tt>type''', PARAMETER :: ''' name '''=''' value</tt>
-|
-|-
-| PHP
-| <tt>'''$'''name '''=''' initial_value''';'''</tt>
-| <tt>'''define("'''name'''", '''value''');''' <br /> '''const '''name''' = '''value (5.3+)</tt>
-| rowspan=2 {{n/a}}
-|-
-| Perl
-| <tt>«'''my'''» '''$'''name «'''=''' initial_value'''»;'''{{ref|Perl's my keyword|[c]}}</tt>
-| <tt>'''use constant''' name '''=>''' value''';'''</tt>
-|-
-| Perl 6
-| <tt>«'''my''' «type»» $name «'''=''' initial_value'''»;'''{{ref|Perl's my keyword|[c]}}</tt>
-| <tt>«'''my''' «type»» '''constant''' name '''=''' value''';'''</tt>
-| <tt>'''::'''synonym '''::=''' type</tt>
-|-
-| Ruby
-| <tt>name '''=''' initial_value</tt>
-| <tt>Name '''=''' value</tt>
-| <tt>synonym '''=''' type{{ref|variable types|[b]}}</tt>
-|-
-| Scala
-| <tt>'''var''' name«''':''' type» '''=''' initial_value</tt>
-| <tt>'''val''' name«''':''' type» '''=''' value</tt>
-| <tt>'''type''' synonym '''=''' type</tt>
-|-
-| Windows PowerShell
-| <tt>«'''['''type''']'''»''' $'''name '''=''' initial_value</tt>
-| {{n/a}}
-| {{n/a}}
-|-
-| Bash shell
-| <tt>name'''='''initial_value</tt>
-| {{n/a}}
-| {{n/a}}
-|-
-| OCaml
-| <tt>'''let''' name «''':''' type '''ref'''» '''= ref''' value{{ref|ML ref|[d]}}</tt>
-| rowspan=2| <tt>'''let''' name «''':''' type» '''=''' value</tt>
-| rowspan=3| <tt>'''type''' synonym '''=''' type</tt>
-|-
-| F#
-| <tt>'''let mutable''' name «''':''' type» '''=''' value</tt>
-|-
-| Standard ML
-| <tt>'''val''' name «''':''' type '''ref'''» '''= ref''' value{{ref|ML ref|[d]}}</tt>
-| <tt>'''val''' name «''':''' type» '''=''' value</tt>
-|-
-| Haskell
-|
-| <tt>«name'''::'''type''';'''» name '''=''' value</tt>
-| <tt>'''type''' Synonym '''=''' type</tt>
-|-
-| [[Forth (programming language)|Forth]]
-| <tt>'''VARIABLE''' name</tt> (in some systems use <tt>value '''VARIABLE''' name</tt> instead)
-| <tt>value '''CONSTANT''' name</tt>
-|
-|-
-| COBOL
-| <tt>level-number name type clauses'''.'''</tt>
-| <tt>«'''0'''»'''1''' name '''CONSTANT''' «'''AS'''» value'''.'''</tt>
-| <tt>level-number name type clauses «'''IS'''» '''TYPEDEF.'''</tt>
-|-
-| Mathematica
-| <tt>name'''='''initialvalue</tt>
-| {{n/a}}
-| {{n/a}}
-|}
-{{note|Pascal's declarations|a}} Pascal has declaration blocks. See [[Comparison of programming languages (basic instructions)#Functions]].
-<br/>{{note|variable types|b}}Types are just regular objects, so you can just assign them.
-<br/>{{note|Perl's my keyword|c}} In Perl, the "my" keyword scopes the variable into the block.
-<br/>{{note|ML ref|d}} Technically, this does not declare ''name'' to be a mutable variable—in ML, all names can only be bound once; rather, it declares ''name'' to point to a "reference" data structure, which is a simple mutable cell. The data structure can then be read and written to using the <tt>!</tt> and <tt>:=</tt> operators, respectively.
-<br/>{{note|Ada declaration|[e]}} If no initial value is given, an invalid value is automatically assigned (which will trigger a run-time exception if it used before a valid value has been assigned). While this behaviour can be suppressed it is recommended in the interest of predictability. If no invalid value can be found for a type (for example in case of an unconstraint integer type), a valid, yet predictable value is chosen instead.
-
-== [[Control flow]] ==
-
-=== [[Conditional (programming)|Conditional]] statements ===
-{| class="wikitable"
-|- valign="top"
-!
-! if
-! else if
-! [[switch statement|select case]]
-! [[Conditional (programming)#If expressions|conditional expression]]
-|- valign="top"
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| rowspan=2| <tt>'''if''' condition '''then''' <dl><dd>statements</dd></dl> «'''else''' <dl><dd>statements»</dd></dl> '''end if'''</tt>
-| rowspan=2| <tt>'''if''' condition<sub>1</sub> '''then''' <dl><dd>statements</dd></dl> '''elsif''' condition<sub>2</sub> '''then''' <dl><dd>statements</dd></dl>...<br>«'''else''' <dl><dd>statements»</dd></dl> '''end if'''</tt>
-| <tt>'''case''' expression '''is'''<dl><dd>'''when''' value_list<sub>1</sub> '''<nowiki>=></nowiki>''' statements</dd><dd>'''when''' value_list<sub>2</sub> '''=>''' statements</dd></dl>...<dl><dd>«'''when others <nowiki>=></nowiki>''' statements» </dd></dl>'''end case'''</tt>
-| <tt>'''(if''' condition<sub>1</sub> '''then''' <dl><dd>expression<sub>1</sub></dd></dl> «'''elsif''' condition<sub>2</sub> '''then''' <dl><dd>expression<sub>2</sub>»</dd></dl> ... <br> '''else''' <dl><dd>expression<sub>n</sub></dd></dl>''')'''<br>'''(case''' expression '''is''' <dl><dd>'''when''' value_list<sub>1</sub> '''<nowiki>=></nowiki>''' expression<sub>1</sub></dd><dd>'''when''' value_list<sub>2</sub> '''=>''' expression<sub>2</sub></dd></dl> ... <dl><dd> «'''when others <nowiki>=></nowiki>''' expression<sub>n</sub>» </dd></dl>''')'''</tt>
-|- valign="top"
-| [[Seed7]]
-| <tt>'''case''' expression '''of'''<br />'''when''' set1 ''':''' statements<br/>...<br/>«'''otherwise:''' statements» <br />'''end case'''</tt>
-|
-|- valign="top"
-| [[Modula-2]]
-| <tt>'''if''' condition '''then''' <dl><dd>statements</dd></dl> «'''else''' <dl><dd>statements»</dd></dl> '''end'''</tt>
-| <tt>'''if''' condition<sub>1</sub> '''then''' <dl><dd>statements</dd></dl> '''elsif''' condition<sub>2</sub> '''then''' <dl><dd>statements</dd></dl>...<br>«'''else''' <dl><dd>statements»</dd></dl> '''end'''</tt>
-| rowspan=1 | <tt>'''case''' expression '''of'''<br />caseLabelList ''':''' statements '''<nowiki>|</nowiki>'''<br/>...<br/>«'''else''' statements» <br />'''end'''</tt>
-|
-|- valign="top"
-| rowspan=2 |[[ALGOL 68]] & "brief form"
-| <tt>'''if''' condition '''then ''' statements «'''else''' statements» '''fi'''</tt>
-| <tt>'''if''' condition '''then''' statements '''elif''' condition '''then''' statements '''fi'''</tt>
-| <tt>'''case''' switch '''in''' statements, statements«,... '''out''' statements» '''esac'''</tt>
-| rowspan=2 | <pre>( condition | valueIfTrue | valueIfFalse )</pre>
-|- valign="top"
-|<pre>( condition | statements «| statements» )</pre>
-|<pre>( condition | statements |: condition | statements )</pre>
-|<pre>( variable | statements,... «| statements» )</pre>
-|- valign="top"
-| [[APL (programming language)|APL]]
-| <tt>''':If''' condition <dl><dd>instructions</dd></dl> «''':Else''' <dl><dd>instructions»</dd></dl>''':EndIf'''</tt>
-| <tt>''':If''' condition <dl><dd>instructions</dd></dl> ''':ElseIf''' condition <dl><dd>instructions</dd></dl> ... <br/>«''':Else''' <dl><dd>instructions»</dd></dl> ''':EndIf'''</tt>
-| <tt>''':Select''' expression <br/> ''':Case''' case1 <br/> <dl><dd>instructions</dd></dl> ... <br/> «''':Else'''<dl><dd>instructions»</dd></dl>''':EndSelect'''</tt>
-| <tt>'''{'''condition''':'''valueIfTrue''' ⋄ '''valueIfFalse'''}'''</tt>
-|- valign="top"
-| C (C99)
-| rowspan=9|<tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
-| rowspan=8|<tt>'''if ('''condition''') {'''instructions'''}<br/>else if ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>
-| rowspan=7|<tt>'''switch ('''variable''') {<dl><dd>case''' case1''':''' instructions «'''break;'''»<br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>
-| rowspan=8| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>
-|- valign="top"
-| Objective-C
-|- valign="top"
-| C++ (STL)
-|- valign="top"
-| D
-|- valign="top"
-| Java
-|- valign="top"
-| JavaScript
-|- valign="top"
-| PHP
-|- valign="top"
-| C#
-| <tt>'''switch ('''variable''') {<dl><dd>case''' case1''':''' instructions'''; '''«jump statement''';'''»<br/>...<br/>«'''default:''' instructions''';''' «jump statement''';'''»» </dd></dl> '''}'''</tt>
-|- valign="top"
-| Windows PowerShell
-| <tt>'''if ('''condition''') { '''instructions''' }<br/>elseif ('''condition''') { '''instructions''' }'''<br/>...<br/>«'''else { '''instructions''' }'''»</tt>
-| <tt>'''switch ('''variable''') { '''case1''' { '''instructions «'''break;'''» '''}''' ... «'''default { '''instructions''' }'''»'''}'''</tt>
-|
-|- valign="top"
-| Go
-| <tt>'''if '''condition''' {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
-| <tt>'''if '''condition''' {'''instructions'''}<br/>else if '''condition''' {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/> or <br/> '''switch {<dl><dd>case''' condition''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>
-| <tt>'''switch '''variable''' {<dl><dd>case''' case1''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>
-|
-|- valign="top"
-| Swift
-| <tt>'''if '''condition''' {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
-| <tt>'''if '''condition''' {'''instructions'''}<br/>else if '''condition''' {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/></tt>
-| <tt>'''switch '''variable''' {<dl><dd>case''' case1''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>
-|
-|- valign="top"
-| Perl
-| <tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless ('''notcondition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
-| <tt>'''if ('''condition''') {'''instructions'''}<br/>elsif ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless ('''notcondition''') {'''instructions'''}<br/>elsif ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>
-| <tt>'''use feature "switch";'''<br/>...<br/>'''given ('''variable''') {<dl><dd>when ('''case1''') { '''instructions''' }'''<br/>...<br/>«'''default { '''instructions''' }'''»</dd></dl>'''}'''</tt>
-| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>
-|- valign="top"
-| Perl 6
-| <tt>'''if''' condition '''{'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless''' notcondition '''{'''instructions'''}'''</tt>
-| <tt>'''if''' condition''' {'''instructions'''}<br/>elsif''' condition '''{'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''</tt>
-| <tt>'''given''' variable '''{<dl><dd>when''' case1 '''{ '''instructions''' }'''<br/>...<br/>«'''default { '''instructions''' }'''»</dd></dl>'''}'''</tt>
-| <tt>condition '''[[?:|??]]''' valueIfTrue '''!!''' valueIfFalse</tt>
-|- valign="top"
-| Ruby
-| <tt>'''if''' condition <dl><dd>instructions</dd></dl> «'''else''' <dl><dd>instructions»</dd></dl> </tt>
-| <tt>'''if''' condition <dl><dd>instructions</dd></dl> '''elsif''' condition <dl><dd>instructions</dd></dl> ... <br/>«'''else''' <dl><dd>instructions»</dd></dl> '''end'''</tt>
-| <tt>'''case''' variable <br/> '''when''' case1 <br/> <dl><dd>instructions</dd></dl> ... <br/> «'''else'''<dl><dd>instructions»</dd></dl>'''end'''</tt>
-| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>
-|- valign="top"
-| Scala
-| <tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>
-| <tt>'''if ('''condition''') {'''instructions'''}<br/>else if ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>
-| <tt>expression '''match {'''<dl><dd>'''case''' pattern1 '''=>''' expression<br/>'''case''' pattern2 '''=>''' expression<br/>...<br/>«'''case _ =>''' expression»</dd></dl>'''}'''{{ref|pattern matching|[b]}}</tt>
-| <tt>'''if ('''condition''')''' valueIfTrue '''else''' valueIfFalse</tt>
-|- valign="top"
-| Smalltalk
-| <tt>condition '''ifTrue:''' <dl><dd>trueBlock</dd></dl> «'''ifFalse:''' <dl><dd>falseBlock»</dd></dl> '''end'''</tt>
-|
-|
-| <tt>condition '''ifTrue:''' trueBlock '''ifFalse:''' falseBlock</tt>
-|- valign="top"
-| Common Lisp
-| <tt>'''(when '''condition<br/> <dl><dd>instructions''')'''</dd></dl> or<br/> '''(unless '''condition<br/> <dl><dd>instructions''')'''</dd></dl> or<br/> '''(if '''condition'''<br/><dl><dd>(progn '''instructions''')</dd><dd>'''«'''(progn '''instructions''')'''»''')'''</dd></dl></tt>
-| <tt>'''(cond ('''condition1 instructions''')<br/><dl><dd>('''condition2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>
-| <tt>'''(case '''expression'''<dl><dd>('''case1 instructions''')</dd><dd>('''case2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(otherwise '''instructions''')'''»''')'''</dd></dl></tt>
-| rowspan=2| <tt>'''(if '''condition valueIfTrue valueIfFalse''')'''</tt>
-|- valign="top"
-| Scheme
-| <tt>'''(when '''conditioninstructions''')''' or <br/> '''(if '''condition''' (begin '''instructions''') '''«'''(begin '''instructions''')'''»''')'''</tt>
-| <tt>'''(cond ('''condition1 instructions''') ('''condition2 instructions''') '''...''' '''«'''(else '''instructions''')'''»''')'''</tt>
-| <tt>'''(case ('''variable''') (('''case1''')''' instructions''') (('''case2''')''' instructions''') '''...''' '''«'''(else '''instructions''')'''»''')'''</tt>
-|- valign="top"
-| ISLISP
-| <tt>'''(if '''condition'''<br/><dl><dd>(progn '''instructions''')</dd><dd>'''«'''(progn '''instructions''')'''»''')'''</dd></dl></tt>
-| <tt>'''(cond ('''condition1 instructions''')<br/><dl><dd>('''condition2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>
-| <tt>'''(case '''expression'''<dl><dd>('''case1 instructions''')</dd><dd>('''case2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>
-| <tt>'''(if '''condition valueIfTrue valueIfFalse''')'''</tt>
-|- valign="top"
-| Pascal
-| <tt>'''if''' condition '''then begin''' <dl><dd>instructions</dd></dl> '''end''' <br/> «'''else begin'''<dl><dd>instructions</dd></dl>'''end'''»{{ref|pascal semicolon|[c]}}</tt>
-| <tt>'''if''' condition '''then begin''' <dl><dd>instructions</dd></dl> '''end <br/> else if''' condition '''then begin'''<dl><dd>instructions</dd></dl> '''end'''<br/>...<br/>«'''else begin'''<dl><dd>instructions</dd></dl> '''end'''»{{ref|pascal semicolon|[c]}}</tt>
-| <tt>'''case '''variable''' of''' <dl><dd>case1''':''' instructions <br/> ... <br/> «'''else:''' instructions»</dd></dl>'''end'''{{ref|pascal semicolon|[c]}}</tt>
-|- valign="top"
-| Visual Basic
-| rowspan=3| <tt>'''If''' condition '''Then''' <dl><dd>instructions</dd></dl> «'''Else''' <dl><dd>instructions»</dd></dl>'''End If'''</tt>
-| rowspan=3| <tt>'''If''' condition '''Then''' <dl><dd>instructions</dd></dl> '''ElseIf''' condition '''Then''' <dl><dd>instructions</dd></dl> ... <br/> «'''Else''' <dl><dd>instructions»</dd></dl>'''End If'''</tt>
-| rowspan=3| <tt>'''Select Case''' variable <br/> '''Case''' case1 <dl><dd>instructions</dd></dl> ... <br/> «'''Case Else''' <dl><dd>instructions»</dd></dl> '''End Select'''</tt>
-| <tt>'''[[IIf]]('''condition''', '''valueIfTrue''', '''valueIfFalse''')'''</tt>
-|- valign="top"
-| Visual Basic .NET
-| rowspan=2| <tt>'''If('''condition''', '''valueIfTrue''', '''valueIfFalse''')'''</tt>
-|- valign="top"
-| Xojo
-|- valign="top"
-| Python {{ref|python indent|[a]}}
-| <tt>'''if''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>
-| <tt>'''if''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> '''elif''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> ... <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>
-|
-| <tt>valueIfTrue '''if''' condition '''else''' valueIfFalse</tt><br/>(Python 2.5+)
-|- valign="top"
-| S-Lang
-| <tt>'''if ('''condition''') { '''instructions''' } '''«'''else { '''instructions''' }'''»</tt>
-| <tt>'''if ('''condition''') { '''instructions''' } else if ('''condition''') {''' instructions '''}''' ... «'''else { '''instructions '''}'''»</tt>
-| <tt>'''switch ('''variable''') { case '''case1''': '''instructions''' } { case '''case2''': '''instructions''' }''' ...</tt>
-|
-|- valign="top"
-| Fortran
-| <tt>'''IF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ELSE <dl><dd> '''instructions''' </dd></dl> ENDIF'''</tt>
-| <tt>'''IF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ELSEIF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ... <br/> ELSE <dl><dd> '''instructions''' </dd></dl> ENDIF'''</tt>
-| <tt>'''SELECT CASE('''variable''')<dl><dd> CASE ('''case1''') <dl><dd> '''instructions''' </dd></dl> ... <br/> CASE DEFAULT <dl><dd> '''instructions''' </dd></dl> </dd></dl> END SELECT</tt>
-|
-|- valign="top"
-| Forth
-| <tt>condition''' IF '''instructions «''' ELSE '''instructions»''' THEN'''</tt>
-| <tt>condition''' IF '''instructions ''' ELSE '''condition''' IF '''instructions''' THEN THEN'''</tt>
-| <tt>value''' CASE'''<br/>case''' OF '''instructions''' ENDOF'''<br/>case''' OF '''instructions''' ENDOF'''<br/> default instructions<br/>'''ENDCASE'''</tt>
-| <tt>condition''' IF '''valueIfTrue''' ELSE '''valueIfFalse''' THEN'''</tt>
-|- valign="top"
-| OCaml
-| <tt>'''if''' condition '''then begin''' instructions '''end''' «'''else begin''' instructions '''end'''»</tt>
-| <tt>'''if''' condition '''then begin''' instructions '''end else if''' condition '''then begin''' instructions '''end''' ... «'''else begin''' instructions '''end'''»</tt>
-| rowspan=2| <tt>'''match''' value '''with <dl><dd>'''pattern1''' <nowiki>-></nowiki> '''expression'''<br/><nowiki>|</nowiki> '''pattern2''' <nowiki>-></nowiki> '''expression<br/> ... <br/>«'''<nowiki>| _ -></nowiki> '''expression»{{ref|pattern matching|[b]}}</dd></dl></tt>
-| rowspan=4| <tt>'''if''' condition '''then''' valueIfTrue '''else''' valueIfFalse</tt>
-|- valign="top"
-| F#
-| <tt>'''if''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> «'''else''' <br/>{{keypress|Tab}} instructions»</tt>
-| <tt>'''if''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> '''elif''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> ... <br/> «'''else''' <br/>{{keypress|Tab}} instructions»</tt>
-|- valign="top"
-| Standard ML
-| <tt>'''if''' condition '''then''' «'''('''»instructions «''')'''»<br/>'''else''' «'''('''» instructions «''')'''»</tt>
-| <tt>'''if''' condition '''then''' «'''('''»instructions «''')'''»<br/>'''else if''' condition '''then''' «'''('''» instructions «''')'''»<br/>...<br/>'''else''' «'''('''» instructions «''')'''»</tt>
-| <tt>'''case''' value '''of<dl><dd>'''pattern1''' <nowiki>=></nowiki> '''expression'''<br/> <nowiki>|</nowiki> '''pattern2''' => '''expression<br/> ...<br/> «'''<nowiki>| _ =></nowiki> '''expression»{{ref|pattern matching|[b]}}</dd></dl></tt>
-|- valign="top"
-| Haskell (GHC)
-| <tt>'''if''' condition '''then''' expression '''else''' expression</tt><br/>or<br/><tt>'''when''' condition '''(do''' instructions''')'''</tt><br/>or<br/><tt>'''unless''' notcondition '''(do''' instructions''')'''</tt>
-| <tt>result '''<nowiki>|</nowiki>''' condition '''=''' expression <dl><dd>'''<nowiki>|</nowiki>''' condition '''=''' expression <br/>'''<nowiki>|</nowiki> otherwise =''' expression</dd></dl></tt>
-| <tt>'''case''' value '''of {<dl><dd>'''pattern1''' <nowiki>-></nowiki> '''expression''';<br/>'''pattern2''' <nowiki>-></nowiki>'''expression''';'''<br/> ... <br/>«'''<nowiki>_ -></nowiki> '''expression»</dd></dl>'''}'''{{ref|pattern matching|[b]}}</tt>
-|- valign="top"
-| Bash shell
-| <poem><tt>'''if''' condition-command; '''then'''
-{{space|4}}expression
-«'''else'''
-{{space|4}}expression»
-'''fi'''</tt></poem>
-| <poem><tt>'''if''' condition-command; '''then'''
-{{space|4}}expression
-'''elif''' condition-command; '''then'''
-{{space|4}}expression
-«'''else'''
-{{space|4}}expression»
-'''fi'''</tt></poem>
-| <poem><tt>'''case''' "$variable" '''in'''
-"$condition1" )
-{{space|4}}command...
-;;
-"$condition2" )
-{{space|4}}command...
-;;
-'''esac'''</tt></poem>
-|
-|- valign="top"
-| rowspan=5| CoffeeScript
-| <tt>'''if''' condition '''then''' expression «'''else''' expression»</tt>
-| <tt>'''if''' condition '''then''' expression '''else if''' condition '''then''' expression «'''else''' expression»</tt>
-| rowspan=2| <tt>'''switch''' expression <dl><dd>'''when''' condition '''then''' expression</dd></dl> <dl><dd>'''else''' expression</dd></dl></tt>
-| rowspan=5| ''All conditions are expressions''
-|- valign="top"
-| <tt>'''if''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>
-| <tt>'''if''' condition <dl><dd>expression</dd></dl> '''else if''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>
-|- valign="top"
-| <tt>expression '''if''' condition</tt>
-| rowspan=3| <tt>'''unless''' condition <dl><dd>expression</dd></dl> '''else unless''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>
-| rowspan=3| <tt>'''switch''' expression <dl><dd>'''when''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></dd></dl></tt>
-|- valign="top"
-| <tt>'''unless''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>
-|- valign="top"
-| <tt>expression '''unless''' condition</tt>
-|- valign="top"
-| COBOL
-| <tt>'''IF''' condition «'''THEN'''» <dl><dd> expression </dd></dl> «'''ELSE''' <dl><dd> expression»'''.''' </dd></dl></tt>{{ref|COBOL END-IF|[d]}}
-|
-| <tt>'''EVALUATE''' expression «'''ALSO''' expression...» <dl><dd> '''WHEN''' case-or-condition «'''ALSO''' case-or-condition...» <dl><dd> expression </dd></dl></dd></dl> <dl><dd> ... </dd></dl> <dl><dd>«'''WHEN OTHER''' <dl><dd> expression» </dd></dl></dd></dl> '''END-EVALUATE'''</tt>
-|
-|- valign="top"
-!
-! if
-! else if
-! [[switch statement|select case]]
-! [[Conditional (programming)#If expressions|conditional expression]]
-|}
-
-{{note|python indent|a}} A single instruction can be written on the same line following the colon. Multiple instructions are grouped together in a [[block (programming)|block]] which starts on a newline (The indentation is required). The conditional expression syntax does not follow this rule.
-<br/>
-{{note|pattern matching|b}} This is [[pattern matching]] and is similar to select case but not the same. It is usually used to deconstruct [[algebraic data type]]s.
-<br/>
-{{note|pascal semicolon|c}} In languages of the Pascal family, the semicolon is not part of the statement. It is a separator between statements, not a terminator.
-<br/>
-{{note|COBOL END-IF|d}} <tt>'''END-IF'''</tt> may be used instead of the period at the end.
-
-=== [[Control flow#Loops|Loop statements]] ===
-{| class="wikitable"
-|-
-!
-! [[while loop|while]]
-! [[do while loop|do while]]
-! [[for loop|for i = first to last]]
-! [[foreach]]
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>'''while''' condition '''loop''' <dl><dd>statements</dd></dl> '''end loop'''</tt>
-| <tt>'''loop''' <dl><dd>statements</dd><dd>'''exit when not''' condition</dd></dl> '''end loop'''</tt>
-| <tt>'''for''' index '''in''' «'''reverse'''» [first '''..''' last <nowiki>|</nowiki> discrete_type] '''loop''' <dl><dd>statements</dd></dl> '''end loop'''</tt>
-| <tt>'''for''' item '''of''' «'''reverse'''» iterator '''loop''' <dl><dd>statements</dd></dl> '''end loop''' <br><br> '''(for''' ['''all''' <nowiki>|</nowiki> '''some'''] ['''in''' <nowiki>|</nowiki> '''of'''] [first '''..''' last <nowiki>|</nowiki> discrete_type <nowiki>|</nowiki> iterator] '''=>''' predicate''')'''{{ref|Ada_quantifiers|[b]}}</tt>
-|-
-|rowspan=2| [[ALGOL 68]] ||colspan=3 align=center| <tt>«'''for''' index» «'''from''' first» «'''by''' increment» «'''to''' last» «'''while''' condition» '''do''' statements '''od'''</tt> ||rowspan=2| <tt>'''for''' ''key'' «'''to''' '''upb''' ''list''» '''do''' «'''typename''' ''val''=''list''[''key''];» statements '''od'''</tt>
-|-
-| <tt>«'''while''' condition»</tt>
- '''do''' statements '''od'''
-| <tt>«'''while''' statements; condition»</tt>
- '''do''' statements '''od'''
-| <tt>«'''for''' index» «'''from''' first» «'''by''' increment» «'''to''' last» '''do''' statements '''od'''</tt>
-|-
-| [[APL (programming language)|APL]]
-| <tt>''':While''' condition<dl><dd>statements</dd></dl> ''':EndWhile'''</tt>
-| <tt>''':Repeat''' <dl><dd>statements</dd></dl>''':Until''' condition</tt>
-| <tt>''':For''' var«s» ''':In''' list<dl><dd>statements</dd></dl> ''':EndFor'''</tt>
-| <tt>''':For''' var«s» ''':InEach''' list<dl><dd>statements</dd></dl> ''':EndFor'''</tt>
-|-
-| C (C99)
-| rowspan=9|<tt>'''while ('''condition''')''' '''{''' instructions '''}'''</tt>
-| rowspan=9|<tt>'''do {''' instructions '''} while ('''condition''')'''</tt>
-| rowspan=5|<tt>'''for ('''«type» i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; ++'''i''') {''' instructions '''}'''</tt>
-| {{n/a}}
-|-
-| Objective-C
-| <tt>'''for ('''type item '''in''' set''') {''' instructions '''}'''</tt>
-|-
-| C++ (STL)
-| <tt>«'''std::'''»'''for_each('''start''',''' end''',''' function''')'''</tt>
-([[C++11]]) <tt>'''for ('''type item ''':''' set''') {''' instructions '''}'''</tt>
-|-
-| C#
-| <tt>'''foreach ('''type item '''in''' set''') {''' instructions '''}'''</tt>
-|-
-| Java
-| <tt>'''for ('''type item ''':''' set''') {''' instructions '''}'''</tt>
-|-
-| JavaScript
-|<tt>'''for (var''' i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last''';''' i'''++) {''' instructions '''}'''</tt>
-|<tt>'''for (var''' index '''in''' set''') {''' instructions '''}''' <br/> or <br/> '''for each (var''' item '''in''' set''') {''' instructions '''}'''</tt> (JS 1.6+, deprecated<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/for_each...in|title=for each...in|author=|date=|work=mozilla.org|accessdate=30 January 2017}}</ref>)<br/>or<br/><tt>'''for (var''' item '''of''' set''') {''' instructions '''}'''</tt> ([[EcmaScript 6]] proposal, supported in Firefox<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/for...of|title=for...of|author=|date=|work=mozilla.org|accessdate=30 January 2017}}</ref>)
-|-
-| PHP
-| <tt>'''foreach (range('''first''', '''last''') as $i) {''' instructions '''}''' or <br/> '''for ($i = '''first'''; $i <= '''last'''; $i++) {''' instructions '''}'''</tt>
-| <tt>'''foreach ('''set '''as''' item''') {''' instructions '''}''' <br/> or <br/> '''foreach ('''set '''as '''key''' =>''' item''') {''' instructions '''}'''</tt>
-|-
-| Windows PowerShell
-| <tt>'''for ($i = '''first'''; $i -le '''last'''; $i++) {''' instructions '''}'''</tt>
-| <tt>'''foreach ('''item '''in''' set''') {''' instructions using item '''}'''</tt>
-|-
-| D
-| <tt>'''foreach''' (i; '''first''' ... '''last''') '''{''' instructions '''}'''</tt>
-| <tt>'''foreach''' («type» item; set) '''{''' instructions '''}'''</tt>
-|-
-| Go
-| <tt>'''for '''condition''' {''' instructions '''}'''</tt>
-|
-| <tt>'''for '''i ''':=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; '''i'''++ {''' instructions '''}'''</tt>
-| <tt>'''for '''key''', '''item''' := range '''set''' {''' instructions '''}'''</tt>
-|-
-| Swift
-| <tt>'''while '''condition''' {''' instructions '''}'''</tt>
-| <tt>'''repeat {''' instructions '''} while '''condition</tt> (2.x)<br /> <tt>'''do {''' instructions '''} while '''condition</tt> (1.x)
-| <tt>'''for''' i '''=''' first '''...''' last {''' instructions '''}</tt> or <br/> <tt>'''for''' i '''=''' first '''..<''' last+1 {''' instructions '''}</tt> or <br/> <tt>'''for var''' i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; '''i'''++ {''' instructions '''}'''</tt>
-| <tt>'''for '''item''' in '''set''' {''' instructions '''}'''</tt>
-|-
-| Perl
-| <tt>'''while ('''condition''')''' '''{''' instructions '''}''' or <br/> '''until ('''notcondition''')''' '''{''' instructions '''}'''</tt>
-| <tt>'''do {''' instructions '''} while ('''condition''')''' or <br/> '''do {''' instructions '''} until ('''notcondition''')'''</tt>
-| <tt>'''for'''«'''each'''»''' '''«'''$i'''»''' ('''first''' .. '''last''') {''' instructions '''}''' or <br/> '''for ($i = '''first'''; $i <= '''last'''; $i++) {''' instructions '''}'''</tt>
-| <tt>'''for'''«'''each'''» «$item» '''('''set''') {''' instructions '''}'''</tt>
-|-
-| Perl 6
-| <tt>'''while''' condition '''{''' instructions '''}''' or <br/> '''until''' notcondition '''{''' instructions '''}'''</tt>
-| <tt>'''repeat {''' instructions '''} while '''condition or <br/> '''repeat {''' instructions '''} until''' notcondition</tt>
-| <tt>'''for''' first'''..'''last '''<nowiki>-></nowiki> $i {''' instructions '''}''' or <br/> '''loop ($i = '''first'''; $i <nowiki><=</nowiki>'''last'''; $i++) {''' instructions '''}'''</tt>
-| <tt>'''for''' set« '''<nowiki>-></nowiki>''' $item» '''{''' instructions '''}'''</tt>
-|-
-| Ruby
-| <tt>'''while''' condition <dl><dd>instructions</dd></dl>'''end''' <br/> or <br/> '''until''' notcondition <dl><dd>instructions</dd></dl> '''end'''</tt>
-| <tt>'''begin''' <dl><dd>instructions</dd></dl> '''end while''' condition <br/> or <br/> '''begin''' <dl><dd>instructions</dd></dl> '''end until''' notcondition</tt>
-| <tt>'''for i in '''first'''..'''last <dl><dd>instructions</dd></dl> '''end''' </tt><br/> or <br/> <tt>'''for i in '''first'''...'''last+1 <dl><dd>instructions</dd></dl> '''end''' <br/> or <br/> first'''.{{not a typo|upto}}('''last''') { <nowiki>|i|</nowiki> '''instructions '''}'''</tt>
-| <tt>'''for''' item '''in''' set <dl><dd>instructions</dd></dl> '''end''' <br/> or <br/> set'''.each { <nowiki>|</nowiki>'''item'''<nowiki>|</nowiki> '''instructions '''}'''</tt>
-|-
-| Bash shell
-| <tt>'''while''' condition ;'''do'''<dl><dd>instructions</dd></dl>'''done''' <br/> or <br/> '''until''' notcondition ;'''do'''<dl><dd>instructions</dd></dl> '''done'''</tt>
-| {{n/a}}
-| <tt>'''for (('''i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; ++'''i''')) ; do'''
-<dl><dd>instructions</dd></dl>
-'''done'''
-</tt>
-| <tt>'''for''' item '''in''' set ;'''do'''<dl><dd>instructions</dd></dl> '''done'''</tt>
-|-
-| Scala
-| <tt>'''while ('''condition''')''' '''{''' instructions '''}'''</tt>
-| <tt>'''do {''' instructions '''} while ('''condition''')'''</tt>
-| <tt>'''for ('''i '''<nowiki><-</nowiki>''' first '''to''' last «'''by 1'''»''') {''' instructions '''}'''<br/>or<br/>first '''to''' last «'''by 1'''» '''foreach ('''i '''<nowiki>=></nowiki> {''' instructions '''})'''</tt>
-| <tt>'''for ('''item '''<nowiki><-</nowiki>''' set''') {''' instructions '''}'''<br/>or<br/>set '''foreach ('''item '''=> {''' instructions '''})'''</tt>
-|-
-| Smalltalk
-| <tt>conditionBlock '''whileTrue:''' <dl><dd>loopBlock</dd></dl></tt>
-| <tt>loopBlock '''doWhile:''' <dl><dd>conditionBlock</dd></dl></tt>
-| <tt>first '''to:''' last '''do:''' <dl><dd>loopBlock</dd></dl></tt>
-| <tt>collection '''do:''' <dl><dd>loopBlock</dd></dl></tt>
-|-
-| Common Lisp
-| <tt>'''(loop<dl><dd>while '''condition'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(do () ('''notcondition''')<dl><dd>'''instructions''')'''</dd></dl></tt>
-| <tt>'''(loop<dl><dd>do</dd><dd>'''instructions'''</dd><dd>while '''condition''')'''</dd></dl></tt>
-| <tt>'''(loop<dl><dd>for i from '''first''' to '''last''' «by 1»</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(dotimes (i N)'''<dl><dd>instructions''')'''</dd></dl> or<br/> '''(do ((i '''first''' (1+ i))) ((<nowiki>>=</nowiki> i '''last'''))<dl><dd>'''instructions''')'''</dd></dl></tt>
-| <tt>'''(loop<dl><dd>for '''item''' in '''list'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(loop<dl><dd>for '''item''' across '''vector'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(dolist ('''item list''')<dl><dd>'''instructions''')'''</dd></dl> or <br/>'''(mapc '''function list''')''' or <br/> '''(map <nowiki>'</nowiki>'''type function sequence''')'''</tt>
-|-
-| Scheme
-| <tt>'''(do () ('''notcondition''') '''instructions''')''' or <br/> '''(let loop () (if '''condition''' (begin '''instructions''' (loop))))'''</tt>
-| <tt>'''(let loop () ('''instructions''' (if '''condition''' (loop))))'''</tt>
-| <tt>'''(do ((i '''first''' (+ i 1))) ((<nowiki>>=</nowiki> i '''last''')) '''instructions''')''' or <br/> '''(let loop ((i '''first''')) (if (< i '''last''') (begin '''instructions''' (loop (+ i 1)))))'''</tt>
-| <tt>'''(for-each (lambda ('''item''') '''instructions''') '''list''')'''</tt>
-|-
-| ISLISP
-| <tt>'''(while '''condition''' '''instructions''')'''</tt>
-| <tt>'''(tagbody loop''' instructions '''(if''' condition '''(go loop))'''</tt>
-| <tt>'''(for ((i '''first''' (+ i 1))) ((<nowiki>>=</nowiki> i '''last''')) '''instructions''')'''</tt>
-| <tt>'''(mapc (lambda ('''item''') '''instructions''') '''list''')'''</tt>
-|-
-| Pascal
-| <tt>'''while''' condition '''do begin''' <dl><dd>instructions</dd></dl> '''end'''</tt>
-| <tt>'''repeat''' <dl><dd>instructions</dd></dl> '''until''' notcondition''';'''</tt>
-| <tt>'''for''' i ''':=''' first «'''step 1'''» '''to''' last '''do begin''' <dl><dd>instructions</dd></dl> '''end;'''{{ref|step|[a]}}</tt>
-| <tt>'''for''' item '''in''' set '''do''' ...</tt>
-|-
-| Visual Basic
-| rowspan=2| <tt>'''Do While''' condition <dl><dd>instructions</dd></dl>'''Loop''' <br/> or <br/>'''Do Until''' notcondition <dl><dd>instructions</dd></dl>'''Loop'''</tt>
-| rowspan=2| <tt>'''Do''' <dl><dd>instructions</dd></dl> '''Loop While''' condition <br/> or <br/>'''Do''' <dl><dd>instructions</dd></dl> '''Loop Until''' notcondition</tt>
-| <tt>'''For''' i '''=''' first '''To''' last «'''Step 1'''» <dl><dd>instructions</dd></dl> '''Next i'''</tt>
-| <tt>'''For Each''' item '''In''' set <dl><dd>instructions</dd></dl> '''Next''' item</tt>
-|-
-| Visual Basic .NET
-| rowspan=2| <tt>'''For i '''«'''As '''type» '''=''' first '''To''' last «'''Step 1'''» <dl><dd>instructions</dd></dl>'''Next i'''{{ref|step|[a]}}</tt>
-| rowspan=2| <tt>'''For Each''' item '''As '''type''' In''' set <dl><dd>instructions</dd></dl> '''Next''' item</tt>
-|-
-| Xojo
-| <tt>'''While''' condition <dl><dd>instructions</dd></dl>'''Wend'''</tt>
-| <tt>'''Do Until''' notcondition <dl><dd>instructions</dd></dl>'''Loop''' <br/> or <br/>'''Do''' <dl><dd>instructions</dd></dl> '''Loop Until''' notcondition</tt>
-|-
-| Python
-| <tt>'''while''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>
-| {{n/a}}
-| <tt>'''for i in range('''first''', '''last+1'''):''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>(Python 3.x)<br/>
-<tt>'''for i in xrange('''first''', '''last+1'''):''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}}instructions»</tt>(Python 2.x)
-| <tt>'''for''' item '''in''' set''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>
-|-
-| S-Lang
-| <tt>'''while ('''condition''') {''' instructions '''}''' «'''then''' optional-block»</tt>
-| <tt>'''do {''' instructions '''} while ('''condition''')''' «'''then''' optional-block»</tt>
-| <tt>'''for (i = '''first'''; i <nowiki><=</nowiki> '''last'''; i++) {''' instructions '''}''' «'''then''' optional-block»</tt>
-| <tt>'''foreach''' item'''('''set''')''' «'''using ('''what''')'''» '''{''' instructions '''}''' «'''then''' optional-block»</tt>
-|-
-| Fortran
-| <tt>'''DO WHILE ('''condition''') <dl><dd> '''instructions'''</dd></dl> ENDDO'''</tt>
-| <tt>'''DO <dl><dd> '''instructions''' <br/> IF ('''condition''') EXIT </dd></dl> ENDDO'''</tt>
-| <tt>'''DO '''I''' = '''first''','''last''' <dl><dd> '''instructions''' </dd></dl> ENDDO'''</tt>
-| {{n/a}}
-|-
-| Forth
-| <tt>'''BEGIN '''« instructions » condition''' WHILE '''instructions''' REPEAT'''</tt>
-| <tt>'''BEGIN ''' instructions condition''' UNTIL'''</tt>
-| <tt>limit start''' DO '''instructions''' LOOP'''</tt>
-| {{n/a}}
-|-
-| OCaml
-| <tt>'''while''' condition '''do''' instructions '''done'''</tt>
-| {{n/a}}
-| <tt>'''for i = '''first''' to '''last''' do''' instructions '''done'''</tt>
-| <tt>'''Array.iter (fun '''item''' <nowiki>-></nowiki> '''instructions''') '''array <br/> '''List.iter (fun '''item''' -> '''instructions''') '''list</tt>
-|-
-| F#
-| <tt>'''while''' condition '''do''' <br/> {{keypress|Tab}} instructions</tt>
-| {{n/a}}
-| <tt>'''for i = '''first''' to '''last''' do''' <br/> {{keypress|Tab}} instructions</tt>
-| <tt>'''for '''item''' in '''set''' do''' <br/> {{keypress|Tab}} instructions <br/> or <br/> '''Seq.iter (fun '''item''' -> '''instructions''') '''set</tt>
-|-
-| Standard ML
-| <tt>'''while''' condition '''do (''' instructions ''')'''</tt>
-| colspan=2 {{n/a}}
-| <tt>'''Array.app (fn '''item''' <nowiki>=></nowiki> '''instructions''') '''array <br/> '''app (fn '''item''' => '''instructions''') '''list</tt>
-|-
-| Haskell (GHC)
-| colspan=2 {{n/a}}
-| <tt>'''Control.Monad.forM_ ['''first'''..'''last'''] (\i <nowiki>-></nowiki> do '''instructions''')'''</tt>
-| <tt>'''Control.Monad.forM_ '''list '''(\item <nowiki>-></nowiki> do '''instructions''')'''</tt>
-|-
-| Eiffel
-| colspan=4| <tt>'''from''' <dl><dd>setup</dd></dl> '''until''' <dl><dd>condition</dd></dl> '''loop''' <dl><dd>instructions</dd></dl> '''end'''</tt>
-|-
-| rowspan=6| CoffeeScript
-| <tt>'''while''' condition <dl><dd>expression</dd></dl></tt>
-| rowspan=6 {{n/a}}
-| rowspan=4| <tt>'''for''' i '''in''' [first..last] <dl><dd>expression</dd></dl></tt>
-| rowspan=4| <tt>'''for''' item '''in''' set <dl><dd>expression</dd></dl></tt>
-|-
-| <tt>expression '''while''' condition</tt>
-|-
-| <tt>'''while''' condition '''then''' expression</tt>
-|-
-| <tt>'''until''' condition <dl><dd>expression</dd></dl></tt>
-|-
-| <tt>expression '''until''' condition</tt>
-| <tt>'''for''' i '''in''' [first..last] '''then''' expression</tt>
-| <tt>'''for''' item '''in''' set '''then''' expression</tt>
-|-
-| <tt>'''until''' condition '''then''' expression</tt>
-| <tt>expression '''for''' i '''in''' [first..last]</tt>
-| <tt>expression '''for''' item '''in''' set</tt>
-|-
-| rowspan=2 | COBOL
-| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» ««'''WITH'''» '''TEST BEFORE'''» '''UNTIL''' condition{{ref|COBOL THRU|[c]}}</tt>
-| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» «'''WITH'''» '''TEST AFTER UNTIL''' condition{{ref|COBOL THRU|[c]}}</tt>
-| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» '''VARYING''' i '''FROM''' first '''BY''' increment '''UNTIL''' i '''>''' last{{ref|COBOL GREATER THAN|[d]}}</tt>
-| rowspan=2 {{n/a}}
-|-
-| <tt>'''PERFORM''' ««'''WITH'''» '''TEST BEFORE'''» '''UNTIL''' condition <dl><dd> expression </dd></dl> '''END-PERFORM'''</tt>
-| <tt>'''PERFORM''' «'''WITH'''» '''TEST AFTER UNTIL''' condition <dl><dd> expression </dd></dl> '''END-PERFORM'''</tt>
-| <tt>'''PERFORM VARYING''' i '''FROM''' first '''BY''' increment '''UNTIL''' i '''>''' last <dl><dd> expression </dd></dl> '''END-PERFORM'''{{ref|COBOL GREATER THAN|[d]}}</tt>
-|}
-{{note|step|a}} "<tt>'''step'''</tt> n" is used to change the loop interval. If "<tt>'''step'''</tt>" is omitted, then the loop interval is 1.
-
-{{note|Ada_quantifiers|b}} This implements the universal quantifier ("for all" or "∀") as well as the existential quantifier ("there exists" or "∃").
-
-{{note|COBOL THRU|c}} <tt>'''THRU'''</tt> may be used instead of <tt>'''THROUGH'''</tt>.
-
-{{note|COBOL GREATER THAN|d}} <tt>«'''IS'''» '''GREATER''' «'''THAN'''»</tt> may be used instead of <tt>'''>'''</tt>.
-
-=== [[Exception handling|Exceptions]] ===
-{{further|Exception handling syntax}}
-{| class="wikitable"
-|-
-!
-! throw
-! handler
-! assertion
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>'''raise''' exception_name «'''with''' string_expression»</tt>
-| <tt>'''begin'''<dl><dd>statements</dd></dl>'''exception'''<dl><dd>'''when''' exception_list<sub>1</sub> '''<nowiki>=></nowiki>''' statements;</dd><dd>'''when''' exception_list<sub>2</sub> '''<nowiki>=></nowiki>''' statements;</dd></dl>...<br><dl><dd>«'''when others <nowiki>=></nowiki>''' statements;»</dd></dl>'''end'''{{ref|Ada_uncaught_exceptions|[b]}}</tt>
-| <tt>'''pragma Assert ('''«'''Check <nowiki>=></nowiki>'''» boolean_expression ««'''Message =>'''» string_expression»''')'''<br><br>[function <nowiki>|</nowiki> procedure <nowiki>|</nowiki> entry] '''with'''<dl><dd>'''Pre <nowiki>=></nowiki>''' boolean_expression</dd><dd>'''Post <nowiki>=></nowiki>''' boolean_expression</dd></dl><br>any_type '''with Type_Invariant <nowiki>=></nowiki>''' boolean_expression</tt>
-|-
-| [[APL (programming language)|APL]]
-| <tt>«string_expression» '''⎕SIGNAL''' number_expression</tt>
-| <tt>''':Trap''' number«s»_expression<dl><dd>statements</dd></dl>«''':Case''' number«s»_expression<dl><dd>statements»</dd></dl>...<br>«''':Else''' number«s»_expression<dl><dd>statements»</dd></dl>''':EndTrap'''</tt>
-| <tt>«string_expression» '''⎕SIGNAL 98/⍨~'''condition</tt>
-|-
-| C (C99)
-| <tt>'''[[longjmp]]('''state''',''' exception''');'''</tt>
-| <tt>'''switch ([[setjmp]]('''state''')) { case 0: '''instructions''' break; case '''exception''': '''instructions''' ... }'''</tt>
-| rowspan=2|<tt>'''assert('''condition''');'''</tt>
-|-
-| C++
-| rowspan=8|<tt>'''throw''' exception''';'''</tt>
-| <tt>'''try { '''instructions''' } catch''' «'''('''exception''')'''» '''{ '''instructions''' }''' ...</tt>
-|-
-| C#
-| <tt>'''try { '''instructions''' } catch''' «'''('''exception''')'''» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
-| <tt>'''Debug.Assert('''condition''');'''</tt>
-|-
-| Java
-| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
-| <tt>'''assert '''condition''' «: '''description'''»;'''</tt>
-|-
-| JavaScript
-| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' «'''finally { '''instructions''' }'''»</tt>
-| {{dunno}}
-|-
-| D
-| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
-| <tt>'''assert('''condition''');'''</tt>
-|-
-| PHP
-| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
-| <tt>'''assert('''condition''');'''</tt>
-|-
-| S-Lang
-| <tt>'''try { '''instructions''' } catch''' «exception» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
-| {{dunno}}
-|-
-| Windows PowerShell
-| <tt>'''trap''' «'''['''exception''']'''» '''{ '''instructions''' }''' ... instructions or '''try { '''instructions''' } catch''' «'''['''exception''']'''» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>
-| <tt>'''[Debug]::Assert('''condition''')'''</tt>
-|-
-| Objective-C
-| <tt>'''@throw''' exception''';'''</tt>
-| <tt>'''@try { '''instructions''' } @catch ('''exception''') { '''instructions''' }''' ... «'''@finally { '''instructions''' }'''»</tt>
-| <tt>'''NSAssert('''condition''', '''description''');'''</tt>
-|-
-| Swift
-| <tt>'''throw''' exception</tt> (2.x)
-| <tt>'''do { try '''expression''' ... '''instructions''' } catch '''exception''' { '''instructions''' }''' ...</tt> (2.x)
-| <tt>'''assert('''condition'''«, '''description'''»)'''</tt>
-|-
-| Perl
-| rowspan=2| <tt>'''die''' exception''';'''</tt>
-| <tt>'''eval { '''instructions''' }; if ($@) { '''instructions''' }'''</tt>
-| {{dunno}}
-|-
-| Perl 6
-| <tt>'''try { '''instructions''' CATCH { when '''exception''' { '''instructions''' } '''...'''}}'''</tt>
-| {{dunno}}
-|-
-| Ruby
-| <tt>'''raise''' exception</tt>
-| <tt>'''begin''' <dl><dd>instructions</dd></dl> '''rescue''' exception <dl><dd>instructions</dd></dl>... <br/> «'''else''' <dl><dd>instructions»</dd></dl> «'''ensure''' <dl><dd>instructions»</dd></dl> '''end'''</tt>
-|
-|-
-| Smalltalk
-| <tt>exception '''raise'''</tt>
-| <tt>instructionBlock '''on:''' exception '''do:''' handlerBlock</tt>
-| <tt>'''assert:''' conditionBlock</tt>
-|-
-| Common Lisp
-| <tt>'''(error '''"exception"''')''' or <br/> '''(error <dl><dd>'''type</dd><dd>arguments''')'''</dd></dl> or <br/> '''(error (make-condition<dl><dd>'''type</dd><dd>arguments'''))'''</dd></dl></tt>
-| <tt>'''(handler-case<dl><dd>(progn '''instructions''')</dd><dd>('''exception instructions''')</dd><dd>'''...''')'''</dd></dl> or <br/>'''(handler-bind<dl><dd>('''condition <dl><dd>'''(lambda</dd><dd>'''instructions</dd><dd>«'''invoke-restart''' restart args»'''))'''</dd></dl>...''')'''{{ref|a|[a]}}</dd></dl></tt>
-| <tt>'''(assert '''condition''')''' or <br/>'''(assert '''condition<dl><dd>«'''('''place''')'''</dd><dd>«error»»''')'''</dd></dl> or <br/>'''(check-type '''var type''')'''</tt>
-|-
-| Scheme (R<sup>6</sup>RS)
-| <tt>'''(raise '''exception''')'''</tt>
-| <tt>'''(guard (con ('''condition''' '''instructions''') '''...''') '''instructions''')'''</tt>
-| {{dunno}}
-|-
-| ISLISP
-| <tt>'''(error '''"error-string" objects''')''' or <br/> '''(signal-condition '''condition continuable''')'''</tt>
-| <tt>'''(with-handler<dl><dd>'''handler form*''')'''</tt>
-| {{dunno}}
-|-
-| Pascal
-| <tt>'''raise''' Exception.Create()</tt>
-| <tt>'''try''' Except '''on''' E: exception '''do begin ''' instructions ''' end; end;'''</tt>
-| {{dunno}}
-|-
-| Visual Basic
-| <tt>'''Err.Raise''' ERRORNUMBER</tt>
-| <tt>'''With New '''Try''': On Error Resume Next''' <dl><dd>OneInstruction</dd></dl> .Catch''': On Error GoTo 0: Select Case '''.Number <dl><dd>'''Case''' ERRORNUMBER</dd></dl> <dl><dd><dl><dd>instructions</dd></dl></dd></dl> '''End Select: End With'''</tt>
-<syntaxhighlight lang="vbnet" enclose="div">
-'*** Try class ***
-Private mstrDescription As String
-Private mlngNumber As Long
-Public Sub Catch()
-
-mstrDescription = Err.Description
-
-mlngNumber = Err.Number
-
-End Sub
-Public Property Get Number() As Long
-
-Number = mlngNumber
-
-End Property
-Public Property Get Description() As String
-
-Description = mstrDescription
-End Property
-</syntaxhighlight><ref>{{cite web|url=https://sites.google.com/site/truetryforvisualbasic/|title=Try-Catch for VB|author=|date=|work=google.com|accessdate=30 January 2017}}</ref>
-| <tt>'''Debug.Assert''' condition</tt>
-|-
-| Visual Basic .NET
-| <tt>'''Throw''' exception</tt>
-| <tt>'''Try''' <dl><dd>instructions</dd></dl> '''Catch''' «exception» «'''When''' condition» <dl><dd>instructions</dd></dl> ... <br/> «'''Finally''' <dl><dd>instructions»</dd></dl> '''End Try'''</tt>
-| <tt>'''Debug.Assert('''condition''')'''</tt>
-|-
-| Xojo
-| <tt>'''Raise''' exception</tt>
-| <tt>'''Try''' <dl><dd>instructions</dd></dl> '''Catch''' «exception»<dl><dd>instructions</dd></dl> ... <br/> «'''Finally''' <dl><dd>instructions»</dd></dl> '''End Try'''</tt>
-| {{n/a}}
-|-
-| Python
-| <tt>'''raise''' exception</tt>
-| <tt>'''try:''' <br/> {{keypress|Tab}} instructions <br/> '''except''' «exception»''':''' <br/> {{keypress|Tab}} instructions <br/> ... <br/> «'''else:''' <br/> {{keypress|Tab}} instructions» <br/> «'''finally:''' <br/> {{keypress|Tab}} instructions»</tt>
-| <tt>'''assert '''condition</tt>
-|-
-| Fortran
-| colspan=3 {{n/a}}
-|-
-| Forth
-| <tt>code''' THROW'''</tt>
-| <tt>xt''' CATCH''' ( code or 0 )</tt>
-| {{n/a}}
-|-
-| OCaml
-| rowspan=2| <tt>'''raise''' exception</tt>
-| <tt>'''try''' expression '''with''' pattern '''->''' expression ...</tt>
-| rowspan=2| <tt>'''assert''' condition</tt>
-|-
-| F#
-| <tt>'''try''' expression '''with''' pattern '''->''' expression ... <br/> or <br/>'''try''' expression '''finally''' expression</tt>
-|-
-| Standard ML
-| <tt>'''raise''' exception «arg»</tt>
-| <tt>expression '''handle''' pattern '''=>''' expression ...</tt>
-|
-|-
-| Haskell (GHC)
-| <tt>'''throw''' exception <br/> ''or'' <br/> '''throwError''' expression</tt>
-| <tt>'''catch''' tryExpression catchExpression <br/> ''or'' <br/> '''catchError''' tryExpression catchExpression</tt>
-| <tt>'''assert''' condition expression</tt>
-|-
-| COBOL
-| <tt>'''RAISE''' «'''EXCEPTION'''» exception</tt>
-| <tt>'''USE''' «'''AFTER'''» '''EXCEPTION OBJECT''' class-name'''.''' or<br/>
-'''USE''' «'''AFTER'''» '''EO''' class-name'''.''' or<br/>
-'''USE''' «'''AFTER'''» '''EXCEPTION CONDITION''' exception-name «'''FILE''' file-name»'''.''' or<br/>
-'''USE''' «'''AFTER'''» '''EC''' exception-name «'''FILE''' file-name»'''.'''</tt>
-| {{n/a}}
-|}
-
-{{note|common lisp restarts|a}} Common Lisp allows <code>with-simple-restart</code>, <code>restart-case</code> and <code>restart-bind</code> to define restarts for use with <code>invoke-restart</code>. Unhandled conditions may cause the implementation to show a restarts menu to the user before unwinding the stack.
-
-{{note|Ada_uncaught_exceptions|b}} Uncaught exceptions are propagated to the innermost dynamically enclosing execution. Exceptions are not propagated across tasks (unless these tasks are currently synchronised in a rendezvous).
-
-=== Other control flow statements ===
-{| class="wikitable"
-|-
-!
-! exit block(break)
-! continue
-! [[Label (programming language)|label]]
-! branch ([[goto]])
-! return value from generator
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>'''exit''' «loop_name» «'''when''' condition»</tt>
-| {{n/a}}
-| <tt>label''':'''</tt>
-| <tt>'''goto''' label</tt>
-| {{n/a}}
-|-
-| ALGOL 68
-| <tt>value '''exit''';</tt> ...
-| <tt>'''do''' statements; '''skip exit'''; label: statements '''od'''</tt>
-| <tt>label:</tt> ...
-| <tt>'''go to''' label; ...<br>
-'''goto''' label; ...<br>
-label; ...</tt>
-| <tt>''yield''(''value'')</tt>
-([[Callback (computer science)|Callback]])<ref>{{cite web|url=http://rosettacode.org/wiki/Prime_decomposition#ALGOL_68|title=Prime decomposition - Rosetta Code|author=|date=|work=rosettacode.org|accessdate=30 January 2017}}</ref>
-|-
-| [[APL (programming language)|APL]]
-| <tt>''':Leave'''</tt>
-| <tt>''':Continue'''</tt>
-| <tt>label''':'''</tt>
-| <tt>'''→'''label<br>or<br>
-''':GoTo''' label</tt>
-| {{n/a}}
-|-
-| C (C99)
-| rowspan=5| <tt>'''break;'''</tt>
-| rowspan=5| <tt>'''continue;'''</tt>
-| rowspan=12| <tt>label''':'''</tt>
-| rowspan=5| <tt>'''goto''' label''';'''</tt>
-| rowspan=4 {{n/a}}
-|-
-| Objective-C
-|-
-| C++ (STL)
-|-
-| D
-|-
-| C#
-| <tt>'''yield return''' value''';'''</tt>
-|-
-| Java
-| rowspan=2| <tt>'''break''' «label»''';'''</tt>
-| rowspan=2| <tt>'''continue''' «label»''';'''</tt>
-| rowspan=2 {{n/a}}
-|
-|-
-| JavaScript
-| <tt>'''yield''' value«;»</tt>
-|-
-| PHP
-| <tt>'''break''' «levels»''';'''</tt>
-| <tt>'''continue''' «levels»''';'''</tt>
-| rowspan=3| <tt>'''goto''' label''';'''</tt>
-| <tt>'''yield''' «key <nowiki>=></nowiki>» value;</tt>
-|-
-| Perl
-| rowspan=2| <tt>'''last''' «label»''';'''</tt>
-| rowspan=2| <tt>'''next''' «label»''';'''</tt>
-|
-|-
-| Perl 6
-|
-|-
-| Go
-| <tt>'''break''' «label»</tt>
-| <tt>'''continue''' «label»</tt>
-| <tt>'''goto''' label</tt>
-|
-|-
-| Swift
-| <tt>'''break''' «label»</tt>
-| <tt>'''continue''' «label»</tt>
-| {{n/a}}
-|
-|-
-| Bash shell
-| <tt>'''break''' «levels»</tt>
-| <tt>'''continue''' «levels»</tt>
-| {{n/a}}
-| {{n/a}}
-
-| {{n/a}}
-|-
-| Common Lisp
-| <tt>'''(return)''' or <br/> '''(return-from '''block''')''' or <br/> '''(loop-finish)'''</tt>
-|
-| <tt>'''(tagbody '''tag<dl><dd><dl><dd>...</dd><dd>tag</dd></dl>...''')'''</tt>
-| <tt>'''(go '''tag''')'''</tt>
-|
-|-
-| Scheme
-|
-|
-|
-|
-|
-|-
-| ISLISP
-| <tt>'''(return-from '''block''')'''</tt>
-|
-| <tt>'''(tagbody '''tag<dl><dd><dl><dd>...</dd><dd>tag</dd></dl>...''')'''</tt>
-| <tt>'''(go '''tag''')'''</tt>
-|
-|-
-| Pascal(ISO)
-| colspan=2 {{n/a}}
-| rowspan=2| <tt>label''':'''</tt>{{ref|Pascal's declarations|[a]}}
-| rowspan=2| <tt>'''goto''' label''';'''</tt>
-| rowspan=5 {{n/a}}
-|-
-| Pascal(FPC)
-| <tt>'''break;'''</tt>
-| <tt>'''continue;'''</tt>
-|-
-| Visual Basic
-| rowspan=3| <tt>'''Exit''' block</tt>
-| {{n/a}}
-| rowspan=3| <tt>label''':'''</tt>
-| rowspan=3| <tt>'''GoTo''' label</tt>
-|-
-| Visual Basic .NET
-| rowspan=2| <tt>'''Continue''' block</tt>
-|-
-| Xojo
-|-
-| Python
-| <tt>'''break'''</tt>
-| <tt>'''continue'''</tt>
-| colspan=2 {{n/a}}
-| <tt>'''yield '''value</tt>
-|-
-| RPG IV
-| <tt>'''LEAVE;'''</tt>
-| <tt>'''ITER;'''</tt>
-|
-|
-|
-|-
-| S-Lang
-| <tt>'''break;'''</tt>
-| <tt>'''continue;'''</tt>
-|
-|
-|
-|-
-| Fortran
-| <tt>'''EXIT'''</tt>
-| <tt>'''CYCLE'''</tt>
-| <tt>label</tt>{{ref|Fortran label|[b]}}
-| <tt>'''GOTO''' label</tt>
-| {{n/a}}
-|-
-| Ruby
-| <tt>'''break'''</tt>
-| <tt>'''next'''</tt>
-|
-|
-|
-|-
-| Windows PowerShell
-| <tt>'''break''' «label»</tt>
-| <tt>'''continue'''</tt>
-|
-|
-|
-|-
-| OCaml
-| rowspan=4 colspan=4 {{n/a}}
-|
-|-
-| F#
-|
-|-
-| Standard ML
-|
-|-
-| Haskell (GHC)
-|
-|-
-| COBOL
-| <tt>'''EXIT PERFORM''' or '''EXIT PARAGRAPH''' or '''EXIT SECTION''' or '''EXIT.'''</tt>
-| <tt>'''EXIT PERFORM CYCLE'''</tt>
-| <tt>label «'''SECTION'''»'''.'''</tt>
-| <tt>'''GO TO''' label</tt>
-| {{n/a}}
-|-
-| Ya
-| <tt>'''break''' «from where»''';'''</tt> f.e.<br>
-<tt>'''break for switch;'''</tt>
-| <tt>'''continue''' «to where»''';'''</tt> f.e.<br>
-<tt>'''continue for switch;'''</tt>
-| <tt>''':'''label</tt>
-| <tt>'''goto :'''label''';'''</tt>
-| {{n/a}}
-|}
-{{note|Pascal's declarations|a}} Pascal has declaration blocks. See [[Comparison of programming languages (basic instructions)#Functions]].
-<br/>{{note|Fortran label|b}} label must be a number between 1 and 99999.
-
-== [[Subroutine|Functions]] ==
-See [[Reflection (computer science)|reflection]] for calling and declaring functions by strings.
-{| class="wikitable"
-|- valign="top"
-!
-! calling a function
-! basic/void function
-! value-returning function
-! required [[main function]]
-|- valign="top"
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>''foo'' «(parameters)»</tt>
-| <tt>'''procedure''' ''foo'' «(parameters)» '''is begin''' statements '''end''' foo</tt>
-| <tt>'''function''' ''foo'' «(parameters)» '''return''' type '''is begin''' statements '''end''' foo</tt>
-| {{n/a}}
-|- valign="top"
-| [[ALGOL 68]]
-|<tt>''foo''«(parameters)»;</tt>
-|<tt>'''proc''' ''foo'' = «(parameters)» [[void type|void]]: ( ''instructions'' );</tt>
-|<tt>'''proc''' ''foo'' = «(parameters)» '''rettype''': ( ''instructions ...; retvalue'' );</tt>
-| {{n/a}}
-|- valign="top"
-| [[APL (programming language)|APL]]
-| <tt>«parameters» ''foo'' parameters</tt>
-| <tt>''foo''←'''{''' statements '''}'''</tt>
-| <tt>''foo''←'''{''' statements '''}'''</tt>
-| {{n/a}}
-|- valign="top"
-| C (C99)
-| rowspan=9| <tt>'''foo('''«parameters»''')'''</tt>
-| rowspan=6| <tt>'''[[void type|void]] foo('''«parameters»''') { '''instructions''' }'''</tt>
-| rowspan=6| <tt>type '''foo('''«parameters»''') { '''instructions ... '''return''' value'''; }'''</tt>
-| rowspan=3| <tt>«global declarations» <br/> '''int main('''«'''int argc, char *argv[]'''»''') { <dl><dd>'''instructions'''</dd></dl> }'''</tt>
-|- valign="top"
-| Objective-C
-|- valign="top"
-| C++ (STL)
-|- valign="top"
-| C#
-| <tt>'''static void Main('''«'''string[] args'''»''') { '''instructions''' }''' or<br/> '''static int Main('''«'''string[] args'''»''') { '''instructions''' }'''</tt>
-|- valign="top"
-| Java
-| <tt>'''public static void main(String[] args) { '''instructions''' }''' or<br/> '''public static void main(String[[variadic function|...]] args) { '''instructions''' }'''</tt>
-|- valign="top"
-| D
-| <tt>'''int main('''«'''char[][] args'''»''') { '''instructions'''}''' or<br /> '''int main('''«'''string[] args'''»''') { '''instructions'''}''' or<br /> '''void main('''«'''char[][] args'''»''') { '''instructions'''}''' or<br /> '''void main('''«'''string[] args'''»''') { '''instructions'''}'''</tt>
-|- valign="top"
-| JavaScript
-| <tt>'''function foo('''«parameters»''') { '''instructions''' }''' or<br/> '''var foo = function ('''«parameters»''') {'''instructions''' }''' or<br/> '''var foo = new Function ('''«'''"'''parameter'''",''' ... ''',"'''last parameter'''"'''»''' "'''instructions'''");'''</tt>
-| <tt>'''function foo('''«parameters»''') { '''instructions ... '''return''' value'''; }'''</tt>
-| {{n/a}}
-|- valign="top"
-| Go
-| <tt>'''func foo('''«parameters»''') { '''instructions''' }'''</tt>
-| <tt>'''func foo('''«parameters»''') '''type''' { '''instructions ... '''return''' value''' }'''</tt>
-| <tt>'''func main() { '''instructions''' }'''</tt>
-|- valign="top"
-| Swift
-| <tt>'''func foo('''«parameters»''') { '''instructions''' }'''</tt>
-| <tt>'''func foo('''«parameters»''') -> '''type''' { '''instructions ... '''return''' value''' }'''</tt>
-| {{n/a}}
-|- valign="top"
-| Common Lisp
-| rowspan=3| <tt>'''(foo '''«parameters»''')'''</tt>
-| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>instructions''')'''</dd></dl> or <br/>'''(setf (symbol-function <nowiki>'</nowiki>'''symbol''')'''<dl><dd>lambda''')'''</dd></dl></tt>
-| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>...</dd><dd>value''')'''</dd></dl></tt>
-| rowspan=3 {{n/a}}
-|- valign="top"
-| Scheme
-| <tt>'''(define (foo '''parameters''')''' instructions''')''' or <br/> '''(define foo ([[anonymous function|lambda]] ('''parameters''')''' instructions'''))'''</tt>
-| <tt>'''(define (foo '''parameters''')''' instructions... return_value''')''' or <br/> '''(define foo ([[anonymous function|lambda]] ('''parameters''')''' instructions... return_value'''))'''</tt>
-|- valign="top"
-| ISLISP
-| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>instructions''')'''</dd></dl></tt>
-| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>...</dd><dd>value''')'''</dd></dl></tt>
-|- valign="top"
-| Pascal
-| <tt>'''foo'''«'''('''parameters''')'''»</tt>
-| <tt>'''procedure foo'''«'''('''parameters''')'''»''';''' «'''forward;'''»{{ref|forward declaration|[a]}}<br/>
-«'''label'''<dl><dd>label declarations»</dd></dl>
-«'''const'''<dl><dd>constant declarations»</dd></dl>
-«'''type'''<dl><dd>type declarations»</dd></dl>
-«'''var'''<dl><dd>variable declarations»</dd></dl>
-«local function declarations»<br/>'''begin'''<dl><dd>instructions</dd></dl>'''end;'''</tt>
-| <tt>'''function foo'''«'''('''parameters''')'''»''': '''type'''; '''«'''forward;'''»{{ref|forward declaration|[a]}}<br/>
-«'''label'''<dl><dd>label declarations»</dd></dl>
-«'''const'''<dl><dd>constant declarations»</dd></dl>
-«'''type'''<dl><dd>type declarations»</dd></dl>
-«'''var'''<dl><dd>variable declarations»</dd></dl>
-«local function declarations»<br/>'''begin'''<dl><dd> instructions'''; <br/> foo := '''value</dd></dl>'''end;'''</tt>
-| <tt>'''program''' name''';'''<br/>
-«'''label'''<dl><dd>label declarations»</dd></dl>
-«'''const'''<dl><dd>constant declarations»</dd></dl>
-«'''type'''<dl><dd>type declarations»</dd></dl>
-«'''var'''<dl><dd>variable declarations»</dd></dl>
-«function declarations»<br/>'''begin'''<dl><dd>instructions</dd></dl> '''end.'''</tt> <!--somewhat of a technicality-->
-|- valign="top"
-| Visual Basic
-| rowspan=3| <tt>'''Foo('''«parameters»''')'''</tt>
-| rowspan=3| <tt>'''Sub Foo('''«parameters»''') <dl><dd> '''instructions''' </dd></dl> End Sub'''</tt>
-| <tt>'''Function Foo('''«parameters»''') As '''type <dl><dd>instructions<br/> '''Foo = '''value</dd></dl>'''End Function'''</tt>
-| <tt>'''Sub Main()'''<dl><dd>instructions</dd></dl>'''End Sub'''</tt>
-|- valign="top"
-| Visual Basic .NET
-| rowspan=2| <tt>'''Function Foo('''«parameters»''') As '''type <dl><dd>instructions<br/>'''Return '''value</dd></dl>'''End Function'''</tt>
-| rowspan=2| <tt>'''Sub Main('''«'''ByVal CmdArgs() As String'''»''') <dl><dd>'''instructions'''</dd></dl> End Sub'''<br/>or<br/> '''Function Main('''«'''ByVal CmdArgs() As String'''»''') As Integer <dl><dd>'''instructions'''</dd></dl>End Function'''</tt>
-|- valign="top"
-| Xojo
-|- valign="top"
-| Python
-| <tt>'''foo('''«parameters»''')'''</tt>
-| <tt>'''def foo('''«parameters»'''):''' <br/> {{keypress|Tab}} instructions </tt>
-| <tt>'''def foo('''«parameters»'''):''' <br/> {{keypress|Tab}} instructions <br/> {{keypress|Tab}} '''return''' value</tt>
-| {{n/a}}
-|- valign="top"
-| S-Lang
-| <tt>'''foo('''«parameters» «;qualifiers»''')'''</tt>
-| <tt>'''define foo ('''«parameters»''') { '''instructions''' }'''</tt>
-| <tt>'''define foo ('''«parameters»''') { '''instructions ... '''return '''value'''; }'''</tt>
-| <tt>'''public define slsh_main () { '''instructions''' }'''</tt>
-|- valign="top"
-| Fortran
-| <tt>'''foo ('''«arguments»''') <br> CALL sub_foo ('''«arguments»''')'''{{ref|Fortran arguments|[c]}}</tt>
-| <tt>'''SUBROUTINE sub_foo ('''«arguments»''') <dl><dd> '''instructions''' </dd></dl> END SUBROUTINE'''{{ref|Fortran arguments|[c]}}</tt>
-| <tt>type''' FUNCTION foo ('''«arguments»''') <dl><dd> '''instructions''' <br/> ... <br/> foo '''= value''' </dd></dl> END FUNCTION'''{{ref|Fortran arguments|[c]}}</tt>
-| <tt>'''PROGRAM '''main''' <dl><dd> '''instructions''' </dd></dl> END PROGRAM'''</tt>
-|- valign="top"
-| Forth
-| <tt>«parameters»''' FOO'''</tt>
-| <tt>''': FOO ''' « ''stack effect comment:'' '''( '''before '''-- )''' » ''' <dl><dd> '''instructions''' </dd></dl> ;'''</tt>
-| <tt>''': FOO ''' « ''stack effect comment:'' '''( '''before '''--''' after ''')''' » ''' <dl><dd> '''instructions''' </dd></dl> ;'''</tt>
-| {{n/a}}
-|- valign="top"
-| PHP
-| <tt>'''foo('''«parameters»''')'''</tt>
-| <tt>'''function foo('''«parameters»''') { '''instructions''' }'''</tt>
-| <tt>'''function foo('''«parameters»''') { '''instructions''' ... return '''value'''; }'''</tt>
-| rowspan=4 {{n/a}}
-|- valign="top"
-| Perl
-| <tt>'''foo('''«parameters»''')''' or <br/> '''&foo'''«'''('''parameters''')'''»</tt>
-| <tt>'''sub foo { '''«'''my ('''parameters''') = @_;'''»''' '''instructions''' }'''</tt>
-| <tt>'''sub foo { '''«'''my ('''parameters''') = @_;'''»''' '''instructions'''... '''«'''return'''»''' '''value'''; }'''</tt>
-|- valign="top"
-| Perl 6
-| <tt>'''foo('''«parameters»''')''' or <br/> '''&foo'''«'''('''parameters''')'''»</tt>
-| <tt>«'''multi''' »'''sub foo('''parameters''') { '''instructions''' }'''</tt>
-| <tt>«'''our''' «type» »«'''multi''' »'''sub foo('''parameters''') { '''instructions'''... '''«'''return'''»''' '''value'''; }'''</tt>
-|- valign="top"
-| Ruby
-| rowspan=2| <tt>'''foo'''«'''('''parameters''')'''»</tt>
-| <tt>'''def foo'''«'''('''parameters''')'''» <dl><dd>instructions </dd></dl> '''end'''</tt>
-| <tt>'''def foo'''«'''('''parameters''')'''» <dl><dd>instructions <br/> «'''return'''» value </dd></dl> '''end'''</tt>
-|- valign="top"
-| Scala
-| <tt>'''def foo'''«'''('''parameters''')'''»«''': Unit ='''» '''{''' instructions '''}'''</tt>
-| <tt>'''def foo'''«'''('''parameters''')'''»«''':''' type» '''= {''' instructions ... «'''return'''» value '''}'''</tt>
-| <tt>'''def main(args: Array[String]) {''' instructions '''}'''</tt>
-|- valign="top"
-| Windows PowerShell
-| <tt>'''foo''' «parameters»</tt>
-| <tt>'''function foo ''' { '''instructions''' };'''<br/>or<br/>'''function foo { '''«'''param('''parameters''')'''»''' '''instructions''' }'''</tt>
-| <tt>'''function foo '''«'''('''parameters''')'''» ''' { '''instructions''' ''' … '''return '''value''' };''' or<br/>'''function foo { '''«'''param('''parameters''')'''» '''instructions''' …''' return '''value''' }'''</tt>
-| rowspan=4 {{n/a}}
-|- valign="top"
-| rowspan=2|Bash shell
-| rowspan=2|<tt>'''foo''' «parameters»</tt>
-| <poem><tt>'''function foo {'''
-{{space|4}}instructions
-'''}'''
-</tt>or<tt>
-'''foo () {'''
-{{space|4}}instructions
-''' }'''</tt></poem>
-| <poem><tt>'''function foo {'''
-{{space|4}}instructions
-{{space|4}}'''return''' «exit_code»
-'''}'''
-</tt>or<tt>
-'''foo () {'''
-{{space|4}}instructions
-{{space|4}}'''return''' «exit_code»
-''' }'''</tt></poem>
-|- valign="top"
-| colspan=2|
-* parameters
-** <tt>'''$'''n</tt> ('''$1''', '''$2''', '''$3''', ...)
-** <tt>'''$@'''</tt> (all parameters)
-** <tt>'''$#'''</tt> (the number of parameters)
-** <tt>'''$0'''</tt> (this function name)
-|- valign="top"
-| OCaml
-| rowspan=4| <tt>'''foo '''parameters</tt>
-| rowspan=2| <tt>'''let''' «'''rec'''» '''foo''' parameters '''=''' instructions</tt>
-| rowspan=2| <tt>'''let''' «'''rec'''» '''foo''' parameters '''=''' instructions... return_value</tt>
-|- valign="top"
-| F#
-| <tt>'''[<EntryPoint>] let main args =''' instructions</tt>
-|- valign="top"
-| Standard ML
-| <tt>'''fun foo''' parameters '''= (''' instructions ''')'''</tt>
-| <tt>'''fun foo''' parameters '''= (''' instructions... return_value ''')'''</tt>
-|
-|- valign="top"
-| Haskell
-| <tt>'''foo''' parameters '''= do'''<br/>{{keypress|Tab}} instructions</tt>
-| <tt>'''foo''' parameters '''=''' return_value <br/> or <br/> '''foo''' parameters '''= do'''<br/>{{keypress|Tab}} instructions<br/>{{keypress|Tab}} '''return''' value</tt>
-| <tt>«'''main :: IO ()'''» <br/> '''main = do''' instructions</tt>
-|- valign="top"
-| Eiffel
-| <tt>'''foo ('''«parameters»''')'''</tt>
-| <tt>'''foo ('''«parameters»''')'''<br/><dl><dd>'''require''' <dl><dd>preconditions</dd></dl> '''do''' <dl><dd>instructions</dd></dl> '''ensure''' <dl><dd>postconditions</dd></dl> '''end'''</dd></dl></tt>
-| <tt>'''foo ('''«parameters»''')''': type<br/><dl><dd>'''require''' <dl><dd>preconditions</dd></dl> '''do''' <dl><dd>instructions</dd><dd>'''Result''' := value</dd></dl> '''ensure''' <dl><dd>postconditions</dd></dl> '''end'''</dd></dl></tt>
-| {{ref|root class and feature|[b]}}
-|- valign="top"
-| rowspan=2| CoffeeScript
-| <tt>'''foo()'''</tt>
-| <tt>'''foo = <nowiki>-></nowiki>'''</tt>
-| <tt>'''foo = <nowiki>-></nowiki>''' value</tt>
-| rowspan=2 {{n/a}}
-|- valign="top"
-| <tt>'''foo''' parameters</tt>
-| <tt>'''foo = <nowiki>() -></nowiki>'''</tt>
-| <tt>'''foo = (''' parameters ''') <nowiki>-></nowiki>''' value</tt>
-|- valign="top"
-| rowspan=2 | COBOL
-| <tt>'''CALL''' '''"'''foo'''"''' «'''USING''' parameters» <dl><dd> «exception-handling» </dd></dl> «'''END-CALL'''»</tt>{{ref|COBOL calling programs|[d]}}
-| <tt>«'''IDENTIFICATION DIVISION.'''»<br/>
-'''PROGRAM-ID.''' foo'''.'''<br/>
-«other divisions...»<br/>
-'''PROCEDURE DIVISION''' «'''USING''' parameters»'''.'''<br/>
-<dl><dd> instructions'''.'''</dd></dl> </tt>
-| rowspan=2 | <tt>«'''IDENTIFICATION DIVISION.'''»<br/>
-'''PROGRAM-ID'''/'''FUNCTION-ID.''' foo'''.'''<br/>
-«other divisions...»<br/>
-'''DATA DIVISION.'''<br/>
-«other sections...»<br/>
-'''LINKAGE SECTION.'''<br/>
-«parameter definitions...»<br/>
-variable-to-return definition<br/>
-«other sections...»<br/>
-'''PROCEDURE DIVISION''' «'''USING''' parameters» '''RETURNING''' variable-to-return'''.'''<br/>
-<dl><dd> instructions'''.'''</dd></dl></tt>
-| rowspan=2 {{n/a}}
-|-
-|<tt>«'''FUNCTION'''» foo«(«parameters»)»</tt>
-| {{n/a}}
-|}
-{{note|forward declaration|a}} Pascal requires "<tt>forward;</tt>" for [[forward declaration]]s.<br/>
-{{note|root class and feature|b}} Eiffel allows the specification of an application's root class and feature.<br/>
-{{note|Fortran arguments|c}} In Fortran, function/subroutine parameters are called arguments (since <tt>PARAMETER</tt> is a language keyword); the <tt>CALL</tt> keyword is required for subroutines.<br/>
-{{note|COBOL calling programs|d}} Instead of using <tt>"foo"</tt>, a string variable may be used instead containing the same value.
-
-== [[Type conversion]]s{{anchor|Data conversions}} ==
-Where ''string'' is a signed decimal number:
-{| class="wikitable"
-|-
-!
-! string to integer
-! string to long integer
-! string to floating point
-! integer to string
-! floating point to string
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt> '''Integer'Value ('''string_expression''')'''</tt>
-| <tt> '''Long_Integer'Value ('''string_expression''')'''</tt>
-| <tt> '''Float'Value ('''string_expression''')'''</tt>
-| <tt> '''Integer'Image ('''integer_expression''')'''</tt>
-| <tt> '''Float'Image ('''float_expression''')'''</tt>
-|-
-| rowspan=3 | [[ALGOL 68]] with general, and then specific formats
-| colspan=5 align=center| With prior declarations and association of: <tt>'''string''' buf := "12345678.9012e34 "; '''file''' proxy; associate(proxy, buf);</tt>
-|-
-| <pre>get(proxy, ivar);</pre>
-| <pre>get(proxy, livar);</pre>
-| <pre>get(proxy, rvar);</pre>
-| <pre>put(proxy, ival);</pre>
-| <pre>put(proxy, rval);</pre>
-|-
-| <pre>getf(proxy, ($g$, ivar));</pre><br/>orv
-<pre>getf(proxy, ($dddd$, ivar));</pre>
-| <pre>getf(proxy, ($g$, livar));</pre><br/>or<br/>
-<pre>getf(proxy, ($8d$, livar));</pre>
-| <pre>getf(proxy, ($g$, rvar));</pre><br/>or<br/>
-<pre>getf(proxy, ($8d.4dE2d$, rvar));</pre>
-| <pre>putf(proxy, ($g$, ival));</pre><br/>or<br/>
-<pre>putf(proxy, ($4d$, ival));</pre>
-| <pre>putf(proxy, ($g(width, places, exp)$, rval));</pre><br/>or<br/>
-<pre>putf(proxy, ($8d.4dE2d$, rval));</pre><br/>etc.
-|-
-| [[APL (programming language)|APL]]
-| <tt> '''⍎'''string_expression</tt>
-| <tt> '''⍎'''string_expression</tt>
-| <tt> '''⍎'''string_expression</tt>
-| <tt> '''⍕'''integer_expression</tt>
-| <tt> '''⍕'''float_expression</tt>
-|-
-| C (C99)
-| <tt> integer '''= [[atoi]]('''string''');'''</tt>
-| <tt> long '''= [[atol (programming)|atol]]('''string''');'''</tt>
-| <tt> float '''= [[atof]]('''string''');'''</tt>
-| <tt> '''[[sprintf]]('''string''', "%i", '''integer''');'''</tt>
-| <tt> '''[[sprintf]]('''string''', "%f", '''float''');'''</tt>
-|-
-| Objective-C
-| <tt> integer '''= ['''string''' intValue];'''</tt>
-| <tt> long '''= ['''string''' longLongValue];'''</tt>
-| <tt> float '''= ['''string''' doubleValue];'''</tt>
-| <tt> string '''= [NSString stringWithFormat<wbr/>:@"%i", '''integer'''];'''</tt>
-| <tt> string '''= [NSString stringWithFormat<wbr/>:@"%f", '''float'''];'''</tt>
-|-
-| C++ (STL)
-| colspan=3| <tt>«'''std::'''»'''istringstream('''string''') >> '''number;</tt>
-| colspan=2| <tt>«'''std::'''»'''ostringstream '''o''';''' o''' << '''number'''; '''string '''= '''o'''.str();'''</tt>
-|-
-| C++11
-| <tt> integer '''= «'''std::'''»stoi('''string''');'''</tt>
-| <tt> long '''= «'''std::'''»stol('''string''');'''</tt>
-| <tt> float '''= «'''std::'''»stof('''string''');'''
-double '''= «'''std::'''»stod('''string''');''' </tt>
-| colspan=2| <tt>string '''= «'''std::'''»to_string('''number''');'''</tt>
-|-
-| C#
-| <tt> integer '''= int.Parse<wbr/>('''string''');'''</tt>
-| <tt> long '''= long.Parse<wbr/>('''string''');'''</tt>
-| <tt> float '''= float.Parse<wbr/>('''string''');''' or<br/> double '''= double.Parse<wbr/>('''string''');'''</tt>
-| colspan=2| <tt>string '''= '''number'''<wbr/>.ToString();'''</tt>
-|-
-| D
-| <tt> integer '''= std.conv.to!int<wbr/>('''string''')'''</tt>
-| <tt> long '''= std.conv.to!long<wbr/>('''string''')'''</tt>
-| <tt> float '''= std.conv.to!float<wbr/>('''string''')''' or<br/> double '''= std.conv.to!double<wbr/>('''string''')'''</tt>
-| colspan=2| <tt> string '''= std.conv.to!string<wbr/>('''number''')'''</tt>
-|-
-| Java
-| <tt> integer '''= Integer.parseInt<wbr/>('''string''');'''</tt>
-| <tt> long''' = Long.parseLong<wbr/>('''string''');'''</tt>
-| <tt> float''' = Float.parseFloat<wbr/>('''string''');''' or<br/> double '''= Double.parseDouble<wbr/>('''string''');'''</tt>
-| <tt> string''' = Integer.toString<wbr/>('''integer''');''' or<br/> string''' = String.valueOf<wbr/>('''integer''');'''</tt>
-| <tt> string''' = Float.toString<wbr/>('''float''');''' or<br/> string''' = Double.toString<wbr/>('''double''');'''</tt>
-|-
-| <tt> JavaScript{{ref|JavaScript's technicalities|[a]}}</tt>
-| colspan=2| <tt> integer '''= parseInt('''string''');'''</tt>
-| <tt> float '''= parseFloat('''string''');''' or<br/> float''' = new Number ('''string''')''' or<br/> float''' = Number ('''string''')''' or<br/> float '''= +'''string</tt>
-| colspan=2| <tt> string''' = '''number'''.toString ();''' or<br/> string '''= new String ('''number''');''' or<br/> string '''= String ('''number''');''' or<br/> string''' = '''number'''+"";'''</tt>
-|-
-| Go
-| <tt> integer''',''' error '''= strconv.Atoi('''string''')''' or<br /> integer''',''' error '''= strconv.ParseInt<wbr/>('''string''', 10, 0)'''</tt>
-| <tt> long''',''' error '''= strconv.ParseInt<wbr/>('''string''', 10, 64)'''</tt>
-| <tt> float''',''' error '''= strconv.ParseFloat<wbr/>('''string''', 64)'''</tt>
-| <tt> string '''= strconv.Itoa('''integer''')''' or<br/> string '''= strconv.FormatInt<wbr/>('''integer''', 10)''' or<br/> string '''= fmt.Sprint('''integer''')'''</tt>
-| <tt> string '''= strconv.FormatFloat<wbr/>('''float''')''' or<br/> string '''= fmt.Sprint<wbr/>('''float''')'''</tt>
-|-
-| Common Lisp
-| colspan=2| <tt>'''(setf''' integer '''(parse-integer '''string'''))'''</tt>
-| <tt> '''(setf''' float '''(read-from-string '''string'''))'''</tt>
-| colspan=2| <tt>'''(setf''' string '''(princ-to-string '''number'''))'''</tt>
-|-
-| Scheme
-| colspan=3| <tt>'''(define''' number '''(string->number '''string'''))'''</tt>
-| colspan=2| <tt>'''(define''' string '''(number->string '''number'''))'''</tt>
-|-
-| ISLISP
-| colspan=2| <tt>'''(setf''' integer '''(convert '''string''' <integer>))'''</tt>
-| <tt> '''(setf''' float '''(convert '''string''' <float>))'''</tt>
-| colspan=2| <tt>'''(setf''' string '''(convert '''number''' <string>))'''</tt>
-|-
-| Pascal <!-- Pascal or Delphi? -->
-| <tt> integer ''':= StrToInt('''string''');'''</tt>
-|
-| <tt> float ''':= StrToFloat('''string''');'''</tt>
-| <tt> string ''':= IntToStr('''integer''');'''</tt>
-| <tt> string ''':= FloatToStr('''float''');'''</tt>
-|-
-| Visual Basic
-| rowspan=2| <tt>integer''' = CInt('''string''')'''</tt>
-| rowspan=2| <tt>long''' = CLng('''string''')'''</tt>
-| rowspan=2| <tt>float''' = CSng('''string''')''' or<br/> double''' = CDbl('''string''')'''</tt>
-| <tt> rowspan=2 colspan=2|string''' = CStr('''number''')'''</tt>
-|-
-| Visual Basic .NET
-|-
-| Xojo
-| <tt>integer''' = Val('''string''')'''</tt>
-| <tt>long''' = Val('''string''')'''</tt>
-| <tt>double''' = Val('''string''')''' or<br/> double''' = CDbl('''string''')'''</tt>
-| colspan=2| <tt> string''' = CStr('''number''')''' or<br/> string''' = Str('''number''')</tt>
-|-
-| Python
-| <tt> integer''' = int('''string''')'''</tt>
-| <tt> long''' = long('''string''')'''</tt>
-| <tt> float''' = float('''string''')'''</tt>
-| colspan=2| <tt>string''' = str('''number''')'''</tt>
-|-
-| S-Lang
-| <tt> integer''' = [[atoi]]('''string''');'''</tt>
-| <tt> long''' = [[atol (programming)|atol]]('''string''');'''</tt>
-| <tt> float''' = [[atof]]('''string''');'''</tt>
-| colspan=2| <tt>string''' = string('''number''');'''</tt>
-|-
-| Fortran
-| colspan=3| <tt>'''READ('''string''','''format''') '''number</tt>
-| colspan=2| <tt>'''WRITE('''string''','''format''') '''number</tt>
-|-
-| PHP
-| colspan=2| <tt> integer '''= intval('''string''');''' or<br/> integer '''= (int)'''string''';'''</tt>
-| <tt> float '''= floatval('''string''');''' or<br/> float '''= (float)'''string''';'''</tt>
-| colspan=2| <tt> string '''= "'''number'''";''' or<br/> string '''= strval('''number''');''' or<br/> string '''= (string)'''number''';'''</tt>
-|-
-| Perl{{ref|Perl's technicalities|[b]}}
-| colspan=3| <tt> number '''= 0 +''' string;</tt>
-| colspan=2| <tt> string '''= "'''number'''";'''</tt>
-|-
-| Perl 6
-| colspan=3| <tt> number '''= +'''string;</tt>
-| colspan=2| <tt> string '''= ~'''number''';'''</tt>
-|-
-| Ruby
-| colspan=2| <tt> integer '''=''' string'''.to_i''' or<br/>integer '''= Integer('''string''')'''</tt>
-| <tt> float '''=''' string'''.to_f''' or<br/>float '''= Float('''string''')'''</tt>
-| colspan=2| <tt> string '''=''' number'''.to_s'''</tt>
-|-
-| Scala
-| <tt> integer '''=''' string'''.toInt'''</tt>
-| <tt> long '''=''' string'''.toLong'''</tt>
-| <tt> float '''=''' string'''.toFloat''' or<br/> double '''=''' string'''.toDouble'''</tt>
-| colspan=2| <tt>string '''= '''number'''.toString'''</tt>
-|-
-| Smalltalk
-| colspan=2| <tt> integer := Integer '''readFrom:''' string</tt>
-| <tt> float := Float '''readFrom:''' string</tt>
-| colspan=2| <tt> string := number '''asString'''</tt>
-|-
-| Windows PowerShell
-| <tt> integer''' = [int]'''string</tt>
-| <tt> long''' = [long]'''string</tt>
-| <tt> float''' = [float]'''string</tt>
-| colspan=2| <tt>string''' = [string]'''number''';''' or<br/>string''' = "'''number'''";''' or<br/>string''' = ('''number''').ToString()'''</tt>
-|-
-| OCaml
-| <tt> '''let''' integer''' = int_<wbr/>of_string '''string</tt>
-|
-| <tt> '''let''' float''' = float_<wbr/>of_string '''string</tt>
-| <tt> '''let''' string''' = string_<wbr/>of_int '''integer</tt>
-| <tt> '''let''' string''' = string_<wbr/>of_float '''float</tt>
-|-
-| F#
-| <tt> '''let''' integer''' = int '''string</tt>
-| <tt> '''let''' integer''' = int64 '''string</tt>
-| <tt> '''let''' float''' = float '''string</tt>
-| colspan=2| <tt> '''let''' string''' = string '''number</tt>
-|-
-| Standard ML
-| <tt> '''val''' integer''' = Int<wbr/>.fromString '''string</tt>
-|
-| <tt> '''val''' float''' = Real<wbr/>.fromString '''string</tt>
-| <tt> '''val''' string''' = Int<wbr/>.toString '''integer</tt>
-| <tt> '''val''' string''' = Real<wbr/>.toString '''float</tt>
-|-
-| Haskell (GHC)
-| colspan=3| <tt> number '''= read '''string</tt>
-| colspan=2| <tt> string '''= show '''number</tt>
-|-
-| COBOL
-| colspan=3 | <code>'''MOVE''' «'''FUNCTION'''» '''NUMVAL('''string''')'''{{ref|COBOL's NUMVAL alternatives|[c]}} '''TO''' number</code>
-| colspan=2 | <code>'''MOVE''' number '''TO''' numeric-edited</code>
-|-
-|}
-{{note|JavaScript's technicalities|a}} JavaScript only uses floating point numbers so there are some technicalities.<ref name="Javascript numbers"/>
-<br/>{{note|Perl's technicalities|b}} Perl doesn't have separate types. Strings and numbers are interchangeable.
-<br/>{{note|COBOL's NUMVAL alternatives|c}} <code>NUMVAL-C</code> or <code>NUMVAL-F</code> may be used instead of <code>NUMVAL</code>.
-
-== [[Standard streams|Standard stream I/O]] ==
-{| class="wikitable"
-|-
-! rowspan=2|
-! read from
-! colspan=2| write to
-|-
-! [[stdin]]
-! [[stdout]]
-! [[stderr]]
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>'''Get ('''x''')'''</tt>
-| <tt>'''Put ('''x''')'''</tt>
-| <tt>'''Put (Standard_Error, '''x''')'''</tt>
-|-
-| [[ALGOL 68]]
-| <tt>'''readf(('''$format$''', '''x'''));''' or <br/> '''getf(stand in, ('''$format$''', '''x'''));'''</tt>
-| <tt>'''[[printf]](('''$format$''', '''x'''));''' or <br/> '''putf(stand out, ('''$format$''', '''x'''));''' </tt>
-| <tt>'''putf(stand error, ('''$format$''', '''x'''));'''{{ref|ALGOL Unformatted|[a]}}</tt>
-|-
-| [[APL (programming language)|APL]]
-| <tt>x←'''⎕'''</tt>
-| <tt>'''⎕←'''x</tt>
-| <tt>'''⍞←'''x</tt>
-|-
-| C (C99)
-| <tt>'''[[scanf]]('''format''', &'''x''');''' or <br/> '''[[fscanf]](stdin, '''format''', &'''x''');''' {{ref|more c input|[b]}}</tt>
-| <tt>'''[[printf]]( '''format''', '''x''');''' or <br/> '''[[fprintf]](stdout, '''format''', '''x''');''' {{ref|more c output|[c]}}</tt>
-| <tt>'''[[fprintf]](stderr, '''format''', '''x''' );'''{{ref|more c error output|[d]}}</tt>
-|-
-| Objective-C
-| <tt>data = '''[[NSFileHandle fileHandleWithStandardInput] readDataToEndOfFile];'''</tt>
-| <tt>'''[[NSFileHandle fileHandleWithStandardOutput] writeData:'''data'''];'''</tt>
-| <tt>'''[[NSFileHandle fileHandleWithStandardError] writeData:'''data'''];'''</tt>
-|-
-| C++
-| <tt>[[iostream|«'''std::'''»'''cin''']] '''>>''' x''';''' or <br/> «'''std::'''»'''getline('''«'''std::'''»'''cin, '''str''');'''</tt>
-| <tt>[[iostream|«'''std::'''»'''cout''']] '''<<''' x''';'''</tt>
-| <tt>[[iostream|«'''std::'''»'''cerr''']] '''<<''' x''';''' or<br/> [[iostream|«'''std::'''»'''clog''']] '''<<''' x''';'''</tt>
-|-
-| C#
-| <tt>x ''' = Console.Read();''' or <br/> x '''= Console.ReadLine();'''</tt>
-| <tt>'''Console.Write('''«format''', '''»x''');''' or <br/> '''Console.WriteLine('''«format''', '''»x''');'''</tt>
-| <tt>'''Console.Error<wbr/>.Write('''«format''', '''»x''');''' or <br/> '''Console.Error<wbr/>.WriteLine('''«format''', '''»x''');'''</tt>
-|-
-| D
-| <tt>x = '''std.stdio.readln()'''</tt>
-| <tt>'''std.stdio.write('''x''')''' or <br /> '''std.stdio.writeln('''x''')''' or <br /> '''std.stdio.writef('''format''', '''x''')''' or <br /> '''std.stdio.writefln('''format''', '''x''')'''</tt>
-| <tt>'''stderr.write('''x''')''' or <br /> '''stderr.writeln('''x''')''' or <br /> '''std.stdio<wbr/>.writef(stderr, '''format''', '''x''')''' or <br /> '''std.stdio<wbr/>.writefln(stderr, '''format''', '''x''')'''</tt>
-|-
-| Java
-| <tt>x '''= System.in.read();''' or <br/> x '''= new Scanner(System.in)<wbr/>.nextInt();''' or <br/> x '''= new Scanner(System.in)<wbr/>.nextLine();'''</tt>
-| <tt>'''System.out.print('''x''');''' or <br/> '''System.out.[[printf]]('''format''', '''x''');''' or <br/> '''System.out.println('''x''');'''</tt>
-| <tt>'''System.err.print('''x''');''' or <br/> '''System.err.[[printf]]('''format''', '''x''');''' or <br/> '''System.err.println('''x''');'''</tt>
-|-
-| Go
-| <tt>'''fmt.Scan(&'''x''')''' or <br/> '''fmt.[[Scanf]]('''format''', &'''x''')''' or <br/> x = '''bufio.NewReader(os.Stdin)<wbr/>.ReadString('\n')'''</tt>
-| <tt>'''fmt.Println('''x''')''' or<br/> '''fmt.[[Printf]]('''format''', '''x''')'''</tt>
-| <tt>'''fmt.Fprintln(os{{Not a typo|.}}Stderr, '''x''')''' or<br/> '''fmt.[[Fprintf]](os{{Not a typo|.}}Stderr, '''format''', '''x''')'''</tt>
-|-
-| Swift
-| <tt>x = '''readLine()'''</tt> (2.x)
-| <tt>'''print('''x''')'''</tt> (2.x)<br /> <tt>'''println('''x''')'''</tt> (1.x)
-|
-|-
-| JavaScript<br/><small>[[Client-side JavaScript|Web Browser implementation]]</small>
-|
-| <tt>'''document.write('''x''')'''</tt>
-|
-|-
-| JavaScript<br/><small>[[Active Server Pages]]</small>
-|
-| <tt>'''Response.Write('''x''')'''</tt>
-|
-|-
-| JavaScript<br/><small>[[Windows Script Host]]</small>
-| <tt>x '''= WScript.StdIn.Read('''chars''')''' or<br/> x '''= WScript.StdIn.ReadLine()'''</tt>
-| <tt>'''WScript.Echo('''x''')''' or<br/> '''WScript.StdOut.Write('''x''')''' or<br/> '''WScript.StdOut.WriteLine('''x''')'''</tt>
-| <tt>'''WScript.StdErr.Write('''x''')''' or<br/> '''WScript.StdErr.WriteLine('''x''')'''</tt>
-|-
-| Common Lisp
-| <tt>'''(setf''' x '''(read-line))'''</tt>
-| <tt>'''(princ''' x''')''' or<br/> '''(format t '''format x''')'''</tt>
-| <tt>'''(princ''' x''' *error-output*)''' or<br/> '''(format *error-output* '''format x''')'''</tt>
-|-
-| Scheme (R<sup>6</sup>RS)
-| <tt>'''(define''' x''' (read-line))'''</tt>
-| <tt>'''(display''' x''')''' or<br/> '''(format #t '''format x''')'''</tt>
-| <tt>'''(display''' x''' (current-error-port))''' or<br/> '''(format (current-error-port) '''format x''')'''</tt>
-|-
-| ISLISP
-| <tt>'''(setf''' x '''(read-line))'''</tt>
-| <tt>'''(format (standard-output) '''format x''')'''</tt>
-| <tt>'''(format (error-output) '''format x''')'''</tt>
-|-
-| Pascal
-| <tt>'''read('''x''');''' or <br/> '''readln('''x''');'''</tt>
-| <tt>'''write('''x''');''' or <br/> '''writeln('''x''');'''</tt>
-| rowspan=2 {{n/a}}
-|-
-| Visual Basic
-| <tt>'''Input'''« prompt''','''»''' '''x'''</tt>
-| <tt>'''Print '''x or <br/> '''? '''x'''</tt>
-|-
-| Visual Basic .NET
-| <tt>x ''' = Console.Read()''' or <br/> x '''= Console.ReadLine()'''</tt>
-| <tt>'''Console.Write('''«format''', '''»x''')''' or <br/> '''Console.WriteLine('''«format''', '''»x''')'''</tt>
-| <tt>'''Console.Error<wbr/>.Write('''«format''', '''»x''')''' or <br/> '''Console.Error<wbr/>.WriteLine('''«format''', '''»x''')'''</tt>
-|-
-| Xojo
-| <tt>x ''' = StandardInputStream.Read()''' or <br/> x '''= StandardInputStreame.ReadLine()'''</tt>
-| <tt>'''StandardOutputStream.Write('''x''')''' or <br/> '''StandardOutputStream.WriteLine('''x''')'''</tt>
-| <tt>'''StdErr.Write('''x''')''' or <br/> '''StdErr.WriteLine('''x''')'''</tt>
-|-
-| Python 2.x
-| <tt>x '''= raw_input('''«prompt»''')'''</tt>
-| <tt>'''print''' x or <br/> '''sys.stdout.write('''x''')'''</tt>
-| <tt>'''print >> sys.stderr,''' x or <br/> '''sys.stderr.write('''x''')'''</tt>
-|-
-| Python 3.x
-| <tt>x '''= input('''«prompt»''')'''</tt>
-| <tt>'''print('''x«''', end=""'''»''')'''</tt>
-| <tt>'''print('''x«''', end=""'''»''', file=sys.stderr)'''</tt>
-|-
-| S-Lang
-| <tt>'''[[fgets]] (&'''x''', stdin)'''</tt>
-| <tt>'''[[fputs]] ('''x''', stdout)'''</tt>
-| <tt>'''[[fputs]] ('''x''', stderr)'''</tt>
-|-
-| Fortran
-| <tt>'''READ(*,'''format''') '''variable names''' or <br/> READ(INPUT_UNIT,'''format''') '''variable names'''{{ref|Fortran standard units|[e]}}</tt>
-| <tt>'''WRITE(*,'''format''') '''expressions''' or <br/>WRITE(OUTPUT_UNIT,'''format''') '''expressions'''{{ref|Fortran standard units|[e]}}</tt>
-| <tt>'''WRITE(ERROR_UNIT,'''format''') '''expressions{{ref|Fortran standard units|[e]}}</tt>
-|-
-| Forth
-| <tt>buffer length''' ACCEPT''' ( # chars read ) <br/>'''KEY''' ( char )</tt>
-| <tt>buffer length''' TYPE'''<br/>char''' EMIT'''</tt>
-| {{n/a}}
-|-
-| PHP
-| <tt>$x '''= [[fgets]](STDIN);''' or <br/> $x '''= [[fscanf]](STDIN, '''format''');'''</tt>
-| <tt>'''print '''x''';''' or <br/> '''[[echo (command)|echo]] '''x''';''' or <br/> '''[[printf]]('''format''', '''x''');'''</tt>
-| <tt>'''[[fprintf]](STDERR, '''format''', '''x''');'''</tt>
-|-
-| Perl
-| <tt>$x '''= <>;''' or <br/> $x '''= <STDIN>;'''</tt>
-| <tt>'''print '''x''';''' or <br/> '''[[printf]] '''format''', '''x''';'''</tt>
-| <tt>'''print STDERR '''x''';''' or <br/> '''[[printf]] STDERR '''format''', '''x''';'''</tt>
-|-
-| Perl 6
-| <tt>$x '''= $*IN.get;'''</tt>
-| <tt>x'''.print''' or<br/> x'''.say'''</tt>
-| <tt>x'''.note''' or<br/> '''$*ERR.print('''x''')''' or<br/> '''$*ERR.say('''x''')'''</tt>
-|-
-| Ruby
-| <tt>x '''= gets'''</tt>
-| <tt>'''puts''' x or<br/> '''[[printf]]('''format''', '''x''')'''</tt>
-| <tt>'''$stderr.puts('''x''')''' or<br/> '''$stderr.[[printf]]('''format''', '''x''')'''</tt>
-|-
-| Windows PowerShell
-| <tt>$x '''= Read-Host'''««''' -Prompt'''» text»''';''' or <br/> $x '''= [Console]::Read();''' or <br/> $x '''= [Console]::ReadLine()'''</tt>
-| <tt>x''';''' or <br/> '''Write-Output '''x''';''' or <br/> '''echo '''x</tt>
-| <tt>'''Write-Error '''x</tt>
-|-
-| OCaml
-| <tt>'''let''' x '''= read_int ()''' or <br/> '''let''' str '''= read_line ()''' or <br/> '''Scanf.[[scanf]]''' format '''(fun '''x ...''' <nowiki>-></nowiki> '''...''')'''</tt>
-| <tt>'''print_int''' x or <br/> '''print_endline''' str or <br/> '''Printf.[[printf]]''' format x ...</tt>
-| <tt>'''prerr_int''' x or <br/> '''prerr_endline''' str or <br/> '''Printf.[[fprintf|eprintf]]''' format x ...</tt>
-|-
-| F#
-| <tt>'''let''' x '''= System.Console<wbr/>.ReadLine()'''</tt>
-| <tt>'''[[printf]]''' format x ... or <br/> '''[[printf]]n''' format x ...</tt>
-| <tt>'''[[fprintf|eprintf]]''' format x ... or <br/>'''[[fprintf|eprintf]]n''' format x ...</tt>
-|-
-| Standard ML
-| <tt>'''val''' str '''= TextIO.inputLIne TextIO.stdIn'''</tt>
-| <tt>'''print''' str</tt>
-| <tt>'''TextIO.output (TextIO.stdErr, '''str''')'''</tt>
-|-
-| Haskell (GHC)
-| <tt>x '''<- readLn''' or <br/> str '''<nowiki><-</nowiki> getLine'''</tt>
-| <tt>'''print '''x or <br/> '''putStrLn''' str</tt>
-| <tt>'''hPrint stderr '''x or <br/> '''hPutStrLn stderr''' str</tt>
-|-
-| COBOL
-| <code>'''ACCEPT''' x</code>
-| <code>'''DISPLAY''' x</code>
-|
-|-
-|}
-<br>{{note|ALGOL Unformatted|a}} ALGOL 68 additionally as the "unformatted" [[transput]] routines: <tt>''read'', ''write'', ''get''</tt> and <tt>''put''</tt>.
-<br>{{note|more c input|b}} <tt>'''[[gets()|gets]](x)'''</tt> and <tt>'''[[fgets]](x,''' length''', stdin)'''</tt> read unformatted text from stdin. Use of gets is not recommended.
-<br/>{{note|more c input|c}} <tt>'''[[puts (C)|puts]](x)'''</tt> and <tt>'''[[fputs]](x, stdout)'''</tt> write unformatted text to stdout.
-<br/>{{note|more c error output|d}} <tt>'''fputs(x, stderr)'''</tt> writes unformatted text to stderr
-<br/>{{note|Fortran standard units|e}} <tt>'''INPUT_UNIT''', '''OUTPUT_UNIT''', '''ERROR_UNIT'''</tt> are defined in the <tt>ISO_FORTRAN_ENV</tt> module.<ref>{{cite web|url=http://fortranwiki.org/fortran/show/iso_fortran_env|title=iso_fortran_env in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref>
-
-== Reading [[command-line argument]]s ==
-{| class="wikitable"
-|-
-!
-! Argument values
-! Argument counts
-! Program name / Script name
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| <tt>'''Argument ('''n''')'''</tt>
-| <tt>'''Argument_Count'''</tt>
-| <tt>'''Command_Name'''</tt>
-|-
-| C (C99)
-| rowspan=3| <tt>'''argv['''n''']'''</tt>
-| rowspan=3| <tt>'''argc'''</tt>
-| rowspan=3| first argument
-|-
-| Objective-C
-|-
-| C++
-|-
-| C#
-| rowspan=3| <tt>'''args['''n''']'''</tt>
-| <tt>'''args.Length'''</tt>
-| <tt>'''Assembly.GetEntryAssembly()<wbr/>.Location;'''</tt>
-|-
-| Java
-| rowspan=2| <tt>'''args.length'''</tt>
-| <!-- same as name of class containing '''main()''' --> <!-- not sure if that would yield the name of the exe/binary file of the program -->
-|-
-| D
-| first argument
-|-
-| JavaScript <br/><small>[[Windows Script Host]] implementation</small>
-| <tt>'''WScript.Arguments('''n''')'''</tt>
-| <tt>'''WScript.Arguments.length'''</tt>
-| <tt>'''WScript.ScriptName''' or '''WScript.ScriptFullName'''</tt>
-|-
-| Go
-| <tt>'''os.Args['''n''']'''</tt>
-| <tt>'''len(os.Args)'''</tt>
-| first argument
-|-
-| Swift
-| <tt>'''Process.arguments['''n''']'''</tt> or <br /> <tt>'''Process.unsafeArgv['''n''']'''</tt>
-| <tt>'''Process.arguments.count'''</tt> or <br /> <tt>'''Process.argc'''</tt>
-| first argument
-|-
-| Common Lisp
-| {{dunno}}
-| {{dunno}}
-| {{dunno}}
-|-
-| Scheme (R<sup>6</sup>RS)
-| <tt>'''(list-ref (command-line) '''n''')'''</tt>
-| <tt>'''(length (command-line))'''</tt>
-| first argument
-|-
-| ISLISP
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| Pascal
-| <tt>'''ParamStr('''n''')'''</tt>
-| <tt>'''ParamCount'''</tt>
-| first argument
-|-
-| Visual Basic
-| <tt>'''Command'''</tt>{{ref|unseparated|[a]}}
-| {{n/a}}
-| <tt>'''App.Path'''</tt>
-|-
-| Visual Basic .NET
-| <tt>'''CmdArgs('''n''')'''</tt>
-| <tt>'''CmdArgs.Length'''</tt>
-| <tt>'''[Assembly].GetEntryAssembly().Location'''</tt>
-|-
-| Xojo
-| <tt>'''System.CommandLine'''</tt>
-| (string parsing)
-| '''Application.ExecutableFile.Name'''
-|-
-| Python
-| <tt>'''sys.argv['''n''']'''</tt>
-| <tt>'''len(sys.argv)'''</tt>
-| first argument
-|-
-| S-Lang
-| <tt>'''__argv['''n''']'''</tt>
-| <tt>'''__argc'''</tt>
-| first argument
-|-
-| Fortran
-| <tt>'''DO '''i''' = '''1''','''argc''' <dl><dd> CALL GET_COMMAND_ARGUMENT ('''i''','''argv(i)''') </dd></dl> ENDDO'''</tt>
-| <tt>argc''' = COMMAND_ARGUMENT_COUNT ()'''</tt>
-| <tt>'''CALL GET_COMMAND_ARGUMENT ('''0''','''progname''')'''</tt>
-|-
-| PHP
-| <tt>'''$argv['''n''']'''</tt>
-| <tt>'''$argc'''</tt>
-| first argument
-|-
-| Bash shell
-| <tt>'''$'''n ('''$1''', '''$2''', '''$3''', ...)</tt><br/><tt>'''$@'''</tt> (all arguments)
-| <tt>'''$#'''</tt>
-| <tt>'''$0'''</tt>
-|-
-| Perl
-| <tt>'''$ARGV['''n''']'''</tt>
-| <tt>'''scalar(@ARGV)'''</tt>
-| <tt>'''$0'''</tt>
-|-
-| Perl 6
-| <tt>'''@*ARGS['''n''']'''</tt>
-| <tt>'''@*ARGS.elems'''</tt>
-| <tt>'''$PROGRAM_NAME'''</tt>
-|-
-| Ruby
-| <tt>'''ARGV['''n''']'''</tt>
-| <tt>'''ARGV.size'''</tt>
-| <tt>'''$0'''</tt>
-|-
-| Windows PowerShell
-| <tt>'''$args['''n''']'''</tt>
-| <tt>'''$args.Length'''</tt>
-| <tt>'''$MyInvocation.MyCommand<wbr/>.Name'''</tt>
-|-
-| OCaml
-| <tt>'''Sys.argv.('''n''')'''</tt>
-| <tt>'''Array.length Sys.argv'''</tt>
-| first argument
-|-
-| F#
-| <tt>'''args.['''n''']'''</tt>
-| <tt>'''args.Length'''</tt>
-| <tt>'''Assembly.GetEntryAssembly()<wbr/>.Location'''</tt>
-|-
-| Standard ML
-| <tt>'''List.nth (CommandLine<wbr/>.arguments (), '''n''')'''</tt>
-| <tt>'''length (CommandLine<wbr/>.arguments ())'''</tt>
-| <tt>'''CommandLine.name ()'''</tt>
-|-
-| Haskell (GHC)
-| {{code|lang=haskell|do { args <- System.getArgs; return length args !! n }}}
-| {{code|lang=haskell|do { args <- System.getArgs; return length args }}}
-| <tt>'''System.getProgName'''</tt>
-|-
-| COBOL
-| colspan=2 | {{ref|COBOL Arguments|[b]}}
-| {{n/a}}
-|}
-* {{note|unseparated|a}} In Visual Basic, command-line arguments are not separated. Separating them requires a split function <code>'''Split('''string''')'''</code>.
-* {{note|COBOL Arguments|b}} The COBOL standard includes no means to access command-line arguments, but common compiler extensions to access them include defining parameters for the main program or using <code>ACCEPT</code> statements.
-
-== Execution of commands ==
-
-{| class="wikitable"
-!
-!Shell command
-!Execute program
-![[exec (operating system)|Replace current program with new executed program]]
-|-
-| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />
-| colspan=3 align="center"| Not part of the language standard. Commonly done by compiler provided packages or by interfacing to C or [[POSIX]].<ref name=Ada_Execute_Command>{{cite web|url=http://rosettacode.org/wiki/Execute_a_system_command#Ada|title=Execute a system command - Rosetta Code|author=|date=|work=rosettacode.org|accessdate=30 January 2017}}</ref>
-|-
-| C
-| rowspan=3| <tt>'''[[system (C standard library)|system]]("'''command'''");'''</tt>
-|
-| rowspan=2| <tt>'''[[Exec (operating system)|execl]]('''path''',''' args''');''' or<br/> '''[[Exec (operating system)|execv]]('''path''',''' arglist''');'''</tt>
-|-
-| C++
-|
-|-
-| Objective-C
-| <tt>'''[NSTask launchedTaskWithLaunchPath:(NSString *)'''path''' arguments:(NSArray *)'''arguments'''];'''</tt>
-|
-|-
-| C#
-|
-| rowspan=2| <tt>'''System.Diagnostics<wbr/>.Process.Start('''path''',''' argstring''');'''</tt>
-|
-|-
-| F#
-|
-|
-|-
-| Go
-|
-| <tt>'''exec.Run('''path''',''' argv''',''' envv''',''' dir''', exec.DevNull, exec.DevNull, exec.DevNull)'''</tt>
-| <tt>'''os.Exec('''path''',''' argv''',''' envv''')'''</tt>
-|-
-| Visual Basic
-| <tt>'''Interaction.Shell('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''')'''</tt>
-|
-|
-|-
-| Visual Basic .NET
-| <tt>'''Microsoft.VisualBasic<wbr/>.Interaction.Shell('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''')'''</tt>
-| <tt>'''System.Diagnostics<wbr/>.Process.Start('''path''',''' argstring''')'''</tt>
-|
-|-
-| Xojo
-| <tt>'''Shell.Execute('''command «''', '''Parameters»''')'''</tt>
-| <tt>'''FolderItem.Launch('''parameters''',''' activate''')'''</tt>
-| {{n/a}}
-|-
-| D
-| <tt>'''std.process.system("'''command'''");'''</tt>
-|
-| <tt>'''std.process.execv('''path''',''' arglist''');'''</tt>
-|-
-| Java
-|
-| <tt>'''Runtime.exec('''command''');''' or<br/> '''new ProcessBuilder('''command''').start();'''</tt>
-|
-|-
-| JavaScript <br/> <small>[[Windows Script Host]] implementation</small>
-| <tt>'''WScript.CreateObject ("WScript.Shell").Run('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''');'''</tt>
-| <tt>'''WshShell.Exec(command)'''</tt>
-|
-|-
-| Common Lisp
-| <tt>'''(shell '''command''')'''</tt>
-|
-|
-|-
-| Scheme
-| <tt>'''(system '''command''')'''</tt>
-|
-|
-|-
-| ISLISP
-| {{n/a}}
-| {{n/a}}
-| {{n/a}}
-|-
-| Pascal
-| <tt>'''system('''command''');'''</tt>
-|
-|
-|-
-| OCaml
-| <tt>'''Sys.command '''command, '''Unix.open_process_full''' command env (stdout, stdin, stderr),...</tt>
-| <tt>'''Unix.create_process''' prog args new_stdin new_stdout new_stderr, ...</tt>
-| <tt>'''Unix.execv''' prog args or <br/> '''Unix.execve''' prog args env</tt>
-|-
-| Standard ML
-| <tt>'''OS.Process.system '''command</tt>
-| <tt>'''Unix.execute ('''path''', '''args''')'''</tt>
-| <tt>'''Posix.Process.exec ('''path''', '''args''')'''</tt>
-|-
-| Haskell (GHC)
-| <tt>'''System.system '''command</tt>
-| <tt>'''System.Process<wbr/>.runProcess '''path''' '''args''' ...</tt>
-| <tt>'''Posix.Process<wbr/>.executeFile '''path''' True '''args''' ...</tt>
-|-
-| Perl
-| <tt>'''system('''command''')''' or <br/>$output '''= `'''command'''`''' or<br/>$output '''= qx('''command''')'''</tt>
-|
-| <tt>'''exec('''path''',''' args''')'''</tt>
-|-
-| Ruby
-| <tt>'''system('''command''')''' or <br/> output '''= `'''command'''`'''</tt>
-|
-| <tt>'''exec('''path''',''' args''')'''</tt>
-|-
-| PHP
-| <tt>'''system('''command''')''' or <br/> $output '''= `'''command'''`''' or <br/> '''exec('''command''')''' or <br/> '''passthru('''command''')'''</tt>
-|
-|
-|-
-| Python
-| <tt>'''os.system('''command''')''' or <br/> '''subprocess.Popen('''command''')''' </tt>
-| <tt>'''subprocess.call('''["program", "arg1", "arg2", …]''')''' </tt>
-| <tt>'''os.execv('''path''',''' args''')'''</tt>
-|-
-| S-Lang
-| <tt>'''system('''command''')'''</tt>
-|
-|
-|-
-| Fortran
-| <tt>'''CALL EXECUTE_COMMAND_LINE ('''COMMAND''' «, '''WAIT'''» «, '''EXITSTAT'''» «, '''CMDSTAT'''» «, '''CMDMSG'''») {{ref|Fortran 2008|[a]}}</tt>
-|
-|
-|-
-| Windows PowerShell
-| <tt>'''[Diagnostics.Process]::Start('''command''')'''</tt>
-| <tt>«'''Invoke-Item''' »program arg1 arg2 …</tt>
-|
-|-
-| Bash shell
-| <tt>output'''=`'''command'''`'''</tt> or
-<tt>output'''=$('''command''')'''</tt>
-| <tt>program arg1 arg2 …</tt>
-|
-|}
-{{note|Fortran 2008|a}} Fortran 2008 or newer.<ref>{{cite web|url=https://gcc.gnu.org/onlinedocs/gfortran/EXECUTE_005fCOMMAND_005fLINE.html|title=EXECUTE_COMMAND_LINE - The GNU Fortran Compiler|author=|date=|work=gnu.org|accessdate=30 January 2017}}</ref>
-
-== References ==
-{{Reflist}}
-
-[[Category:Programming constructs]]
-[[Category:Programming language comparisons|*Basic instructions]]
' |
New page size (new_size ) | 0 |
Old page size (old_size ) | 143487 |
Size change in edit (edit_delta ) | -143487 |
Lines added in edit (added_lines ) | [] |
Lines removed in edit (removed_lines ) | [
0 => '{{Refimprove|date=February 2009}}',
1 => '{{ProgLangCompare}}',
2 => ''''Comparison of programming languages''' is a common topic of discussion among [[software engineer]]s. Basic instructions of several [[programming language]]s are compared here.',
3 => '__TOC__',
4 => '== Conventions of this article ==',
5 => 'The '''bold''' is the literal code. The non-bold is interpreted by the reader. Statements in [[guillemets]] (« … ») are optional. {{keypress|Tab}} indicates a necessary indent (with whitespace).',
6 => '{{Clear}}',
7 => false,
8 => '== Type identifiers ==',
9 => false,
10 => '=== [[Integer (computer science)|Integer]]s ===',
11 => '{| class="wikitable"',
12 => '! rowspan=2| ',
13 => '! colspan=2| 8 bit ([[byte]])',
14 => '! colspan=2| 16 bit ([[short integer]])',
15 => '! colspan=2| 32 bit',
16 => '! colspan=2| 64 bit ([[long integer]])',
17 => '! colspan=2| Word size',
18 => '! rowspan=2| Arbitrarily precise ([[Arbitrary-precision arithmetic|bignum]])',
19 => '|-',
20 => '! Signed',
21 => '! Unsigned',
22 => '! Signed',
23 => '! Unsigned',
24 => '! Signed',
25 => '! Unsigned',
26 => '! Signed',
27 => '! Unsigned',
28 => '! Signed',
29 => '! Unsigned',
30 => '|-',
31 => '| [[Ada (programming language)|Ada]]<ref name=Ada_RM_2012>Ada Reference Manual - Language and Standard Libraries; ISO/IEC 8652:201x (E), {{cite web |url=http://www.ada-auth.org/standards/12rm/RM-Final.pdf |title=Archived copy |accessdate=2013-07-19 |deadurl=yes |archiveurl=https://web.archive.org/web/20110427190723/http://www.ada-auth.org/standards/12rm/RM-Final.pdf |archivedate=2011-04-27 |df= }}</ref>',
32 => '| <tt>range -2**7 .. 2**7 - 1</tt>{{ref|Ada_range|[j]}}',
33 => '| <tt>range 0 .. 2**8 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**8</tt>{{ref|Ada_mod|[k]}}',
34 => '| <tt>range -2**15 .. 2**15 - 1</tt>{{ref|Ada_range|[j]}}',
35 => '| <tt>range 0 .. 2**16 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**16</tt>{{ref|Ada_mod|[k]}}',
36 => '| <tt>range -2**31 .. 2**31 - 1</tt>{{ref|Ada_range|[j]}}',
37 => '| <tt>range 0 .. 2**32 - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod 2**32</tt>{{ref|Ada_mod|[k]}}',
38 => '| <tt>range -2**63 .. 2**63 - 1</tt>{{ref|Ada_range|[j]}}',
39 => '| <tt>mod 2**64</tt>{{ref|Ada_mod|[k]}}',
40 => '| <tt>Integer</tt>{{ref|Ada_range|[j]}}',
41 => '| <tt>range 0 .. 2**Integer'<wbr/>Size - 1</tt>{{ref|Ada_range|[j]}} or <tt>mod Integer'<wbr/>Size</tt>{{ref|Ada_mod|[k]}}',
42 => '| {{n/a}}',
43 => '|-',
44 => '| rowspan=2| [[ALGOL 68]] (variable-width)',
45 => '| rowspan=2| <tt>short short int</tt>{{ref|CInt|[c]}}',
46 => '| rowspan=2 {{n/a}}',
47 => '| rowspan=2| <tt>short int</tt>{{ref|CInt|[c]}}',
48 => '| rowspan=2 {{n/a}}',
49 => '| rowspan=2| <tt>int</tt>{{ref|CInt|[c]}}',
50 => '| rowspan=2 {{n/a}}',
51 => '| rowspan=2| <tt>long int</tt>{{ref|CInt|[c]}}',
52 => '| rowspan=2 {{n/a}}',
53 => '| <tt>int</tt>{{ref|CInt|[c]}}',
54 => '| {{n/a}}',
55 => '| rowspan=2| <tt>long long int</tt> {{ref|a68|[a]}}{{ref|a68g|[g]}}',
56 => '|-',
57 => '| colspan=2 align=center|<tt>bytes</tt> & <tt>bits</tt>',
58 => '|-',
59 => '| [[C (programming language)|C]] ([[C99]] fixed-width)',
60 => '| rowspan=2| <tt>int8_t</tt>',
61 => '| rowspan=2| <tt>uint8_t</tt>',
62 => '| rowspan=2| <tt>int16_t</tt>',
63 => '| rowspan=2| <tt>uint16_t</tt>',
64 => '| rowspan=2| <tt>int32_t</tt>',
65 => '| rowspan=2| <tt>uint32_t</tt>',
66 => '| rowspan=2| <tt>int64_t</tt>',
67 => '| rowspan=2| <tt>uint64_t</tt>',
68 => '| rowspan=4| <tt>int</tt>',
69 => '| rowspan=4| <tt>unsigned int</tt>',
70 => '| rowspan=5 {{n/a}}',
71 => '|-',
72 => '| [[C++]] ([[C++11]] fixed-width)',
73 => '|-',
74 => '| [[C (programming language)|C]] ([[C99]] variable-width)',
75 => '| rowspan=2| <tt>signed char</tt>',
76 => '| rowspan=2| <tt>unsigned char</tt>',
77 => '| rowspan=2| <tt>short</tt>{{ref|CInt|[c]}}',
78 => '| rowspan=2| <tt>unsigned short</tt>{{ref|CInt|[c]}}',
79 => '| rowspan=2| <tt>long</tt>{{ref|CInt|[c]}}',
80 => '| rowspan=2| <tt>unsigned long</tt>{{ref|CInt|[c]}}',
81 => '| rowspan=2| <tt>long long</tt>{{ref|CInt|[c]}}',
82 => '| rowspan=2| <tt>unsigned long long</tt>{{ref|CInt|[c]}}',
83 => '|-',
84 => '| [[C++]] ([[C++11]] variable-width)',
85 => '|-',
86 => '| [[Objective-C]] ([[Cocoa (API)|Cocoa]])',
87 => '| <tt>signed char''' <br>or<br> '''int8_t</tt>',
88 => '| <tt>unsigned char''' <br>or<br> '''uint8_t</tt>',
89 => '| <tt>short''' <br>or<br> '''int16_t</tt>',
90 => '| <tt>unsigned short''' <br>or<br> '''uint16_t</tt>',
91 => '| <tt>int''' <br>or<br> '''int32_t</tt>',
92 => '| <tt>unsigned int''' <br>or<br> '''uint32_t</tt>',
93 => '| <tt>long long''' <br>or<br> '''int64_t</tt>',
94 => '| <tt>unsigned long long''' <br>or<br> '''uint64_t</tt>',
95 => '| <tt>NSInteger''' <br>or<br> '''long</tt>',
96 => '| <tt>NSUInteger''' <br>or<br> '''unsigned long</tt>',
97 => '|-',
98 => '| [[C Sharp (programming language)|C#]]',
99 => '| <tt>sbyte</tt>',
100 => '| <tt>byte</tt>',
101 => '| rowspan=2| <tt>short</tt>',
102 => '| <tt>ushort</tt>',
103 => '| rowspan=2| <tt>int</tt>',
104 => '| <tt>uint</tt>',
105 => '| rowspan=2| <tt>long</tt>',
106 => '| <tt>ulong</tt>',
107 => '| <tt>IntPtr</tt>',
108 => '| <tt>UIntPtr</tt>',
109 => '| <tt>System.Numerics<wbr/>.BigInteger</tt><br/>(.NET 4.0)',
110 => '|-',
111 => '| [[Java (programming language)|Java]]',
112 => '| <tt>byte</tt>',
113 => '| {{n/a}}',
114 => '| <tt>char</tt>{{ref|Java char|[b]}}',
115 => '| {{n/a}}',
116 => '| {{n/a}}',
117 => '| {{n/a}}',
118 => '| {{n/a}}',
119 => '| <tt>java.math<wbr/>.BigInteger</tt>',
120 => '|-',
121 => '| [[Go (programming language)|Go]]',
122 => '| <tt>int8</tt>',
123 => '| <tt>uint8</tt> or <tt>byte</tt>',
124 => '| <tt>int16</tt>',
125 => '| <tt>uint16</tt>',
126 => '| <tt>int32</tt>',
127 => '| <tt>uint32</tt>',
128 => '| <tt>int64</tt>',
129 => '| <tt>uint64</tt>',
130 => '| <tt>int</tt>',
131 => '| <tt>uint</tt>',
132 => '| <tt>big.Int</tt>',
133 => '|-',
134 => '| [[Swift (programming language)|Swift]]',
135 => '| <tt>Int8</tt>',
136 => '| <tt>UInt8</tt>',
137 => '| <tt>Int16</tt>',
138 => '| <tt>UInt16</tt>',
139 => '| <tt>Int32</tt>',
140 => '| <tt>UInt32</tt>',
141 => '| <tt>Int64</tt>',
142 => '| <tt>UInt64</tt>',
143 => '| <tt>Int</tt>',
144 => '| <tt>UInt</tt>',
145 => '| ',
146 => '|-',
147 => '| [[D (programming language)|D]]',
148 => '| <tt>byte</tt>',
149 => '| <tt>ubyte</tt>',
150 => '| <tt>short</tt>',
151 => '| <tt>ushort</tt>',
152 => '| <tt>int</tt>',
153 => '| <tt>uint</tt>',
154 => '| <tt>long</tt>',
155 => '| <tt>ulong</tt>',
156 => '|{{n/a}}',
157 => '|{{n/a}}',
158 => '| <tt>BigInt</tt>',
159 => '|-',
160 => '| [[Common Lisp]]<ref name=HyperSpec>{{cite web|url=http://www.lispworks.com/documentation/HyperSpec/Front/index.htm|title=Common Lisp HyperSpec (TM)|author=|date=|work=lispworks.com|accessdate=30 January 2017}}</ref>',
161 => '| <tt>(integer -128 127)</tt>',
162 => '| <tt>(integer 0 255)</tt>',
163 => '| <tt>(integer -32768 32767)</tt>',
164 => '| <tt>(integer 0 65536)</tt>',
165 => '| <tt>(integer -2147483648 2147483647)</tt>',
166 => '| <tt>(integer 0 4294967296)</tt>',
167 => '| <tt>(integer -9223372036854775808 9223372036854775807)</tt>',
168 => '| <tt>(integer 0 18446744073709551616)</tt>',
169 => '| ',
170 => '| ',
171 => '| <tt>bignum</tt>',
172 => '|-',
173 => '| [[Scheme (programming language)|Scheme]]',
174 => '| ',
175 => '| ',
176 => '| ',
177 => '| ',
178 => '| ',
179 => '| ',
180 => '| ',
181 => '| ',
182 => '| ',
183 => '| ',
184 => '| ',
185 => '|-',
186 => '| [[ISLISP]]<ref name=Specification>{{cite web|url=http://www.islisp.info/specification.html|title=www.islisp.info: Specification|author=|date=|work=islisp.info|accessdate=30 January 2017}}</ref>',
187 => '| ',
188 => '| ',
189 => '| ',
190 => '| ',
191 => '| ',
192 => '| ',
193 => '| ',
194 => '| ',
195 => '| ',
196 => '| ',
197 => '| <tt>bignum</tt>',
198 => '|-',
199 => '| [[Pascal (programming language)|Pascal]] ([[Free Pascal|FPC]])',
200 => '| <tt>shortint</tt>',
201 => '| <tt>byte</tt>',
202 => '| <tt>smallint</tt>',
203 => '| <tt>word</tt>',
204 => '| <tt>longint</tt>',
205 => '| <tt>longword</tt>',
206 => '| <tt>int64</tt>',
207 => '| <tt>qword</tt>',
208 => '| <tt>integer</tt>',
209 => '| <tt>cardinal</tt>',
210 => '| {{n/a}}',
211 => '|-',
212 => '| [[Visual Basic]]',
213 => '| {{n/a}}',
214 => '| rowspan=2|<tt>Byte</tt>',
215 => '| <tt>Integer</tt>',
216 => '| {{n/a}}',
217 => '| <tt>Long</tt>',
218 => '| {{n/a}}',
219 => '| colspan=2 {{n/a}}',
220 => '| rowspan=2 colspan=2 {{n/a}}',
221 => '| rowspan=1 {{n/a}}',
222 => '|-',
223 => '| [[Visual Basic .NET]]',
224 => '| <tt>SByte</tt>',
225 => '| <tt>Short</tt>',
226 => '| <tt>UShort</tt>',
227 => '| <tt>Integer</tt>',
228 => '| <tt>UInteger</tt>',
229 => '| <tt>Long</tt>',
230 => '| <tt>ULong</tt>',
231 => '| <tt>System.Numerics<wbr/>.BigInteger</tt><br/>(.NET 4.0)',
232 => '|-',
233 => '| [[FreeBasic]]',
234 => '| <tt>Byte</tt> or <tt>Integer<8></tt>',
235 => '| <tt>UByte</tt> or <tt>UInteger<8></tt>',
236 => '| <tt>Short</tt> or <tt>Integer<16></tt>',
237 => '| <tt>UShort</tt> or <tt>UInteger<16></tt>',
238 => '| <tt>Long</tt> or <tt>Integer<32></tt>',
239 => '| <tt>ULong</tt> or <tt>UInteger<32></tt>',
240 => '| <tt>LongInt</tt> or <tt>Integer<64></tt>',
241 => '| <tt>ULongInt</tt> or <tt>UInteger<64></tt>',
242 => '| <tt>Integer</tt>',
243 => '| <tt>UInteger</tt>',
244 => '| {{n/a}}',
245 => '|-',
246 => '| [[Python (programming language)|Python]] 2.x',
247 => '| colspan=2 {{n/a}}',
248 => '| colspan=2 {{n/a}}',
249 => '| colspan=2 {{n/a}}',
250 => '| colspan=2 {{n/a}}',
251 => '| <tt>int</tt>',
252 => '| {{n/a}}',
253 => '| <tt>long</tt>',
254 => '|-',
255 => '| Python 3.x',
256 => '| colspan=2 {{n/a}}',
257 => '| colspan=2 {{n/a}}',
258 => '| colspan=2 {{n/a}}',
259 => '| colspan=2 {{n/a}}',
260 => '| colspan=2 {{n/a}}',
261 => '| <tt>int</tt>',
262 => '|-',
263 => '| [[S-Lang (programming language)|S-Lang]]',
264 => '| colspan=2 {{n/a}}',
265 => '| colspan=2 {{n/a}}',
266 => '| colspan=2 {{n/a}}',
267 => '| colspan=2 {{n/a}}',
268 => '| colspan=2 {{n/a}}',
269 => '| {{n/a}}',
270 => '|-',
271 => '| [[Fortran]]',
272 => '| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}',
273 => '| {{n/a}}',
274 => '| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}',
275 => '| {{n/a}}',
276 => '| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}',
277 => '| {{n/a}}',
278 => '| <tt>INTEGER<wbr/>(KIND = n)</tt>{{ref|Kinds|[f]}}',
279 => '| {{n/a}}',
280 => '|',
281 => '|',
282 => '|',
283 => '|-',
284 => '| [[PHP]]',
285 => '| colspan=2 {{n/a}}',
286 => '| colspan=2 {{n/a}}',
287 => '| <tt>int</tt> {{ref|PHP 32/64 bit long|[m]}}',
288 => '| {{n/a}}',
289 => '| <tt>int</tt> {{ref|PHP 32/64 bit long|[m]}}',
290 => '| {{n/a}}',
291 => '| colspan=2 {{n/a}}',
292 => '| {{ref|PHP bignum|[e]}}',
293 => '|-',
294 => '| [[Perl]] 5',
295 => '| colspan=2 {{n/a}}{{ref|scalars|[d]}}',
296 => '| colspan=2 {{n/a}}{{ref|scalars|[d]}}',
297 => '| colspan=2 {{n/a}}{{ref|scalars|[d]}}',
298 => '| colspan=2 {{n/a}}{{ref|scalars|[d]}}',
299 => '| colspan=2 {{n/a}}{{ref|scalars|[d]}}',
300 => '| <tt>Math::BigInt</tt>',
301 => '|-',
302 => '| [[Perl 6]]',
303 => '| <tt>int8</tt>',
304 => '| <tt>uint8</tt>',
305 => '| <tt>int16</tt>',
306 => '| <tt>uint16</tt>',
307 => '| <tt>int32</tt>',
308 => '| <tt>uint32</tt>',
309 => '| <tt>int64</tt>',
310 => '| <tt>uint64</tt>',
311 => '| <tt>Int</tt>',
312 => '| colspan=2 {{n/a}}',
313 => '|-',
314 => '| [[Ruby (programming language)|Ruby]]',
315 => '| colspan=2 {{n/a}}',
316 => '| colspan=2 {{n/a}}',
317 => '| colspan=2 {{n/a}}',
318 => '| colspan=2 {{n/a}}',
319 => '| <tt>Fixnum</tt>',
320 => '| {{n/a}}',
321 => '| <tt>Bignum</tt>',
322 => '|-',
323 => '| [[Erlang (programming language)|Erlang]]{{ref|Erlang_int|[n]}}',
324 => '| colspan=2 {{n/a}}',
325 => '| colspan=2 {{n/a}}',
326 => '| colspan=2 {{n/a}}',
327 => '| colspan=2 {{n/a}}',
328 => '| integer() ',
329 => '| {{n/a}}',
330 => '| integer(){{ref|Erlang_arb|[o]}}',
331 => '|-',
332 => '| [[Scala (programming language)|Scala]]',
333 => '| <tt>Byte</tt>',
334 => '| {{n/a}}',
335 => '| <tt>Short</tt>',
336 => '| <tt>Char</tt>{{ref|Scala Char|[l]}}',
337 => '| <tt>Int</tt>',
338 => '| {{n/a}}',
339 => '| <tt>Long</tt>',
340 => '| {{n/a}}',
341 => '| {{n/a}}',
342 => '| {{n/a}}',
343 => '| <tt>scala.math.BigInt</tt>',
344 => '|-',
345 => '| [[Seed7]]',
346 => '| {{n/a}}',
347 => '| {{n/a}}',
348 => '| {{n/a}}',
349 => '| {{n/a}}',
350 => '| {{n/a}}',
351 => '| {{n/a}}',
352 => '| <tt>integer</tt>',
353 => '| {{n/a}}',
354 => '| {{n/a}}',
355 => '| {{n/a}}',
356 => '| <tt>bigInteger</tt>',
357 => '|-',
358 => '| [[Smalltalk]]',
359 => '| colspan=2 {{n/a}}',
360 => '| colspan=2 {{n/a}}',
361 => '| colspan=2 {{n/a}}',
362 => '| colspan=2 {{n/a}}',
363 => '| <tt>SmallInteger</tt>{{ref|Smalltalk|[i]}}',
364 => '| {{n/a}}',
365 => '| <tt>LargeInteger</tt>{{ref|Smalltalk|[i]}}',
366 => '|-',
367 => '| [[Windows PowerShell]]',
368 => '| colspan=2 {{n/a}}',
369 => '| colspan=2 {{n/a}}',
370 => '| colspan=2 {{n/a}}',
371 => '| colspan=2 {{n/a}}',
372 => '| colspan=2 {{n/a}}',
373 => '| {{n/a}}',
374 => '|-',
375 => '| [[OCaml]]',
376 => '| colspan=2 {{n/a}}',
377 => '| colspan=2 {{n/a}}',
378 => '| <tt>int32</tt>',
379 => '| {{n/a}}',
380 => '| rowspan=2| <tt>int64</tt>',
381 => '| {{n/a}}',
382 => '| <tt>int''' <br/> or <br/> '''nativeint</tt>',
383 => '|',
384 => '| <tt>open Big_int;; <br/> big_int</tt>',
385 => '|-',
386 => '| [[F Sharp (programming language)|F#]]',
387 => '| <tt>sbyte</tt>',
388 => '| <tt>byte</tt>',
389 => '| <tt>int16</tt>',
390 => '| <tt>uint16</tt>',
391 => '| <tt>int32</tt> or <tt>int</tt>',
392 => '| <tt>uint32</tt>',
393 => '| <tt>uint64</tt>',
394 => '| <tt>nativeint</tt>',
395 => '| <tt>unativeint</tt>',
396 => '| <tt>bigint</tt>',
397 => '|-',
398 => '| [[Standard ML]]',
399 => '| {{n/a}}',
400 => '| <tt>Word8.word</tt>',
401 => '| colspan=2 {{n/a}}',
402 => '| <tt>Int32.int</tt>',
403 => '| <tt>Word32.word</tt>',
404 => '| <tt>Int64.int</tt>',
405 => '| <tt>Word64.word</tt>',
406 => '| <tt>int</tt>',
407 => '| <tt>word</tt>',
408 => '| <tt>LargeInt.int</tt> or <br/> <tt>IntInf.int</tt>',
409 => '|-',
410 => '| [[Haskell (programming language)|Haskell]] ([[Glasgow Haskell Compiler|GHC]])',
411 => '| «<tt>import Int</tt>» <br/> <tt>Int8</tt>',
412 => '| «<tt>import Word</tt>» <br/> <tt>Word8</tt>',
413 => '| «<tt>import Int</tt>» <br/> <tt>Int16</tt>',
414 => '| «<tt>import Word</tt>» <br/> <tt>Word16</tt>',
415 => '| «<tt>import Int</tt>» <br/> <tt>Int32</tt>',
416 => '| «<tt>import Word</tt>» <br/> <tt>Word32</tt>',
417 => '| «<tt>import Int</tt>» <br/> <tt>Int64</tt>',
418 => '| «<tt>import Word</tt>» <br/> <tt>Word64</tt>',
419 => '| <tt>Int</tt>',
420 => '| «<tt>import Word</tt>» <br/> <tt>Word</tt>',
421 => '| <tt>Integer</tt>',
422 => '|-',
423 => '| [[Eiffel (programming language)|Eiffel]]',
424 => '| <tt>INTEGER_8</tt>',
425 => '| <tt>NATURAL_8</tt>',
426 => '| <tt>INTEGER_16</tt>',
427 => '| <tt>NATURAL_16</tt>',
428 => '| <tt>INTEGER_32</tt>',
429 => '| <tt>NATURAL_32</tt>',
430 => '| <tt>INTEGER_64</tt>',
431 => '| <tt>NATURAL_64</tt>',
432 => '| <tt>INTEGER</tt>',
433 => '| <tt>NATURAL</tt>',
434 => '| {{n/a}}',
435 => '|-',
436 => '| [[COBOL]]{{ref|Cobol|[h]}}',
437 => '| <tt>BINARY-CHAR «SIGNED»</tt>',
438 => '| <tt>BINARY-CHAR UNSIGNED</tt>',
439 => '| <tt>BINARY-SHORT «SIGNED»</tt>',
440 => '| <tt>BINARY-SHORT UNSIGNED</tt>',
441 => '| <tt>BINARY-LONG «SIGNED»</tt>',
442 => '| <tt>BINARY-LONG UNSIGNED</tt>',
443 => '| <tt>BINARY-DOUBLE «SIGNED»</tt>',
444 => '| <tt>BINARY-DOUBLE UNSIGNED</tt>',
445 => '| {{n/a}}',
446 => '| {{n/a}}',
447 => '| {{n/a}}',
448 => '|-',
449 => '| [[Mathematica]]',
450 => '| colspan=2 {{n/a}}',
451 => '| colspan=2 {{n/a}}',
452 => '| colspan=2 {{n/a}}',
453 => '| colspan=2 {{n/a}}',
454 => '| colspan=2 {{n/a}}',
455 => '| <tt>Integer</tt>',
456 => '|-',
457 => '| [[Wolfram Language]]',
458 => '| colspan=2 {{n/a}}',
459 => '| colspan=2 {{n/a}}',
460 => '| colspan=2 {{n/a}}',
461 => '| colspan=2 {{n/a}}',
462 => '| colspan=2 {{n/a}}',
463 => '| <tt>Integer</tt>',
464 => '|}',
465 => '{{note|a68|a}} The <u>standard</u> constants <tt>int shorts</tt> and <tt>int lengths</tt> can be used to determine how many '<tt>short</tt>'s and '<tt>long</tt>'s can be usefully prefixed to '<tt>short int</tt>' and '<tt>long int</tt>'. The actually size of the '<tt>short int</tt>', '<tt>int</tt>' and '<tt>long int</tt>' is available as constants <tt>short max int</tt>, <tt>max int</tt> and <tt>long max int</tt> etc.',
466 => '<br/>{{note|Java char|b}} Commonly used for characters.',
467 => '<br/>{{note|CInt|c}} The ALGOL 68, C and C++ languages do not specify the exact width of the integer types <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and (C99, C++11) <tt>long long</tt>, so they are implementation-dependent. In C and C++ <tt>short</tt>, <tt>long</tt>, and <tt>long long</tt> types are required to be at least 16, 32, and 64 bits wide, respectively, but can be more. The <tt>int</tt> type is required to be at least as wide as <tt>short</tt> and at most as wide as <tt>long</tt>, and is typically the width of the word size on the processor of the machine (i.e. on a 32-bit machine it is often 32 bits wide; on 64-bit machines it is often 64 bits wide). C99 and C++11{{citation needed|date=December 2011}} also define the <tt>[u]intN_t</tt> exact-width types in the [[stdint.h]] header. See[[C syntax#Integral types]] for more information.',
468 => '<br/>{{note|scalars|d}} Perl 5 does not have distinct types. Integers, floating point numbers, strings, etc. are all considered "scalars".',
469 => '<br/>{{note|PHP bignum|e}} PHP has two arbitrary-precision libraries. The BCMath library just uses strings as datatype. The GMP library uses an internal "resource" type.',
470 => '<br/>{{note|Kinds|f}} The value of "n" is provided by the <tt>SELECTED_INT_KIND</tt><ref name="fortranwiki.org">{{cite web|url=http://fortranwiki.org/fortran/show/selected_int_kind|title=selected_int_kind in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref> intrinsic function.',
471 => '<br/>{{note|a68g|g}} [[ALGOL 68]]G's run time option ''<tt>--precision "number"</tt>'' can set precision for <tt>long long int</tt>s to the required "number" significant digits. The <u>standard</u> constants ''<tt>long long int width</tt>'' and ''<tt>long long max int</tt>'' can be used to determine actual precision.',
472 => '<br/>{{note|Cobol|h}} [[COBOL]] allows the specification of a required precision and will automatically select an available type capable of representing the specified precision. "<tt>PIC S9999</tt>", for example, would require a signed variable of four decimal digits precision. If specified as a binary field, this would select a 16-bit signed type on most platforms.',
473 => '<br/>{{note|Smalltalk|i}} [[Smalltalk]] automatically chooses an appropriate representation for integral numbers. Typically, two representations are present, one for integers fitting the native word size minus any tag bit (SmallInteger) and one supporting arbitrary sized integers (LargeInteger). Arithmetic operations support polymorphic arguments and return the result in the most appropriate compact representation.',
474 => '<br/>{{note|Ada_range|j}} [[Ada (programming language)|Ada]] range types are checked for boundary violations at run-time (as well as at compile-time for static expressions). Run-time boundary violations raise a "constraint error" exception. Ranges are not restricted to powers of two. Commonly predefined Integer subtypes are: Positive (<tt>range 1 .. Integer'Last</tt>) and Natural (<tt>range 0 .. Integer'Last</tt>). <tt>Short_Short_Integer</tt> (8 bits), <tt>Short_Integer</tt> (16 bits) and <tt>Long_Integer</tt> (64 bits) are also commonly predefined, but not required by the Ada standard. Run time checks can be disabled if performance is more important than integrity checks.',
475 => '<br/>{{note|Ada_mod|k}} [[Ada (programming language)|Ada]] modulo types implement modulo arithmetic in all operations, i.e. no range violations are possible. Modulos are not restricted to powers of two.',
476 => '<br/>{{note|Scala char|l}} Commonly used for characters like Java's char.',
477 => '<br/>{{note|PHP 32/64 bit long|m}} <tt>int</tt> in PHP has the same width as <tt>long</tt> type in C has on that system {{ref|CInt|[c]}}.',
478 => '<br/>{{note|Erlang_int|n}} [[Erlang (programming language)|Erlang]] is dynamically typed. The type identifiers are usually used to specify types of record fields and the argument and return types of functions.<ref>{{cite web|url=http://www.erlang.org/doc/reference_manual/typespec.html|title=Erlang -- Types and Function Specifications|author=|date=|work=erlang.org|accessdate=30 January 2017}}</ref>',
479 => '<br/>{{note|Erlang_arb|o}} When it exceeds one word.<ref>{{cite web|url=http://www.erlang.org/doc/efficiency_guide/advanced.html|title=Erlang -- Advanced|author=|date=|work=erlang.org|accessdate=30 January 2017}}</ref>',
480 => false,
481 => '=== [[Floating point]] ===',
482 => '{| class="wikitable"',
483 => '!',
484 => '! [[Single precision]]',
485 => '! [[Double precision]]',
486 => '! Other precision',
487 => '! Processor dependent',
488 => '|-',
489 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
490 => '| <tt>Float</tt>',
491 => '| <tt>Long_Float</tt>',
492 => '| {{n/a}}',
493 => '|-',
494 => '| ALGOL 68',
495 => '| <tt>real</tt>{{ref|a68|[a]}}',
496 => '| <tt>long real</tt>{{ref|a68|[a]}}',
497 => '| <tt>short real</tt>, <tt>long long real</tt>, etc.{{ref|a68g|[d]}}',
498 => '|-',
499 => '| C',
500 => '| rowspan=3| <tt>float</tt>{{ref|lax floats|[b]}}',
501 => '| rowspan=5| <tt>double</tt>',
502 => '| rowspan=3| <tt>long double</tt>{{ref|C-long-double|[f]}}',
503 => '|-',
504 => '| C++ (STL)',
505 => '|-',
506 => '| Objective-C (Cocoa)',
507 => '| <tt>CGFloat</tt>',
508 => '|-',
509 => '| C#',
510 => '| rowspan=2| <tt>float</tt>',
511 => '| rowspan=3 {{n/a}}',
512 => '|-',
513 => '| Java',
514 => '|-',
515 => '| Go',
516 => '| <tt>float32</tt>',
517 => '| <tt>float64</tt>',
518 => '|-',
519 => '| Swift',
520 => '| <tt>Float'''<br/>'''Float32</tt>',
521 => '| <tt>Double'''<br/>'''Float64</tt>',
522 => '| <tt>Float80</tt>{{ref|Swift-long-double|[g]}}',
523 => '| <tt>CGFloat</tt>',
524 => '|-',
525 => '| D',
526 => '| <tt>float</tt>',
527 => '| <tt>double</tt>',
528 => '|',
529 => '| <tt>real</tt>',
530 => '|-',
531 => '| Common Lisp',
532 => '| <tt>single-float</tt>',
533 => '| <tt>double-float</tt>',
534 => '| <tt>float, short-float, long-float</tt>',
535 => '|-',
536 => '| Scheme',
537 => '|',
538 => '|',
539 => '|',
540 => '|-',
541 => '| ISLISP',
542 => '|',
543 => '|',
544 => '| ',
545 => '|-',
546 => '| Pascal (Free Pascal)',
547 => '| <tt>single</tt>',
548 => '| <tt>double</tt>',
549 => '|',
550 => '| <tt>real</tt>',
551 => '|-',
552 => '| Visual Basic',
553 => '| rowspan=3| <tt>Single</tt>',
554 => '| rowspan=3| <tt>Double</tt>',
555 => '| rowspan=3 {{n/a}}',
556 => '|-',
557 => '| Visual Basic .NET',
558 => '|-',
559 => '| Xojo',
560 => '|-',
561 => '| Python',
562 => '| rowspan=2 {{n/a}}',
563 => '| <tt>float</tt>',
564 => '| ',
565 => '|-',
566 => '| JavaScript',
567 => '| <tt>Number</tt><ref name="Javascript numbers">[http://www.mozilla.org/js/language/E262-3.pdf 8.5 The Number Type]</ref>',
568 => '| {{n/a}}',
569 => '|-',
570 => '| S-Lang',
571 => '| <!-- '''x =''' value'''f;''' -->',
572 => '| <!-- '''x =''' value''';''' -->',
573 => '| ',
574 => '|-',
575 => '| Fortran',
576 => '| colspan=2|<tt>REAL(KIND = n)</tt>{{ref|real inds|[c]}}',
577 => '| ',
578 => '|-',
579 => '| PHP',
580 => '| ',
581 => '| <tt>float</tt>',
582 => '| ',
583 => '|-',
584 => '| Perl',
585 => '| ',
586 => '| ',
587 => '| ',
588 => '|-',
589 => '| Perl 6',
590 => '| <tt>num32</tt>',
591 => '| <tt>num64</tt>',
592 => '|',
593 => '| <tt>Num</tt>',
594 => '|-',
595 => '| Ruby',
596 => '| {{n/a}}',
597 => '| <tt>Float</tt>',
598 => '| rowspan=4 {{n/a}}',
599 => '|-',
600 => '| Scala',
601 => '| <tt>Float</tt>',
602 => '| <tt>Double</tt>',
603 => '|-',
604 => '| Seed7',
605 => '| {{n/a}}',
606 => '| <tt>float</tt>',
607 => '|-',
608 => '| Smalltalk',
609 => '| <tt>Float</tt>',
610 => '| <tt>Double</tt>',
611 => '|-',
612 => '| Windows PowerShell',
613 => '| ',
614 => '| ',
615 => '|-',
616 => '| OCaml',
617 => '| {{n/a}}',
618 => '| rowspan=2| <tt>float</tt>',
619 => '| rowspan=3 {{n/a}}',
620 => '|-',
621 => '| F#',
622 => '| <tt>float32</tt>',
623 => '|-',
624 => '| Standard ML',
625 => '| {{n/a}}',
626 => '|',
627 => '| <tt>real</tt>',
628 => '|-',
629 => '| Haskell (GHC)',
630 => '| <tt>Float</tt>',
631 => '| <tt>Double</tt>',
632 => '| ',
633 => '|-',
634 => '| Eiffel',
635 => '| <tt>REAL_32</tt>',
636 => '| <tt>REAL_64</tt>',
637 => '| ',
638 => '|-',
639 => '| COBOL',
640 => '| <tt>FLOAT-BINARY-7</tt>{{ref|Cobol_ieee|[e]}}',
641 => '| <tt>FLOAT-BINARY-34</tt>{{ref|Cobol_ieee|[e]}}',
642 => '| <tt>FLOAT-SHORT</tt>, <tt>FLOAT-LONG</tt>, <tt>FLOAT-EXTENDED</tt>',
643 => '|-',
644 => '| Mathematica',
645 => '| {{n/a}}',
646 => '| {{n/a}}',
647 => '|',
648 => '| <tt>Real</tt>',
649 => '|}',
650 => '{{note|a68_real|a}} The <u>standard</u> constants <tt>real shorts</tt> and <tt>real lengths</tt> can be used to determine how many '<tt>short</tt>'s and '<tt>long</tt>'s can be usefully prefixed to '<tt>short real</tt>' and '<tt>long real</tt>'. The actually size of the '<tt>short real</tt>', '<tt>real</tt>' and '<tt>long real</tt>' is available as constants <tt>short max real</tt>, <tt>max real</tt> and <tt>long max real</tt> etc. With the constants <tt>short small real</tt>, <tt>small real</tt> and <tt>long small real</tt> available for each type's [[machine epsilon]].',
651 => '<br/>{{note|lax floats|b}} declarations of single precision often are not honored',
652 => '<br/>{{note|real kinds|c}} The value of "n" is provided by the <tt>SELECTED_REAL_KIND</tt><ref name="ReferenceA">{{cite web|url=http://fortranwiki.org/fortran/show/selected_real_kind|title=selected_real_kind in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref> intrinsic function.',
653 => '<br/>{{note|a68g-real|d}} [[ALGOL 68]]G's run time option ''<tt>--precision "number"</tt>'' can set precision for <tt>long long real</tt>s to the required "number" significant digits. The <u>standard</u> constants <tt>long long real width</tt> and '<tt>long long max real</tt> can be used to determine actual precision.',
654 => '<br/>{{note|Cobol-ieee|e}} These IEEE floating-point types will be introduced in the next COBOL standard.',
655 => '<br/>{{note|C-long-double|f}} Same size as '<tt>double</tt>' on many implementations.',
656 => '<br/>{{note|Swift-long-double|g}} Swift supports 80-bit [[Extended precision#Language support|extended precision]] floating point type, equivalent to <tt>long double</tt> in C languages.',
657 => false,
658 => '=== [[Complex number]]s ===',
659 => false,
660 => '{|class="wikitable"',
661 => '! ',
662 => '! Integer',
663 => '! Single precision',
664 => '! Double precision',
665 => '! Half and Quadruple precision etc.',
666 => '|-',
667 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
668 => '| {{n/a}}',
669 => '| <tt>Complex</tt>{{ref|generic type|[b]}}',
670 => '| <tt>Complex</tt>{{ref|generic type|[b]}}',
671 => '| <tt>Complex</tt>{{ref|generic type|[b]}}',
672 => '|-',
673 => '| ALGOL 68',
674 => '| {{n/a}}',
675 => '| <tt>compl</tt>',
676 => '| <tt>long compl</tt> etc.',
677 => '| <tt>short compl</tt> etc. & <tt>long long compl</tt> etc.',
678 => '|-',
679 => '| C (C99) <ref>{{cite web|url=https://www.gnu.org/software/libc/manual/html_node/Complex-Numbers.html#Complex-Numbers|title=The GNU C Library: Complex Numbers|author=|date=|work=gnu.org|accessdate=30 January 2017}}</ref>',
680 => '| {{n/a}}',
681 => '| <tt>float complex</tt>',
682 => '| <tt>double complex</tt>',
683 => '| rowspan=7 {{n/a}}',
684 => '|-',
685 => '| C++ (STL)',
686 => '| {{n/a}}<!-- No std::complex<int>. See C++ standard section 26.2 paragraph 2 -->',
687 => '| <tt>std::complex<float></tt>',
688 => '| <tt>std::complex<double></tt>',
689 => '|-',
690 => '| C#',
691 => '| {{n/a}}',
692 => '| {{n/a}}',
693 => '| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)',
694 => '|-',
695 => '| Java',
696 => '| {{n/a}}',
697 => '| {{n/a}}',
698 => '| {{n/a}}',
699 => '|-',
700 => '| Go',
701 => '| {{n/a}}',
702 => '| <tt>complex64</tt>',
703 => '| <tt>complex128</tt>',
704 => '|-',
705 => '| D',
706 => '| {{n/a}}',
707 => '| <tt>cfloat</tt>',
708 => '| <tt>cdouble</tt>',
709 => '|-',
710 => '| Objective-C',
711 => '| {{n/a}}',
712 => '| {{n/a}}',
713 => '| {{n/a}}',
714 => '|-',
715 => '| Common Lisp',
716 => '| (complex integer)',
717 => '| (complex single-float)',
718 => '| (complex double-float)',
719 => '| complex',
720 => '|-',
721 => '| Scheme',
722 => '|',
723 => '|',
724 => '|',
725 => '| rowspan=4 {{n/a}}',
726 => '|-',
727 => '| Pascal',
728 => '| {{n/a}}',
729 => '| {{n/a}}',
730 => '|',
731 => '|-',
732 => '| Visual Basic',
733 => '| {{n/a}}',
734 => '| {{n/a}}',
735 => '|',
736 => '|-',
737 => '| Visual Basic .NET',
738 => '| {{n/a}}',
739 => '| {{n/a}}',
740 => '| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)',
741 => '|-',
742 => '| Perl',
743 => '| ',
744 => '| ',
745 => '| <tt>Math::Complex</tt>',
746 => '| ',
747 => '|-',
748 => '| Perl 6',
749 => '| ',
750 => '| <tt>complex64</tt>',
751 => '| <tt>complex128</tt>',
752 => '| <tt>Complex</tt>',
753 => '|-',
754 => '| Python',
755 => '| ',
756 => '|',
757 => '| <tt>complex</tt>',
758 => '| rowspan=15 {{n/a}}',
759 => '|-',
760 => '| JavaScript',
761 => '| {{n/a}}',
762 => '| {{n/a}}',
763 => '|',
764 => '|-',
765 => '| S-Lang',
766 => '| {{n/a}}',
767 => '| {{n/a}}',
768 => '|',
769 => '|-',
770 => '| Fortran',
771 => '| ',
772 => '| colspan=2|<tt>COMPLEX(KIND = n)</tt>{{ref|complex kinds|[a]}}',
773 => '|-',
774 => '| Ruby',
775 => '| <tt>Complex</tt>',
776 => '| {{n/a}}',
777 => '| <tt>Complex</tt>',
778 => '|-',
779 => '| Scala',
780 => '| {{n/a}}',
781 => '| {{n/a}}',
782 => '| {{n/a}}',
783 => '|-',
784 => '| Seed7',
785 => '| {{n/a}}',
786 => '| {{n/a}}',
787 => '| <tt>complex</tt>',
788 => '|-',
789 => '| Smalltalk',
790 => '| <tt>Complex</tt>',
791 => '| <tt>Complex</tt>',
792 => '| <tt>Complex</tt>',
793 => '|-',
794 => '| Windows PowerShell',
795 => '| {{n/a}}',
796 => '| {{n/a}}',
797 => '|',
798 => '|-',
799 => '| OCaml',
800 => '| {{n/a}}',
801 => '| {{n/a}}',
802 => '| <tt>Complex.t</tt>',
803 => '|-',
804 => '| F#',
805 => '| ',
806 => '| ',
807 => '| <tt>System.Numerics.Complex</tt> <br />(.NET 4.0)',
808 => '|-',
809 => '| Standard ML',
810 => '| {{n/a}}',
811 => '| {{n/a}}',
812 => '| {{n/a}}',
813 => '|-',
814 => '| Haskell (GHC)',
815 => '| {{n/a}}',
816 => '| <tt>Complex{{Not a typo|.}}Complex Float</tt>',
817 => '| <tt>Complex{{Not a typo|.}}Complex Double</tt>',
818 => '|-',
819 => '| Eiffel',
820 => '| {{n/a}}',
821 => '| {{n/a}}',
822 => '| {{n/a}}',
823 => '|-',
824 => '| COBOL',
825 => '| {{n/a}}',
826 => '| {{n/a}}',
827 => '| {{n/a}}',
828 => '|-',
829 => '| Mathematica',
830 => '| <tt>Complex</tt>',
831 => '| {{n/a}}',
832 => '| {{n/a}}',
833 => '| <tt>Complex</tt>',
834 => '|}',
835 => false,
836 => '{{note|complex kinds|a}} The value of "n" is provided by the <tt>SELECTED_REAL_KIND</tt><ref name="ReferenceA"/> intrinsic function.',
837 => false,
838 => '{{note|generic type|b}} Generic type which can be instantiated with any base floating point type.',
839 => false,
840 => '=== Other variable types ===',
841 => false,
842 => '{|class="wikitable"',
843 => '! rowspan=2|',
844 => '! colspan=2| Text',
845 => '! rowspan=2| [[Boolean datatype|Boolean]]',
846 => '! rowspan=2| [[Enumerated type|Enumeration]]',
847 => '! rowspan=2| [[Object (computer science)|Object]]/[[Top type|Universal]]',
848 => '|-',
849 => '! [[Character (computing)|Character]]',
850 => '! [[String (computer science)|String]]{{ref|string|[a]}}',
851 => '|-',
852 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
853 => '| <tt>Character</tt>',
854 => '| <tt>String''' & '''Bounded_String''' & '''Unbounded_String</tt>',
855 => '| <tt>Boolean</tt>',
856 => '| <tt>('''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ...''')</tt>',
857 => '| <tt>tagged null record</tt>',
858 => '|-',
859 => '| ALGOL 68',
860 => '| <tt>char</tt>',
861 => '| <tt>string''' & '''bytes</tt>',
862 => '| <tt>bool''' & '''bits</tt>',
863 => '| {{n/a}} - [http://rosettacode.org/wiki/Enumerations#ALGOL_68 User defined]',
864 => '| {{n/a}}',
865 => '|-',
866 => '| C (C99)',
867 => '| rowspan=2| <tt>char'''<br/>'''wchar_t</tt>',
868 => '| {{n/a}}',
869 => '| rowspan=2| <tt>bool</tt>{{ref|int bool|[b]}}',
870 => '| rowspan=3|<tt>'''enum''' «name» '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''};</tt>',
871 => '| rowspan=2| <tt>[[void type|void]] [[pointer (computer programming)|*]]</tt>',
872 => '|-',
873 => '| C++ (STL)',
874 => '| <code>[[std::string|</code>«<tt>std::'''»'''<code>string]]</code></tt>',
875 => '|-',
876 => '| Objective-C',
877 => '| <tt>unichar</tt>',
878 => '| <tt>NSString *</tt>',
879 => '| <tt>BOOL</tt>',
880 => '| <tt>id</tt>',
881 => '|-',
882 => '| C#',
883 => '| rowspan=2| <tt>char</tt>',
884 => '| <tt>string</tt>',
885 => '| <tt>bool</tt>',
886 => '| rowspan=2| <tt>'''enum''' name '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}'''</tt>',
887 => '| <tt>object</tt>',
888 => '|-',
889 => '| Java',
890 => '| <tt>String</tt>',
891 => '| <tt>boolean</tt>',
892 => '| <tt>Object</tt>',
893 => '|-',
894 => '| Go',
895 => '| <tt>byte'''<br/>'''rune</tt>',
896 => '| <tt>string</tt>',
897 => '| <tt>bool</tt>',
898 => '| <tt>const (<dl><dd>'''item<sub>1</sub>''' = iota'''<br/>item<sub>2</sub><br/> ... '''</dd></dl>)</tt>',
899 => '| <tt>interface{}</tt>',
900 => '|-',
901 => '| Swift',
902 => '| <tt>Character</tt>',
903 => '| <tt>String</tt>',
904 => '| <tt>Bool</tt>',
905 => '| <tt>'''enum''' name '''{ case''' item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}'''</tt>',
906 => '| <tt>Any</tt>',
907 => '|-',
908 => '| D',
909 => '| <tt>char</tt>',
910 => '| <tt>string</tt>',
911 => '| <tt>bool</tt>',
912 => '| <tt>enum''' name '''{'''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''}</tt>',
913 => '| <tt>std.variant.Variant</tt>',
914 => '|-',
915 => '| Common Lisp',
916 => '|',
917 => '|',
918 => '|',
919 => '|',
920 => '|',
921 => '|-',
922 => '| Scheme',
923 => '| ',
924 => '|',
925 => '| ',
926 => '|',
927 => '|',
928 => '|-',
929 => '| ISLISP',
930 => '| ',
931 => '|',
932 => '| ',
933 => '|',
934 => '|',
935 => '|-',
936 => '| Pascal (ISO)',
937 => '| rowspan=2| <tt>char</tt>',
938 => '| {{n/a}}',
939 => '| rowspan=2| <tt>boolean</tt>',
940 => '| rowspan=2| <tt>('''item<sub>1</sub>''',''' item<sub>2</sub>''',''' ...''')</tt>',
941 => '| {{n/a}}',
942 => '|-',
943 => '| Object Pascal (Delphi)',
944 => '| <tt>string</tt>',
945 => '| <tt>variant</tt>',
946 => '|-',
947 => '| Visual Basic',
948 => '| {{n/a}}',
949 => '| rowspan=3| <tt>String</tt>',
950 => '| rowspan=3| <tt>Boolean</tt>',
951 => '| rowspan=3| <tt>Enum''' name <dl><dd> item<sub>1</sub> <br /> item<sub>2</sub> <br /> ... </dd></dl> '''End Enum</tt>',
952 => '| <tt>[[Variant type|Variant]]</tt>',
953 => '|-',
954 => '| Visual Basic .NET',
955 => '| <tt>Char</tt>',
956 => '| <tt>Object</tt>',
957 => '|-',
958 => '| Xojo',
959 => '| {{n/a}}',
960 => '| <tt>Object or Variant</tt>',
961 => '|-',
962 => '| Python',
963 => '| {{n/a}}{{ref|string as char|[d]}}',
964 => '| <tt>str</tt>',
965 => '| <tt>bool</tt>',
966 => '|',
967 => '| <tt>object</tt>',
968 => '|-',
969 => '| JavaScript',
970 => '| {{n/a}}{{ref|string as char|[d]}}',
971 => '| <tt>String</tt>',
972 => '| <tt>Boolean</tt>',
973 => '|',
974 => '| <tt>Object</tt>',
975 => '|-',
976 => '| S-Lang',
977 => '| ',
978 => '|',
979 => '| ',
980 => '|',
981 => '| ',
982 => '|-',
983 => '| Fortran',
984 => '| <tt>CHARACTER(LEN = *)</tt>',
985 => '| <tt>CHARACTER(LEN = :), allocatable </tt>',
986 => '| <tt>LOGICAL(KIND = n)</tt>{{ref|logical kinds|[f]}}',
987 => '|',
988 => '| <tt>CLASS(*)</tt>',
989 => '|-',
990 => '| PHP',
991 => '| {{n/a}}{{ref|string as char|[d]}}',
992 => '| <tt>string</tt>',
993 => '| <tt>bool</tt>',
994 => '|',
995 => '| (type declaration omitted)',
996 => '|-',
997 => '| Perl',
998 => '| {{n/a}}{{ref|string as char|[d]}}',
999 => '| ',
1000 => '|',
1001 => '|',
1002 => '| <tt>UNIVERSAL</tt>',
1003 => '|-',
1004 => '| Perl 6',
1005 => '| <tt>Char</tt>',
1006 => '| <tt>Str</tt>',
1007 => '| <tt>Bool</tt>',
1008 => '| <tt>enum''' name '''<'''item<sub>1</sub> item<sub>2</sub> ...'''>''' or<br /> '''enum''' name '''<<:'''item<sub>1</sub>'''('''value''')''' ''':'''item<sub>2</sub>'''('''value''')''' ...'''>></tt>',
1009 => '| <tt>Mu</tt>',
1010 => '|-',
1011 => '| Ruby',
1012 => '| {{n/a}}{{ref|string as char|[d]}}',
1013 => '| <tt>String</tt>',
1014 => '| <tt>Object</tt>{{ref|Ruby's bool|[c]}}',
1015 => '|',
1016 => '| <tt>Object</tt>',
1017 => '|-',
1018 => '| Scala',
1019 => '| <tt>Char</tt>',
1020 => '| <tt>String</tt>',
1021 => '| <tt>Boolean</tt>',
1022 => '| <tt>object''' name '''extends Enumeration {'''<dl><dd>'''val''' item<sub>1</sub>''',''' item<sub>2</sub>''',''' ... '''= Value'''</dd></dl>'''}</tt>',
1023 => '| <tt>Any</tt>',
1024 => '|-',
1025 => '| Seed7',
1026 => '| <tt>char</tt>',
1027 => '| <tt>string</tt>',
1028 => '| <tt>boolean</tt>',
1029 => '| <tt>'''const type''': name '''is new enum'''<dl><dd> item<sub>1</sub>''','''<br /> item<sub>2</sub>''','''<br /> ... </dd></dl>'''end enum;'''</tt>',
1030 => '|',
1031 => '|-',
1032 => '| Windows PowerShell',
1033 => '| ',
1034 => '| ',
1035 => '|',
1036 => '|',
1037 => '|',
1038 => '|-',
1039 => '| OCaml',
1040 => '| rowspan=3| <tt>char</tt>',
1041 => '| rowspan=3| <tt>string</tt>',
1042 => '| rowspan=3| <tt>bool</tt>',
1043 => '| {{n/a}}{{ref|enum|[e]}}',
1044 => '| {{n/a}}',
1045 => '|-',
1046 => '| F#',
1047 => '| <tt>type''' name '''=''' item<sub>1</sub> '''=''' value '''<nowiki>|</nowiki>''' item<sub>2</sub> = value '''<nowiki>|</nowiki></tt> ...',
1048 => '| <tt>obj</tt>',
1049 => '|-',
1050 => '| Standard ML',
1051 => '| {{n/a}}{{ref|enum|[e]}}',
1052 => '| {{n/a}}',
1053 => '|-',
1054 => '| Haskell (GHC)',
1055 => '| <tt>Char</tt>',
1056 => '| <tt>String</tt>',
1057 => '| <tt>Bool</tt>',
1058 => '| {{n/a}}{{ref|enum|[e]}}',
1059 => '| {{n/a}}',
1060 => '|-',
1061 => '| Eiffel',
1062 => '| <tt>CHARACTER</tt>',
1063 => '| <tt>STRING</tt>',
1064 => '| <tt>BOOLEAN</tt>',
1065 => '| {{n/a}}',
1066 => '| <tt>ANY</tt>',
1067 => '|-',
1068 => '| COBOL',
1069 => '| <tt>PIC X</tt>',
1070 => '| <tt>PIC X('''string length''') '''or''' PIC X«X...»</tt>',
1071 => '| <tt>PIC 1«('''number of digits''')» '''or''' PIC 1«1...»</tt>',
1072 => '| {{n/a}}',
1073 => '| <tt>OBJECT REFERENCE</tt>',
1074 => '|-',
1075 => '| Mathematica',
1076 => '| {{n/a}}{{ref|string as char|[d]}}',
1077 => '| <tt>String</tt>',
1078 => '| ',
1079 => '| ',
1080 => '| {{n/a}}',
1081 => '|}',
1082 => '{{note|string|a}} specifically, strings of arbitrary length and automatically managed.',
1083 => '<br/>{{note|int bool|b}} This language represents a boolean as an integer where false is represented as a value of zero and true by a non-zero value.',
1084 => '<br/>{{note|Ruby's bool|c}} All values evaluate to either true or false. Everything in '''<tt>TrueClass</tt>''' evaluates to true and everything in '''<tt>FalseClass</tt>''' evaluates to false.',
1085 => '<br/>{{note|string as char|d}}This language does not have a separate character type. Characters are represented as strings of length 1.',
1086 => '<br/>{{note|enum|e}} Enumerations in this language are algebraic types with only nullary constructors',
1087 => '<br/>{{note|logical kinds|f}} The value of "n" is provided by the <tt>SELECTED_INT_KIND</tt><ref name="fortranwiki.org"/> intrinsic function.',
1088 => false,
1089 => '== Derived types ==',
1090 => false,
1091 => '=== [[Array data type|Array]] ===',
1092 => false,
1093 => '{{further|Comparison of programming languages (array)}}',
1094 => '{| class="wikitable"',
1095 => '|- valign="top"',
1096 => '! rowspan=2|',
1097 => '! colspan=2| fixed size array',
1098 => '! colspan=2| dynamic size array',
1099 => '|- valign="top"',
1100 => '! one-dimensional array',
1101 => '! [[Array data structure|multi-dimensional array]]',
1102 => '! one-dimensional array',
1103 => '! [[Array data structure|multi-dimensional array]]',
1104 => '|- valign="top"',
1105 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
1106 => '| <tt>'''array ('''<first>''' .. '''<last>''') of '''<type></tt><br>or<br>'''array ('''<discrete_type>''') of '''<type></tt>',
1107 => '| <tt>'''array ('''<first<sub>1</sub>>''' .. '''<last<sub>1</sub>>''', '''<first<sub>2</sub>>''' .. '''<last<sub>2</sub>>''',''' ...''') of '''<type><br>or<br>'''array ('''<discrete_type<sub>1</sub>>''', '''<discrete_type<sub>2</sub>>''', '''...''') of '''<type></tt>',
1108 => '| <tt>'''array ('''<discrete_type>''' range <>) of '''<type></tt>',
1109 => '| <tt>'''array ('''<discrete_type<sub>1</sub>>''' range <>, '''<discrete_type<sub>2</sub>>''' range <>,''' ...''') of '''<type></tt>',
1110 => '|- valign="top"',
1111 => '| ALGOL 68',
1112 => '| <tt>[''first'':''last'']'''<wbr/>«modename»'''</tt><br/>or simply:<br/><tt>[''size'']'''<wbr/>«modename»'''</tt>',
1113 => '| <tt>[''first<sub>1</sub>'':''last<sub>1</sub>'', ''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>or<br><tt>[''first<sub>1</sub>'':''last<sub>1</sub>''][''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>etc.',
1114 => '| <tt>'''flex'''[''first'':''last'']'''<wbr/>«modename»'''</tt><br/>or simply:<br/><tt>'''flex'''[''size'']'''<wbr/>«modename»'''</tt>',
1115 => '| <tt>'''flex'''[''first<sub>1</sub>'':''last<sub>1</sub>'', ''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»'''</tt><br/>or<br/><tt>'''flex'''[''first<sub>1</sub>'':''last<sub>1</sub>'']<wbr/>'''flex'''[''first<sub>2</sub>'':''last<sub>2</sub>'']'''<wbr/>«modename»''' etc.</tt>',
1116 => '|- valign="top"',
1117 => '| C (C99)',
1118 => '| <tt>type name'''['''size''']'''{{ref|C's array|[a]}}</tt>',
1119 => '| <tt>type name'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''{{ref|C's array|[a]}}</tt>',
1120 => '| <tt>type '''*'''name</tt><br/>or within a block:<br/><tt>int n = ...; type name'''['''n''']'''</tt>',
1121 => '|',
1122 => '|- valign="top"',
1123 => '| C++ (STL)',
1124 => '| colspan=1| <tt>'''[[std::array|«std::»array]]<'''type, size'''>'''</tt>(C++11)',
1125 => '|',
1126 => '| colspan=2| <tt>'''[[std::vector|«std::»vector]]<'''type'''>'''</tt>',
1127 => '|- valign="top"',
1128 => '| C#',
1129 => '| <tt>type'''[]'''</tt>',
1130 => '| <tt>type'''[{{Not a typo|,,}}'''...''']'''</tt>',
1131 => '| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/><'''type'''>'''</tt>',
1132 => '|',
1133 => '|- valign="top"',
1134 => '| Java',
1135 => '| <tt>type'''[]'''{{ref|Java's array|[b]}}</tt>',
1136 => '| <tt>type'''[][]'''...{{ref|Java's array|[b]}}</tt>',
1137 => '| <tt>'''ArrayList''' or '''ArrayList<'''type'''>'''</tt>',
1138 => '|',
1139 => '|- valign="top"',
1140 => '| D',
1141 => '| <tt>type'''['''size''']'''</tt>',
1142 => '| <tt>type'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''</tt>',
1143 => '| <tt>type'''[]'''</tt>',
1144 => '|',
1145 => '|- valign="top"',
1146 => '| Go',
1147 => '| <tt>'''['''size''']'''type</tt>',
1148 => '| <tt>'''['''size<sub>1</sub>''']['''size<sub>2</sub>''']'''...type</tt>',
1149 => '| <tt>'''[]type'''</tt>',
1150 => '| <tt>'''[][]type'''</tt>',
1151 => '|',
1152 => '|- valign="top"',
1153 => '| Swift',
1154 => '| ',
1155 => '| ',
1156 => '| <tt>'''['''type''']'''</tt> or <tt>'''Array<'''type'''>'''</tt>',
1157 => '| <tt>'''<nowiki>[[</nowiki>'''type'''<nowiki>]]</nowiki>'''</tt> or <tt>'''Array<Array<'''type'''>>'''</tt>',
1158 => '|',
1159 => '|- valign="top"',
1160 => '| Objective-C',
1161 => '| <tt>'''NSArray'''</tt>',
1162 => '|',
1163 => '| <tt>'''NSMutableArray'''</tt>',
1164 => '|',
1165 => '|- valign="top"',
1166 => '| JavaScript',
1167 => '| {{n/a}}',
1168 => '| {{n/a}}',
1169 => '| colspan=2|<tt>'''Array'''</tt>{{ref|JavaScript's array|[d]}}',
1170 => '|- valign="top"',
1171 => '| Common Lisp',
1172 => '| ',
1173 => '| ',
1174 => '|',
1175 => '|',
1176 => '|- valign="top"',
1177 => '| Scheme',
1178 => '| ',
1179 => '| ',
1180 => '| ',
1181 => '| ',
1182 => '|- valign="top"',
1183 => '| ISLISP',
1184 => '| ',
1185 => '| ',
1186 => '| ',
1187 => '| ',
1188 => '|- valign="top"',
1189 => '| Pascal',
1190 => '| rowspan=2|<tt>'''array['''first'''..'''last'''] of''' type{{ref|subrange|[c]}}</tt>',
1191 => '| rowspan=2|<tt>'''array['''first<sub>1</sub>'''..'''last<sub>1</sub>'''] of array['''first<sub>2</sub>'''..'''last<sub>2</sub>'''] ''' ... '''of''' type {{ref|subrange|[c]}}<br/></tt>',
1192 => 'or<br/>',
1193 => '<tt>''' array['''first<sub>1</sub>'''..'''last<sub>1</sub>''', '''first<sub>2</sub>'''..'''last<sub>2</sub>''', '''...'''] of''' type </tt>{{ref|subrange|[c]}}',
1194 => '| {{n/a}}',
1195 => '| {{n/a}}',
1196 => '|- valign="top"',
1197 => '| Object Pascal (Delphi)',
1198 => '|<tt>'''array of''' type</tt>',
1199 => '|<tt>'''array of array''' ... '''of''' type</tt>',
1200 => '|- valign="top"',
1201 => '| Visual Basic',
1202 => '| <tt><!-- '''Dim x('''last''') As '''type''' --></tt>',
1203 => '| <tt><!-- '''Dim x('''last<sub>1</sub>''', '''last<sub>2</sub>''','''...''') As '''type''' --></tt>',
1204 => '|',
1205 => '|',
1206 => '|- valign="top"',
1207 => '| Visual Basic .NET',
1208 => '|',
1209 => '|',
1210 => '| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/>(Of''' type''')'''</tt>',
1211 => '|',
1212 => '|- valign="top"',
1213 => '| Python',
1214 => '| ',
1215 => '| ',
1216 => '| <tt>'''list'''</tt>',
1217 => '| ',
1218 => '|- valign="top"',
1219 => '| S-Lang',
1220 => '| <tt><!-- '''x = '''type'''['''size'''];''' --></tt>',
1221 => '| <tt><!-- '''x = '''type'''['''size<sub>1</sub>''', '''size<sub>2</sub>''', '''...'''];''' --></tt>',
1222 => '|',
1223 => '|',
1224 => '|- valign="top"',
1225 => '| Fortran',
1226 => '| <tt>''' '''type''' :: '''name'''('''size''')'''</tt>',
1227 => '| <tt>''' '''type''' :: '''name'''('''size'''<sub>1</sub>, '''size'''<sub>2</sub>,...)'''</tt>',
1228 => '| <tt>''' '''type''', ALLOCATABLE :: '''name'''(:)'''</tt>',
1229 => '| <tt>''' '''type''', ALLOCATABLE :: '''name'''(:,:,...)'''</tt>',
1230 => '|- valign="top"',
1231 => '| PHP',
1232 => '| ',
1233 => '|',
1234 => '| <tt>'''array'''</tt>',
1235 => '|',
1236 => '|- valign="top"',
1237 => '| Perl',
1238 => '| ',
1239 => '| ',
1240 => '|',
1241 => '|',
1242 => '|- valign="top"',
1243 => '| Perl 6',
1244 => '| ',
1245 => '| ',
1246 => '| <tt>'''Array['''type''']''' or '''Array of''' type</tt>',
1247 => '|',
1248 => '|- valign="top"',
1249 => '| Ruby',
1250 => '| ',
1251 => '| <tt><!-- '''x = Array.new('''size<sub>1</sub>'''){ Array.new('''size<sub>2</sub>''') }''' --></tt>',
1252 => '| <tt>'''Array'''</tt>',
1253 => '|',
1254 => '|- valign="top"',
1255 => '| Scala',
1256 => '| <tt>'''Array['''type''']'''</tt>',
1257 => '| <tt>'''Array['''...'''[Array['''type''']]'''...''']'''</tt>',
1258 => '| <tt>'''ArrayBuffer['''type''']'''</tt>',
1259 => '|',
1260 => '|- valign="top"',
1261 => '| Seed7',
1262 => '| <tt>'''array''' type<br />or<br />'''array ['''idxType''']''' type</tt>',
1263 => '| <tt>'''array array''' type<br />or<br />'''array ['''idxType'''] array ['''idxType''']''' type</tt>',
1264 => '| <tt>'''array''' type<br />or<br />'''array ['''idxType''']''' type</tt>',
1265 => '| <tt>'''array array''' type<br />or<br />'''array ['''idxType'''] array ['''idxType''']''' type</tt>',
1266 => '|- valign="top"',
1267 => '| Smalltalk',
1268 => '| <tt>'''Array'''</tt>',
1269 => '| ',
1270 => '| <tt>'''OrderedCollection'''</tt>',
1271 => '|',
1272 => '|- valign="top"',
1273 => '| Windows PowerShell',
1274 => '| <tt>type'''[]'''</tt>',
1275 => '|<tt>type'''[{{Not a typo|,,}}'''...''']'''</tt>',
1276 => '|',
1277 => '|',
1278 => '|- valign="top"',
1279 => '| OCaml',
1280 => '| <tt>type '''array'''</tt>',
1281 => '| <tt>type '''array''' ... '''array'''</tt>',
1282 => '| ',
1283 => '|',
1284 => '|- valign="top"',
1285 => '| F#',
1286 => '| <tt>type '''[]''' or type '''array'''</tt>',
1287 => '| <tt>type '''[{{Not a typo|,,}}'''...''']'''</tt>',
1288 => '| <tt>'''System<wbr/>.Collections<wbr/>.ArrayList'''<br/>or<br/>'''System<wbr/>.Collections<wbr/>.Generic<wbr/>.List<wbr/><'''type'''>'''</tt>',
1289 => '|',
1290 => '|- valign="top"',
1291 => '| Standard ML',
1292 => '| <tt>type '''vector''' or type '''array'''</tt>',
1293 => '| ',
1294 => '|',
1295 => '|',
1296 => '|- valign="top"',
1297 => '| Haskell (GHC)',
1298 => '| <tt><!-- '''x = Array.array (0, '''size'''-1)''' list_of_association_pairs --></tt>',
1299 => '| <tt><!-- '''x = Array.array ((0, 0,'''...'''), ('''size<sub>1</sub>'''-1, '''size<sub>2</sub>'''-1,'''...'''))''' list_of_association_pairs --></tt>',
1300 => '|',
1301 => '|',
1302 => '|- valign="top"',
1303 => '| COBOL',
1304 => '| <tt>level-number type '''OCCURS''' size «'''TIMES'''»'''.'''',
1305 => '| <tt>one-dimensional array definition...</tt>',
1306 => '| <tt>level-number type '''OCCURS''' min-size '''TO''' max-size «'''TIMES'''» '''DEPENDING''' «'''ON'''» size'''.'''</tt>{{ref|COBOL DEPENDING ON clause|[e]}}',
1307 => '| {{n/a}}',
1308 => '|}',
1309 => '{{note|C's array|a}}In most expressions (except the <tt>sizeof</tt> and <tt>&</tt> operators), values of array types in C are automatically converted to a pointer of its first argument. See [[C syntax#Arrays]] for further details of syntax and pointer operations.',
1310 => '<br/>{{note|Java's array|b}} The C-like "type '''<tt>x[]</tt>'''" works in Java, however "type'''<tt>[] x</tt>'''" is the preferred form of array declaration.',
1311 => '<br/>{{note|subrange|c}} Subranges are used to define the bounds of the array.',
1312 => '<br/>{{note|JavaScript's array|d}} JavaScript's array are a special kind of object. <!-- explain array(size) thing -->',
1313 => '<br/>{{note|COBOL DEPENDING ON clause|e}} The <code>DEPENDING ON</code> clause in COBOL does not create a 'true' variable length array and will always allocate the maximum size of the array.',
1314 => false,
1315 => '=== Other types ===',
1316 => '{| class="wikitable"',
1317 => '! rowspan=2|',
1318 => '! colspan=2|Simple composite types',
1319 => '! rowspan=2|[[Algebraic data type]]s',
1320 => '! rowspan=2|[[Union (computer science)|Unions]]',
1321 => '|-',
1322 => '! [[Record (computer science)|Records]]',
1323 => '! [[Tuple]] expression',
1324 => '|-',
1325 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
1326 => '| <tt>'''type''' identifier '''is''' «'''abstract'''» «'''tagged'''» «'''limited'''» ['''record'''',
1327 => '<dl><dd>fieldname<sub>1</sub> ''':''' type''';'''</dd>',
1328 => '<dd>fieldname<sub>2</sub> ''':''' type''';'''</dd></dl>...<br>',
1329 => ''''end record''' <nowiki>|</nowiki>',
1330 => ''''null record''']</tt>',
1331 => '| {{n/a}}',
1332 => '| Any combination of records, unions and enumerations (as well as references to those, enabling recursive types).',
1333 => '| <tt>'''type''' identifier '''('''variation ''':''' discrete_type''') is record'''',
1334 => '<dl><dd>'''case''' variation '''is'''',
1335 => '<dl><dd>'''when''' choice_list<sub>1</sub> '''<nowiki>=></nowiki>'''',
1336 => '<dl><dd>fieldname<sub>1</sub> ''':''' type''';'''</dd>',
1337 => '<dd>...</dd></dl></dd></dl>',
1338 => '<dl><dd>'''when''' choice_list<sub>2</sub> '''<nowiki>=></nowiki>'''',
1339 => '<dl><dd>fieldname<sub>2</sub> ''':''' type''';'''</dd>',
1340 => '<dd>...</dd></dl></dd></dl>',
1341 => '<dl><dd>...</dd></dl>',
1342 => ''''end case;'''</dd></dl>'''end record'''</tt>',
1343 => '|-',
1344 => '| ALGOL 68',
1345 => '| <tt>'''struct''' ('''modename''' ''«fieldname»'', '''...''');</tt>',
1346 => '| colspan=2 align=center| Required types and operators can be [[User-defined function|user defined]]',
1347 => '| <tt>'''union''' ('''modename''', '''...''');</tt>',
1348 => '|-',
1349 => '| C (C99)',
1350 => '| rowspan=2| <tt>'''struct''' «name» '''{'''type name''';'''...'''};'''</tt>',
1351 => '| rowspan=2 {{n/a}}',
1352 => '| rowspan=3 {{n/a}}',
1353 => '| rowspan=3| <tt>'''union {'''type name''';'''...'''};'''</tt>',
1354 => '|-',
1355 => '| Objective-C',
1356 => '|-',
1357 => '| C++',
1358 => '| <tt>'''struct''' «name» '''{'''type name''';'''...'''};'''{{ref|C++'s struct|[b]}}</tt>',
1359 => '| <tt>[[C++11#Tuple_types|«std::»tuple]]<type<sub>1</sub>..type<sub>n</sub>></tt>',
1360 => '|-',
1361 => '| C#',
1362 => '| <tt>'''struct''' name '''{'''type name''';'''...'''}'''</tt>',
1363 => '|',
1364 => '|',
1365 => '| rowspan=3 {{n/a}}',
1366 => '|-',
1367 => '| Java',
1368 => '| {{n/a}}{{ref|just classes|[a]}}',
1369 => '|',
1370 => '|',
1371 => '|-',
1372 => '| JavaScript',
1373 => '|',
1374 => '| {{n/a}}',
1375 => '|',
1376 => '|-',
1377 => '| D',
1378 => '| <tt>'''struct''' name '''{'''type name''';'''...'''}'''</tt>',
1379 => '| ',
1380 => '| <tt>'''std.variant.Algebraic'''!(type,...)</tt>',
1381 => '| <tt>'''union {'''type name''';'''...'''}'''</tt>',
1382 => '|-',
1383 => '| Go',
1384 => '| <tt>'''struct {<dl><dd>'''«name» type'''<br/>'''...'''</dd></dl>}'''</tt>',
1385 => '| ',
1386 => '| ',
1387 => '| ',
1388 => '|-',
1389 => '| Swift',
1390 => '| <tt>'''struct''' name '''{<dl><dd>var '''name «''': '''type»'''<br/>'''...'''</dd></dl>}'''</tt>',
1391 => '| <tt>'''('''«name<sub>1</sub>''':'''» val<sub>1</sub>''',''' «name<sub>2</sub>''':'''» val<sub>2</sub>''',''' «name<sub>3</sub>''':'''» val<sub>3</sub>''',''' ... ''')'''</tt>',
1392 => '| <tt>'''enum''' name '''{ case''' Foo«'''('''types''')'''»''' case''' Bar «'''('''types''')'''» ... '''}'''</tt>',
1393 => '| ',
1394 => '|-',
1395 => '| Common Lisp',
1396 => '|',
1397 => '| rowspan=3| <tt>'''(cons '''val<sub>1</sub> val<sub>2</sub>''')'''{{ref|pair only|[c]}}</tt>',
1398 => '|',
1399 => '|',
1400 => '|-',
1401 => '| Scheme',
1402 => '| {{n/a}}',
1403 => '|',
1404 => '|',
1405 => '|-',
1406 => '| ISLISP',
1407 => '|',
1408 => '|',
1409 => '|',
1410 => '|-',
1411 => '| Pascal',
1412 => '| <tt>'''record'''<dl><dd>name''':''' type''';'''<br/>...</dd></dl>'''end'''</tt>',
1413 => '| {{n/a}}',
1414 => '| {{n/a}}',
1415 => '| <tt>'''record'''<dl><dd>'''case''' type '''of''' <br/>value''': ('''types''');'''<br/>...</dd></dl>'''end'''</tt>',
1416 => '|-',
1417 => '| Visual Basic',
1418 => '|',
1419 => '|',
1420 => '|',
1421 => '|',
1422 => '|-',
1423 => '| Visual Basic .NET',
1424 => '| <tt>'''Structure''' name <dl><dd> '''Dim''' name '''As''' type <br/> ... </dd></dl>''' End Structure'''</tt>',
1425 => '|',
1426 => '|',
1427 => '|',
1428 => '|-',
1429 => '| Python',
1430 => '| {{n/a}}{{ref|just classes|[a]}}',
1431 => '| <tt>«'''('''»val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... «''')'''»</tt>',
1432 => '|',
1433 => '| {{n/a}}',
1434 => '|-',
1435 => '| S-Lang',
1436 => '| <tt>'''struct {'''name [=value], ...'''}'''</tt>',
1437 => '|',
1438 => '|',
1439 => '|',
1440 => '|-',
1441 => '| Fortran',
1442 => '|'''TYPE''' name <dl><dd> ''' '''type''' :: ''' name <br/> ... </dd></dl>''' END TYPE'''',
1443 => '|',
1444 => '|',
1445 => '|',
1446 => '|-',
1447 => '| PHP',
1448 => '| {{n/a}}{{ref|just classes|[a]}}',
1449 => '|',
1450 => '|',
1451 => '|',
1452 => '|-',
1453 => '| Perl',
1454 => '| {{n/a}}{{ref|Perl's records|[d]}}',
1455 => '|',
1456 => '|',
1457 => '| rowspan=3 {{n/a}}',
1458 => '|-',
1459 => '| Perl 6',
1460 => '| {{n/a}}{{ref|just classes|[a]}}',
1461 => '|',
1462 => '|',
1463 => '|-',
1464 => '| Ruby',
1465 => '| {{code|lang=ruby|1=OpenStruct.new({:name => value})}}',
1466 => '|',
1467 => '|',
1468 => '|-',
1469 => '| Scala',
1470 => '| <tt>'''case class''' name'''('''«'''var'''» name''':''' type''',''' ...''')'''</tt>',
1471 => '| <tt>'''('''val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... ''')'''</tt>',
1472 => '| <tt>'''abstract class''' name<br/>',
1473 => ''''case class''' Foo'''('''«parameters»''') extends''' name<br/>',
1474 => ''''case class''' Bar'''('''«parameters»''') extends''' name<br/>',
1475 => '...<br /></tt>',
1476 => 'or<br />',
1477 => '<tt>'''abstract class''' name<br/>',
1478 => ''''case object''' Foo '''extends''' name<br/>',
1479 => ''''case object''' Bar '''extends''' name<br/>',
1480 => '...<br /></tt>',
1481 => 'or combination of case classes and case objects',
1482 => '|',
1483 => '|-',
1484 => '| Windows PowerShell',
1485 => '|',
1486 => '|',
1487 => '|',
1488 => '|',
1489 => '|-',
1490 => '| OCaml',
1491 => '| rowspan=2| <tt>'''type''' name '''= {'''«'''mutable'''» name ''':''' type''';'''...'''}'''</tt>',
1492 => '| rowspan=2| <tt>«'''('''»val<sub>1</sub>''',''' val<sub>2</sub>''',''' val<sub>3</sub>''',''' ... «''')'''»</tt>',
1493 => '| rowspan=2| <tt>'''type''' name '''=''' Foo «'''of''' type»''' <nowiki>|</nowiki>''' Bar «'''of''' type»''' <nowiki>|</nowiki>''' ...</tt>',
1494 => '| rowspan=4 {{n/a}}',
1495 => '|-',
1496 => '| F#',
1497 => '|-',
1498 => '| Standard ML',
1499 => '| <tt>'''type''' name '''= {'''name ''':''' type''','''...'''}'''</tt>',
1500 => '| rowspan=2| <tt>'''('''val<sub>1</sub>''', '''val<sub>2</sub>''', '''val<sub>3</sub>''', '''... ''')'''</tt>',
1501 => '| <tt>'''datatype''' name '''=''' Foo «'''of''' type»''' <nowiki>|</nowiki>''' Bar «'''of''' type»''' <nowiki>|</nowiki>''' ...</tt>',
1502 => '|-',
1503 => '| Haskell',
1504 => '| <tt>'''data''' Name '''=''' Constr '''{'''name '''::''' type''','''...'''}'''</tt>',
1505 => '| <tt>'''data''' Name '''=''' Foo «types»''' <nowiki>|</nowiki>''' Bar «types»''' <nowiki>|</nowiki>''' ...</tt>',
1506 => '|-',
1507 => '| COBOL',
1508 => '| <tt>level-number name type clauses'''.'''<br/>',
1509 => ' level-number+n name type clauses'''.'''<br/>',
1510 => ' ...</tt>',
1511 => '| {{n/a}}',
1512 => '| {{n/a}}',
1513 => '| <tt>name '''REDEFINES''' variable type'''.'''</tt>',
1514 => '|}',
1515 => '{{note|just classes|a}} Only classes are supported.',
1516 => '<br />{{note|C++'s struct|b}} <code>struct</code>s in C++ are actually classes, but have default public visibility and ''are'' also [[Plain old data structure|POD]] objects. C++11 extended this further, to make classes act identically to POD objects in many more cases.',
1517 => '<br />{{note|pair only|c}} pair only',
1518 => '<br />{{note|Perl's records|d}} Although Perl doesn't have records, because Perl's type system allows different data types to be in an array, "hashes" (associative arrays) that don't have a variable index would effectively be the same as records.',
1519 => '<br />{{note|enum|e}} Enumerations in this language are algebraic types with only nullary constructors',
1520 => false,
1521 => '== Variable and constant declarations ==',
1522 => '{| class="wikitable"',
1523 => '!',
1524 => '! variable',
1525 => '! constant',
1526 => '! type synonym',
1527 => '|-',
1528 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
1529 => '| <tt>identifier ''':''' type «''':=''' initial_value»{{ref|Ada declaration|[e]}}</tt>',
1530 => '| <tt>identifier ''': constant''' type ''':=''' final_value</tt>',
1531 => '| <tt>'''subtype''' identifier '''is''' type</tt>',
1532 => '|-',
1533 => '| [[ALGOL 68]]',
1534 => '|<tt>'''modename''' ''name'' «''':=''' initial_value»;</tt>',
1535 => '|<tt>'''modename''' ''name'' '''=''' value;</tt>',
1536 => '|<tt>'''[[typedef|mode]]''' '''synonym''' = '''modename''';</tt>',
1537 => '|-',
1538 => '| C (C99)',
1539 => '| rowspan=3| <tt>type name «'''=''' initial_value»''';'''</tt>',
1540 => '| rowspan=2| <tt>'''enum{''' name '''=''' value '''};'''</tt>',
1541 => '| rowspan=3| <tt>'''[[typedef]]''' type synonym''';'''</tt>',
1542 => '|-',
1543 => '| Objective-C',
1544 => '|-',
1545 => '| C++',
1546 => '| <tt>'''const''' type name '''=''' value''';'''</tt>',
1547 => '|-',
1548 => '| C#',
1549 => '| <tt>type name «'''=''' initial_value»''';''' or <br/> '''var''' name '''=''' value''';'''</tt>',
1550 => '| <tt>'''const''' type name '''=''' value''';''' or <br/> '''readonly''' type name '''=''' value''';'''</tt>',
1551 => '| <tt>'''using''' synonym '''=''' type''';'''</tt>',
1552 => '|-',
1553 => '| D',
1554 => '| <tt>type name «'''=''' initial_value»''';''' or <br/> '''auto''' name '''=''' value''';'''</tt>',
1555 => '| <tt>'''const''' type name '''=''' value''';''' or <br/> '''immutable''' type name '''=''' value''';'''</tt>',
1556 => '| <tt>'''alias''' type synonym''';'''</tt>',
1557 => '|-',
1558 => '| Java',
1559 => '| <tt>type name «'''=''' initial_value»''';'''</tt>',
1560 => '| <tt>'''final''' type name '''=''' value''';'''</tt>',
1561 => '| rowspan=2 {{n/a}}',
1562 => '|-',
1563 => '| JavaScript',
1564 => '| <tt>'''var''' name «'''=''' initial_value»''';'''</tt>',
1565 => '| <tt>'''const''' name '''=''' value''';'''</tt>',
1566 => '|-',
1567 => '| Go',
1568 => '| <tt>'''var''' name type «'''=''' initial_value» or <br/> name ''':=''' initial_value</tt>',
1569 => '| <tt>'''const''' name «type» '''=''' value</tt>',
1570 => '| <tt>'''type''' synonym type</tt>',
1571 => '|-',
1572 => '| Swift',
1573 => '| <tt>'''var''' name «''': '''type» «'''=''' initial_value»</tt>',
1574 => '| <tt>'''let''' name «''': '''type» '''=''' value</tt>',
1575 => '| <tt>'''typealias''' synonym '''=''' type</tt>',
1576 => '|-',
1577 => '| Common Lisp',
1578 => '| <tt>'''(defparameter''' name initial_value''')''' or <br/> '''(defvar''' name initial_value''')''' or <br/> '''(setf (symbol-value <nowiki>'</nowiki>'''symbol''')''' initial_value''')'''</tt>',
1579 => '| <tt>'''(defconstant''' name value''')'''</tt>',
1580 => '| <tt>'''(deftype '''synonym''' () <nowiki>'</nowiki>'''type''')'''</tt>',
1581 => '|-',
1582 => '| Scheme',
1583 => '| <tt>'''(define''' name initial_value''')'''</tt>',
1584 => '| ',
1585 => '| ',
1586 => '|-',
1587 => '| ISLISP',
1588 => '| <tt>'''(defglobal''' name initial_value''')''' or <br/> '''(defdynamic''' name initial_value''')'''</tt>',
1589 => '| <tt>'''(defconstant''' name value''')'''</tt>',
1590 => '| {{n/a}}',
1591 => '|-',
1592 => '| <tt>Pascal{{ref|Pascal's declarations|[a]}}</tt>',
1593 => '| <tt>name''':''' type «'''=''' initial_value»</tt>',
1594 => '| <tt>name '''=''' value</tt>',
1595 => '| <tt>synonym '''=''' type</tt>',
1596 => '|-',
1597 => '| Visual Basic',
1598 => '| <tt>'''Dim''' name '''As''' type</tt>',
1599 => '| rowspan=3| <tt>'''Const''' name '''As''' type '''=''' value</tt>',
1600 => '|',
1601 => '|-',
1602 => '| Visual Basic .NET',
1603 => '| <tt>'''Dim''' name '''As''' type«'''=''' initial_value»'''</tt>',
1604 => '| <tt>'''Imports''' synonym '''=''' type</tt>',
1605 => '|-',
1606 => '| Xojo',
1607 => '| <tt>'''Dim''' name '''As''' type«'''=''' initial_value»'''</tt>',
1608 => '| {{n/a}}',
1609 => '|-',
1610 => '| Python',
1611 => '| rowspan=2| <tt>name '''=''' initial_value</tt>',
1612 => '| rowspan=2 {{n/a}}',
1613 => '| <tt>synonym '''=''' type{{ref|variable types|[b]}}</tt>',
1614 => '|-',
1615 => '| [[CoffeeScript]]',
1616 => '| {{n/a}}',
1617 => '|-',
1618 => '| S-Lang',
1619 => '| <tt>name '''=''' initial_value''';'''</tt>',
1620 => '|',
1621 => '| <tt>'''typedef struct {...}''' typename</tt>',
1622 => '|-',
1623 => '| Fortran',
1624 => '| type name',
1625 => '| <tt>type''', PARAMETER :: ''' name '''=''' value</tt>',
1626 => '|',
1627 => '|-',
1628 => '| PHP',
1629 => '| <tt>'''$'''name '''=''' initial_value''';'''</tt>',
1630 => '| <tt>'''define("'''name'''", '''value''');''' <br /> '''const '''name''' = '''value (5.3+)</tt>',
1631 => '| rowspan=2 {{n/a}}',
1632 => '|-',
1633 => '| Perl',
1634 => '| <tt>«'''my'''» '''$'''name «'''=''' initial_value'''»;'''{{ref|Perl's my keyword|[c]}}</tt>',
1635 => '| <tt>'''use constant''' name '''=>''' value''';'''</tt>',
1636 => '|-',
1637 => '| Perl 6',
1638 => '| <tt>«'''my''' «type»» $name «'''=''' initial_value'''»;'''{{ref|Perl's my keyword|[c]}}</tt>',
1639 => '| <tt>«'''my''' «type»» '''constant''' name '''=''' value''';'''</tt>',
1640 => '| <tt>'''::'''synonym '''::=''' type</tt>',
1641 => '|-',
1642 => '| Ruby',
1643 => '| <tt>name '''=''' initial_value</tt>',
1644 => '| <tt>Name '''=''' value</tt>',
1645 => '| <tt>synonym '''=''' type{{ref|variable types|[b]}}</tt>',
1646 => '|-',
1647 => '| Scala',
1648 => '| <tt>'''var''' name«''':''' type» '''=''' initial_value</tt>',
1649 => '| <tt>'''val''' name«''':''' type» '''=''' value</tt>',
1650 => '| <tt>'''type''' synonym '''=''' type</tt>',
1651 => '|-',
1652 => '| Windows PowerShell',
1653 => '| <tt>«'''['''type''']'''»''' $'''name '''=''' initial_value</tt>',
1654 => '| {{n/a}}',
1655 => '| {{n/a}}',
1656 => '|-',
1657 => '| Bash shell',
1658 => '| <tt>name'''='''initial_value</tt>',
1659 => '| {{n/a}}',
1660 => '| {{n/a}}',
1661 => '|-',
1662 => '| OCaml',
1663 => '| <tt>'''let''' name «''':''' type '''ref'''» '''= ref''' value{{ref|ML ref|[d]}}</tt>',
1664 => '| rowspan=2| <tt>'''let''' name «''':''' type» '''=''' value</tt>',
1665 => '| rowspan=3| <tt>'''type''' synonym '''=''' type</tt>',
1666 => '|-',
1667 => '| F#',
1668 => '| <tt>'''let mutable''' name «''':''' type» '''=''' value</tt>',
1669 => '|-',
1670 => '| Standard ML',
1671 => '| <tt>'''val''' name «''':''' type '''ref'''» '''= ref''' value{{ref|ML ref|[d]}}</tt>',
1672 => '| <tt>'''val''' name «''':''' type» '''=''' value</tt>',
1673 => '|-',
1674 => '| Haskell',
1675 => '|',
1676 => '| <tt>«name'''::'''type''';'''» name '''=''' value</tt>',
1677 => '| <tt>'''type''' Synonym '''=''' type</tt>',
1678 => '|-',
1679 => '| [[Forth (programming language)|Forth]]',
1680 => '| <tt>'''VARIABLE''' name</tt> (in some systems use <tt>value '''VARIABLE''' name</tt> instead)',
1681 => '| <tt>value '''CONSTANT''' name</tt>',
1682 => '| ',
1683 => '|-',
1684 => '| COBOL',
1685 => '| <tt>level-number name type clauses'''.'''</tt>',
1686 => '| <tt>«'''0'''»'''1''' name '''CONSTANT''' «'''AS'''» value'''.'''</tt>',
1687 => '| <tt>level-number name type clauses «'''IS'''» '''TYPEDEF.'''</tt>',
1688 => '|-',
1689 => '| Mathematica',
1690 => '| <tt>name'''='''initialvalue</tt>',
1691 => '| {{n/a}}',
1692 => '| {{n/a}}',
1693 => '|}',
1694 => '{{note|Pascal's declarations|a}} Pascal has declaration blocks. See [[Comparison of programming languages (basic instructions)#Functions]].',
1695 => '<br/>{{note|variable types|b}}Types are just regular objects, so you can just assign them.',
1696 => '<br/>{{note|Perl's my keyword|c}} In Perl, the "my" keyword scopes the variable into the block.',
1697 => '<br/>{{note|ML ref|d}} Technically, this does not declare ''name'' to be a mutable variable—in ML, all names can only be bound once; rather, it declares ''name'' to point to a "reference" data structure, which is a simple mutable cell. The data structure can then be read and written to using the <tt>!</tt> and <tt>:=</tt> operators, respectively.',
1698 => '<br/>{{note|Ada declaration|[e]}} If no initial value is given, an invalid value is automatically assigned (which will trigger a run-time exception if it used before a valid value has been assigned). While this behaviour can be suppressed it is recommended in the interest of predictability. If no invalid value can be found for a type (for example in case of an unconstraint integer type), a valid, yet predictable value is chosen instead.',
1699 => false,
1700 => '== [[Control flow]] ==',
1701 => false,
1702 => '=== [[Conditional (programming)|Conditional]] statements ===',
1703 => '{| class="wikitable"',
1704 => '|- valign="top"',
1705 => '!',
1706 => '! if',
1707 => '! else if',
1708 => '! [[switch statement|select case]]',
1709 => '! [[Conditional (programming)#If expressions|conditional expression]]',
1710 => '|- valign="top"',
1711 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
1712 => '| rowspan=2| <tt>'''if''' condition '''then''' <dl><dd>statements</dd></dl> «'''else''' <dl><dd>statements»</dd></dl> '''end if'''</tt>',
1713 => '| rowspan=2| <tt>'''if''' condition<sub>1</sub> '''then''' <dl><dd>statements</dd></dl> '''elsif''' condition<sub>2</sub> '''then''' <dl><dd>statements</dd></dl>...<br>«'''else''' <dl><dd>statements»</dd></dl> '''end if'''</tt>',
1714 => '| <tt>'''case''' expression '''is'''<dl><dd>'''when''' value_list<sub>1</sub> '''<nowiki>=></nowiki>''' statements</dd><dd>'''when''' value_list<sub>2</sub> '''=>''' statements</dd></dl>...<dl><dd>«'''when others <nowiki>=></nowiki>''' statements» </dd></dl>'''end case'''</tt>',
1715 => '| <tt>'''(if''' condition<sub>1</sub> '''then''' <dl><dd>expression<sub>1</sub></dd></dl> «'''elsif''' condition<sub>2</sub> '''then''' <dl><dd>expression<sub>2</sub>»</dd></dl> ... <br> '''else''' <dl><dd>expression<sub>n</sub></dd></dl>''')'''<br>'''(case''' expression '''is''' <dl><dd>'''when''' value_list<sub>1</sub> '''<nowiki>=></nowiki>''' expression<sub>1</sub></dd><dd>'''when''' value_list<sub>2</sub> '''=>''' expression<sub>2</sub></dd></dl> ... <dl><dd> «'''when others <nowiki>=></nowiki>''' expression<sub>n</sub>» </dd></dl>''')'''</tt>',
1716 => '|- valign="top"',
1717 => '| [[Seed7]]',
1718 => '| <tt>'''case''' expression '''of'''<br />'''when''' set1 ''':''' statements<br/>...<br/>«'''otherwise:''' statements» <br />'''end case'''</tt>',
1719 => '|',
1720 => '|- valign="top"',
1721 => '| [[Modula-2]]',
1722 => '| <tt>'''if''' condition '''then''' <dl><dd>statements</dd></dl> «'''else''' <dl><dd>statements»</dd></dl> '''end'''</tt>',
1723 => '| <tt>'''if''' condition<sub>1</sub> '''then''' <dl><dd>statements</dd></dl> '''elsif''' condition<sub>2</sub> '''then''' <dl><dd>statements</dd></dl>...<br>«'''else''' <dl><dd>statements»</dd></dl> '''end'''</tt>',
1724 => '| rowspan=1 | <tt>'''case''' expression '''of'''<br />caseLabelList ''':''' statements '''<nowiki>|</nowiki>'''<br/>...<br/>«'''else''' statements» <br />'''end'''</tt>',
1725 => '|',
1726 => '|- valign="top"',
1727 => '| rowspan=2 |[[ALGOL 68]] & "brief form"',
1728 => '| <tt>'''if''' condition '''then ''' statements «'''else''' statements» '''fi'''</tt>',
1729 => '| <tt>'''if''' condition '''then''' statements '''elif''' condition '''then''' statements '''fi'''</tt>',
1730 => '| <tt>'''case''' switch '''in''' statements, statements«,... '''out''' statements» '''esac'''</tt>',
1731 => '| rowspan=2 | <pre>( condition | valueIfTrue | valueIfFalse )</pre>',
1732 => '|- valign="top"',
1733 => '|<pre>( condition | statements «| statements» )</pre>',
1734 => '|<pre>( condition | statements |: condition | statements )</pre>',
1735 => '|<pre>( variable | statements,... «| statements» )</pre>',
1736 => '|- valign="top"',
1737 => '| [[APL (programming language)|APL]]',
1738 => '| <tt>''':If''' condition <dl><dd>instructions</dd></dl> «''':Else''' <dl><dd>instructions»</dd></dl>''':EndIf'''</tt>',
1739 => '| <tt>''':If''' condition <dl><dd>instructions</dd></dl> ''':ElseIf''' condition <dl><dd>instructions</dd></dl> ... <br/>«''':Else''' <dl><dd>instructions»</dd></dl> ''':EndIf'''</tt>',
1740 => '| <tt>''':Select''' expression <br/> ''':Case''' case1 <br/> <dl><dd>instructions</dd></dl> ... <br/> «''':Else'''<dl><dd>instructions»</dd></dl>''':EndSelect'''</tt>',
1741 => '| <tt>'''{'''condition''':'''valueIfTrue''' ⋄ '''valueIfFalse'''}'''</tt>',
1742 => '|- valign="top"',
1743 => '| C (C99)',
1744 => '| rowspan=9|<tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>',
1745 => '| rowspan=8|<tt>'''if ('''condition''') {'''instructions'''}<br/>else if ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>',
1746 => '| rowspan=7|<tt>'''switch ('''variable''') {<dl><dd>case''' case1''':''' instructions «'''break;'''»<br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>',
1747 => '| rowspan=8| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>',
1748 => '|- valign="top"',
1749 => '| Objective-C',
1750 => '|- valign="top"',
1751 => '| C++ (STL)',
1752 => '|- valign="top"',
1753 => '| D',
1754 => '|- valign="top"',
1755 => '| Java',
1756 => '|- valign="top"',
1757 => '| JavaScript',
1758 => '|- valign="top"',
1759 => '| PHP',
1760 => '|- valign="top"',
1761 => '| C#',
1762 => '| <tt>'''switch ('''variable''') {<dl><dd>case''' case1''':''' instructions'''; '''«jump statement''';'''»<br/>...<br/>«'''default:''' instructions''';''' «jump statement''';'''»» </dd></dl> '''}'''</tt>',
1763 => '|- valign="top"',
1764 => '| Windows PowerShell',
1765 => '| <tt>'''if ('''condition''') { '''instructions''' }<br/>elseif ('''condition''') { '''instructions''' }'''<br/>...<br/>«'''else { '''instructions''' }'''»</tt>',
1766 => '| <tt>'''switch ('''variable''') { '''case1''' { '''instructions «'''break;'''» '''}''' ... «'''default { '''instructions''' }'''»'''}'''</tt>',
1767 => '| ',
1768 => '|- valign="top"',
1769 => '| Go',
1770 => '| <tt>'''if '''condition''' {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>',
1771 => '| <tt>'''if '''condition''' {'''instructions'''}<br/>else if '''condition''' {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/> or <br/> '''switch {<dl><dd>case''' condition''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>',
1772 => '| <tt>'''switch '''variable''' {<dl><dd>case''' case1''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>',
1773 => '| ',
1774 => '|- valign="top"',
1775 => '| Swift',
1776 => '| <tt>'''if '''condition''' {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>',
1777 => '| <tt>'''if '''condition''' {'''instructions'''}<br/>else if '''condition''' {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/></tt>',
1778 => '| <tt>'''switch '''variable''' {<dl><dd>case''' case1''':''' instructions <br/>...<br/>«'''default:''' instructions»</dd></dl>'''}'''</tt>',
1779 => '| ',
1780 => '|- valign="top"',
1781 => '| Perl',
1782 => '| <tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless ('''notcondition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>',
1783 => '| <tt>'''if ('''condition''') {'''instructions'''}<br/>elsif ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless ('''notcondition''') {'''instructions'''}<br/>elsif ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>',
1784 => '| <tt>'''use feature "switch";'''<br/>...<br/>'''given ('''variable''') {<dl><dd>when ('''case1''') { '''instructions''' }'''<br/>...<br/>«'''default { '''instructions''' }'''»</dd></dl>'''}'''</tt>',
1785 => '| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>',
1786 => '|- valign="top"',
1787 => '| Perl 6',
1788 => '| <tt>'''if''' condition '''{'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»<br/>or<br/>'''unless''' notcondition '''{'''instructions'''}'''</tt>',
1789 => '| <tt>'''if''' condition''' {'''instructions'''}<br/>elsif''' condition '''{'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''</tt>',
1790 => '| <tt>'''given''' variable '''{<dl><dd>when''' case1 '''{ '''instructions''' }'''<br/>...<br/>«'''default { '''instructions''' }'''»</dd></dl>'''}'''</tt>',
1791 => '| <tt>condition '''[[?:|??]]''' valueIfTrue '''!!''' valueIfFalse</tt>',
1792 => '|- valign="top"',
1793 => '| Ruby',
1794 => '| <tt>'''if''' condition <dl><dd>instructions</dd></dl> «'''else''' <dl><dd>instructions»</dd></dl> </tt>',
1795 => '| <tt>'''if''' condition <dl><dd>instructions</dd></dl> '''elsif''' condition <dl><dd>instructions</dd></dl> ... <br/>«'''else''' <dl><dd>instructions»</dd></dl> '''end'''</tt>',
1796 => '| <tt>'''case''' variable <br/> '''when''' case1 <br/> <dl><dd>instructions</dd></dl> ... <br/> «'''else'''<dl><dd>instructions»</dd></dl>'''end'''</tt>',
1797 => '| <tt>condition '''[[?:|?]]''' valueIfTrue '''[[?:|:]]''' valueIfFalse</tt>',
1798 => '|- valign="top"',
1799 => '| Scala',
1800 => '| <tt>'''if ('''condition''') {'''instructions'''}'''<br/>«'''else {'''instructions'''}'''»</tt>',
1801 => '| <tt>'''if ('''condition''') {'''instructions'''}<br/>else if ('''condition''') {'''instructions'''}'''<br/>...<br/>«'''else {'''instructions'''}'''»</tt>',
1802 => '| <tt>expression '''match {'''<dl><dd>'''case''' pattern1 '''=>''' expression<br/>'''case''' pattern2 '''=>''' expression<br/>...<br/>«'''case _ =>''' expression»</dd></dl>'''}'''{{ref|pattern matching|[b]}}</tt>',
1803 => '| <tt>'''if ('''condition''')''' valueIfTrue '''else''' valueIfFalse</tt>',
1804 => '|- valign="top"',
1805 => '| Smalltalk',
1806 => '| <tt>condition '''ifTrue:''' <dl><dd>trueBlock</dd></dl> «'''ifFalse:''' <dl><dd>falseBlock»</dd></dl> '''end'''</tt>',
1807 => '| ',
1808 => '| ',
1809 => '| <tt>condition '''ifTrue:''' trueBlock '''ifFalse:''' falseBlock</tt>',
1810 => '|- valign="top"',
1811 => '| Common Lisp',
1812 => '| <tt>'''(when '''condition<br/> <dl><dd>instructions''')'''</dd></dl> or<br/> '''(unless '''condition<br/> <dl><dd>instructions''')'''</dd></dl> or<br/> '''(if '''condition'''<br/><dl><dd>(progn '''instructions''')</dd><dd>'''«'''(progn '''instructions''')'''»''')'''</dd></dl></tt>',
1813 => '| <tt>'''(cond ('''condition1 instructions''')<br/><dl><dd>('''condition2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>',
1814 => '| <tt>'''(case '''expression'''<dl><dd>('''case1 instructions''')</dd><dd>('''case2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(otherwise '''instructions''')'''»''')'''</dd></dl></tt>',
1815 => '| rowspan=2| <tt>'''(if '''condition valueIfTrue valueIfFalse''')'''</tt>',
1816 => '|- valign="top"',
1817 => '| Scheme',
1818 => '| <tt>'''(when '''conditioninstructions''')''' or <br/> '''(if '''condition''' (begin '''instructions''') '''«'''(begin '''instructions''')'''»''')'''</tt>',
1819 => '| <tt>'''(cond ('''condition1 instructions''') ('''condition2 instructions''') '''...''' '''«'''(else '''instructions''')'''»''')'''</tt>',
1820 => '| <tt>'''(case ('''variable''') (('''case1''')''' instructions''') (('''case2''')''' instructions''') '''...''' '''«'''(else '''instructions''')'''»''')'''</tt>',
1821 => '|- valign="top"',
1822 => '| ISLISP',
1823 => '| <tt>'''(if '''condition'''<br/><dl><dd>(progn '''instructions''')</dd><dd>'''«'''(progn '''instructions''')'''»''')'''</dd></dl></tt>',
1824 => '| <tt>'''(cond ('''condition1 instructions''')<br/><dl><dd>('''condition2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>',
1825 => '| <tt>'''(case '''expression'''<dl><dd>('''case1 instructions''')</dd><dd>('''case2 instructions''')</dd><dd>'''...'''</dd><dd>'''«'''(t '''instructions''')'''»''')'''</dd></dl></tt>',
1826 => '| <tt>'''(if '''condition valueIfTrue valueIfFalse''')'''</tt>',
1827 => '|- valign="top"',
1828 => '| Pascal',
1829 => '| <tt>'''if''' condition '''then begin''' <dl><dd>instructions</dd></dl> '''end''' <br/> «'''else begin'''<dl><dd>instructions</dd></dl>'''end'''»{{ref|pascal semicolon|[c]}}</tt>',
1830 => '| <tt>'''if''' condition '''then begin''' <dl><dd>instructions</dd></dl> '''end <br/> else if''' condition '''then begin'''<dl><dd>instructions</dd></dl> '''end'''<br/>...<br/>«'''else begin'''<dl><dd>instructions</dd></dl> '''end'''»{{ref|pascal semicolon|[c]}}</tt>',
1831 => '| <tt>'''case '''variable''' of''' <dl><dd>case1''':''' instructions <br/> ... <br/> «'''else:''' instructions»</dd></dl>'''end'''{{ref|pascal semicolon|[c]}}</tt>',
1832 => '|- valign="top"',
1833 => '| Visual Basic',
1834 => '| rowspan=3| <tt>'''If''' condition '''Then''' <dl><dd>instructions</dd></dl> «'''Else''' <dl><dd>instructions»</dd></dl>'''End If'''</tt>',
1835 => '| rowspan=3| <tt>'''If''' condition '''Then''' <dl><dd>instructions</dd></dl> '''ElseIf''' condition '''Then''' <dl><dd>instructions</dd></dl> ... <br/> «'''Else''' <dl><dd>instructions»</dd></dl>'''End If'''</tt>',
1836 => '| rowspan=3| <tt>'''Select Case''' variable <br/> '''Case''' case1 <dl><dd>instructions</dd></dl> ... <br/> «'''Case Else''' <dl><dd>instructions»</dd></dl> '''End Select'''</tt>',
1837 => '| <tt>'''[[IIf]]('''condition''', '''valueIfTrue''', '''valueIfFalse''')'''</tt>',
1838 => '|- valign="top"',
1839 => '| Visual Basic .NET',
1840 => '| rowspan=2| <tt>'''If('''condition''', '''valueIfTrue''', '''valueIfFalse''')'''</tt>',
1841 => '|- valign="top"',
1842 => '| Xojo',
1843 => '|- valign="top"',
1844 => '| Python {{ref|python indent|[a]}}',
1845 => '| <tt>'''if''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>',
1846 => '| <tt>'''if''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> '''elif''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> ... <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>',
1847 => '| ',
1848 => '| <tt>valueIfTrue '''if''' condition '''else''' valueIfFalse</tt><br/>(Python 2.5+)',
1849 => '|- valign="top"',
1850 => '| S-Lang',
1851 => '| <tt>'''if ('''condition''') { '''instructions''' } '''«'''else { '''instructions''' }'''»</tt>',
1852 => '| <tt>'''if ('''condition''') { '''instructions''' } else if ('''condition''') {''' instructions '''}''' ... «'''else { '''instructions '''}'''»</tt>',
1853 => '| <tt>'''switch ('''variable''') { case '''case1''': '''instructions''' } { case '''case2''': '''instructions''' }''' ...</tt>',
1854 => '|',
1855 => '|- valign="top"',
1856 => '| Fortran',
1857 => '| <tt>'''IF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ELSE <dl><dd> '''instructions''' </dd></dl> ENDIF'''</tt>',
1858 => '| <tt>'''IF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ELSEIF ('''condition''') THEN <dl><dd> '''instructions''' </dd></dl> ... <br/> ELSE <dl><dd> '''instructions''' </dd></dl> ENDIF'''</tt>',
1859 => '| <tt>'''SELECT CASE('''variable''')<dl><dd> CASE ('''case1''') <dl><dd> '''instructions''' </dd></dl> ... <br/> CASE DEFAULT <dl><dd> '''instructions''' </dd></dl> </dd></dl> END SELECT</tt>',
1860 => '|',
1861 => '|- valign="top"',
1862 => '| Forth',
1863 => '| <tt>condition''' IF '''instructions «''' ELSE '''instructions»''' THEN'''</tt>',
1864 => '| <tt>condition''' IF '''instructions ''' ELSE '''condition''' IF '''instructions''' THEN THEN'''</tt>',
1865 => '| <tt>value''' CASE'''<br/>case''' OF '''instructions''' ENDOF'''<br/>case''' OF '''instructions''' ENDOF'''<br/> default instructions<br/>'''ENDCASE'''</tt>',
1866 => '| <tt>condition''' IF '''valueIfTrue''' ELSE '''valueIfFalse''' THEN'''</tt>',
1867 => '|- valign="top"',
1868 => '| OCaml',
1869 => '| <tt>'''if''' condition '''then begin''' instructions '''end''' «'''else begin''' instructions '''end'''»</tt>',
1870 => '| <tt>'''if''' condition '''then begin''' instructions '''end else if''' condition '''then begin''' instructions '''end''' ... «'''else begin''' instructions '''end'''»</tt>',
1871 => '| rowspan=2| <tt>'''match''' value '''with <dl><dd>'''pattern1''' <nowiki>-></nowiki> '''expression'''<br/><nowiki>|</nowiki> '''pattern2''' <nowiki>-></nowiki> '''expression<br/> ... <br/>«'''<nowiki>| _ -></nowiki> '''expression»{{ref|pattern matching|[b]}}</dd></dl></tt>',
1872 => '| rowspan=4| <tt>'''if''' condition '''then''' valueIfTrue '''else''' valueIfFalse</tt>',
1873 => '|- valign="top"',
1874 => '| F#',
1875 => '| <tt>'''if''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> «'''else''' <br/>{{keypress|Tab}} instructions»</tt>',
1876 => '| <tt>'''if''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> '''elif''' condition '''then''' <br/>{{keypress|Tab}} instructions <br/> ... <br/> «'''else''' <br/>{{keypress|Tab}} instructions»</tt>',
1877 => '|- valign="top"',
1878 => '| Standard ML',
1879 => '| <tt>'''if''' condition '''then''' «'''('''»instructions «''')'''»<br/>'''else''' «'''('''» instructions «''')'''»</tt>',
1880 => '| <tt>'''if''' condition '''then''' «'''('''»instructions «''')'''»<br/>'''else if''' condition '''then''' «'''('''» instructions «''')'''»<br/>...<br/>'''else''' «'''('''» instructions «''')'''»</tt>',
1881 => '| <tt>'''case''' value '''of<dl><dd>'''pattern1''' <nowiki>=></nowiki> '''expression'''<br/> <nowiki>|</nowiki> '''pattern2''' => '''expression<br/> ...<br/> «'''<nowiki>| _ =></nowiki> '''expression»{{ref|pattern matching|[b]}}</dd></dl></tt>',
1882 => '|- valign="top"',
1883 => '| Haskell (GHC)',
1884 => '| <tt>'''if''' condition '''then''' expression '''else''' expression</tt><br/>or<br/><tt>'''when''' condition '''(do''' instructions''')'''</tt><br/>or<br/><tt>'''unless''' notcondition '''(do''' instructions''')'''</tt>',
1885 => '| <tt>result '''<nowiki>|</nowiki>''' condition '''=''' expression <dl><dd>'''<nowiki>|</nowiki>''' condition '''=''' expression <br/>'''<nowiki>|</nowiki> otherwise =''' expression</dd></dl></tt>',
1886 => '| <tt>'''case''' value '''of {<dl><dd>'''pattern1''' <nowiki>-></nowiki> '''expression''';<br/>'''pattern2''' <nowiki>-></nowiki>'''expression''';'''<br/> ... <br/>«'''<nowiki>_ -></nowiki> '''expression»</dd></dl>'''}'''{{ref|pattern matching|[b]}}</tt>',
1887 => '|- valign="top"',
1888 => '| Bash shell',
1889 => '| <poem><tt>'''if''' condition-command; '''then'''',
1890 => '{{space|4}}expression ',
1891 => '«'''else''' ',
1892 => '{{space|4}}expression»',
1893 => ''''fi'''</tt></poem>',
1894 => '| <poem><tt>'''if''' condition-command; '''then'''',
1895 => '{{space|4}}expression ',
1896 => ''''elif''' condition-command; '''then'''',
1897 => '{{space|4}}expression ',
1898 => '«'''else''' ',
1899 => '{{space|4}}expression»',
1900 => ''''fi'''</tt></poem>',
1901 => '| <poem><tt>'''case''' "$variable" '''in'''',
1902 => '"$condition1" )',
1903 => '{{space|4}}command...',
1904 => ';;',
1905 => '"$condition2" )',
1906 => '{{space|4}}command...',
1907 => ';;',
1908 => ''''esac'''</tt></poem>',
1909 => '| ',
1910 => '|- valign="top"',
1911 => '| rowspan=5| CoffeeScript',
1912 => '| <tt>'''if''' condition '''then''' expression «'''else''' expression»</tt>',
1913 => '| <tt>'''if''' condition '''then''' expression '''else if''' condition '''then''' expression «'''else''' expression»</tt>',
1914 => '| rowspan=2| <tt>'''switch''' expression <dl><dd>'''when''' condition '''then''' expression</dd></dl> <dl><dd>'''else''' expression</dd></dl></tt>',
1915 => '| rowspan=5| ''All conditions are expressions''',
1916 => '|- valign="top"',
1917 => '| <tt>'''if''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>',
1918 => '| <tt>'''if''' condition <dl><dd>expression</dd></dl> '''else if''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>',
1919 => '|- valign="top"',
1920 => '| <tt>expression '''if''' condition</tt>',
1921 => '| rowspan=3| <tt>'''unless''' condition <dl><dd>expression</dd></dl> '''else unless''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>',
1922 => '| rowspan=3| <tt>'''switch''' expression <dl><dd>'''when''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></dd></dl></tt>',
1923 => '|- valign="top"',
1924 => '| <tt>'''unless''' condition <dl><dd>expression</dd></dl> «'''else''' <dl><dd>expression»</dd></dl></tt>',
1925 => '|- valign="top"',
1926 => '| <tt>expression '''unless''' condition</tt>',
1927 => '|- valign="top"',
1928 => '| COBOL',
1929 => '| <tt>'''IF''' condition «'''THEN'''» <dl><dd> expression </dd></dl> «'''ELSE''' <dl><dd> expression»'''.''' </dd></dl></tt>{{ref|COBOL END-IF|[d]}}',
1930 => '| ',
1931 => '| <tt>'''EVALUATE''' expression «'''ALSO''' expression...» <dl><dd> '''WHEN''' case-or-condition «'''ALSO''' case-or-condition...» <dl><dd> expression </dd></dl></dd></dl> <dl><dd> ... </dd></dl> <dl><dd>«'''WHEN OTHER''' <dl><dd> expression» </dd></dl></dd></dl> '''END-EVALUATE'''</tt>',
1932 => '|',
1933 => '|- valign="top"',
1934 => '!',
1935 => '! if',
1936 => '! else if',
1937 => '! [[switch statement|select case]]',
1938 => '! [[Conditional (programming)#If expressions|conditional expression]]',
1939 => '|}',
1940 => false,
1941 => '{{note|python indent|a}} A single instruction can be written on the same line following the colon. Multiple instructions are grouped together in a [[block (programming)|block]] which starts on a newline (The indentation is required). The conditional expression syntax does not follow this rule.',
1942 => '<br/>',
1943 => '{{note|pattern matching|b}} This is [[pattern matching]] and is similar to select case but not the same. It is usually used to deconstruct [[algebraic data type]]s.',
1944 => '<br/>',
1945 => '{{note|pascal semicolon|c}} In languages of the Pascal family, the semicolon is not part of the statement. It is a separator between statements, not a terminator.',
1946 => '<br/>',
1947 => '{{note|COBOL END-IF|d}} <tt>'''END-IF'''</tt> may be used instead of the period at the end.',
1948 => false,
1949 => '=== [[Control flow#Loops|Loop statements]] ===',
1950 => '{| class="wikitable"',
1951 => '|-',
1952 => '!',
1953 => '! [[while loop|while]]',
1954 => '! [[do while loop|do while]]',
1955 => '! [[for loop|for i = first to last]]',
1956 => '! [[foreach]]',
1957 => '|-',
1958 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
1959 => '| <tt>'''while''' condition '''loop''' <dl><dd>statements</dd></dl> '''end loop'''</tt>',
1960 => '| <tt>'''loop''' <dl><dd>statements</dd><dd>'''exit when not''' condition</dd></dl> '''end loop'''</tt>',
1961 => '| <tt>'''for''' index '''in''' «'''reverse'''» [first '''..''' last <nowiki>|</nowiki> discrete_type] '''loop''' <dl><dd>statements</dd></dl> '''end loop'''</tt>',
1962 => '| <tt>'''for''' item '''of''' «'''reverse'''» iterator '''loop''' <dl><dd>statements</dd></dl> '''end loop''' <br><br> '''(for''' ['''all''' <nowiki>|</nowiki> '''some'''] ['''in''' <nowiki>|</nowiki> '''of'''] [first '''..''' last <nowiki>|</nowiki> discrete_type <nowiki>|</nowiki> iterator] '''=>''' predicate''')'''{{ref|Ada_quantifiers|[b]}}</tt>',
1963 => '|-',
1964 => '|rowspan=2| [[ALGOL 68]] ||colspan=3 align=center| <tt>«'''for''' index» «'''from''' first» «'''by''' increment» «'''to''' last» «'''while''' condition» '''do''' statements '''od'''</tt> ||rowspan=2| <tt>'''for''' ''key'' «'''to''' '''upb''' ''list''» '''do''' «'''typename''' ''val''=''list''[''key''];» statements '''od'''</tt>',
1965 => '|-',
1966 => '| <tt>«'''while''' condition»</tt>',
1967 => ' '''do''' statements '''od'''',
1968 => '| <tt>«'''while''' statements; condition»</tt>',
1969 => ' '''do''' statements '''od'''',
1970 => '| <tt>«'''for''' index» «'''from''' first» «'''by''' increment» «'''to''' last» '''do''' statements '''od'''</tt>',
1971 => '|-',
1972 => '| [[APL (programming language)|APL]]',
1973 => '| <tt>''':While''' condition<dl><dd>statements</dd></dl> ''':EndWhile'''</tt>',
1974 => '| <tt>''':Repeat''' <dl><dd>statements</dd></dl>''':Until''' condition</tt>',
1975 => '| <tt>''':For''' var«s» ''':In''' list<dl><dd>statements</dd></dl> ''':EndFor'''</tt>',
1976 => '| <tt>''':For''' var«s» ''':InEach''' list<dl><dd>statements</dd></dl> ''':EndFor'''</tt>',
1977 => '|-',
1978 => '| C (C99)',
1979 => '| rowspan=9|<tt>'''while ('''condition''')''' '''{''' instructions '''}'''</tt>',
1980 => '| rowspan=9|<tt>'''do {''' instructions '''} while ('''condition''')'''</tt>',
1981 => '| rowspan=5|<tt>'''for ('''«type» i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; ++'''i''') {''' instructions '''}'''</tt>',
1982 => '| {{n/a}}',
1983 => '|-',
1984 => '| Objective-C',
1985 => '| <tt>'''for ('''type item '''in''' set''') {''' instructions '''}'''</tt>',
1986 => '|-',
1987 => '| C++ (STL)',
1988 => '| <tt>«'''std::'''»'''for_each('''start''',''' end''',''' function''')'''</tt>',
1989 => '([[C++11]]) <tt>'''for ('''type item ''':''' set''') {''' instructions '''}'''</tt>',
1990 => '|-',
1991 => '| C#',
1992 => '| <tt>'''foreach ('''type item '''in''' set''') {''' instructions '''}'''</tt>',
1993 => '|-',
1994 => '| Java',
1995 => '| <tt>'''for ('''type item ''':''' set''') {''' instructions '''}'''</tt>',
1996 => '|-',
1997 => '| JavaScript',
1998 => '|<tt>'''for (var''' i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last''';''' i'''++) {''' instructions '''}'''</tt>',
1999 => '|<tt>'''for (var''' index '''in''' set''') {''' instructions '''}''' <br/> or <br/> '''for each (var''' item '''in''' set''') {''' instructions '''}'''</tt> (JS 1.6+, deprecated<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/for_each...in|title=for each...in|author=|date=|work=mozilla.org|accessdate=30 January 2017}}</ref>)<br/>or<br/><tt>'''for (var''' item '''of''' set''') {''' instructions '''}'''</tt> ([[EcmaScript 6]] proposal, supported in Firefox<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/for...of|title=for...of|author=|date=|work=mozilla.org|accessdate=30 January 2017}}</ref>)',
2000 => '|-',
2001 => '| PHP',
2002 => '| <tt>'''foreach (range('''first''', '''last''') as $i) {''' instructions '''}''' or <br/> '''for ($i = '''first'''; $i <= '''last'''; $i++) {''' instructions '''}'''</tt>',
2003 => '| <tt>'''foreach ('''set '''as''' item''') {''' instructions '''}''' <br/> or <br/> '''foreach ('''set '''as '''key''' =>''' item''') {''' instructions '''}'''</tt>',
2004 => '|-',
2005 => '| Windows PowerShell',
2006 => '| <tt>'''for ($i = '''first'''; $i -le '''last'''; $i++) {''' instructions '''}'''</tt>',
2007 => '| <tt>'''foreach ('''item '''in''' set''') {''' instructions using item '''}'''</tt>',
2008 => '|-',
2009 => '| D',
2010 => '| <tt>'''foreach''' (i; '''first''' ... '''last''') '''{''' instructions '''}'''</tt>',
2011 => '| <tt>'''foreach''' («type» item; set) '''{''' instructions '''}'''</tt>',
2012 => '|-',
2013 => '| Go',
2014 => '| <tt>'''for '''condition''' {''' instructions '''}'''</tt>',
2015 => '| ',
2016 => '| <tt>'''for '''i ''':=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; '''i'''++ {''' instructions '''}'''</tt>',
2017 => '| <tt>'''for '''key''', '''item''' := range '''set''' {''' instructions '''}'''</tt>',
2018 => '|-',
2019 => '| Swift',
2020 => '| <tt>'''while '''condition''' {''' instructions '''}'''</tt>',
2021 => '| <tt>'''repeat {''' instructions '''} while '''condition</tt> (2.x)<br /> <tt>'''do {''' instructions '''} while '''condition</tt> (1.x)',
2022 => '| <tt>'''for''' i '''=''' first '''...''' last {''' instructions '''}</tt> or <br/> <tt>'''for''' i '''=''' first '''..<''' last+1 {''' instructions '''}</tt> or <br/> <tt>'''for var''' i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; '''i'''++ {''' instructions '''}'''</tt>',
2023 => '| <tt>'''for '''item''' in '''set''' {''' instructions '''}'''</tt>',
2024 => '|-',
2025 => '| Perl',
2026 => '| <tt>'''while ('''condition''')''' '''{''' instructions '''}''' or <br/> '''until ('''notcondition''')''' '''{''' instructions '''}'''</tt>',
2027 => '| <tt>'''do {''' instructions '''} while ('''condition''')''' or <br/> '''do {''' instructions '''} until ('''notcondition''')'''</tt>',
2028 => '| <tt>'''for'''«'''each'''»''' '''«'''$i'''»''' ('''first''' .. '''last''') {''' instructions '''}''' or <br/> '''for ($i = '''first'''; $i <= '''last'''; $i++) {''' instructions '''}'''</tt>',
2029 => '| <tt>'''for'''«'''each'''» «$item» '''('''set''') {''' instructions '''}'''</tt>',
2030 => '|-',
2031 => '| Perl 6',
2032 => '| <tt>'''while''' condition '''{''' instructions '''}''' or <br/> '''until''' notcondition '''{''' instructions '''}'''</tt>',
2033 => '| <tt>'''repeat {''' instructions '''} while '''condition or <br/> '''repeat {''' instructions '''} until''' notcondition</tt>',
2034 => '| <tt>'''for''' first'''..'''last '''<nowiki>-></nowiki> $i {''' instructions '''}''' or <br/> '''loop ($i = '''first'''; $i <nowiki><=</nowiki>'''last'''; $i++) {''' instructions '''}'''</tt>',
2035 => '| <tt>'''for''' set« '''<nowiki>-></nowiki>''' $item» '''{''' instructions '''}'''</tt>',
2036 => '|-',
2037 => '| Ruby',
2038 => '| <tt>'''while''' condition <dl><dd>instructions</dd></dl>'''end''' <br/> or <br/> '''until''' notcondition <dl><dd>instructions</dd></dl> '''end'''</tt>',
2039 => '| <tt>'''begin''' <dl><dd>instructions</dd></dl> '''end while''' condition <br/> or <br/> '''begin''' <dl><dd>instructions</dd></dl> '''end until''' notcondition</tt>',
2040 => '| <tt>'''for i in '''first'''..'''last <dl><dd>instructions</dd></dl> '''end''' </tt><br/> or <br/> <tt>'''for i in '''first'''...'''last+1 <dl><dd>instructions</dd></dl> '''end''' <br/> or <br/> first'''.{{not a typo|upto}}('''last''') { <nowiki>|i|</nowiki> '''instructions '''}'''</tt>',
2041 => '| <tt>'''for''' item '''in''' set <dl><dd>instructions</dd></dl> '''end''' <br/> or <br/> set'''.each { <nowiki>|</nowiki>'''item'''<nowiki>|</nowiki> '''instructions '''}'''</tt>',
2042 => '|-',
2043 => '| Bash shell',
2044 => '| <tt>'''while''' condition ;'''do'''<dl><dd>instructions</dd></dl>'''done''' <br/> or <br/> '''until''' notcondition ;'''do'''<dl><dd>instructions</dd></dl> '''done'''</tt>',
2045 => '| {{n/a}}',
2046 => '| <tt>'''for (('''i '''=''' first''';''' i '''<nowiki><=</nowiki>''' last'''; ++'''i''')) ; do'''',
2047 => '<dl><dd>instructions</dd></dl>',
2048 => ''''done'''',
2049 => '</tt>',
2050 => '| <tt>'''for''' item '''in''' set ;'''do'''<dl><dd>instructions</dd></dl> '''done'''</tt>',
2051 => '|-',
2052 => '| Scala',
2053 => '| <tt>'''while ('''condition''')''' '''{''' instructions '''}'''</tt>',
2054 => '| <tt>'''do {''' instructions '''} while ('''condition''')'''</tt>',
2055 => '| <tt>'''for ('''i '''<nowiki><-</nowiki>''' first '''to''' last «'''by 1'''»''') {''' instructions '''}'''<br/>or<br/>first '''to''' last «'''by 1'''» '''foreach ('''i '''<nowiki>=></nowiki> {''' instructions '''})'''</tt>',
2056 => '| <tt>'''for ('''item '''<nowiki><-</nowiki>''' set''') {''' instructions '''}'''<br/>or<br/>set '''foreach ('''item '''=> {''' instructions '''})'''</tt>',
2057 => '|-',
2058 => '| Smalltalk',
2059 => '| <tt>conditionBlock '''whileTrue:''' <dl><dd>loopBlock</dd></dl></tt>',
2060 => '| <tt>loopBlock '''doWhile:''' <dl><dd>conditionBlock</dd></dl></tt>',
2061 => '| <tt>first '''to:''' last '''do:''' <dl><dd>loopBlock</dd></dl></tt>',
2062 => '| <tt>collection '''do:''' <dl><dd>loopBlock</dd></dl></tt>',
2063 => '|-',
2064 => '| Common Lisp',
2065 => '| <tt>'''(loop<dl><dd>while '''condition'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(do () ('''notcondition''')<dl><dd>'''instructions''')'''</dd></dl></tt>',
2066 => '| <tt>'''(loop<dl><dd>do</dd><dd>'''instructions'''</dd><dd>while '''condition''')'''</dd></dl></tt>',
2067 => '| <tt>'''(loop<dl><dd>for i from '''first''' to '''last''' «by 1»</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(dotimes (i N)'''<dl><dd>instructions''')'''</dd></dl> or<br/> '''(do ((i '''first''' (1+ i))) ((<nowiki>>=</nowiki> i '''last'''))<dl><dd>'''instructions''')'''</dd></dl></tt>',
2068 => '| <tt>'''(loop<dl><dd>for '''item''' in '''list'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(loop<dl><dd>for '''item''' across '''vector'''</dd><dd>do</dd><dd>'''instructions''')'''</dd></dl> or <br/> '''(dolist ('''item list''')<dl><dd>'''instructions''')'''</dd></dl> or <br/>'''(mapc '''function list''')''' or <br/> '''(map <nowiki>'</nowiki>'''type function sequence''')'''</tt>',
2069 => '|-',
2070 => '| Scheme',
2071 => '| <tt>'''(do () ('''notcondition''') '''instructions''')''' or <br/> '''(let loop () (if '''condition''' (begin '''instructions''' (loop))))'''</tt>',
2072 => '| <tt>'''(let loop () ('''instructions''' (if '''condition''' (loop))))'''</tt>',
2073 => '| <tt>'''(do ((i '''first''' (+ i 1))) ((<nowiki>>=</nowiki> i '''last''')) '''instructions''')''' or <br/> '''(let loop ((i '''first''')) (if (< i '''last''') (begin '''instructions''' (loop (+ i 1)))))'''</tt>',
2074 => '| <tt>'''(for-each (lambda ('''item''') '''instructions''') '''list''')'''</tt>',
2075 => '|-',
2076 => '| ISLISP',
2077 => '| <tt>'''(while '''condition''' '''instructions''')'''</tt>',
2078 => '| <tt>'''(tagbody loop''' instructions '''(if''' condition '''(go loop))'''</tt>',
2079 => '| <tt>'''(for ((i '''first''' (+ i 1))) ((<nowiki>>=</nowiki> i '''last''')) '''instructions''')'''</tt>',
2080 => '| <tt>'''(mapc (lambda ('''item''') '''instructions''') '''list''')'''</tt>',
2081 => '|-',
2082 => '| Pascal',
2083 => '| <tt>'''while''' condition '''do begin''' <dl><dd>instructions</dd></dl> '''end'''</tt>',
2084 => '| <tt>'''repeat''' <dl><dd>instructions</dd></dl> '''until''' notcondition''';'''</tt>',
2085 => '| <tt>'''for''' i ''':=''' first «'''step 1'''» '''to''' last '''do begin''' <dl><dd>instructions</dd></dl> '''end;'''{{ref|step|[a]}}</tt>',
2086 => '| <tt>'''for''' item '''in''' set '''do''' ...</tt>',
2087 => '|-',
2088 => '| Visual Basic',
2089 => '| rowspan=2| <tt>'''Do While''' condition <dl><dd>instructions</dd></dl>'''Loop''' <br/> or <br/>'''Do Until''' notcondition <dl><dd>instructions</dd></dl>'''Loop'''</tt>',
2090 => '| rowspan=2| <tt>'''Do''' <dl><dd>instructions</dd></dl> '''Loop While''' condition <br/> or <br/>'''Do''' <dl><dd>instructions</dd></dl> '''Loop Until''' notcondition</tt>',
2091 => '| <tt>'''For''' i '''=''' first '''To''' last «'''Step 1'''» <dl><dd>instructions</dd></dl> '''Next i'''</tt>',
2092 => '| <tt>'''For Each''' item '''In''' set <dl><dd>instructions</dd></dl> '''Next''' item</tt>',
2093 => '|-',
2094 => '| Visual Basic .NET',
2095 => '| rowspan=2| <tt>'''For i '''«'''As '''type» '''=''' first '''To''' last «'''Step 1'''» <dl><dd>instructions</dd></dl>'''Next i'''{{ref|step|[a]}}</tt>',
2096 => '| rowspan=2| <tt>'''For Each''' item '''As '''type''' In''' set <dl><dd>instructions</dd></dl> '''Next''' item</tt>',
2097 => '|-',
2098 => '| Xojo',
2099 => '| <tt>'''While''' condition <dl><dd>instructions</dd></dl>'''Wend'''</tt>',
2100 => '| <tt>'''Do Until''' notcondition <dl><dd>instructions</dd></dl>'''Loop''' <br/> or <br/>'''Do''' <dl><dd>instructions</dd></dl> '''Loop Until''' notcondition</tt>',
2101 => '|-',
2102 => '| Python',
2103 => '| <tt>'''while''' condition ''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>',
2104 => '| {{n/a}}',
2105 => '| <tt>'''for i in range('''first''', '''last+1'''):''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>(Python 3.x)<br/>',
2106 => '<tt>'''for i in xrange('''first''', '''last+1'''):''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}}instructions»</tt>(Python 2.x)',
2107 => '| <tt>'''for''' item '''in''' set''':''' <br/> {{keypress|Tab}} instructions <br/> «'''else:''' <br/> {{keypress|Tab}} instructions»</tt>',
2108 => '|-',
2109 => '| S-Lang',
2110 => '| <tt>'''while ('''condition''') {''' instructions '''}''' «'''then''' optional-block»</tt>',
2111 => '| <tt>'''do {''' instructions '''} while ('''condition''')''' «'''then''' optional-block»</tt>',
2112 => '| <tt>'''for (i = '''first'''; i <nowiki><=</nowiki> '''last'''; i++) {''' instructions '''}''' «'''then''' optional-block»</tt>',
2113 => '| <tt>'''foreach''' item'''('''set''')''' «'''using ('''what''')'''» '''{''' instructions '''}''' «'''then''' optional-block»</tt>',
2114 => '|-',
2115 => '| Fortran',
2116 => '| <tt>'''DO WHILE ('''condition''') <dl><dd> '''instructions'''</dd></dl> ENDDO'''</tt>',
2117 => '| <tt>'''DO <dl><dd> '''instructions''' <br/> IF ('''condition''') EXIT </dd></dl> ENDDO'''</tt>',
2118 => '| <tt>'''DO '''I''' = '''first''','''last''' <dl><dd> '''instructions''' </dd></dl> ENDDO'''</tt>',
2119 => '| {{n/a}}',
2120 => '|-',
2121 => '| Forth',
2122 => '| <tt>'''BEGIN '''« instructions » condition''' WHILE '''instructions''' REPEAT'''</tt>',
2123 => '| <tt>'''BEGIN ''' instructions condition''' UNTIL'''</tt>',
2124 => '| <tt>limit start''' DO '''instructions''' LOOP'''</tt>',
2125 => '| {{n/a}}',
2126 => '|-',
2127 => '| OCaml',
2128 => '| <tt>'''while''' condition '''do''' instructions '''done'''</tt>',
2129 => '| {{n/a}}',
2130 => '| <tt>'''for i = '''first''' to '''last''' do''' instructions '''done'''</tt>',
2131 => '| <tt>'''Array.iter (fun '''item''' <nowiki>-></nowiki> '''instructions''') '''array <br/> '''List.iter (fun '''item''' -> '''instructions''') '''list</tt>',
2132 => '|-',
2133 => '| F#',
2134 => '| <tt>'''while''' condition '''do''' <br/> {{keypress|Tab}} instructions</tt>',
2135 => '| {{n/a}}',
2136 => '| <tt>'''for i = '''first''' to '''last''' do''' <br/> {{keypress|Tab}} instructions</tt>',
2137 => '| <tt>'''for '''item''' in '''set''' do''' <br/> {{keypress|Tab}} instructions <br/> or <br/> '''Seq.iter (fun '''item''' -> '''instructions''') '''set</tt>',
2138 => '|-',
2139 => '| Standard ML',
2140 => '| <tt>'''while''' condition '''do (''' instructions ''')'''</tt>',
2141 => '| colspan=2 {{n/a}}',
2142 => '| <tt>'''Array.app (fn '''item''' <nowiki>=></nowiki> '''instructions''') '''array <br/> '''app (fn '''item''' => '''instructions''') '''list</tt>',
2143 => '|-',
2144 => '| Haskell (GHC)',
2145 => '| colspan=2 {{n/a}}',
2146 => '| <tt>'''Control.Monad.forM_ ['''first'''..'''last'''] (\i <nowiki>-></nowiki> do '''instructions''')'''</tt>',
2147 => '| <tt>'''Control.Monad.forM_ '''list '''(\item <nowiki>-></nowiki> do '''instructions''')'''</tt>',
2148 => '|-',
2149 => '| Eiffel',
2150 => '| colspan=4| <tt>'''from''' <dl><dd>setup</dd></dl> '''until''' <dl><dd>condition</dd></dl> '''loop''' <dl><dd>instructions</dd></dl> '''end'''</tt>',
2151 => '|-',
2152 => '| rowspan=6| CoffeeScript',
2153 => '| <tt>'''while''' condition <dl><dd>expression</dd></dl></tt>',
2154 => '| rowspan=6 {{n/a}}',
2155 => '| rowspan=4| <tt>'''for''' i '''in''' [first..last] <dl><dd>expression</dd></dl></tt>',
2156 => '| rowspan=4| <tt>'''for''' item '''in''' set <dl><dd>expression</dd></dl></tt>',
2157 => '|-',
2158 => '| <tt>expression '''while''' condition</tt>',
2159 => '|-',
2160 => '| <tt>'''while''' condition '''then''' expression</tt>',
2161 => '|-',
2162 => '| <tt>'''until''' condition <dl><dd>expression</dd></dl></tt>',
2163 => '|-',
2164 => '| <tt>expression '''until''' condition</tt>',
2165 => '| <tt>'''for''' i '''in''' [first..last] '''then''' expression</tt>',
2166 => '| <tt>'''for''' item '''in''' set '''then''' expression</tt>',
2167 => '|-',
2168 => '| <tt>'''until''' condition '''then''' expression</tt>',
2169 => '| <tt>expression '''for''' i '''in''' [first..last]</tt>',
2170 => '| <tt>expression '''for''' item '''in''' set</tt>',
2171 => '|-',
2172 => '| rowspan=2 | COBOL',
2173 => '| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» ««'''WITH'''» '''TEST BEFORE'''» '''UNTIL''' condition{{ref|COBOL THRU|[c]}}</tt>',
2174 => '| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» «'''WITH'''» '''TEST AFTER UNTIL''' condition{{ref|COBOL THRU|[c]}}</tt>',
2175 => '| <tt>'''PERFORM''' procedure-1 «'''THROUGH''' procedure-2» '''VARYING''' i '''FROM''' first '''BY''' increment '''UNTIL''' i '''>''' last{{ref|COBOL GREATER THAN|[d]}}</tt>',
2176 => '| rowspan=2 {{n/a}}',
2177 => '|-',
2178 => '| <tt>'''PERFORM''' ««'''WITH'''» '''TEST BEFORE'''» '''UNTIL''' condition <dl><dd> expression </dd></dl> '''END-PERFORM'''</tt>',
2179 => '| <tt>'''PERFORM''' «'''WITH'''» '''TEST AFTER UNTIL''' condition <dl><dd> expression </dd></dl> '''END-PERFORM'''</tt>',
2180 => '| <tt>'''PERFORM VARYING''' i '''FROM''' first '''BY''' increment '''UNTIL''' i '''>''' last <dl><dd> expression </dd></dl> '''END-PERFORM'''{{ref|COBOL GREATER THAN|[d]}}</tt>',
2181 => '|}',
2182 => '{{note|step|a}} "<tt>'''step'''</tt> n" is used to change the loop interval. If "<tt>'''step'''</tt>" is omitted, then the loop interval is 1.',
2183 => false,
2184 => '{{note|Ada_quantifiers|b}} This implements the universal quantifier ("for all" or "∀") as well as the existential quantifier ("there exists" or "∃").',
2185 => false,
2186 => '{{note|COBOL THRU|c}} <tt>'''THRU'''</tt> may be used instead of <tt>'''THROUGH'''</tt>.',
2187 => false,
2188 => '{{note|COBOL GREATER THAN|d}} <tt>«'''IS'''» '''GREATER''' «'''THAN'''»</tt> may be used instead of <tt>'''>'''</tt>.',
2189 => false,
2190 => '=== [[Exception handling|Exceptions]] ===',
2191 => '{{further|Exception handling syntax}}',
2192 => '{| class="wikitable"',
2193 => '|-',
2194 => '!',
2195 => '! throw',
2196 => '! handler',
2197 => '! assertion',
2198 => '|-',
2199 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
2200 => '| <tt>'''raise''' exception_name «'''with''' string_expression»</tt>',
2201 => '| <tt>'''begin'''<dl><dd>statements</dd></dl>'''exception'''<dl><dd>'''when''' exception_list<sub>1</sub> '''<nowiki>=></nowiki>''' statements;</dd><dd>'''when''' exception_list<sub>2</sub> '''<nowiki>=></nowiki>''' statements;</dd></dl>...<br><dl><dd>«'''when others <nowiki>=></nowiki>''' statements;»</dd></dl>'''end'''{{ref|Ada_uncaught_exceptions|[b]}}</tt>',
2202 => '| <tt>'''pragma Assert ('''«'''Check <nowiki>=></nowiki>'''» boolean_expression ««'''Message =>'''» string_expression»''')'''<br><br>[function <nowiki>|</nowiki> procedure <nowiki>|</nowiki> entry] '''with'''<dl><dd>'''Pre <nowiki>=></nowiki>''' boolean_expression</dd><dd>'''Post <nowiki>=></nowiki>''' boolean_expression</dd></dl><br>any_type '''with Type_Invariant <nowiki>=></nowiki>''' boolean_expression</tt>',
2203 => '|-',
2204 => '| [[APL (programming language)|APL]]',
2205 => '| <tt>«string_expression» '''⎕SIGNAL''' number_expression</tt>',
2206 => '| <tt>''':Trap''' number«s»_expression<dl><dd>statements</dd></dl>«''':Case''' number«s»_expression<dl><dd>statements»</dd></dl>...<br>«''':Else''' number«s»_expression<dl><dd>statements»</dd></dl>''':EndTrap'''</tt>',
2207 => '| <tt>«string_expression» '''⎕SIGNAL 98/⍨~'''condition</tt>',
2208 => '|-',
2209 => '| C (C99)',
2210 => '| <tt>'''[[longjmp]]('''state''',''' exception''');'''</tt>',
2211 => '| <tt>'''switch ([[setjmp]]('''state''')) { case 0: '''instructions''' break; case '''exception''': '''instructions''' ... }'''</tt>',
2212 => '| rowspan=2|<tt>'''assert('''condition''');'''</tt>',
2213 => '|-',
2214 => '| C++',
2215 => '| rowspan=8|<tt>'''throw''' exception''';'''</tt>',
2216 => '| <tt>'''try { '''instructions''' } catch''' «'''('''exception''')'''» '''{ '''instructions''' }''' ...</tt>',
2217 => '|-',
2218 => '| C#',
2219 => '| <tt>'''try { '''instructions''' } catch''' «'''('''exception''')'''» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>',
2220 => '| <tt>'''Debug.Assert('''condition''');'''</tt>',
2221 => '|-',
2222 => '| Java',
2223 => '| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>',
2224 => '| <tt>'''assert '''condition''' «: '''description'''»;'''</tt>',
2225 => '|-',
2226 => '| JavaScript',
2227 => '| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' «'''finally { '''instructions''' }'''»</tt>',
2228 => '| {{dunno}}',
2229 => '|-',
2230 => '| D',
2231 => '| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>',
2232 => '| <tt>'''assert('''condition''');'''</tt>',
2233 => '|-',
2234 => '| PHP',
2235 => '| <tt>'''try { '''instructions''' } catch ('''exception''') { '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>',
2236 => '| <tt>'''assert('''condition''');'''</tt>',
2237 => '|-',
2238 => '| S-Lang',
2239 => '| <tt>'''try { '''instructions''' } catch''' «exception» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>',
2240 => '| {{dunno}}',
2241 => '|-',
2242 => '| Windows PowerShell',
2243 => '| <tt>'''trap''' «'''['''exception''']'''» '''{ '''instructions''' }''' ... instructions or '''try { '''instructions''' } catch''' «'''['''exception''']'''» '''{ '''instructions''' }''' ... «'''finally { '''instructions''' }'''»</tt>',
2244 => '| <tt>'''[Debug]::Assert('''condition''')'''</tt>',
2245 => '|-',
2246 => '| Objective-C',
2247 => '| <tt>'''@throw''' exception''';'''</tt>',
2248 => '| <tt>'''@try { '''instructions''' } @catch ('''exception''') { '''instructions''' }''' ... «'''@finally { '''instructions''' }'''»</tt>',
2249 => '| <tt>'''NSAssert('''condition''', '''description''');'''</tt>',
2250 => '|-',
2251 => '| Swift',
2252 => '| <tt>'''throw''' exception</tt> (2.x)',
2253 => '| <tt>'''do { try '''expression''' ... '''instructions''' } catch '''exception''' { '''instructions''' }''' ...</tt> (2.x)',
2254 => '| <tt>'''assert('''condition'''«, '''description'''»)'''</tt>',
2255 => '|-',
2256 => '| Perl',
2257 => '| rowspan=2| <tt>'''die''' exception''';'''</tt>',
2258 => '| <tt>'''eval { '''instructions''' }; if ($@) { '''instructions''' }'''</tt>',
2259 => '| {{dunno}}',
2260 => '|-',
2261 => '| Perl 6',
2262 => '| <tt>'''try { '''instructions''' CATCH { when '''exception''' { '''instructions''' } '''...'''}}'''</tt>',
2263 => '| {{dunno}}',
2264 => '|-',
2265 => '| Ruby',
2266 => '| <tt>'''raise''' exception</tt>',
2267 => '| <tt>'''begin''' <dl><dd>instructions</dd></dl> '''rescue''' exception <dl><dd>instructions</dd></dl>... <br/> «'''else''' <dl><dd>instructions»</dd></dl> «'''ensure''' <dl><dd>instructions»</dd></dl> '''end'''</tt>',
2268 => '|',
2269 => '|-',
2270 => '| Smalltalk',
2271 => '| <tt>exception '''raise'''</tt>',
2272 => '| <tt>instructionBlock '''on:''' exception '''do:''' handlerBlock</tt>',
2273 => '| <tt>'''assert:''' conditionBlock</tt>',
2274 => '|-',
2275 => '| Common Lisp',
2276 => '| <tt>'''(error '''"exception"''')''' or <br/> '''(error <dl><dd>'''type</dd><dd>arguments''')'''</dd></dl> or <br/> '''(error (make-condition<dl><dd>'''type</dd><dd>arguments'''))'''</dd></dl></tt>',
2277 => '| <tt>'''(handler-case<dl><dd>(progn '''instructions''')</dd><dd>('''exception instructions''')</dd><dd>'''...''')'''</dd></dl> or <br/>'''(handler-bind<dl><dd>('''condition <dl><dd>'''(lambda</dd><dd>'''instructions</dd><dd>«'''invoke-restart''' restart args»'''))'''</dd></dl>...''')'''{{ref|a|[a]}}</dd></dl></tt>',
2278 => '| <tt>'''(assert '''condition''')''' or <br/>'''(assert '''condition<dl><dd>«'''('''place''')'''</dd><dd>«error»»''')'''</dd></dl> or <br/>'''(check-type '''var type''')'''</tt>',
2279 => '|-',
2280 => '| Scheme (R<sup>6</sup>RS)',
2281 => '| <tt>'''(raise '''exception''')'''</tt>',
2282 => '| <tt>'''(guard (con ('''condition''' '''instructions''') '''...''') '''instructions''')'''</tt>',
2283 => '| {{dunno}}',
2284 => '|-',
2285 => '| ISLISP',
2286 => '| <tt>'''(error '''"error-string" objects''')''' or <br/> '''(signal-condition '''condition continuable''')'''</tt>',
2287 => '| <tt>'''(with-handler<dl><dd>'''handler form*''')'''</tt>',
2288 => '| {{dunno}}',
2289 => '|-',
2290 => '| Pascal',
2291 => '| <tt>'''raise''' Exception.Create()</tt>',
2292 => '| <tt>'''try''' Except '''on''' E: exception '''do begin ''' instructions ''' end; end;'''</tt>',
2293 => '| {{dunno}}',
2294 => '|-',
2295 => '| Visual Basic',
2296 => '| <tt>'''Err.Raise''' ERRORNUMBER</tt>',
2297 => '| <tt>'''With New '''Try''': On Error Resume Next''' <dl><dd>OneInstruction</dd></dl> .Catch''': On Error GoTo 0: Select Case '''.Number <dl><dd>'''Case''' ERRORNUMBER</dd></dl> <dl><dd><dl><dd>instructions</dd></dl></dd></dl> '''End Select: End With'''</tt>',
2298 => '<syntaxhighlight lang="vbnet" enclose="div">',
2299 => ''*** Try class ***',
2300 => 'Private mstrDescription As String',
2301 => 'Private mlngNumber As Long',
2302 => 'Public Sub Catch()',
2303 => false,
2304 => 'mstrDescription = Err.Description',
2305 => false,
2306 => 'mlngNumber = Err.Number',
2307 => false,
2308 => 'End Sub',
2309 => 'Public Property Get Number() As Long',
2310 => false,
2311 => 'Number = mlngNumber',
2312 => false,
2313 => 'End Property',
2314 => 'Public Property Get Description() As String',
2315 => false,
2316 => 'Description = mstrDescription',
2317 => 'End Property',
2318 => '</syntaxhighlight><ref>{{cite web|url=https://sites.google.com/site/truetryforvisualbasic/|title=Try-Catch for VB|author=|date=|work=google.com|accessdate=30 January 2017}}</ref>',
2319 => '| <tt>'''Debug.Assert''' condition</tt>',
2320 => '|-',
2321 => '| Visual Basic .NET',
2322 => '| <tt>'''Throw''' exception</tt>',
2323 => '| <tt>'''Try''' <dl><dd>instructions</dd></dl> '''Catch''' «exception» «'''When''' condition» <dl><dd>instructions</dd></dl> ... <br/> «'''Finally''' <dl><dd>instructions»</dd></dl> '''End Try'''</tt>',
2324 => '| <tt>'''Debug.Assert('''condition''')'''</tt>',
2325 => '|-',
2326 => '| Xojo',
2327 => '| <tt>'''Raise''' exception</tt>',
2328 => '| <tt>'''Try''' <dl><dd>instructions</dd></dl> '''Catch''' «exception»<dl><dd>instructions</dd></dl> ... <br/> «'''Finally''' <dl><dd>instructions»</dd></dl> '''End Try'''</tt>',
2329 => '| {{n/a}}',
2330 => '|-',
2331 => '| Python',
2332 => '| <tt>'''raise''' exception</tt>',
2333 => '| <tt>'''try:''' <br/> {{keypress|Tab}} instructions <br/> '''except''' «exception»''':''' <br/> {{keypress|Tab}} instructions <br/> ... <br/> «'''else:''' <br/> {{keypress|Tab}} instructions» <br/> «'''finally:''' <br/> {{keypress|Tab}} instructions»</tt>',
2334 => '| <tt>'''assert '''condition</tt>',
2335 => '|-',
2336 => '| Fortran',
2337 => '| colspan=3 {{n/a}}',
2338 => '|-',
2339 => '| Forth',
2340 => '| <tt>code''' THROW'''</tt>',
2341 => '| <tt>xt''' CATCH''' ( code or 0 )</tt>',
2342 => '| {{n/a}}',
2343 => '|-',
2344 => '| OCaml',
2345 => '| rowspan=2| <tt>'''raise''' exception</tt>',
2346 => '| <tt>'''try''' expression '''with''' pattern '''->''' expression ...</tt>',
2347 => '| rowspan=2| <tt>'''assert''' condition</tt>',
2348 => '|-',
2349 => '| F#',
2350 => '| <tt>'''try''' expression '''with''' pattern '''->''' expression ... <br/> or <br/>'''try''' expression '''finally''' expression</tt>',
2351 => '|-',
2352 => '| Standard ML',
2353 => '| <tt>'''raise''' exception «arg»</tt>',
2354 => '| <tt>expression '''handle''' pattern '''=>''' expression ...</tt>',
2355 => '| ',
2356 => '|-',
2357 => '| Haskell (GHC)',
2358 => '| <tt>'''throw''' exception <br/> ''or'' <br/> '''throwError''' expression</tt>',
2359 => '| <tt>'''catch''' tryExpression catchExpression <br/> ''or'' <br/> '''catchError''' tryExpression catchExpression</tt>',
2360 => '| <tt>'''assert''' condition expression</tt>',
2361 => '|-',
2362 => '| COBOL',
2363 => '| <tt>'''RAISE''' «'''EXCEPTION'''» exception</tt>',
2364 => '| <tt>'''USE''' «'''AFTER'''» '''EXCEPTION OBJECT''' class-name'''.''' or<br/>',
2365 => ''''USE''' «'''AFTER'''» '''EO''' class-name'''.''' or<br/>',
2366 => ''''USE''' «'''AFTER'''» '''EXCEPTION CONDITION''' exception-name «'''FILE''' file-name»'''.''' or<br/>',
2367 => ''''USE''' «'''AFTER'''» '''EC''' exception-name «'''FILE''' file-name»'''.'''</tt>',
2368 => '| {{n/a}}',
2369 => '|}',
2370 => false,
2371 => '{{note|common lisp restarts|a}} Common Lisp allows <code>with-simple-restart</code>, <code>restart-case</code> and <code>restart-bind</code> to define restarts for use with <code>invoke-restart</code>. Unhandled conditions may cause the implementation to show a restarts menu to the user before unwinding the stack.',
2372 => false,
2373 => '{{note|Ada_uncaught_exceptions|b}} Uncaught exceptions are propagated to the innermost dynamically enclosing execution. Exceptions are not propagated across tasks (unless these tasks are currently synchronised in a rendezvous).',
2374 => false,
2375 => '=== Other control flow statements ===',
2376 => '{| class="wikitable"',
2377 => '|-',
2378 => '!',
2379 => '! exit block(break)',
2380 => '! continue',
2381 => '! [[Label (programming language)|label]]',
2382 => '! branch ([[goto]])',
2383 => '! return value from generator',
2384 => '|-',
2385 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
2386 => '| <tt>'''exit''' «loop_name» «'''when''' condition»</tt>',
2387 => '| {{n/a}}',
2388 => '| <tt>label''':'''</tt>',
2389 => '| <tt>'''goto''' label</tt>',
2390 => '| {{n/a}}',
2391 => '|-',
2392 => '| ALGOL 68',
2393 => '| <tt>value '''exit''';</tt> ...',
2394 => '| <tt>'''do''' statements; '''skip exit'''; label: statements '''od'''</tt>',
2395 => '| <tt>label:</tt> ...',
2396 => '| <tt>'''go to''' label; ...<br>',
2397 => ''''goto''' label; ...<br>',
2398 => 'label; ...</tt>',
2399 => '| <tt>''yield''(''value'')</tt>',
2400 => '([[Callback (computer science)|Callback]])<ref>{{cite web|url=http://rosettacode.org/wiki/Prime_decomposition#ALGOL_68|title=Prime decomposition - Rosetta Code|author=|date=|work=rosettacode.org|accessdate=30 January 2017}}</ref>',
2401 => '|-',
2402 => '| [[APL (programming language)|APL]]',
2403 => '| <tt>''':Leave'''</tt>',
2404 => '| <tt>''':Continue'''</tt>',
2405 => '| <tt>label''':'''</tt>',
2406 => '| <tt>'''→'''label<br>or<br>',
2407 => '''':GoTo''' label</tt>',
2408 => '| {{n/a}}',
2409 => '|-',
2410 => '| C (C99)',
2411 => '| rowspan=5| <tt>'''break;'''</tt>',
2412 => '| rowspan=5| <tt>'''continue;'''</tt>',
2413 => '| rowspan=12| <tt>label''':'''</tt>',
2414 => '| rowspan=5| <tt>'''goto''' label''';'''</tt>',
2415 => '| rowspan=4 {{n/a}}',
2416 => '|-',
2417 => '| Objective-C',
2418 => '|-',
2419 => '| C++ (STL)',
2420 => '|-',
2421 => '| D',
2422 => '|-',
2423 => '| C#',
2424 => '| <tt>'''yield return''' value''';'''</tt>',
2425 => '|-',
2426 => '| Java',
2427 => '| rowspan=2| <tt>'''break''' «label»''';'''</tt>',
2428 => '| rowspan=2| <tt>'''continue''' «label»''';'''</tt>',
2429 => '| rowspan=2 {{n/a}}',
2430 => '|',
2431 => '|-',
2432 => '| JavaScript',
2433 => '| <tt>'''yield''' value«;»</tt>',
2434 => '|-',
2435 => '| PHP',
2436 => '| <tt>'''break''' «levels»''';'''</tt>',
2437 => '| <tt>'''continue''' «levels»''';'''</tt>',
2438 => '| rowspan=3| <tt>'''goto''' label''';'''</tt>',
2439 => '| <tt>'''yield''' «key <nowiki>=></nowiki>» value;</tt>',
2440 => '|-',
2441 => '| Perl',
2442 => '| rowspan=2| <tt>'''last''' «label»''';'''</tt>',
2443 => '| rowspan=2| <tt>'''next''' «label»''';'''</tt>',
2444 => '| ',
2445 => '|-',
2446 => '| Perl 6',
2447 => '| ',
2448 => '|-',
2449 => '| Go',
2450 => '| <tt>'''break''' «label»</tt>',
2451 => '| <tt>'''continue''' «label»</tt>',
2452 => '| <tt>'''goto''' label</tt>',
2453 => '| ',
2454 => '|-',
2455 => '| Swift',
2456 => '| <tt>'''break''' «label»</tt>',
2457 => '| <tt>'''continue''' «label»</tt>',
2458 => '| {{n/a}}',
2459 => '| ',
2460 => '|-',
2461 => '| Bash shell',
2462 => '| <tt>'''break''' «levels»</tt>',
2463 => '| <tt>'''continue''' «levels»</tt>',
2464 => '| {{n/a}}',
2465 => '| {{n/a}}',
2466 => false,
2467 => '| {{n/a}}',
2468 => '|-',
2469 => '| Common Lisp',
2470 => '| <tt>'''(return)''' or <br/> '''(return-from '''block''')''' or <br/> '''(loop-finish)'''</tt>',
2471 => '| ',
2472 => '| <tt>'''(tagbody '''tag<dl><dd><dl><dd>...</dd><dd>tag</dd></dl>...''')'''</tt>',
2473 => '| <tt>'''(go '''tag''')'''</tt>',
2474 => '|',
2475 => '|-',
2476 => '| Scheme',
2477 => '| ',
2478 => '| ',
2479 => '|',
2480 => '| ',
2481 => '|',
2482 => '|-',
2483 => '| ISLISP',
2484 => '| <tt>'''(return-from '''block''')'''</tt>',
2485 => '| ',
2486 => '| <tt>'''(tagbody '''tag<dl><dd><dl><dd>...</dd><dd>tag</dd></dl>...''')'''</tt>',
2487 => '| <tt>'''(go '''tag''')'''</tt>',
2488 => '|',
2489 => '|-',
2490 => '| Pascal(ISO)',
2491 => '| colspan=2 {{n/a}}',
2492 => '| rowspan=2| <tt>label''':'''</tt>{{ref|Pascal's declarations|[a]}}',
2493 => '| rowspan=2| <tt>'''goto''' label''';'''</tt>',
2494 => '| rowspan=5 {{n/a}}',
2495 => '|-',
2496 => '| Pascal(FPC)',
2497 => '| <tt>'''break;'''</tt>',
2498 => '| <tt>'''continue;'''</tt>',
2499 => '|-',
2500 => '| Visual Basic',
2501 => '| rowspan=3| <tt>'''Exit''' block</tt>',
2502 => '| {{n/a}}',
2503 => '| rowspan=3| <tt>label''':'''</tt>',
2504 => '| rowspan=3| <tt>'''GoTo''' label</tt>',
2505 => '|-',
2506 => '| Visual Basic .NET ',
2507 => '| rowspan=2| <tt>'''Continue''' block</tt>',
2508 => '|-',
2509 => '| Xojo ',
2510 => '|-',
2511 => '| Python',
2512 => '| <tt>'''break'''</tt>',
2513 => '| <tt>'''continue'''</tt>',
2514 => '| colspan=2 {{n/a}}',
2515 => '| <tt>'''yield '''value</tt>',
2516 => '|-',
2517 => '| RPG IV',
2518 => '| <tt>'''LEAVE;'''</tt>',
2519 => '| <tt>'''ITER;'''</tt>',
2520 => '| ',
2521 => '| ',
2522 => '| ',
2523 => '|-',
2524 => '| S-Lang',
2525 => '| <tt>'''break;'''</tt>',
2526 => '| <tt>'''continue;'''</tt>',
2527 => '|',
2528 => '| ',
2529 => '|',
2530 => '|-',
2531 => '| Fortran',
2532 => '| <tt>'''EXIT'''</tt>',
2533 => '| <tt>'''CYCLE'''</tt>',
2534 => '| <tt>label</tt>{{ref|Fortran label|[b]}}',
2535 => '| <tt>'''GOTO''' label</tt>',
2536 => '| {{n/a}}',
2537 => '|-',
2538 => '| Ruby',
2539 => '| <tt>'''break'''</tt>',
2540 => '| <tt>'''next'''</tt>',
2541 => '| ',
2542 => '| ',
2543 => '| ',
2544 => '|-',
2545 => '| Windows PowerShell',
2546 => '| <tt>'''break''' «label»</tt>',
2547 => '| <tt>'''continue'''</tt>',
2548 => '|',
2549 => '|',
2550 => '|',
2551 => '|-',
2552 => '| OCaml',
2553 => '| rowspan=4 colspan=4 {{n/a}}',
2554 => '|',
2555 => '|-',
2556 => '| F#',
2557 => '| ',
2558 => '|-',
2559 => '| Standard ML',
2560 => '|',
2561 => '|-',
2562 => '| Haskell (GHC)',
2563 => '|',
2564 => '|-',
2565 => '| COBOL',
2566 => '| <tt>'''EXIT PERFORM''' or '''EXIT PARAGRAPH''' or '''EXIT SECTION''' or '''EXIT.'''</tt>',
2567 => '| <tt>'''EXIT PERFORM CYCLE'''</tt>',
2568 => '| <tt>label «'''SECTION'''»'''.'''</tt>',
2569 => '| <tt>'''GO TO''' label</tt>',
2570 => '| {{n/a}}',
2571 => '|-',
2572 => '| Ya',
2573 => '| <tt>'''break''' «from where»''';'''</tt> f.e.<br>',
2574 => '<tt>'''break for switch;'''</tt>',
2575 => '| <tt>'''continue''' «to where»''';'''</tt> f.e.<br>',
2576 => '<tt>'''continue for switch;'''</tt>',
2577 => '| <tt>''':'''label</tt>',
2578 => '| <tt>'''goto :'''label''';'''</tt>',
2579 => '| {{n/a}}',
2580 => '|}',
2581 => '{{note|Pascal's declarations|a}} Pascal has declaration blocks. See [[Comparison of programming languages (basic instructions)#Functions]].',
2582 => '<br/>{{note|Fortran label|b}} label must be a number between 1 and 99999.',
2583 => false,
2584 => '== [[Subroutine|Functions]] ==',
2585 => 'See [[Reflection (computer science)|reflection]] for calling and declaring functions by strings.',
2586 => '{| class="wikitable"',
2587 => '|- valign="top"',
2588 => '!',
2589 => '! calling a function',
2590 => '! basic/void function',
2591 => '! value-returning function',
2592 => '! required [[main function]]',
2593 => '|- valign="top"',
2594 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
2595 => '| <tt>''foo'' «(parameters)»</tt>',
2596 => '| <tt>'''procedure''' ''foo'' «(parameters)» '''is begin''' statements '''end''' foo</tt>',
2597 => '| <tt>'''function''' ''foo'' «(parameters)» '''return''' type '''is begin''' statements '''end''' foo</tt>',
2598 => '| {{n/a}}',
2599 => '|- valign="top"',
2600 => '| [[ALGOL 68]]',
2601 => '|<tt>''foo''«(parameters)»;</tt>',
2602 => '|<tt>'''proc''' ''foo'' = «(parameters)» [[void type|void]]: ( ''instructions'' );</tt>',
2603 => '|<tt>'''proc''' ''foo'' = «(parameters)» '''rettype''': ( ''instructions ...; retvalue'' );</tt>',
2604 => '| {{n/a}}',
2605 => '|- valign="top"',
2606 => '| [[APL (programming language)|APL]]',
2607 => '| <tt>«parameters» ''foo'' parameters</tt>',
2608 => '| <tt>''foo''←'''{''' statements '''}'''</tt>',
2609 => '| <tt>''foo''←'''{''' statements '''}'''</tt>',
2610 => '| {{n/a}}',
2611 => '|- valign="top"',
2612 => '| C (C99)',
2613 => '| rowspan=9| <tt>'''foo('''«parameters»''')'''</tt>',
2614 => '| rowspan=6| <tt>'''[[void type|void]] foo('''«parameters»''') { '''instructions''' }'''</tt>',
2615 => '| rowspan=6| <tt>type '''foo('''«parameters»''') { '''instructions ... '''return''' value'''; }'''</tt>',
2616 => '| rowspan=3| <tt>«global declarations» <br/> '''int main('''«'''int argc, char *argv[]'''»''') { <dl><dd>'''instructions'''</dd></dl> }'''</tt>',
2617 => '|- valign="top"',
2618 => '| Objective-C',
2619 => '|- valign="top"',
2620 => '| C++ (STL)',
2621 => '|- valign="top"',
2622 => '| C#',
2623 => '| <tt>'''static void Main('''«'''string[] args'''»''') { '''instructions''' }''' or<br/> '''static int Main('''«'''string[] args'''»''') { '''instructions''' }'''</tt>',
2624 => '|- valign="top"',
2625 => '| Java',
2626 => '| <tt>'''public static void main(String[] args) { '''instructions''' }''' or<br/> '''public static void main(String[[variadic function|...]] args) { '''instructions''' }'''</tt>',
2627 => '|- valign="top"',
2628 => '| D',
2629 => '| <tt>'''int main('''«'''char[][] args'''»''') { '''instructions'''}''' or<br /> '''int main('''«'''string[] args'''»''') { '''instructions'''}''' or<br /> '''void main('''«'''char[][] args'''»''') { '''instructions'''}''' or<br /> '''void main('''«'''string[] args'''»''') { '''instructions'''}'''</tt>',
2630 => '|- valign="top"',
2631 => '| JavaScript',
2632 => '| <tt>'''function foo('''«parameters»''') { '''instructions''' }''' or<br/> '''var foo = function ('''«parameters»''') {'''instructions''' }''' or<br/> '''var foo = new Function ('''«'''"'''parameter'''",''' ... ''',"'''last parameter'''"'''»''' "'''instructions'''");'''</tt>',
2633 => '| <tt>'''function foo('''«parameters»''') { '''instructions ... '''return''' value'''; }'''</tt>',
2634 => '| {{n/a}}',
2635 => '|- valign="top"',
2636 => '| Go',
2637 => '| <tt>'''func foo('''«parameters»''') { '''instructions''' }'''</tt>',
2638 => '| <tt>'''func foo('''«parameters»''') '''type''' { '''instructions ... '''return''' value''' }'''</tt>',
2639 => '| <tt>'''func main() { '''instructions''' }'''</tt>',
2640 => '|- valign="top"',
2641 => '| Swift',
2642 => '| <tt>'''func foo('''«parameters»''') { '''instructions''' }'''</tt>',
2643 => '| <tt>'''func foo('''«parameters»''') -> '''type''' { '''instructions ... '''return''' value''' }'''</tt>',
2644 => '| {{n/a}}',
2645 => '|- valign="top"',
2646 => '| Common Lisp',
2647 => '| rowspan=3| <tt>'''(foo '''«parameters»''')'''</tt>',
2648 => '| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>instructions''')'''</dd></dl> or <br/>'''(setf (symbol-function <nowiki>'</nowiki>'''symbol''')'''<dl><dd>lambda''')'''</dd></dl></tt>',
2649 => '| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>...</dd><dd>value''')'''</dd></dl></tt>',
2650 => '| rowspan=3 {{n/a}}',
2651 => '|- valign="top"',
2652 => '| Scheme',
2653 => '| <tt>'''(define (foo '''parameters''')''' instructions''')''' or <br/> '''(define foo ([[anonymous function|lambda]] ('''parameters''')''' instructions'''))'''</tt>',
2654 => '| <tt>'''(define (foo '''parameters''')''' instructions... return_value''')''' or <br/> '''(define foo ([[anonymous function|lambda]] ('''parameters''')''' instructions... return_value'''))'''</tt>',
2655 => '|- valign="top"',
2656 => '| ISLISP',
2657 => '| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>instructions''')'''</dd></dl></tt>',
2658 => '| <tt>'''([[defun]] foo ('''«parameters»''')'''<dl><dd>...</dd><dd>value''')'''</dd></dl></tt>',
2659 => '|- valign="top"',
2660 => '| Pascal',
2661 => '| <tt>'''foo'''«'''('''parameters''')'''»</tt>',
2662 => '| <tt>'''procedure foo'''«'''('''parameters''')'''»''';''' «'''forward;'''»{{ref|forward declaration|[a]}}<br/>',
2663 => '«'''label'''<dl><dd>label declarations»</dd></dl>',
2664 => '«'''const'''<dl><dd>constant declarations»</dd></dl>',
2665 => '«'''type'''<dl><dd>type declarations»</dd></dl>',
2666 => '«'''var'''<dl><dd>variable declarations»</dd></dl>',
2667 => '«local function declarations»<br/>'''begin'''<dl><dd>instructions</dd></dl>'''end;'''</tt>',
2668 => '| <tt>'''function foo'''«'''('''parameters''')'''»''': '''type'''; '''«'''forward;'''»{{ref|forward declaration|[a]}}<br/>',
2669 => '«'''label'''<dl><dd>label declarations»</dd></dl>',
2670 => '«'''const'''<dl><dd>constant declarations»</dd></dl>',
2671 => '«'''type'''<dl><dd>type declarations»</dd></dl>',
2672 => '«'''var'''<dl><dd>variable declarations»</dd></dl>',
2673 => '«local function declarations»<br/>'''begin'''<dl><dd> instructions'''; <br/> foo := '''value</dd></dl>'''end;'''</tt>',
2674 => '| <tt>'''program''' name''';'''<br/>',
2675 => '«'''label'''<dl><dd>label declarations»</dd></dl>',
2676 => '«'''const'''<dl><dd>constant declarations»</dd></dl>',
2677 => '«'''type'''<dl><dd>type declarations»</dd></dl>',
2678 => '«'''var'''<dl><dd>variable declarations»</dd></dl>',
2679 => '«function declarations»<br/>'''begin'''<dl><dd>instructions</dd></dl> '''end.'''</tt> <!--somewhat of a technicality-->',
2680 => '|- valign="top"',
2681 => '| Visual Basic',
2682 => '| rowspan=3| <tt>'''Foo('''«parameters»''')'''</tt>',
2683 => '| rowspan=3| <tt>'''Sub Foo('''«parameters»''') <dl><dd> '''instructions''' </dd></dl> End Sub'''</tt>',
2684 => '| <tt>'''Function Foo('''«parameters»''') As '''type <dl><dd>instructions<br/> '''Foo = '''value</dd></dl>'''End Function'''</tt>',
2685 => '| <tt>'''Sub Main()'''<dl><dd>instructions</dd></dl>'''End Sub'''</tt>',
2686 => '|- valign="top"',
2687 => '| Visual Basic .NET',
2688 => '| rowspan=2| <tt>'''Function Foo('''«parameters»''') As '''type <dl><dd>instructions<br/>'''Return '''value</dd></dl>'''End Function'''</tt>',
2689 => '| rowspan=2| <tt>'''Sub Main('''«'''ByVal CmdArgs() As String'''»''') <dl><dd>'''instructions'''</dd></dl> End Sub'''<br/>or<br/> '''Function Main('''«'''ByVal CmdArgs() As String'''»''') As Integer <dl><dd>'''instructions'''</dd></dl>End Function'''</tt>',
2690 => '|- valign="top"',
2691 => '| Xojo',
2692 => '|- valign="top"',
2693 => '| Python',
2694 => '| <tt>'''foo('''«parameters»''')'''</tt>',
2695 => '| <tt>'''def foo('''«parameters»'''):''' <br/> {{keypress|Tab}} instructions </tt>',
2696 => '| <tt>'''def foo('''«parameters»'''):''' <br/> {{keypress|Tab}} instructions <br/> {{keypress|Tab}} '''return''' value</tt>',
2697 => '| {{n/a}}',
2698 => '|- valign="top"',
2699 => '| S-Lang',
2700 => '| <tt>'''foo('''«parameters» «;qualifiers»''')'''</tt>',
2701 => '| <tt>'''define foo ('''«parameters»''') { '''instructions''' }'''</tt>',
2702 => '| <tt>'''define foo ('''«parameters»''') { '''instructions ... '''return '''value'''; }'''</tt>',
2703 => '| <tt>'''public define slsh_main () { '''instructions''' }'''</tt>',
2704 => '|- valign="top"',
2705 => '| Fortran',
2706 => '| <tt>'''foo ('''«arguments»''') <br> CALL sub_foo ('''«arguments»''')'''{{ref|Fortran arguments|[c]}}</tt>',
2707 => '| <tt>'''SUBROUTINE sub_foo ('''«arguments»''') <dl><dd> '''instructions''' </dd></dl> END SUBROUTINE'''{{ref|Fortran arguments|[c]}}</tt>',
2708 => '| <tt>type''' FUNCTION foo ('''«arguments»''') <dl><dd> '''instructions''' <br/> ... <br/> foo '''= value''' </dd></dl> END FUNCTION'''{{ref|Fortran arguments|[c]}}</tt>',
2709 => '| <tt>'''PROGRAM '''main''' <dl><dd> '''instructions''' </dd></dl> END PROGRAM'''</tt>',
2710 => '|- valign="top"',
2711 => '| Forth',
2712 => '| <tt>«parameters»''' FOO'''</tt>',
2713 => '| <tt>''': FOO ''' « ''stack effect comment:'' '''( '''before '''-- )''' » ''' <dl><dd> '''instructions''' </dd></dl> ;'''</tt>',
2714 => '| <tt>''': FOO ''' « ''stack effect comment:'' '''( '''before '''--''' after ''')''' » ''' <dl><dd> '''instructions''' </dd></dl> ;'''</tt>',
2715 => '| {{n/a}}',
2716 => '|- valign="top"',
2717 => '| PHP',
2718 => '| <tt>'''foo('''«parameters»''')'''</tt>',
2719 => '| <tt>'''function foo('''«parameters»''') { '''instructions''' }'''</tt>',
2720 => '| <tt>'''function foo('''«parameters»''') { '''instructions''' ... return '''value'''; }'''</tt>',
2721 => '| rowspan=4 {{n/a}}',
2722 => '|- valign="top"',
2723 => '| Perl',
2724 => '| <tt>'''foo('''«parameters»''')''' or <br/> '''&foo'''«'''('''parameters''')'''»</tt>',
2725 => '| <tt>'''sub foo { '''«'''my ('''parameters''') = @_;'''»''' '''instructions''' }'''</tt>',
2726 => '| <tt>'''sub foo { '''«'''my ('''parameters''') = @_;'''»''' '''instructions'''... '''«'''return'''»''' '''value'''; }'''</tt>',
2727 => '|- valign="top"',
2728 => '| Perl 6',
2729 => '| <tt>'''foo('''«parameters»''')''' or <br/> '''&foo'''«'''('''parameters''')'''»</tt>',
2730 => '| <tt>«'''multi''' »'''sub foo('''parameters''') { '''instructions''' }'''</tt>',
2731 => '| <tt>«'''our''' «type» »«'''multi''' »'''sub foo('''parameters''') { '''instructions'''... '''«'''return'''»''' '''value'''; }'''</tt>',
2732 => '|- valign="top"',
2733 => '| Ruby',
2734 => '| rowspan=2| <tt>'''foo'''«'''('''parameters''')'''»</tt>',
2735 => '| <tt>'''def foo'''«'''('''parameters''')'''» <dl><dd>instructions </dd></dl> '''end'''</tt>',
2736 => '| <tt>'''def foo'''«'''('''parameters''')'''» <dl><dd>instructions <br/> «'''return'''» value </dd></dl> '''end'''</tt>',
2737 => '|- valign="top"',
2738 => '| Scala',
2739 => '| <tt>'''def foo'''«'''('''parameters''')'''»«''': Unit ='''» '''{''' instructions '''}'''</tt>',
2740 => '| <tt>'''def foo'''«'''('''parameters''')'''»«''':''' type» '''= {''' instructions ... «'''return'''» value '''}'''</tt>',
2741 => '| <tt>'''def main(args: Array[String]) {''' instructions '''}'''</tt>',
2742 => '|- valign="top"',
2743 => '| Windows PowerShell',
2744 => '| <tt>'''foo''' «parameters»</tt>',
2745 => '| <tt>'''function foo ''' { '''instructions''' };'''<br/>or<br/>'''function foo { '''«'''param('''parameters''')'''»''' '''instructions''' }'''</tt>',
2746 => '| <tt>'''function foo '''«'''('''parameters''')'''» ''' { '''instructions''' ''' … '''return '''value''' };''' or<br/>'''function foo { '''«'''param('''parameters''')'''» '''instructions''' …''' return '''value''' }'''</tt>',
2747 => '| rowspan=4 {{n/a}}',
2748 => '|- valign="top"',
2749 => '| rowspan=2|Bash shell',
2750 => '| rowspan=2|<tt>'''foo''' «parameters»</tt>',
2751 => '| <poem><tt>'''function foo {'''',
2752 => '{{space|4}}instructions',
2753 => ''''}'''',
2754 => '</tt>or<tt>',
2755 => ''''foo () {'''',
2756 => '{{space|4}}instructions',
2757 => '''' }'''</tt></poem>',
2758 => '| <poem><tt>'''function foo {'''',
2759 => '{{space|4}}instructions',
2760 => '{{space|4}}'''return''' «exit_code»',
2761 => ''''}'''',
2762 => '</tt>or<tt>',
2763 => ''''foo () {'''',
2764 => '{{space|4}}instructions',
2765 => '{{space|4}}'''return''' «exit_code»',
2766 => '''' }'''</tt></poem>',
2767 => '|- valign="top"',
2768 => '| colspan=2|',
2769 => '* parameters',
2770 => '** <tt>'''$'''n</tt> ('''$1''', '''$2''', '''$3''', ...)',
2771 => '** <tt>'''$@'''</tt> (all parameters)',
2772 => '** <tt>'''$#'''</tt> (the number of parameters)',
2773 => '** <tt>'''$0'''</tt> (this function name)',
2774 => '|- valign="top"',
2775 => '| OCaml',
2776 => '| rowspan=4| <tt>'''foo '''parameters</tt>',
2777 => '| rowspan=2| <tt>'''let''' «'''rec'''» '''foo''' parameters '''=''' instructions</tt>',
2778 => '| rowspan=2| <tt>'''let''' «'''rec'''» '''foo''' parameters '''=''' instructions... return_value</tt>',
2779 => '|- valign="top"',
2780 => '| F#',
2781 => '| <tt>'''[<EntryPoint>] let main args =''' instructions</tt>',
2782 => '|- valign="top"',
2783 => '| Standard ML',
2784 => '| <tt>'''fun foo''' parameters '''= (''' instructions ''')'''</tt>',
2785 => '| <tt>'''fun foo''' parameters '''= (''' instructions... return_value ''')'''</tt>',
2786 => '| ',
2787 => '|- valign="top"',
2788 => '| Haskell',
2789 => '| <tt>'''foo''' parameters '''= do'''<br/>{{keypress|Tab}} instructions</tt>',
2790 => '| <tt>'''foo''' parameters '''=''' return_value <br/> or <br/> '''foo''' parameters '''= do'''<br/>{{keypress|Tab}} instructions<br/>{{keypress|Tab}} '''return''' value</tt>',
2791 => '| <tt>«'''main :: IO ()'''» <br/> '''main = do''' instructions</tt>',
2792 => '|- valign="top"',
2793 => '| Eiffel',
2794 => '| <tt>'''foo ('''«parameters»''')'''</tt>',
2795 => '| <tt>'''foo ('''«parameters»''')'''<br/><dl><dd>'''require''' <dl><dd>preconditions</dd></dl> '''do''' <dl><dd>instructions</dd></dl> '''ensure''' <dl><dd>postconditions</dd></dl> '''end'''</dd></dl></tt>',
2796 => '| <tt>'''foo ('''«parameters»''')''': type<br/><dl><dd>'''require''' <dl><dd>preconditions</dd></dl> '''do''' <dl><dd>instructions</dd><dd>'''Result''' := value</dd></dl> '''ensure''' <dl><dd>postconditions</dd></dl> '''end'''</dd></dl></tt>',
2797 => '| {{ref|root class and feature|[b]}}',
2798 => '|- valign="top"',
2799 => '| rowspan=2| CoffeeScript',
2800 => '| <tt>'''foo()'''</tt>',
2801 => '| <tt>'''foo = <nowiki>-></nowiki>'''</tt>',
2802 => '| <tt>'''foo = <nowiki>-></nowiki>''' value</tt>',
2803 => '| rowspan=2 {{n/a}}',
2804 => '|- valign="top"',
2805 => '| <tt>'''foo''' parameters</tt>',
2806 => '| <tt>'''foo = <nowiki>() -></nowiki>'''</tt>',
2807 => '| <tt>'''foo = (''' parameters ''') <nowiki>-></nowiki>''' value</tt>',
2808 => '|- valign="top"',
2809 => '| rowspan=2 | COBOL',
2810 => '| <tt>'''CALL''' '''"'''foo'''"''' «'''USING''' parameters» <dl><dd> «exception-handling» </dd></dl> «'''END-CALL'''»</tt>{{ref|COBOL calling programs|[d]}}',
2811 => '| <tt>«'''IDENTIFICATION DIVISION.'''»<br/>',
2812 => ''''PROGRAM-ID.''' foo'''.'''<br/>',
2813 => '«other divisions...»<br/>',
2814 => ''''PROCEDURE DIVISION''' «'''USING''' parameters»'''.'''<br/>',
2815 => '<dl><dd> instructions'''.'''</dd></dl> </tt>',
2816 => '| rowspan=2 | <tt>«'''IDENTIFICATION DIVISION.'''»<br/>',
2817 => ''''PROGRAM-ID'''/'''FUNCTION-ID.''' foo'''.'''<br/>',
2818 => '«other divisions...»<br/>',
2819 => ''''DATA DIVISION.'''<br/>',
2820 => '«other sections...»<br/>',
2821 => ''''LINKAGE SECTION.'''<br/>',
2822 => '«parameter definitions...»<br/>',
2823 => 'variable-to-return definition<br/>',
2824 => '«other sections...»<br/>',
2825 => ''''PROCEDURE DIVISION''' «'''USING''' parameters» '''RETURNING''' variable-to-return'''.'''<br/>',
2826 => '<dl><dd> instructions'''.'''</dd></dl></tt>',
2827 => '| rowspan=2 {{n/a}}',
2828 => '|-',
2829 => '|<tt>«'''FUNCTION'''» foo«(«parameters»)»</tt>',
2830 => '| {{n/a}}',
2831 => '|}',
2832 => '{{note|forward declaration|a}} Pascal requires "<tt>forward;</tt>" for [[forward declaration]]s.<br/>',
2833 => '{{note|root class and feature|b}} Eiffel allows the specification of an application's root class and feature.<br/>',
2834 => '{{note|Fortran arguments|c}} In Fortran, function/subroutine parameters are called arguments (since <tt>PARAMETER</tt> is a language keyword); the <tt>CALL</tt> keyword is required for subroutines.<br/>',
2835 => '{{note|COBOL calling programs|d}} Instead of using <tt>"foo"</tt>, a string variable may be used instead containing the same value.',
2836 => false,
2837 => '== [[Type conversion]]s{{anchor|Data conversions}} ==',
2838 => 'Where ''string'' is a signed decimal number:',
2839 => '{| class="wikitable"',
2840 => '|-',
2841 => '! ',
2842 => '! string to integer',
2843 => '! string to long integer',
2844 => '! string to floating point',
2845 => '! integer to string',
2846 => '! floating point to string',
2847 => '|-',
2848 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
2849 => '| <tt> '''Integer'Value ('''string_expression''')'''</tt>',
2850 => '| <tt> '''Long_Integer'Value ('''string_expression''')'''</tt>',
2851 => '| <tt> '''Float'Value ('''string_expression''')'''</tt>',
2852 => '| <tt> '''Integer'Image ('''integer_expression''')'''</tt>',
2853 => '| <tt> '''Float'Image ('''float_expression''')'''</tt>',
2854 => '|-',
2855 => '| rowspan=3 | [[ALGOL 68]] with general, and then specific formats',
2856 => '| colspan=5 align=center| With prior declarations and association of: <tt>'''string''' buf := "12345678.9012e34 "; '''file''' proxy; associate(proxy, buf);</tt>',
2857 => '|-',
2858 => '| <pre>get(proxy, ivar);</pre>',
2859 => '| <pre>get(proxy, livar);</pre>',
2860 => '| <pre>get(proxy, rvar);</pre>',
2861 => '| <pre>put(proxy, ival);</pre>',
2862 => '| <pre>put(proxy, rval);</pre>',
2863 => '|-',
2864 => '| <pre>getf(proxy, ($g$, ivar));</pre><br/>orv',
2865 => '<pre>getf(proxy, ($dddd$, ivar));</pre>',
2866 => '| <pre>getf(proxy, ($g$, livar));</pre><br/>or<br/>',
2867 => '<pre>getf(proxy, ($8d$, livar));</pre>',
2868 => '| <pre>getf(proxy, ($g$, rvar));</pre><br/>or<br/>',
2869 => '<pre>getf(proxy, ($8d.4dE2d$, rvar));</pre>',
2870 => '| <pre>putf(proxy, ($g$, ival));</pre><br/>or<br/>',
2871 => '<pre>putf(proxy, ($4d$, ival));</pre>',
2872 => '| <pre>putf(proxy, ($g(width, places, exp)$, rval));</pre><br/>or<br/>',
2873 => '<pre>putf(proxy, ($8d.4dE2d$, rval));</pre><br/>etc.',
2874 => '|-',
2875 => '| [[APL (programming language)|APL]]',
2876 => '| <tt> '''⍎'''string_expression</tt>',
2877 => '| <tt> '''⍎'''string_expression</tt>',
2878 => '| <tt> '''⍎'''string_expression</tt>',
2879 => '| <tt> '''⍕'''integer_expression</tt>',
2880 => '| <tt> '''⍕'''float_expression</tt>',
2881 => '|-',
2882 => '| C (C99)',
2883 => '| <tt> integer '''= [[atoi]]('''string''');'''</tt>',
2884 => '| <tt> long '''= [[atol (programming)|atol]]('''string''');'''</tt>',
2885 => '| <tt> float '''= [[atof]]('''string''');'''</tt>',
2886 => '| <tt> '''[[sprintf]]('''string''', "%i", '''integer''');'''</tt>',
2887 => '| <tt> '''[[sprintf]]('''string''', "%f", '''float''');'''</tt>',
2888 => '|-',
2889 => '| Objective-C',
2890 => '| <tt> integer '''= ['''string''' intValue];'''</tt>',
2891 => '| <tt> long '''= ['''string''' longLongValue];'''</tt>',
2892 => '| <tt> float '''= ['''string''' doubleValue];'''</tt>',
2893 => '| <tt> string '''= [NSString stringWithFormat<wbr/>:@"%i", '''integer'''];'''</tt>',
2894 => '| <tt> string '''= [NSString stringWithFormat<wbr/>:@"%f", '''float'''];'''</tt>',
2895 => '|-',
2896 => '| C++ (STL)',
2897 => '| colspan=3| <tt>«'''std::'''»'''istringstream('''string''') >> '''number;</tt>',
2898 => '| colspan=2| <tt>«'''std::'''»'''ostringstream '''o''';''' o''' << '''number'''; '''string '''= '''o'''.str();'''</tt>',
2899 => '|-',
2900 => '| C++11',
2901 => '| <tt> integer '''= «'''std::'''»stoi('''string''');'''</tt>',
2902 => '| <tt> long '''= «'''std::'''»stol('''string''');'''</tt>',
2903 => '| <tt> float '''= «'''std::'''»stof('''string''');''' ',
2904 => 'double '''= «'''std::'''»stod('''string''');''' </tt>',
2905 => '| colspan=2| <tt>string '''= «'''std::'''»to_string('''number''');'''</tt>',
2906 => '|-',
2907 => '| C#',
2908 => '| <tt> integer '''= int.Parse<wbr/>('''string''');'''</tt>',
2909 => '| <tt> long '''= long.Parse<wbr/>('''string''');'''</tt>',
2910 => '| <tt> float '''= float.Parse<wbr/>('''string''');''' or<br/> double '''= double.Parse<wbr/>('''string''');'''</tt>',
2911 => '| colspan=2| <tt>string '''= '''number'''<wbr/>.ToString();'''</tt>',
2912 => '|-',
2913 => '| D',
2914 => '| <tt> integer '''= std.conv.to!int<wbr/>('''string''')'''</tt>',
2915 => '| <tt> long '''= std.conv.to!long<wbr/>('''string''')'''</tt>',
2916 => '| <tt> float '''= std.conv.to!float<wbr/>('''string''')''' or<br/> double '''= std.conv.to!double<wbr/>('''string''')'''</tt>',
2917 => '| colspan=2| <tt> string '''= std.conv.to!string<wbr/>('''number''')'''</tt>',
2918 => '|-',
2919 => '| Java',
2920 => '| <tt> integer '''= Integer.parseInt<wbr/>('''string''');'''</tt>',
2921 => '| <tt> long''' = Long.parseLong<wbr/>('''string''');'''</tt>',
2922 => '| <tt> float''' = Float.parseFloat<wbr/>('''string''');''' or<br/> double '''= Double.parseDouble<wbr/>('''string''');'''</tt>',
2923 => '| <tt> string''' = Integer.toString<wbr/>('''integer''');''' or<br/> string''' = String.valueOf<wbr/>('''integer''');'''</tt>',
2924 => '| <tt> string''' = Float.toString<wbr/>('''float''');''' or<br/> string''' = Double.toString<wbr/>('''double''');'''</tt>',
2925 => '|-',
2926 => '| <tt> JavaScript{{ref|JavaScript's technicalities|[a]}}</tt>',
2927 => '| colspan=2| <tt> integer '''= parseInt('''string''');'''</tt>',
2928 => '| <tt> float '''= parseFloat('''string''');''' or<br/> float''' = new Number ('''string''')''' or<br/> float''' = Number ('''string''')''' or<br/> float '''= +'''string</tt>',
2929 => '| colspan=2| <tt> string''' = '''number'''.toString ();''' or<br/> string '''= new String ('''number''');''' or<br/> string '''= String ('''number''');''' or<br/> string''' = '''number'''+"";'''</tt>',
2930 => '|-',
2931 => '| Go',
2932 => '| <tt> integer''',''' error '''= strconv.Atoi('''string''')''' or<br /> integer''',''' error '''= strconv.ParseInt<wbr/>('''string''', 10, 0)'''</tt>',
2933 => '| <tt> long''',''' error '''= strconv.ParseInt<wbr/>('''string''', 10, 64)'''</tt>',
2934 => '| <tt> float''',''' error '''= strconv.ParseFloat<wbr/>('''string''', 64)'''</tt>',
2935 => '| <tt> string '''= strconv.Itoa('''integer''')''' or<br/> string '''= strconv.FormatInt<wbr/>('''integer''', 10)''' or<br/> string '''= fmt.Sprint('''integer''')'''</tt>',
2936 => '| <tt> string '''= strconv.FormatFloat<wbr/>('''float''')''' or<br/> string '''= fmt.Sprint<wbr/>('''float''')'''</tt>',
2937 => '|-',
2938 => '| Common Lisp',
2939 => '| colspan=2| <tt>'''(setf''' integer '''(parse-integer '''string'''))'''</tt>',
2940 => '| <tt> '''(setf''' float '''(read-from-string '''string'''))'''</tt>',
2941 => '| colspan=2| <tt>'''(setf''' string '''(princ-to-string '''number'''))'''</tt>',
2942 => '|-',
2943 => '| Scheme',
2944 => '| colspan=3| <tt>'''(define''' number '''(string->number '''string'''))'''</tt>',
2945 => '| colspan=2| <tt>'''(define''' string '''(number->string '''number'''))'''</tt>',
2946 => '|-',
2947 => '| ISLISP',
2948 => '| colspan=2| <tt>'''(setf''' integer '''(convert '''string''' <integer>))'''</tt>',
2949 => '| <tt> '''(setf''' float '''(convert '''string''' <float>))'''</tt>',
2950 => '| colspan=2| <tt>'''(setf''' string '''(convert '''number''' <string>))'''</tt>',
2951 => '|-',
2952 => '| Pascal <!-- Pascal or Delphi? -->',
2953 => '| <tt> integer ''':= StrToInt('''string''');'''</tt>',
2954 => '| ',
2955 => '| <tt> float ''':= StrToFloat('''string''');'''</tt>',
2956 => '| <tt> string ''':= IntToStr('''integer''');'''</tt>',
2957 => '| <tt> string ''':= FloatToStr('''float''');'''</tt>',
2958 => '|-',
2959 => '| Visual Basic',
2960 => '| rowspan=2| <tt>integer''' = CInt('''string''')'''</tt>',
2961 => '| rowspan=2| <tt>long''' = CLng('''string''')'''</tt>',
2962 => '| rowspan=2| <tt>float''' = CSng('''string''')''' or<br/> double''' = CDbl('''string''')'''</tt>',
2963 => '| <tt> rowspan=2 colspan=2|string''' = CStr('''number''')'''</tt>',
2964 => '|-',
2965 => '| Visual Basic .NET',
2966 => '|-',
2967 => '| Xojo',
2968 => '| <tt>integer''' = Val('''string''')'''</tt>',
2969 => '| <tt>long''' = Val('''string''')'''</tt>',
2970 => '| <tt>double''' = Val('''string''')''' or<br/> double''' = CDbl('''string''')'''</tt>',
2971 => '| colspan=2| <tt> string''' = CStr('''number''')''' or<br/> string''' = Str('''number''')</tt>',
2972 => '|-',
2973 => '| Python',
2974 => '| <tt> integer''' = int('''string''')'''</tt>',
2975 => '| <tt> long''' = long('''string''')'''</tt>',
2976 => '| <tt> float''' = float('''string''')'''</tt>',
2977 => '| colspan=2| <tt>string''' = str('''number''')'''</tt>',
2978 => '|-',
2979 => '| S-Lang',
2980 => '| <tt> integer''' = [[atoi]]('''string''');'''</tt>',
2981 => '| <tt> long''' = [[atol (programming)|atol]]('''string''');'''</tt>',
2982 => '| <tt> float''' = [[atof]]('''string''');'''</tt>',
2983 => '| colspan=2| <tt>string''' = string('''number''');'''</tt>',
2984 => '|-',
2985 => '| Fortran',
2986 => '| colspan=3| <tt>'''READ('''string''','''format''') '''number</tt>',
2987 => '| colspan=2| <tt>'''WRITE('''string''','''format''') '''number</tt>',
2988 => '|-',
2989 => '| PHP',
2990 => '| colspan=2| <tt> integer '''= intval('''string''');''' or<br/> integer '''= (int)'''string''';'''</tt>',
2991 => '| <tt> float '''= floatval('''string''');''' or<br/> float '''= (float)'''string''';'''</tt>',
2992 => '| colspan=2| <tt> string '''= "'''number'''";''' or<br/> string '''= strval('''number''');''' or<br/> string '''= (string)'''number''';'''</tt>',
2993 => '|-',
2994 => '| Perl{{ref|Perl's technicalities|[b]}}',
2995 => '| colspan=3| <tt> number '''= 0 +''' string;</tt>',
2996 => '| colspan=2| <tt> string '''= "'''number'''";'''</tt>',
2997 => '|-',
2998 => '| Perl 6',
2999 => '| colspan=3| <tt> number '''= +'''string;</tt>',
3000 => '| colspan=2| <tt> string '''= ~'''number''';'''</tt>',
3001 => '|-',
3002 => '| Ruby',
3003 => '| colspan=2| <tt> integer '''=''' string'''.to_i''' or<br/>integer '''= Integer('''string''')'''</tt>',
3004 => '| <tt> float '''=''' string'''.to_f''' or<br/>float '''= Float('''string''')'''</tt>',
3005 => '| colspan=2| <tt> string '''=''' number'''.to_s'''</tt>',
3006 => '|-',
3007 => '| Scala',
3008 => '| <tt> integer '''=''' string'''.toInt'''</tt>',
3009 => '| <tt> long '''=''' string'''.toLong'''</tt>',
3010 => '| <tt> float '''=''' string'''.toFloat''' or<br/> double '''=''' string'''.toDouble'''</tt>',
3011 => '| colspan=2| <tt>string '''= '''number'''.toString'''</tt>',
3012 => '|-',
3013 => '| Smalltalk',
3014 => '| colspan=2| <tt> integer := Integer '''readFrom:''' string</tt>',
3015 => '| <tt> float := Float '''readFrom:''' string</tt>',
3016 => '| colspan=2| <tt> string := number '''asString'''</tt>',
3017 => '|-',
3018 => '| Windows PowerShell',
3019 => '| <tt> integer''' = [int]'''string</tt>',
3020 => '| <tt> long''' = [long]'''string</tt>',
3021 => '| <tt> float''' = [float]'''string</tt>',
3022 => '| colspan=2| <tt>string''' = [string]'''number''';''' or<br/>string''' = "'''number'''";''' or<br/>string''' = ('''number''').ToString()'''</tt>',
3023 => '|-',
3024 => '| OCaml',
3025 => '| <tt> '''let''' integer''' = int_<wbr/>of_string '''string</tt>',
3026 => '| ',
3027 => '| <tt> '''let''' float''' = float_<wbr/>of_string '''string</tt>',
3028 => '| <tt> '''let''' string''' = string_<wbr/>of_int '''integer</tt>',
3029 => '| <tt> '''let''' string''' = string_<wbr/>of_float '''float</tt>',
3030 => '|-',
3031 => '| F#',
3032 => '| <tt> '''let''' integer''' = int '''string</tt>',
3033 => '| <tt> '''let''' integer''' = int64 '''string</tt>',
3034 => '| <tt> '''let''' float''' = float '''string</tt>',
3035 => '| colspan=2| <tt> '''let''' string''' = string '''number</tt>',
3036 => '|-',
3037 => '| Standard ML',
3038 => '| <tt> '''val''' integer''' = Int<wbr/>.fromString '''string</tt>',
3039 => '| ',
3040 => '| <tt> '''val''' float''' = Real<wbr/>.fromString '''string</tt>',
3041 => '| <tt> '''val''' string''' = Int<wbr/>.toString '''integer</tt>',
3042 => '| <tt> '''val''' string''' = Real<wbr/>.toString '''float</tt>',
3043 => '|-',
3044 => '| Haskell (GHC)',
3045 => '| colspan=3| <tt> number '''= read '''string</tt>',
3046 => '| colspan=2| <tt> string '''= show '''number</tt>',
3047 => '|-',
3048 => '| COBOL',
3049 => '| colspan=3 | <code>'''MOVE''' «'''FUNCTION'''» '''NUMVAL('''string''')'''{{ref|COBOL's NUMVAL alternatives|[c]}} '''TO''' number</code>',
3050 => '| colspan=2 | <code>'''MOVE''' number '''TO''' numeric-edited</code>',
3051 => '|-',
3052 => '|}',
3053 => '{{note|JavaScript's technicalities|a}} JavaScript only uses floating point numbers so there are some technicalities.<ref name="Javascript numbers"/>',
3054 => '<br/>{{note|Perl's technicalities|b}} Perl doesn't have separate types. Strings and numbers are interchangeable.',
3055 => '<br/>{{note|COBOL's NUMVAL alternatives|c}} <code>NUMVAL-C</code> or <code>NUMVAL-F</code> may be used instead of <code>NUMVAL</code>.',
3056 => false,
3057 => '== [[Standard streams|Standard stream I/O]] ==',
3058 => '{| class="wikitable"',
3059 => '|-',
3060 => '! rowspan=2| ',
3061 => '! read from',
3062 => '! colspan=2| write to',
3063 => '|-',
3064 => '! [[stdin]]',
3065 => '! [[stdout]]',
3066 => '! [[stderr]]',
3067 => '|-',
3068 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
3069 => '| <tt>'''Get ('''x''')'''</tt>',
3070 => '| <tt>'''Put ('''x''')'''</tt>',
3071 => '| <tt>'''Put (Standard_Error, '''x''')'''</tt>',
3072 => '|-',
3073 => '| [[ALGOL 68]]',
3074 => '| <tt>'''readf(('''$format$''', '''x'''));''' or <br/> '''getf(stand in, ('''$format$''', '''x'''));'''</tt>',
3075 => '| <tt>'''[[printf]](('''$format$''', '''x'''));''' or <br/> '''putf(stand out, ('''$format$''', '''x'''));''' </tt>',
3076 => '| <tt>'''putf(stand error, ('''$format$''', '''x'''));'''{{ref|ALGOL Unformatted|[a]}}</tt>',
3077 => '|-',
3078 => '| [[APL (programming language)|APL]]',
3079 => '| <tt>x←'''⎕'''</tt>',
3080 => '| <tt>'''⎕←'''x</tt>',
3081 => '| <tt>'''⍞←'''x</tt>',
3082 => '|-',
3083 => '| C (C99) ',
3084 => '| <tt>'''[[scanf]]('''format''', &'''x''');''' or <br/> '''[[fscanf]](stdin, '''format''', &'''x''');''' {{ref|more c input|[b]}}</tt>',
3085 => '| <tt>'''[[printf]]( '''format''', '''x''');''' or <br/> '''[[fprintf]](stdout, '''format''', '''x''');''' {{ref|more c output|[c]}}</tt>',
3086 => '| <tt>'''[[fprintf]](stderr, '''format''', '''x''' );'''{{ref|more c error output|[d]}}</tt>',
3087 => '|-',
3088 => '| Objective-C',
3089 => '| <tt>data = '''[[NSFileHandle fileHandleWithStandardInput] readDataToEndOfFile];'''</tt>',
3090 => '| <tt>'''[[NSFileHandle fileHandleWithStandardOutput] writeData:'''data'''];'''</tt>',
3091 => '| <tt>'''[[NSFileHandle fileHandleWithStandardError] writeData:'''data'''];'''</tt>',
3092 => '|-',
3093 => '| C++',
3094 => '| <tt>[[iostream|«'''std::'''»'''cin''']] '''>>''' x''';''' or <br/> «'''std::'''»'''getline('''«'''std::'''»'''cin, '''str''');'''</tt>',
3095 => '| <tt>[[iostream|«'''std::'''»'''cout''']] '''<<''' x''';'''</tt>',
3096 => '| <tt>[[iostream|«'''std::'''»'''cerr''']] '''<<''' x''';''' or<br/> [[iostream|«'''std::'''»'''clog''']] '''<<''' x''';'''</tt>',
3097 => '|-',
3098 => '| C#',
3099 => '| <tt>x ''' = Console.Read();''' or <br/> x '''= Console.ReadLine();'''</tt>',
3100 => '| <tt>'''Console.Write('''«format''', '''»x''');''' or <br/> '''Console.WriteLine('''«format''', '''»x''');'''</tt>',
3101 => '| <tt>'''Console.Error<wbr/>.Write('''«format''', '''»x''');''' or <br/> '''Console.Error<wbr/>.WriteLine('''«format''', '''»x''');'''</tt>',
3102 => '|-',
3103 => '| D',
3104 => '| <tt>x = '''std.stdio.readln()'''</tt>',
3105 => '| <tt>'''std.stdio.write('''x''')''' or <br /> '''std.stdio.writeln('''x''')''' or <br /> '''std.stdio.writef('''format''', '''x''')''' or <br /> '''std.stdio.writefln('''format''', '''x''')'''</tt>',
3106 => '| <tt>'''stderr.write('''x''')''' or <br /> '''stderr.writeln('''x''')''' or <br /> '''std.stdio<wbr/>.writef(stderr, '''format''', '''x''')''' or <br /> '''std.stdio<wbr/>.writefln(stderr, '''format''', '''x''')'''</tt>',
3107 => '|-',
3108 => '| Java',
3109 => '| <tt>x '''= System.in.read();''' or <br/> x '''= new Scanner(System.in)<wbr/>.nextInt();''' or <br/> x '''= new Scanner(System.in)<wbr/>.nextLine();'''</tt>',
3110 => '| <tt>'''System.out.print('''x''');''' or <br/> '''System.out.[[printf]]('''format''', '''x''');''' or <br/> '''System.out.println('''x''');'''</tt>',
3111 => '| <tt>'''System.err.print('''x''');''' or <br/> '''System.err.[[printf]]('''format''', '''x''');''' or <br/> '''System.err.println('''x''');'''</tt>',
3112 => '|-',
3113 => '| Go',
3114 => '| <tt>'''fmt.Scan(&'''x''')''' or <br/> '''fmt.[[Scanf]]('''format''', &'''x''')''' or <br/> x = '''bufio.NewReader(os.Stdin)<wbr/>.ReadString('\n')'''</tt>',
3115 => '| <tt>'''fmt.Println('''x''')''' or<br/> '''fmt.[[Printf]]('''format''', '''x''')'''</tt>',
3116 => '| <tt>'''fmt.Fprintln(os{{Not a typo|.}}Stderr, '''x''')''' or<br/> '''fmt.[[Fprintf]](os{{Not a typo|.}}Stderr, '''format''', '''x''')'''</tt>',
3117 => '|-',
3118 => '| Swift',
3119 => '| <tt>x = '''readLine()'''</tt> (2.x)',
3120 => '| <tt>'''print('''x''')'''</tt> (2.x)<br /> <tt>'''println('''x''')'''</tt> (1.x)',
3121 => '| ',
3122 => '|-',
3123 => '| JavaScript<br/><small>[[Client-side JavaScript|Web Browser implementation]]</small>',
3124 => '| ',
3125 => '| <tt>'''document.write('''x''')'''</tt>',
3126 => '| ',
3127 => '|-',
3128 => '| JavaScript<br/><small>[[Active Server Pages]]</small>',
3129 => '| ',
3130 => '| <tt>'''Response.Write('''x''')'''</tt>',
3131 => '| ',
3132 => '|-',
3133 => '| JavaScript<br/><small>[[Windows Script Host]]</small>',
3134 => '| <tt>x '''= WScript.StdIn.Read('''chars''')''' or<br/> x '''= WScript.StdIn.ReadLine()'''</tt>',
3135 => '| <tt>'''WScript.Echo('''x''')''' or<br/> '''WScript.StdOut.Write('''x''')''' or<br/> '''WScript.StdOut.WriteLine('''x''')'''</tt>',
3136 => '| <tt>'''WScript.StdErr.Write('''x''')''' or<br/> '''WScript.StdErr.WriteLine('''x''')'''</tt>',
3137 => '|-',
3138 => '| Common Lisp',
3139 => '| <tt>'''(setf''' x '''(read-line))'''</tt>',
3140 => '| <tt>'''(princ''' x''')''' or<br/> '''(format t '''format x''')'''</tt>',
3141 => '| <tt>'''(princ''' x''' *error-output*)''' or<br/> '''(format *error-output* '''format x''')'''</tt>',
3142 => '|-',
3143 => '| Scheme (R<sup>6</sup>RS)',
3144 => '| <tt>'''(define''' x''' (read-line))'''</tt>',
3145 => '| <tt>'''(display''' x''')''' or<br/> '''(format #t '''format x''')'''</tt>',
3146 => '| <tt>'''(display''' x''' (current-error-port))''' or<br/> '''(format (current-error-port) '''format x''')'''</tt>',
3147 => '|-',
3148 => '| ISLISP',
3149 => '| <tt>'''(setf''' x '''(read-line))'''</tt>',
3150 => '| <tt>'''(format (standard-output) '''format x''')'''</tt>',
3151 => '| <tt>'''(format (error-output) '''format x''')'''</tt>',
3152 => '|-',
3153 => '| Pascal',
3154 => '| <tt>'''read('''x''');''' or <br/> '''readln('''x''');'''</tt>',
3155 => '| <tt>'''write('''x''');''' or <br/> '''writeln('''x''');'''</tt>',
3156 => '| rowspan=2 {{n/a}}',
3157 => '|-',
3158 => '| Visual Basic',
3159 => '| <tt>'''Input'''« prompt''','''»''' '''x'''</tt>',
3160 => '| <tt>'''Print '''x or <br/> '''? '''x'''</tt>',
3161 => '|-',
3162 => '| Visual Basic .NET',
3163 => '| <tt>x ''' = Console.Read()''' or <br/> x '''= Console.ReadLine()'''</tt>',
3164 => '| <tt>'''Console.Write('''«format''', '''»x''')''' or <br/> '''Console.WriteLine('''«format''', '''»x''')'''</tt>',
3165 => '| <tt>'''Console.Error<wbr/>.Write('''«format''', '''»x''')''' or <br/> '''Console.Error<wbr/>.WriteLine('''«format''', '''»x''')'''</tt>',
3166 => '|-',
3167 => '| Xojo',
3168 => '| <tt>x ''' = StandardInputStream.Read()''' or <br/> x '''= StandardInputStreame.ReadLine()'''</tt>',
3169 => '| <tt>'''StandardOutputStream.Write('''x''')''' or <br/> '''StandardOutputStream.WriteLine('''x''')'''</tt>',
3170 => '| <tt>'''StdErr.Write('''x''')''' or <br/> '''StdErr.WriteLine('''x''')'''</tt>',
3171 => '|-',
3172 => '| Python 2.x',
3173 => '| <tt>x '''= raw_input('''«prompt»''')'''</tt>',
3174 => '| <tt>'''print''' x or <br/> '''sys.stdout.write('''x''')'''</tt>',
3175 => '| <tt>'''print >> sys.stderr,''' x or <br/> '''sys.stderr.write('''x''')'''</tt>',
3176 => '|-',
3177 => '| Python 3.x',
3178 => '| <tt>x '''= input('''«prompt»''')'''</tt>',
3179 => '| <tt>'''print('''x«''', end=""'''»''')'''</tt>',
3180 => '| <tt>'''print('''x«''', end=""'''»''', file=sys.stderr)'''</tt>',
3181 => '|-',
3182 => '| S-Lang',
3183 => '| <tt>'''[[fgets]] (&'''x''', stdin)'''</tt>',
3184 => '| <tt>'''[[fputs]] ('''x''', stdout)'''</tt>',
3185 => '| <tt>'''[[fputs]] ('''x''', stderr)'''</tt>',
3186 => '|-',
3187 => '| Fortran',
3188 => '| <tt>'''READ(*,'''format''') '''variable names''' or <br/> READ(INPUT_UNIT,'''format''') '''variable names'''{{ref|Fortran standard units|[e]}}</tt>',
3189 => '| <tt>'''WRITE(*,'''format''') '''expressions''' or <br/>WRITE(OUTPUT_UNIT,'''format''') '''expressions'''{{ref|Fortran standard units|[e]}}</tt>',
3190 => '| <tt>'''WRITE(ERROR_UNIT,'''format''') '''expressions{{ref|Fortran standard units|[e]}}</tt>',
3191 => '|-',
3192 => '| Forth',
3193 => '| <tt>buffer length''' ACCEPT''' ( # chars read ) <br/>'''KEY''' ( char )</tt>',
3194 => '| <tt>buffer length''' TYPE'''<br/>char''' EMIT'''</tt>',
3195 => '| {{n/a}}',
3196 => '|-',
3197 => '| PHP',
3198 => '| <tt>$x '''= [[fgets]](STDIN);''' or <br/> $x '''= [[fscanf]](STDIN, '''format''');'''</tt>',
3199 => '| <tt>'''print '''x''';''' or <br/> '''[[echo (command)|echo]] '''x''';''' or <br/> '''[[printf]]('''format''', '''x''');'''</tt>',
3200 => '| <tt>'''[[fprintf]](STDERR, '''format''', '''x''');'''</tt>',
3201 => '|-',
3202 => '| Perl',
3203 => '| <tt>$x '''= <>;''' or <br/> $x '''= <STDIN>;'''</tt>',
3204 => '| <tt>'''print '''x''';''' or <br/> '''[[printf]] '''format''', '''x''';'''</tt>',
3205 => '| <tt>'''print STDERR '''x''';''' or <br/> '''[[printf]] STDERR '''format''', '''x''';'''</tt>',
3206 => '|-',
3207 => '| Perl 6',
3208 => '| <tt>$x '''= $*IN.get;'''</tt>',
3209 => '| <tt>x'''.print''' or<br/> x'''.say'''</tt>',
3210 => '| <tt>x'''.note''' or<br/> '''$*ERR.print('''x''')''' or<br/> '''$*ERR.say('''x''')'''</tt>',
3211 => '|-',
3212 => '| Ruby',
3213 => '| <tt>x '''= gets'''</tt>',
3214 => '| <tt>'''puts''' x or<br/> '''[[printf]]('''format''', '''x''')'''</tt>',
3215 => '| <tt>'''$stderr.puts('''x''')''' or<br/> '''$stderr.[[printf]]('''format''', '''x''')'''</tt>',
3216 => '|-',
3217 => '| Windows PowerShell',
3218 => '| <tt>$x '''= Read-Host'''««''' -Prompt'''» text»''';''' or <br/> $x '''= [Console]::Read();''' or <br/> $x '''= [Console]::ReadLine()'''</tt>',
3219 => '| <tt>x''';''' or <br/> '''Write-Output '''x''';''' or <br/> '''echo '''x</tt>',
3220 => '| <tt>'''Write-Error '''x</tt>',
3221 => '|-',
3222 => '| OCaml',
3223 => '| <tt>'''let''' x '''= read_int ()''' or <br/> '''let''' str '''= read_line ()''' or <br/> '''Scanf.[[scanf]]''' format '''(fun '''x ...''' <nowiki>-></nowiki> '''...''')'''</tt>',
3224 => '| <tt>'''print_int''' x or <br/> '''print_endline''' str or <br/> '''Printf.[[printf]]''' format x ...</tt>',
3225 => '| <tt>'''prerr_int''' x or <br/> '''prerr_endline''' str or <br/> '''Printf.[[fprintf|eprintf]]''' format x ...</tt>',
3226 => '|-',
3227 => '| F#',
3228 => '| <tt>'''let''' x '''= System.Console<wbr/>.ReadLine()'''</tt>',
3229 => '| <tt>'''[[printf]]''' format x ... or <br/> '''[[printf]]n''' format x ...</tt>',
3230 => '| <tt>'''[[fprintf|eprintf]]''' format x ... or <br/>'''[[fprintf|eprintf]]n''' format x ...</tt>',
3231 => '|-',
3232 => '| Standard ML',
3233 => '| <tt>'''val''' str '''= TextIO.inputLIne TextIO.stdIn'''</tt>',
3234 => '| <tt>'''print''' str</tt>',
3235 => '| <tt>'''TextIO.output (TextIO.stdErr, '''str''')'''</tt>',
3236 => '|-',
3237 => '| Haskell (GHC)',
3238 => '| <tt>x '''<- readLn''' or <br/> str '''<nowiki><-</nowiki> getLine'''</tt>',
3239 => '| <tt>'''print '''x or <br/> '''putStrLn''' str</tt>',
3240 => '| <tt>'''hPrint stderr '''x or <br/> '''hPutStrLn stderr''' str</tt>',
3241 => '|-',
3242 => '| COBOL',
3243 => '| <code>'''ACCEPT''' x</code>',
3244 => '| <code>'''DISPLAY''' x</code>',
3245 => '|',
3246 => '|-',
3247 => '|}',
3248 => '<br>{{note|ALGOL Unformatted|a}} ALGOL 68 additionally as the "unformatted" [[transput]] routines: <tt>''read'', ''write'', ''get''</tt> and <tt>''put''</tt>.',
3249 => '<br>{{note|more c input|b}} <tt>'''[[gets()|gets]](x)'''</tt> and <tt>'''[[fgets]](x,''' length''', stdin)'''</tt> read unformatted text from stdin. Use of gets is not recommended.',
3250 => '<br/>{{note|more c input|c}} <tt>'''[[puts (C)|puts]](x)'''</tt> and <tt>'''[[fputs]](x, stdout)'''</tt> write unformatted text to stdout.',
3251 => '<br/>{{note|more c error output|d}} <tt>'''fputs(x, stderr)'''</tt> writes unformatted text to stderr',
3252 => '<br/>{{note|Fortran standard units|e}} <tt>'''INPUT_UNIT''', '''OUTPUT_UNIT''', '''ERROR_UNIT'''</tt> are defined in the <tt>ISO_FORTRAN_ENV</tt> module.<ref>{{cite web|url=http://fortranwiki.org/fortran/show/iso_fortran_env|title=iso_fortran_env in Fortran Wiki|author=|date=|work=fortranwiki.org|accessdate=30 January 2017}}</ref>',
3253 => false,
3254 => '== Reading [[command-line argument]]s ==',
3255 => '{| class="wikitable"',
3256 => '|-',
3257 => '! ',
3258 => '! Argument values',
3259 => '! Argument counts',
3260 => '! Program name / Script name',
3261 => '|-',
3262 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
3263 => '| <tt>'''Argument ('''n''')'''</tt>',
3264 => '| <tt>'''Argument_Count'''</tt>',
3265 => '| <tt>'''Command_Name'''</tt>',
3266 => '|-',
3267 => '| C (C99) ',
3268 => '| rowspan=3| <tt>'''argv['''n''']'''</tt>',
3269 => '| rowspan=3| <tt>'''argc'''</tt>',
3270 => '| rowspan=3| first argument',
3271 => '|-',
3272 => '| Objective-C',
3273 => '|-',
3274 => '| C++',
3275 => '|-',
3276 => '| C#',
3277 => '| rowspan=3| <tt>'''args['''n''']'''</tt>',
3278 => '| <tt>'''args.Length'''</tt>',
3279 => '| <tt>'''Assembly.GetEntryAssembly()<wbr/>.Location;'''</tt>',
3280 => '|-',
3281 => '| Java',
3282 => '| rowspan=2| <tt>'''args.length'''</tt>',
3283 => '| <!-- same as name of class containing '''main()''' --> <!-- not sure if that would yield the name of the exe/binary file of the program -->',
3284 => '|-',
3285 => '| D',
3286 => '| first argument',
3287 => '|-',
3288 => '| JavaScript <br/><small>[[Windows Script Host]] implementation</small>',
3289 => '| <tt>'''WScript.Arguments('''n''')'''</tt>',
3290 => '| <tt>'''WScript.Arguments.length'''</tt>',
3291 => '| <tt>'''WScript.ScriptName''' or '''WScript.ScriptFullName'''</tt>',
3292 => '|-',
3293 => '| Go',
3294 => '| <tt>'''os.Args['''n''']'''</tt>',
3295 => '| <tt>'''len(os.Args)'''</tt> ',
3296 => '| first argument',
3297 => '|-',
3298 => '| Swift',
3299 => '| <tt>'''Process.arguments['''n''']'''</tt> or <br /> <tt>'''Process.unsafeArgv['''n''']'''</tt>',
3300 => '| <tt>'''Process.arguments.count'''</tt> or <br /> <tt>'''Process.argc'''</tt>',
3301 => '| first argument',
3302 => '|-',
3303 => '| Common Lisp',
3304 => '| {{dunno}}',
3305 => '| {{dunno}}',
3306 => '| {{dunno}}',
3307 => '|-',
3308 => '| Scheme (R<sup>6</sup>RS)',
3309 => '| <tt>'''(list-ref (command-line) '''n''')'''</tt>',
3310 => '| <tt>'''(length (command-line))'''</tt>',
3311 => '| first argument',
3312 => '|-',
3313 => '| ISLISP',
3314 => '| {{n/a}}',
3315 => '| {{n/a}}',
3316 => '| {{n/a}}',
3317 => '|-',
3318 => '| Pascal',
3319 => '| <tt>'''ParamStr('''n''')'''</tt>',
3320 => '| <tt>'''ParamCount'''</tt>',
3321 => '| first argument',
3322 => '|-',
3323 => '| Visual Basic',
3324 => '| <tt>'''Command'''</tt>{{ref|unseparated|[a]}}',
3325 => '| {{n/a}}',
3326 => '| <tt>'''App.Path'''</tt>',
3327 => '|-',
3328 => '| Visual Basic .NET',
3329 => '| <tt>'''CmdArgs('''n''')'''</tt>',
3330 => '| <tt>'''CmdArgs.Length'''</tt>',
3331 => '| <tt>'''[Assembly].GetEntryAssembly().Location'''</tt>',
3332 => '|-',
3333 => '| Xojo',
3334 => '| <tt>'''System.CommandLine'''</tt>',
3335 => '| (string parsing)',
3336 => '| '''Application.ExecutableFile.Name'''',
3337 => '|-',
3338 => '| Python',
3339 => '| <tt>'''sys.argv['''n''']'''</tt>',
3340 => '| <tt>'''len(sys.argv)'''</tt>',
3341 => '| first argument',
3342 => '|-',
3343 => '| S-Lang',
3344 => '| <tt>'''__argv['''n''']'''</tt>',
3345 => '| <tt>'''__argc'''</tt>',
3346 => '| first argument',
3347 => '|-',
3348 => '| Fortran',
3349 => '| <tt>'''DO '''i''' = '''1''','''argc''' <dl><dd> CALL GET_COMMAND_ARGUMENT ('''i''','''argv(i)''') </dd></dl> ENDDO'''</tt>',
3350 => '| <tt>argc''' = COMMAND_ARGUMENT_COUNT ()'''</tt>',
3351 => '| <tt>'''CALL GET_COMMAND_ARGUMENT ('''0''','''progname''')'''</tt>',
3352 => '|-',
3353 => '| PHP',
3354 => '| <tt>'''$argv['''n''']'''</tt>',
3355 => '| <tt>'''$argc'''</tt>',
3356 => '| first argument',
3357 => '|-',
3358 => '| Bash shell',
3359 => '| <tt>'''$'''n ('''$1''', '''$2''', '''$3''', ...)</tt><br/><tt>'''$@'''</tt> (all arguments)',
3360 => '| <tt>'''$#'''</tt>',
3361 => '| <tt>'''$0'''</tt>',
3362 => '|-',
3363 => '| Perl',
3364 => '| <tt>'''$ARGV['''n''']'''</tt>',
3365 => '| <tt>'''scalar(@ARGV)'''</tt>',
3366 => '| <tt>'''$0'''</tt>',
3367 => '|-',
3368 => '| Perl 6',
3369 => '| <tt>'''@*ARGS['''n''']'''</tt>',
3370 => '| <tt>'''@*ARGS.elems'''</tt>',
3371 => '| <tt>'''$PROGRAM_NAME'''</tt>',
3372 => '|-',
3373 => '| Ruby',
3374 => '| <tt>'''ARGV['''n''']'''</tt>',
3375 => '| <tt>'''ARGV.size'''</tt>',
3376 => '| <tt>'''$0'''</tt>',
3377 => '|-',
3378 => '| Windows PowerShell',
3379 => '| <tt>'''$args['''n''']'''</tt>',
3380 => '| <tt>'''$args.Length'''</tt>',
3381 => '| <tt>'''$MyInvocation.MyCommand<wbr/>.Name'''</tt>',
3382 => '|-',
3383 => '| OCaml',
3384 => '| <tt>'''Sys.argv.('''n''')'''</tt>',
3385 => '| <tt>'''Array.length Sys.argv'''</tt>',
3386 => '| first argument',
3387 => '|-',
3388 => '| F#',
3389 => '| <tt>'''args.['''n''']'''</tt>',
3390 => '| <tt>'''args.Length'''</tt>',
3391 => '| <tt>'''Assembly.GetEntryAssembly()<wbr/>.Location'''</tt>',
3392 => '|-',
3393 => '| Standard ML',
3394 => '| <tt>'''List.nth (CommandLine<wbr/>.arguments (), '''n''')'''</tt>',
3395 => '| <tt>'''length (CommandLine<wbr/>.arguments ())'''</tt>',
3396 => '| <tt>'''CommandLine.name ()'''</tt>',
3397 => '|-',
3398 => '| Haskell (GHC)',
3399 => '| {{code|lang=haskell|do { args <- System.getArgs; return length args !! n }}}',
3400 => '| {{code|lang=haskell|do { args <- System.getArgs; return length args }}}',
3401 => '| <tt>'''System.getProgName'''</tt>',
3402 => '|-',
3403 => '| COBOL',
3404 => '| colspan=2 | {{ref|COBOL Arguments|[b]}}',
3405 => '| {{n/a}}',
3406 => '|}',
3407 => '* {{note|unseparated|a}} In Visual Basic, command-line arguments are not separated. Separating them requires a split function <code>'''Split('''string''')'''</code>.',
3408 => '* {{note|COBOL Arguments|b}} The COBOL standard includes no means to access command-line arguments, but common compiler extensions to access them include defining parameters for the main program or using <code>ACCEPT</code> statements.',
3409 => false,
3410 => '== Execution of commands ==',
3411 => false,
3412 => '{| class="wikitable"',
3413 => '!',
3414 => '!Shell command',
3415 => '!Execute program',
3416 => '![[exec (operating system)|Replace current program with new executed program]]',
3417 => '|-',
3418 => '| [[Ada (programming language)|Ada]]<ref name="Ada_RM_2012" />',
3419 => '| colspan=3 align="center"| Not part of the language standard. Commonly done by compiler provided packages or by interfacing to C or [[POSIX]].<ref name=Ada_Execute_Command>{{cite web|url=http://rosettacode.org/wiki/Execute_a_system_command#Ada|title=Execute a system command - Rosetta Code|author=|date=|work=rosettacode.org|accessdate=30 January 2017}}</ref> ',
3420 => '|-',
3421 => '| C',
3422 => '| rowspan=3| <tt>'''[[system (C standard library)|system]]("'''command'''");'''</tt>',
3423 => '|',
3424 => '| rowspan=2| <tt>'''[[Exec (operating system)|execl]]('''path''',''' args''');''' or<br/> '''[[Exec (operating system)|execv]]('''path''',''' arglist''');'''</tt>',
3425 => '|-',
3426 => '| C++',
3427 => '| ',
3428 => '|-',
3429 => '| Objective-C',
3430 => '| <tt>'''[NSTask launchedTaskWithLaunchPath:(NSString *)'''path''' arguments:(NSArray *)'''arguments'''];'''</tt>',
3431 => '| ',
3432 => '|-',
3433 => '| C#',
3434 => '|',
3435 => '| rowspan=2| <tt>'''System.Diagnostics<wbr/>.Process.Start('''path''',''' argstring''');'''</tt>',
3436 => '|',
3437 => '|-',
3438 => '| F#',
3439 => '|',
3440 => '|',
3441 => '|-',
3442 => '| Go',
3443 => '|',
3444 => '| <tt>'''exec.Run('''path''',''' argv''',''' envv''',''' dir''', exec.DevNull, exec.DevNull, exec.DevNull)'''</tt>',
3445 => '| <tt>'''os.Exec('''path''',''' argv''',''' envv''')'''</tt>',
3446 => '|-',
3447 => '| Visual Basic',
3448 => '| <tt>'''Interaction.Shell('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''')'''</tt>',
3449 => '|',
3450 => '|',
3451 => '|-',
3452 => '| Visual Basic .NET',
3453 => '| <tt>'''Microsoft.VisualBasic<wbr/>.Interaction.Shell('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''')'''</tt>',
3454 => '| <tt>'''System.Diagnostics<wbr/>.Process.Start('''path''',''' argstring''')'''</tt>',
3455 => '|',
3456 => '|-',
3457 => '| Xojo',
3458 => '| <tt>'''Shell.Execute('''command «''', '''Parameters»''')'''</tt>',
3459 => '| <tt>'''FolderItem.Launch('''parameters''',''' activate''')'''</tt>',
3460 => '| {{n/a}}',
3461 => '|-',
3462 => '| D',
3463 => '| <tt>'''std.process.system("'''command'''");'''</tt>',
3464 => '| ',
3465 => '| <tt>'''std.process.execv('''path''',''' arglist''');'''</tt>',
3466 => '|-',
3467 => '| Java',
3468 => '|',
3469 => '| <tt>'''Runtime.exec('''command''');''' or<br/> '''new ProcessBuilder('''command''').start();'''</tt>',
3470 => '|',
3471 => '|-',
3472 => '| JavaScript <br/> <small>[[Windows Script Host]] implementation</small>',
3473 => '| <tt>'''WScript.CreateObject ("WScript.Shell").Run('''command «''', '''WindowStyle» «''', '''isWaitOnReturn»''');'''</tt>',
3474 => '| <tt>'''WshShell.Exec(command)'''</tt>',
3475 => '|',
3476 => '|-',
3477 => '| Common Lisp',
3478 => '| <tt>'''(shell '''command''')'''</tt>',
3479 => '|',
3480 => '|',
3481 => '|-',
3482 => '| Scheme',
3483 => '| <tt>'''(system '''command''')'''</tt>',
3484 => '|',
3485 => '| ',
3486 => '|-',
3487 => '| ISLISP',
3488 => '| {{n/a}}',
3489 => '| {{n/a}}',
3490 => '| {{n/a}}',
3491 => '|-',
3492 => '| Pascal',
3493 => '| <tt>'''system('''command''');'''</tt>',
3494 => '|',
3495 => '| ',
3496 => '|-',
3497 => '| OCaml',
3498 => '| <tt>'''Sys.command '''command, '''Unix.open_process_full''' command env (stdout, stdin, stderr),...</tt>',
3499 => '| <tt>'''Unix.create_process''' prog args new_stdin new_stdout new_stderr, ...</tt>',
3500 => '| <tt>'''Unix.execv''' prog args or <br/> '''Unix.execve''' prog args env</tt>',
3501 => '|-',
3502 => '| Standard ML',
3503 => '| <tt>'''OS.Process.system '''command</tt>',
3504 => '| <tt>'''Unix.execute ('''path''', '''args''')'''</tt>',
3505 => '| <tt>'''Posix.Process.exec ('''path''', '''args''')'''</tt>',
3506 => '|-',
3507 => '| Haskell (GHC)',
3508 => '| <tt>'''System.system '''command</tt>',
3509 => '| <tt>'''System.Process<wbr/>.runProcess '''path''' '''args''' ...</tt>',
3510 => '| <tt>'''Posix.Process<wbr/>.executeFile '''path''' True '''args''' ...</tt>',
3511 => '|-',
3512 => '| Perl',
3513 => '| <tt>'''system('''command''')''' or <br/>$output '''= `'''command'''`''' or<br/>$output '''= qx('''command''')'''</tt> ',
3514 => '|',
3515 => '| <tt>'''exec('''path''',''' args''')'''</tt>',
3516 => '|-',
3517 => '| Ruby',
3518 => '| <tt>'''system('''command''')''' or <br/> output '''= `'''command'''`'''</tt>',
3519 => '|',
3520 => '| <tt>'''exec('''path''',''' args''')'''</tt>',
3521 => '|-',
3522 => '| PHP',
3523 => '| <tt>'''system('''command''')''' or <br/> $output '''= `'''command'''`''' or <br/> '''exec('''command''')''' or <br/> '''passthru('''command''')'''</tt>',
3524 => '|',
3525 => '|',
3526 => '|-',
3527 => '| Python',
3528 => '| <tt>'''os.system('''command''')''' or <br/> '''subprocess.Popen('''command''')''' </tt>',
3529 => '| <tt>'''subprocess.call('''["program", "arg1", "arg2", …]''')''' </tt>',
3530 => '| <tt>'''os.execv('''path''',''' args''')'''</tt>',
3531 => '|-',
3532 => '| S-Lang',
3533 => '| <tt>'''system('''command''')'''</tt>',
3534 => '|',
3535 => '|',
3536 => '|-',
3537 => '| Fortran',
3538 => '| <tt>'''CALL EXECUTE_COMMAND_LINE ('''COMMAND''' «, '''WAIT'''» «, '''EXITSTAT'''» «, '''CMDSTAT'''» «, '''CMDMSG'''») {{ref|Fortran 2008|[a]}}</tt>',
3539 => '|',
3540 => '|',
3541 => '|-',
3542 => '| Windows PowerShell',
3543 => '| <tt>'''[Diagnostics.Process]::Start('''command''')'''</tt>',
3544 => '| <tt>«'''Invoke-Item''' »program arg1 arg2 …</tt>',
3545 => '|',
3546 => '|-',
3547 => '| Bash shell',
3548 => '| <tt>output'''=`'''command'''`'''</tt> or',
3549 => '<tt>output'''=$('''command''')'''</tt>',
3550 => '| <tt>program arg1 arg2 …</tt>',
3551 => '| ',
3552 => '|}',
3553 => '{{note|Fortran 2008|a}} Fortran 2008 or newer.<ref>{{cite web|url=https://gcc.gnu.org/onlinedocs/gfortran/EXECUTE_005fCOMMAND_005fLINE.html|title=EXECUTE_COMMAND_LINE - The GNU Fortran Compiler|author=|date=|work=gnu.org|accessdate=30 January 2017}}</ref>',
3554 => false,
3555 => '== References ==',
3556 => '{{Reflist}}',
3557 => false,
3558 => '[[Category:Programming constructs]]',
3559 => '[[Category:Programming language comparisons|*Basic instructions]]'
] |
Whether or not the change was made through a Tor exit node (tor_exit_node ) | 0 |
Unix timestamp of change (timestamp ) | 1525772072 |