Chunklet
Encyclopedia
Chunklet is a programming term for the contents of code wrapped by a conditional statement
Conditional statement
In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false...

.

Example of a chunklet in Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

:

if ($x 10) {
print "The value of x is 10.\n";
}

The above chunklet could be referred by "The x equals 10 chunklet".

Example of a chunklet in XSLT
XSLT
XSLT is a declarative, XML-based language used for the transformation of XML documents. The original document is not changed; rather, a new document is created based on the content of an existing one. The new document may be serialized by the processor in standard XML syntax or in another format,...

:


The value of node child x is 10.


Again, the above XSLT chunklet can be referred to in the same manner.
Embedded Chunklets


Sometimes you will find a chunk of logic (or chunklet) within a larger chunklet. This would be referred to as an Embeded Chunklet. Below is an example of an embedded chunklet within a for loop.

for ($x = 0; $x < $intCounter; $x++) {
if ($x

10) {
print "The value of x is 10.\n";
}
}

In the above example, the embedded chunklet would be referred by "The x equals 10 chunklet". This embedded chunklet is within the "for x to intCounter" chunklet.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK