Strange variable naming issue

Hi folks,
I´m using a CCR for PCC load balancing and trying to achieve a automatic failover mechanism that disables the default routes when they don't get a ping. Also it should try to re-activate shutdown routes. For this I'm trying to get the enabled state of a route based on some of its parameters and stumbled on somewhat weired issue. After several hours of guessing and testing I was able to write this debug code that reproduces the problem:
{
:local printRoute do={
:put ([:tostr $1]. " " . (![/ip route get $1 disabled]) . " " . [/ip route get $1 gateway]. " " . [/ip route get $1 dst-address]. " " . [/ip route get $1 routing-mark])
}

:local direct [/ip route find gateway=192.168.30.1 dst-address=0.0.0.0/0 routing-mark="ISP3" !disabled]
:foreach i in=$direct do={$printRoute $i}

:put "------"
:local gatewayAddr 192.168.30.1
:local routingMark "ISP3"
:local param [/ip route find gateway=$gatewayAddr dst-address=0.0.0.0/0 routing-mark=$routingMark !disabled]
:foreach i in=$param do={$printRoute $i}

:put "------"
:local gateway 192.168.30.1
:local routingMark "ISP3"
:local param [/ip route find gateway=$gateway dst-address=0.0.0.0/0 routing-mark=$routingMark !disabled]
:foreach i in=$param do={$printRoute $i}
}which produces the following output
*9 true 192.168.30.1 0.0.0.0/0 ISP3

*9 true 192.168.30.1 0.0.0.0/0 ISP3

*9 true 192.168.30.1 0.0.0.0/0 ISP3
*A true 192.168.10.1 0.0.0.0/0 ISP3
*B true 192.168.20.1 0.0.0.0/0 ISP3The first and second code sections work as expected, but it seems that the parameter is jsut ignored when the name of the variable matches name of the argument. Although I don't get any warnings or errors on this code and there seems nothing wrong about naming a variable "gateway". Did I miss anything from the documentation?
Guess I'm going to stick to some sort of hungarian notation to avoid this in the future.
Would be great to get any hints or recommendations on this.