[R] How to make "<-" generic?

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Sat Jul 26 12:33:24 CEST 2003

Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> writes:

> Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
> > What are you trying to do with this?  Assignment (<-) is not a function,
> > and the language grammar does not convert a <- b into "<-"(a, b) (as it
> > would with the binary operator functions).  You could call it that way,
> > and then it will probably work.
> Eh? Are you sure about that???
> > quote("<-"(a,b))
> a <- b

Adding on to this, I think the point is that assignment bypasses the
usual *evaluation* rules, even though it is syntactically a binop.

I think it basically has to be so: For one thing, it is kind of
difficult to check for a signature match without evaluating the
arguments and the left hand side of an assignment will not in general
exist at that point.

   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