<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Incr Tcl - Page 2 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Incr_Tcl&amp;p=1">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Incr_Tcl&amp;p=3">3.Next</a>
</p>
<p>loaded by a <a href="page.php?w=Tcl_%28programming_language%29">Tcl</a> application, as well as an independent standalone language with its own interpreter.</p>

<p><big> Overview </big></p>
<p><big> Features </big></p>
<p><big> Namespace support </big></p>
<p>Itcl allows namespaces to be used for organizing commands and variables.</p>

<p>Example:<syntaxhighlight lang=tcl>package require Itcl    itcl::class Toaster {    variable crumbs 0    method toast {nslices} {        if {$crumbs > 50} {            error "== FIRE! FIRE! =="        }        set crumbs [expr $crumbs+4*$nslices]    }    method clean {} {        set crumbs 0    }}    itcl::class SmartToaster {    inherit Toaster    method toast {nslices} {        if {$crumbs > 40} {            clean        }        return [chain $nslices]    }}    set toaster [SmartToaster #auto]$toaster toast 2</syntaxhighlight></p><p>
<a accesskey="1" href="page.php?w=Incr_Tcl&amp;p=1">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Incr_Tcl&amp;p=3">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
