04-04-2025, 09:46 AM
(04-03-2025, 10:09 PM)boriel Wrote: Yes, the variable n is "Non local", that is, is not global, nor local, but in the closure of the outer scope.
This is not well supported yet, sorry, due to limitations of the Z80 registers (working on it yet...)
This situation, when it works sometimes and sometimes not, is rather dangerous.
If it is not easy to implement, then just forbidding referencing of outer-scope local variables (compilation error), would be a good enough solution.
With "strict" option, one should expect safety. Not being able to reference outer-scope local variables is quite acceptable, can you implement this?
Swan, my ZX Spectrum emulator https://github.com/zoran-vucenovic/swan