Script variables and upvars: make 'm local

As for @ego-lay_atman-bay ’s criticism: you have a point, upvars as they are now do have applications - I should have thought of that myself, from the discussion on topic: Scheme's LET. However, most of the time (e.g. with conditional and iterative blocks) variables being available outside the scope in which they are defined is useless (and, as I argued, a potential source of unnecessary error).

So let me, pragmatically, amend my proposal:

  1. Additional to single input, multiple input and upvar, let there be a fourth option in the long input name dialog box: local variable. This local variable exists only within the same command / reporter predicate block, including any defined inline commands, reporters, predicates and anything inside a C-shape. So “upvar” remains an option. The difference between an upvar and a local variable (locvar?) is that the latter does not exist outside the structure in which it is declared.
  2. Conditional and iterative primitives, such as IF and FOR will use local vars (I really don’t think upvar should remain an option here; utilizing their data outside their structure is probably bad coding - unless anyone has an example to the contrary?)
  3. Other than upvars, any variable will be available only within the scope of the structure it is declared in.

Thus I believe well thought out existing code will hardly be affected - and if it is, can easily be repaired. But I may be wrong. Happy to learn from criticism, and sharpen my thoughts, and proposal.