1 # utils.exp
, a collection of Tcl
/Expect utilities
for texinfo tests.
3 #
----------default
--------------------------------------------
5 # Check whether VAR
exists and has a nonempty value
;
6 #
if not
, use VALUE as the default
7 #
-------------------------------------------------------------
8 proc default
{varname varval
} {
9 upvar $varname outervar
10 if { ![info exists outervar
] ||
[string match
{} $outervar
] } then {
11 verbose
"Defaulting $varname to $varval\n" 1
14 verbose
"$varname retains existing value $outervar\n" 1
20 #
----------is_executable
--------------------------------------
22 #
Boolean predicate
: is
NAME an executable file
23 # somewhere
on our PATH?
24 #
-------------------------------------------------------------
25 proc is_executable
{name} {
26 if [ file executable
[which $
name] ] then {