From winstonchang1 at gmail.com  Fri Aug  1 23:34:25 2014
From: winstonchang1 at gmail.com (Winston Chang)
Date: Fri, 1 Aug 2014 16:34:25 -0500
Subject: [Rd] modifying a persistent (reference) class
In-Reply-To: <CABtg=KmbOqBiUmW_mAjShCRYKnFcfkbE17Hwi3_=0TtAHLEH9A@mail.gmail.com>
References: <1406915617.9451.47.camel@localhost>
	<852F505F-BB94-4825-A118-40D685240574@muxspace.com>
	<1406920680.9451.64.camel@localhost>
	<6AF0CD15-A22B-4072-9A29-C184FF4E5DA2@muxspace.com>
	<1406926072.9451.90.camel@localhost>
	<CABtg=KmbOqBiUmW_mAjShCRYKnFcfkbE17Hwi3_=0TtAHLEH9A@mail.gmail.com>
Message-ID: <CAFOpNVEJFHCDxdwLX7xGdUtnS6ZBM8V9HRcUgvkTLb0m2xo-Dg@mail.gmail.com>

R6 objects are basically just environments, so they're probably pretty
simple to save and restore (I haven't tested it out, though).

-Winston

On Fri, Aug 1, 2014 at 4:00 PM, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote:
> On Fri, Aug 1, 2014 at 4:47 PM, Ross Boylan <ross at biostat.ucsf.edu> wrote:
> [...]
>> First, I'd like to understand more about exactly what is saved to disk
>> for reference and other classes, in particular how much meta-information
>> they contain.  And my mental model for reference class persistence is
>> clearly wrong, because in that model instances based on old definitions
>> come back intact (albeit not with the new method definitions or other
>> new slots), whereas mine seemed to come back damaged.
>>
>> Second, I'm still hoping for some elegant way around this problem (how
>> to redefine classes and still use saved versions from older definitions)
>> for the future, both with reference and regular classes.  Or at least
>> some rules about what changes, if any, are safe to make in class
>> definitions after an instance has been persisted.
>>>
>> Third, if changes to R could make things better, I'm hoping some
>> developers might take them up.  I realize that is unlikely to happen,
>> for many good reasons, but I can still hope :)
>
> I believe that the brand new R6 class system can do this. I mean your
> saved instances from old classes will be read back properly, with the
> old methods. They are on CRAN and also here if you want to experiment:
> https://github.com/wch/R6
>
> Best,
> Gabor
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] modifying a persistent (reference) class
Winston Chang