Part of the language required me to allow something equivalent to this: print $foo bar
So I decided to just solve a more general problem and make the part after the print a string and allow this: bar="$foo $bar"
Avoiding infinite recursion was easy. Just store previous levels in a stack and check that no variable is traversed more than once in the same branch.