an uplevel-proc is a proc which evaluate the entire content uplevel → example:
proc Format_Return_Error_Check {hdl err} { uplevel "Format_Error_Check $hdl $err ; set retM void" }
This simulate a CPP-Macro like behavior in tcl.
The easy solution to just a proc-body like function:
proc Format_Return_Error_Check {hdl err} { upvar retM retM Format_Error_Check $hdl $err set retM void }
is not really a solution because the "upvar" in a sub-proc like Format_Error_Check is broken because Format_Return_Error_Check return an extra call-frame.
solution:
It should be possible to create a proc witch not add an extra level to the call-frame, a good name would be macro :
macro Format_Return_Error_Check {hdl err} { Format_Error_Check $hdl $err set retM void }
The following features should be present: