The Jacl upvar command is converted to global variables in the Jython scripts

The Jacl statement upvar n X translates to the following meaning: use the variable X from n stack frames up. The Jacl upvar command has no equivalent syntax in Jython scripting language. The Jacl2Jython program converts Jacl upvar commands to global variables in the preliminary converted Jython scripts. This transformation might not be a syntactically equivalent conversion and can cause unexpected behaviors in the runtime of the preliminary converted Jython scripts. You need to manually verify and perhaps modify the preliminary conversion of the Jacl upvar commands to ensure the intended runtime results are maintained in the Jython scripts.
The following example illustrates the conversion of the Jacl upvar command is flagged #?PROBLEM? in the preliminary converted Jython script. This help identify areas in the Jython script that may require further processing:
JACL: upvar x
==>
JYTHON: global x #?PROBLEM? (jacl 123) UPVAR_RELATIVE_STACK is always \
          converted as #0 global.
You need to verify there are no existing global variables with the same variable name as specified in the upvar command. If there is such a case, the preliminary converted Jython script might not run as originally intended and you need to manually modify the preliminary converted Jython script to function as originally intended.
Tip: The Jacl upvar references to absolute stack frame zero is syntactically equivalent to global variables in Jython syntax and should not cause a problem in the Jython runtime:
JACL: upvar #0 x
==>
JYTHON: global x

Feedback