Sorry, the example was unnecessarily long.
After a quick reading of this, I'd have expected the value of "f" at the indicated point to be 1, but instead it's 2.
The dark chapters of imcc documentations and functionality are getting revealed again ;-)
The story is like this:
- the "pseudo gloabal" declaration of C<f> declares a variable usable in both subs. This was invented[1] to cover vars outside of all subs in a main execution stream, which is intersparsed with sub declarations, like a perl programm could be.
- both subs "_foo1" and "_foo2" are compiled totally independent. This implies: no usage of C<f> and C<x> in "_foo1" do interfere, so they get the same register - bumm.
If you want true variables around compilations units, please use globals or lexicals if they are in the same lexical pad.
[1] This "feature" is IMHO at the boarders of imcc as the namespace instructions is. Should the HL handle these or imcc? But if its as confusing as your test case, I would say I'll rather not support this inside imcc.
leo