Block (programming): Difference between revisions

Content deleted Content added
m Reverted 1 edit by 223.181.7.65 (talk) to last revision by 89.147.70.233 (TW)
Syntax: Combine the Algol-family examples into one bullet point
Line 50:
Blocks use different syntax in different languages. Two broad families are:
 
* the [[ALGOL]] family in which blocks are delimited by the keywords "<code>begin</code>" and "<code>end</code>" or equivalent. In [[C (programming language)|C]], blocks are delimited by curly braces - "<code>{</code>" and "<code>}</code>". [[ALGOL 68]] uses parentheses.
* the [[C (programming language)|C]] family in which blocks are delimited by curly bracesParentheses - "<code>{(</code>" and "<code>})</code>", are used in the MS-DOS [[batch language]]
 
Some other techniques used are as follows :
 
* parentheses - "<code>(</code>" and "<code>)</code>", as in [[batch language]] and [[ALGOL 68]].
* [[off-side rule|indentation]], as in [[Python (programming language)|Python]]
* [[s-expression]]s with a syntactic keyword such as <code>lambda</code> or <code>let</code> (as in the [[Lisp (programming language)|Lisp]] family)