A short question in comp.lang.tcl got me several useful answers that I'm now putting here for later reference:
The (generalized) question:
The specific context:
The answers:
by Roy Terry:
# proc ? {cond args} {return $cond} # RT - this version ought to work more flexibly proc ? {cond args} { return [uplevel expr $cond]} if { [? {<cond1>} John Doe ] && [? {<cond2>} Fu Bar ] ... } ...
This works nicely, if the cond's are plain values, rather than expressions (which I forgot to specify in my posting), however it can still be used to wrap the specific value inside each condition. See 2nd version of proc "?" with expr above - RT.
if { cond1 (* John Doe *) && cond2 (* Fu Bar *) ... } ...
by Ulrich Schoebel
set cond [list] lappend cond $cond1 ;# John Doe lappend cond $cond2 ;# Fu Bar ... if {[expr [join $cond &&]]} { ...
Thanks for all the hints! Andreas Leitgeb