Yes, I got that. They indeed obtain the same in current versions.
I’m just saying that I don’t think the so called “right” syntax makes sense.
:set $newvar > value=> newValue> ;
→ now set newvar variable content to string “newValue”
But see… THAT doesn’t make sense… With all other commands, the normal process of interpretation is for
[command] ([unnamed parameter VALUE])* ([named parameter]=[value of named parameter])*
to become
[command] [unnamed parameter]=[value of unnamed parameter] [named parameter]=[value of named parameter]
So for example, in the code
:local interface LAN
/interface monitor-traffic $interface
the later command is interpolated to
/interface monitor-traffic interface="LAN"
and this is true even for the “local” and “global” commands, i.e.
:local varB $interface
is interpolated to
/local name="varB" value="LAN"
But with “set”… no… that normal flow is broken, and instead of
:set $varB $interface
being interpolated to
/set name="LAN" value="LAN"
it’s suddenly
/set name="varB" value="LAN"
completely flying in the face of how any other command would deal with variables.
The “pointer” type of variable do not exist on that scripting language.
Neither does it exist in PHP… “variable variables” and “pointers” are two distinct features of a language, and in fact, PHP has the former - see here… In the case of PHP, there’s a different syntax required, which can make code confusing, but in RouterOS’ scripting language, it’s the lack of a different syntax that seems to make things more confusing.
And about share same value because one variable is previous set as another variable, I think is the worst way of programming code, without explicit use of pointer.
I’ll agree that “variable variables” aren’t in general a good programming practice, and I for one avoid them in PHP, and would probably avoid them in RouterOS scripting too. But just like any programming tool, they should be available for use if needed, which would arguably be more often in RouterOS scripting that in PHP.