From jmc at r-project.org  Mon Jan 14 22:18:26 2013
From: jmc at r-project.org (John Chambers)
Date: Mon, 14 Jan 2013 13:18:26 -0800
Subject: [Rd] Regarding the recent changes to @<-
In-Reply-To: <CAKL30wWzneLOehKrFT1Spk6bWZSjpQmERCpMYRCRsXLt=SBDcw@mail.gmail.com>
References: <CAKL30wVySBksnfovg6TxAk9tmHzu_bSc=tip7rDS4iDnA1_mbQ@mail.gmail.com>
	<20724.20686.556286.756858@stat.math.ethz.ch>
	<CAKL30wWzneLOehKrFT1Spk6bWZSjpQmERCpMYRCRsXLt=SBDcw@mail.gmail.com>
Message-ID: <0ABC5811-D0AD-4EC6-8EB6-60A1A6EF5BE0@r-project.org>

My guess is that the distinction here is between `@<-` and `slot<-`.

The first, but not the second, has been converted to a primitive (the second has an optional argument, making it more of a nuisance to implement.)

Previously they did the same check; after the revision of `@<-` they did not; after a (fairly soon) new revision they will again.

John

On Jan 14, 2013, at 10:59 AM, Fran?ois Michonneau wrote:

> Hello Martin,
> 
>  Below is a reduced version of our code that doesn't produce an error in
> r61643 but does in 2.15.2.
> 
>  Thanks,
>  -- Fran?ois
> 
> setClass("phylo4",
>         representation(edge="matrix",
>                        annote="list"),
>         prototype = list(edge = matrix(nrow = 0, ncol = 2),
>                        annote = list())
> )
> 
> setGeneric("phylo4", function(x, ...) { standardGeneric("phylo4")} )
> 
> setMethod("phylo4", "matrix",
>    function(x, annote = list()) {
>    res <- new("phylo4")
>        res at edge <- x
>        res at annote <- annote
>        res
>    }
> )
> 
> edge <- structure(c(6L, 7L, 8L, 8L, 9L, 9L, 7L, 6L, 7L, 8L, 1L, 9L,
>      2L, 3L, 4L, 5L), .Dim = c(8, 2))
> phylo4(edge, annote="foo")
> 
> 
> 
> 
> On Mon, Jan 14, 2013 at 1:39 PM, Martin Maechler <maechler at stat.math.ethz.ch
>> wrote:
> 
>> phylo4 <- setClass("phylo4",
>>         representation(edge = "matrix",
>>                        edge.length = "numeric",
>>                        label = "character",
>>                        edge.label = "character",
>>                        order = "character",
>>                        annote = "list"),
>>         prototype = list(edge = matrix(nrow = 0, ncol = 2,
>>                                        dimnames = list(NULL,
>>                                        c("ancestor", "descendant"))),
>>                          edge.length = numeric(0),
>>                          label = character(0),
>>                          edge.label = character(0),
>>                          order = "unknown",
>>                          annote = list()
>>         )
>> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Regarding the recent changes to @<-
John Chambers