From murdoch.duncan at gmail.com  Wed Jan 16 01:55:59 2013
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Tue, 15 Jan 2013 19:55:59 -0500
Subject: [Rd] Prevent serialization of an environment?
In-Reply-To: <CAJoaRhabfD2AVoyeB-4yiNpi26sfNXuxQ+eTXuYRqCJ5hs=xnQ@mail.gmail.com>
References: <CAJoaRhabfD2AVoyeB-4yiNpi26sfNXuxQ+eTXuYRqCJ5hs=xnQ@mail.gmail.com>
Message-ID: <50F5FA9F.5090102@gmail.com>

On 13-01-15 7:39 PM, Peter Meilstrup wrote:
> Within I'm using an environment as a hashtable to cache the results of some
> repeated computations in a package. The thing is that the contents of the
> cache will not be valid across R sessions, so I would like to make sure
> that the cache is cleared if the user saves or restores the workspace (or
> when a package is prepared for lazy loading, etc.). Is there a way to mark
> an environment so that its contents do not serialize?
>

Seems like the refhook argument to serialize() could do that.

Duncan Murdoch



[Rd] Prevent serialization of an environment?
Duncan Murdoch