/usr/share/doc/tcl-sugar/examples/example2.tcl is in tcl-sugar 0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | package require sugar
sugar::macro inlist {name list element} {
list expr "\{\[lsearch -exact $list $element\] != -1\}"
}
sugar::proc test {} {
set list {tcl c ada python scheme forth joy smalltalk}
foreach lang {pascal scheme php ada tcl} {
if {[inlist $list $lang]} {
puts "$lang is in the list"
} else {
puts "$lang is not in the list"
}
}
}
test
|