[Rd] Destructive str(...)?

Simon Urbanek simon.urbanek at math.uni-augsburg.de
Sun Oct 31 05:00:23 CET 2004


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 ...

Cheers,
Simon



More information about the R-devel mailing list