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

Duncan Murdoch dmurdoch at pair.com
Sat Jul 26 14:54:29 CEST 2003


On Sat, 26 Jul 2003 14:24:48 +0100, you wrote:

>Am Samstag, 26. Juli 2003 11:38 schrieb Peter Dalgaard BSA:

>> 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.
>
>In the methods is the class "missing". Could that help?
>for one thing : signature=c("missing","A") (only allowed for <- ?)
>for both things: signature=c("A","B")
>for nothing ;-) : signature=c("missing","missing")

But A isn't missing in "A <- B"; I can see it right there!

It might make sense to require that "<-" methods have "ANY" as the
type of the first argument.  It's part of the semantics of the
language that the result of "A <- B" does not depend on the value of A
in any way, and that shouldn't be changed.

Duncan Murdoch




More information about the R-help mailing list