On Thu, Oct 30, 2008 at 09:15:54AM +0100, Liviu Andronic wrote: > Dear all, > > The other day I stumbled on this article, "A critique of R and S-PLUS" > [1], and got curious on whether the points outlined are (still) valid. > The article is quite old, dating 2004, but was updated several times. > > Regards, > Liviu > [1] http://fluff.info/blog/arch/00000041.htm
It's basically true that R notionally passes parameters by value, i.e. functions cannot alter objects they're passed to them by their callers. The critique that "this makes the language slow" is debatable, as the R's "pass by promise" mechanism avoids much unnecessary copying. Personally, I don't think that performance issues should be considered "first and foremost", as the decision whether to use references should primarily follow from the content i.e. the problem to be solved. There are plenty of problems which require references, so not having a pass by reference mechanism is a limitation. In principle, it's possible to use environments in R for passing by reference. The practical use of this is limited by the fact that the majority of functions provided by standard packages don't operate on environments, though. Best regards, Jan -- +- Jan T. Kim -------------------------------------------------------+ | email: [EMAIL PROTECTED] | | WWW: http://www.cmp.uea.ac.uk/people/jtk | *-----=< hierarchical systems are for files, not for humans >=-----* ______________________________________________ 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.