Re: [Rd] Class generator functions for reference classes

From: John Chambers <jmc_at_r-project.org>
Date: Wed, 31 Oct 2012 14:34:41 -0700

The values returned by setRefClass(), getRefClass() now (rev. 61058) have class "refObjectGenerator" as they do in 2.15.2, for the sake of back compatibility.

This is only a reversion of the class name. The behavior of such objects as generator functions with additional reference methods should remain as in rev. 61035.

John

On 10/30/12 2:09 PM, John Chambers wrote:
> A heads up for those using Rcpp and perhaps other packages related to
> reference classes.
>
> The changes in 61035 cause a problem for classes defined with a slot
> using the return value of setRefClass(), notably for Rcpp. The name of
> that class changed.
>
> Rather than introduce back-incompatibility, I will rename a couple of
> classes so the class name of the return value remains the same. (It's
> not as natural a naming scheme as what is in place, but not the first
> time back-compatibility has won out over preferred design.)
>
> It will be a day or two before I can get to this, so don't panic if your
> package does not install from the current r-devel until then.
>
> John
>
> On 10/27/12 2:07 PM, John Chambers wrote:
>> As of rev. 61035 in r-devel, setRefClass() now returns a generator
>> function, as setClass() has done since 2.15.0.
>>
>> The convenient style is now:
>> mEdit <- setRefClass("mEdit",......)
>> xx <- mEdit(data = xMat)
>>
>> instead of
>> xx <- mEdit$new(data = xMat)
>>
>> The returned object still has fields and methods accessible as before.
>>
>> See the "Value" and "Reference Class Generators" sections of
>> ?ReferenceClasses for details.
>>
>> Thanks to Romain François for suggesting this.
>>
>> John
>>
>> ______________________________________________
>> R-devel_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 31 Oct 2012 - 21:37:26 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 01 Nov 2012 - 04:40:50 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive