Documentation, LOL…
But yeah both “print where” and “find” acts as iterators… In the case of “print where”, you can use an as-value to suppress print’s output to “override” it with custom output per line. I think this is a good example of some real world case for the “functions in iterators”:
http://forum.mikrotik.com/t/container-traefik-on-rb5009/165849/14
(which essentially colorizes log output from Traefik container using a function in a "print).
Another example, is @optio using the both “find” and “:find” to deal with /interface/bridge/vlan vlan-ids array:
http://forum.mikrotik.com/t/append-bridge-vlan-values/147015/1
Also [:parse “/what/ever/wierd/thing/you/want to=see”] will get you an s-expression which is closer to how the script is executed. This for sure isn’t documented, but you can see it’s a stack… so function in find gets added to stack:
:put [:parse "/ip/arp/find [:if (\$address=10.10.23.8) do={:put \$address}]"]
(
evl /ip/arp/findwhere=
$address;
$mac-address;
$interface;
$published;
$status;
$invalid;
$dhcp;
$dynamic;
$published;
$complete;
$disabled;
$comment;
$.id;
$.nextid;
$.dead;
$.about;
(evl
(evl /ifcondition=
(= $address 10.10.23.9);
do=;
(evl
(evl /putmessage=$address)
)
)
)
;5
)
And there you can see all the attributes from [find] are provided on stack.
Additionally, you can also get more “hints” on how the S-expr / IL thing works from looking at the API docs on “query” - which implies some stack-based internal processing of “RouterOS list things”:
https://help.mikrotik.com/docs/spaces/ROS/pages/47579160/API#API-Queries (see also http://forum.mikrotik.com/t/how-using-query-stack-in-rest-api/173298/1 )