Re: References (was: Re: Is garbage collection here yet?)
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: References (was: Re: Is garbage collection here yet?)

From: Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date: Tue Mar 21 2006 - 09:54:53 CET

Darren New <dnew@san.rr.com> wrote:
> Andreas Leitgeb wrote:
>> To clean up a stringified ref, simply [unset] it.
>> The point is, that as long as the ref is never
>> stringified, no variable is ever created.
>
> And once the variable is created, the ref now points to a different
> value than the variable?

No,no,no.
Its always the same "target".
  real ref: references the target
  stringfied ref: a name of an autogenerated variable
        that refers to the object.
  2nd stringified ref: a name of yet another autogenerated
        variable that refers to the same object as the
        previously autogenerated vars.

>> If you stringify it "on purpose" for later access, you'll
>> finally have to invalidate it manually.
> Maybe you don't know it happened? This sounds really
> difficult to debug.

You're right. sometimes one doesn't know that a ref has been
stringified, and that's one point where trouble starts.
Another one is, if you use it as array-key, and next time
you look it up you (inadvertently) do it with a new stringfication,
that's where my trick (to solve other problems) actually fires
back on you.

Yes I don't even think it will really work out. I just want
  to know where it will irrepairably fail, and wanting that,
  I play devil's advocate trying to find ways that solve the
  stated problems :-)

Both followups (the interp-problem and this) are probably
enough to convince even the dev.adv. in me that it won't
work out. Let's see, if the actual proposers of references
pick up the ball, but it seems they still think they could
place traces on strings, lists and dicts :-)
Received on Sun Apr 30 02:43:06 2006