[R] %+=% and eval.parent()

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Apr 9 14:41:24 CEST 2004


Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> > This *should* be somewhere in the R Language Definition, although I'm
> > not sure it is actually there. Or the blue book, although I suspect
> > that S v.3 actually used positional matching (and jumped through
> > hoops).
> 
> It did.  This is in the FAQ, 3.2.3:
> 
>    * In R, the argument of a replacement function which corresponds to the
>      right hand side must be named `value'.  E.g., `f(a) <- b' is evaluated
>      as `a <- "f<-"(a, value = b)'.  S always takes the last argument,
>      irrespective of its name.
> 
> I seem to recall I discovered the discrepancy in ca 1998.

I seem to recall when we introduced it, and that it was deliberate.
What I can't remember is what the occasion was.
 
> R-lang is minimalist about what it calls `assignment functions', most of 
> the time.

`replacement functions' would be correct terminology, right? <- and
<<- are the assignment functions.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list