Loading AI tools
From Wikipedia, the free encyclopedia
incr Tcl (commonly stylised as [incr Tcl], and often abbreviated to itcl) is a set of object-oriented extensions for the Tcl programming language. It is widely used among the Tcl community, and is generally regarded as industrial strength [citation needed]. Its name is a pun on "C++". Itcl implementations exist as both a package that may be dynamically loaded by a Tcl application, as well as an independent standalone language with its own interpreter.
Paradigm | multi-paradigm: object-oriented, functional, Imperative, event-driven programming |
---|---|
Designed by | Michael McLennan |
Developer | Michael McLennan |
First appeared | 1993 |
Stable release | Itcl4.1.1
/ 21 December 2017 |
Typing discipline | dynamic typing, everything can be treated as a string |
License | BSD-style |
Website | itcl at SourceForge |
Influenced by | |
Tcl, C++ |
Itcl allows namespaces to be used for organizing commands and variables.
Example:
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
Itcl (like Tcl) has built-in support for the integration of C code into Itcl classes.
incr Tcl from the Ground Up by Chad Smith, published in January 2000.
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.