Re: [Rd] Destructive str(...)?

From: Simon Urbanek <>
Date: Sun 31 Oct 2004 - 15:00:23 EST

Thank you all for your replies. I wrapped the reference in a LISTSXP and everyone's happy (I know that the docs say one ought to do so right away, but I was curious what breaks ;)).

On Oct 30, 2004, at 5:55 PM, Peter Dalgaard wrote:

> Anyways, Tcl objects do provide a rather nice illustration of why
> reference objects are non-duplicatable (which is the reason behind
> unclass being destructive). They have a finalizer that decrements the
> Tcl reference count when the R object is destroyed. To avoid bad
> things resulting from decreasing the refcount multiple times,

Now, hold on a second - I thought the main point of EXTPTR is that the finalizer is called only once, that is when the last instance of the reference is disposed of by the gc (no matter how many copies existed meanwhile). Am I wrong and/or did I miss something? I did some tests which support my view, but one never knows ...

Simon mailing list Received on Sun Oct 31 15:07:43 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:00:58 EST