You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I presume the code below coredumps because tsp upvar accepts but doesn't support #0. Would this be hard to add? We call the routine below a lot and avoid running subst on conclusionCode unless the referenced global variable is true. If analysis_subst_if could be defined as a tsp::proc and since most of the time the referenced variable is false, it seems like this tsp would be a clear performance win.
Alternatively I'm looking for a way to get the contents of a global variable inside a tsp::proc where the name of the global variable is in a variable.
package require tsp
tsp::proc analysis_subst_if {varName ident conclusionCode} {
#tsp::procdef void -args var var var
#tsp::int mute
#tsp::boolean var
#tsp::compile assert
global mute
if {$mute} {
return
}
upvar #0 $varName var
if {!$var} {
return
}
analysis $ident [uplevel [list subst $conclusionCode]] [style_from_var $varName]
}
set var1 0
set var2 1
analysis_subst_if var1 foo "this should not emit"
analysis_subst_if var2 foo "this should emit"
The text was updated successfully, but these errors were encountered:
I presume the code below coredumps because tsp upvar accepts but doesn't support #0. Would this be hard to add? We call the routine below a lot and avoid running subst on conclusionCode unless the referenced global variable is true. If analysis_subst_if could be defined as a tsp::proc and since most of the time the referenced variable is false, it seems like this tsp would be a clear performance win.
Alternatively I'm looking for a way to get the contents of a global variable inside a tsp::proc where the name of the global variable is in a variable.
The text was updated successfully, but these errors were encountered: