Skip to content
Prev 14157 / 63461 Next

Destructive str(...)?

Simon Urbanek <simon.urbanek@math.uni-augsburg.de> writes:
How do you ensure that the finalizer is called once? By *not* copying
the reference object! You can have as many references to it as you
like (i.e. assign it to multiple variables), and the object itself is
not removed until the last reference is gone, but if you modify the
object (most likely by setting attributes, but you might also change
the C pointer payload in a C routine), all "copies" are changed:
<Tcl> 3.14159265359
<Tcl> 3.14159265359
[1] "externalptr"
$class
[1] "tclObj"

$Simon
[1] "Urbanek"