using ``<-'' in function argument
G'day Ivan, On Fri, 03 Dec 2010 10:54:58 +0100
Ivan Calandra <ivan.calandra at uni-hamburg.de> wrote:
Arf, yes it makes sense now!
Well, my original post said: "R has lazy evaluation" and "the assignment takes place when the function evaluates the argument" :)
So the idea here is: never use "<-" in function argument...
Never say never. :) But if you want to perform a (global) assignment within an actual argument to a function, you should better be sure that the formal argument gets evaluated. In fact, this trick is probably a good way, short of studying the source, to find out whether an argument gets evaluated or not (or only occasionally). Cheers, Berwin