All data types explained and demonstrated. help.mikrotik.com/docs/displa... 00:00 Nil 00:33 Num 01:41 Bool 01:52 Str 02:03 IP and IP-prefix 02:19 IP6 and IP6-prefix 02:27 ID 03:05 Time 04:07 Array
What I would love to see is ansible netcommon network_cli module with a propper mikrotik.ros.ros_* functions to abstract different configurations to allow for easy vendor transition. The bigger ones like Cisco with IOS/NXOS or Arista all have modules using the same functions such taht I don't need to rewrite the entire code all the time.
@@mikrotik I'll add another interesting observation. If we :put the result of a function that should be returns a "nothing", we will see the "nil". Moreover, inside the function itself it will still be a "nothing", and when substituting the return in the :put commanf, we will already see an "nil" :local testFunc do={ :local var; :put ("Inside function is: ".[:typeof $var]); :return $var; }; :put ("Outside function is: ".[:typeof [$testFunc]]); Result: Inside function is: nothing Outside function is: nil I think type damage occurs in the process of substituting using square brackets. This nuance causes another problem: The :nothing command is designed to produce the data type "nothing" and does it successfully. But to use this command in a script, it needs to be wrapped in square brackets so that the value is substituted, and this process convert it to the "nil". :put [:typeof [:nothing]]; Result: nil We get that the system has a command that in practical form cannot produce the intended result. I wrote a ticket about this problem, but support did not accept the arguments. P.S. For example: A simple method to substitute a real "nothing" into an expression is :put [:typeof (:)]; A simple method to substitute a "nil" into an expression is :put [:typeof []];
At that point, you'd get people wanting to have JavaScript as well, and Go, and Rust and because not everyone likes Python. I think it's best to just stick to the DSL they have created for RouterOS and if you really want to use Python, write a wrapper and run it in a container or something.