On Thu, Mar 12, 2009 at 8:29 AM, "Jens Oehlschlägel" <oehl_l...@gmx.de> wrote:
> Thus there is dangerous advice in the referenced blog which reads:
> "
> f(x <- 3)
> which means "assign 3 to x, and call f with the first argument set to the 
> value 3
> "

The thrust of the blog post was the stylistic question of whether to
use <- or = for assignment, not a recommendation to use constructs
like this.  (In fact, the next line reads "This is a contrived example
though, and never really occurs in real-world programming.")  But I've
added your sound advice that such constructs are best avoided. I've
never seen the need to perform assignments in function calls before,
but I'll avoid them now knowing about potential for mischief from lazy
evaluation. Thanks.

http://blog.revolution-computing.com/2008/12/use-equals-or-arrow-for-assignment.html

# David Smith

--
David M Smith <da...@revolution-computing.com>
Director of Community, REvolution Computing www.revolution-computing.com
Tel: +1 (206) 577-4778 x3203 (Seattle, USA)

______________________________________________
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