Extensible Control Structures
Parser knows nothing about control structures.
Control structures are commands that take scripts as arguments:
foreach i {1 2 3 4 5 6} {
set sq [expr $i*$i]
puts "$i squared is $sq"
}
proc plus {a b} {
expr $a+$b
}
Previous slide
Next slide
Back to first slide
View graphic version