Closed morvael closed 3 months ago
Consider this code:
"NAME_OVERRIDE_TEST": { "args": ["$A", "$B"], "code": [ ["LOG", "A is {{$A}}, B is {{$B}}"] ] }, "NAME_OVERRIDE_TEST_FAIL": { "args": [], "code": [ ["VAR", "$A", "A"], ["VAR", "$B", "B"], ["NAME_OVERRIDE_TEST", "$B", "$A"] ] }
(call NAME_OVERRIDE_TEST_FAIL)
Expected output is: A is B, B is A What you get is: A is B, B is B
A is B, B is A
A is B, B is B
This happens because argument names are probably not resolved until some code akin to this one is ran before main function body:
["VAR", "$A", "$B"], ["VAR", "$B", "$A"],
Second assignment fails, since argument value was overwritten in first assignment.
This is kind of a blocker, it's hard to require variables at outer level to be always named differently than arguments inside function...
Introduced MULTI_VAR, which I now use when setting variables for functions. Let me know if you are able to break it now.
Looks like it's ok now.
Consider this code:
(call NAME_OVERRIDE_TEST_FAIL)
Expected output is:
A is B, B is A
What you get is:A is B, B is B
This happens because argument names are probably not resolved until some code akin to this one is ran before main function body:
Second assignment fails, since argument value was overwritten in first assignment.
This is kind of a blocker, it's hard to require variables at outer level to be always named differently than arguments inside function...