Statement block
In computer programming, a statement block is a section of code which is grouped together, much like a paragraph; such blocks consist of one, or more, statements. In C, C++, and some other languages, statement blocks are enclosed by braces {}. In Ada, Pascal, and some other languages, blocks are denoted by "begin" and "end" statements. In Python they are indicated by indentation. Unlike paragraphs, statement blocks can be nested; that is, with one block inside another. Blocks often define the scope of the identifiers used within.
Related Topics:
Computer programming - Code - Paragraph - Statement - C - C++ - Brace - Ada - Pascal - Python - Scope
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Blocks often have subtle but important differences in semantics. In languages in the C tradition, they define identifier scope. In C++ they can be used to define object lifetime (creation and destruction). In some languages (such as Pico) they are merely used for grouping expressions without notions of variable scope. In languages such as Smalltalk, blocks are objects in their own right, extended with a reference to their environment of definition, i.e. closures.
Related Topics:
Pico - Smalltalk - Closures
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Table of Content ~
| ► | Introduction |
| ► | A typical statement block |
| ► | A nested statement block |
~ What's Hot ~
~ Community ~
| ► | History Forum Come and discuss about History, Civilizations, Historical Events and Figures |
| ► | History Web-Ring A community of sites, blogs and forums dedicated to History. Do not hesitate to submit your site. |
and are licensed under the GNU Free Documentation License.
Lexicon - Privacy Policy - Spiritus-Temporis.com ©2005.
