Now to try something I’m not sure will even work (running RouterOS 6.23):
[user@mikrotik] /system script environment> {:local x do={:put "Hi $1"};[$x "Mom"];:set x [:parse ":put \"Hello \$1\""];[$x "Dad"]}
Hi Mom
Hello Dad
Hi
The “Hi Mom” first output line is exactly what I expected (as documented). Good. Setting the local variable $x to the output of the :parse command in hopes that the resulting code value could be executed with a numbered argument, I wasn’t sure that would work. But it DID work, resulting in “Hello Dad” in output line 2.
Can anyone explain the third line of output? Yeah, that’s the one that’s got me puzzled.