Jump to content

Define a primitive data type: Difference between revisions

→‎{{header|Tcl}}: More on what a trace is
(→‎{{header|Tcl}}: More on what a trace is)
Line 629:
 
=={{header|Tcl}}==
Tcl allowsdoes not attach types to values or variables, but it does allow the programmer to create traces, on variables that can be used to enforce type-like constraints among other things. Traces are procedures that execute when variables are read/, written and/or unset. (Traces are also available for commands and for the execution of a script.) Tcl's compiler does not enforce these constraints; they're strictly runtime entities.
<lang tcl>namespace eval ::myIntType {
variable value_cache
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.