3 ms·
Not for tcloo objects, channels and file handles. I don't think you get it. In sane languages like C++ you can expect a destructor to call itself no matter wher
by a8da6b0c91d 11y ago
Not for tcloo objects, channels and file handles. I don't think you get it. In sane languages like C++ you can expect a destructor to call itself no matter where a function exited.
- sigzero 11y agoC++ is not a scripting language. Give me a scripting language that does that so I can research and compare.
- a8da6b0c91d 11y agoperl: sub do_stuff { my $thing = Thing->new; # no need to manually destroy thing. Its DESTROY method will be called at the closing brace. }
- sigzero 11y agoCool...now I get to play. Perl does it because it goes out of scope once the sub is run. I am pretty sure you can tell TclOO to do the same thing (play time) if it already doesn't do that. In the end, they all make trade offs depending on the "whim" of the language designer.
- a8da6b0c91d 11y agoJesus Christ, you don't even know tcl. Why are you blathering on here? No, tcloo objects are not garbage collected. That's the whole point here.
- sigzero 11y agoYeah just blathering. Carry on.
- AnimalMuppet 11y agoSo, about four posts before this one, you said: > Many scripting languages in practice do reference counting GC that will reliably and deterministically clean up resources other than memory. When challenged, you offered one. So, is this a Perl-only thing, or can you give other examples?