Le 12/3/2010 11:35, Berwin A Turlach a écrit :
G'day Ivan,

On Fri, 03 Dec 2010 10:54:58 +0100
Ivan Calandra<ivan.calan...@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" :)
Well you did say it indeed... but it doesn't mean that I understood it, I needed more details to grasp it!
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


--
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calan...@uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to