Chunklet

For the magazine, see Chunklet (magazine).

Chunklet is a programming term for the contents of code wrapped by a conditional statement.

Example of a chunklet in Perl:

 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:

 <xsl:if test="/node/x='10'">
    The value of node child x is 10.
 </xsl:if>

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.