From simon.urbanek at math.uni-augsburg.de  Sun Oct 31 05:00:23 2004
From: simon.urbanek at math.uni-augsburg.de (Simon Urbanek)
Date: Sun Oct 31 05:00:23 2004
Subject: [Rd] Destructive str(...)?
In-Reply-To: <x2brejna59.fsf@biostat.ku.dk>
References: <Pine.LNX.4.44.0410300859130.4649-100000@gannet.stats>
	<Pine.LNX.4.61.0410301104170.5261@itasca2.stat.uiowa.edu>
	<x2brejna59.fsf@biostat.ku.dk>
Message-ID: <6401039C-2AF1-11D9-B02D-0003938AF008@math.uni-augsburg.de>

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


[Rd] Destructive str(...)?
Simon Urbanek