Close($file) required in Perl 6, unlike Perl 5

Andrew Whitworth wknight8111 at gmail.com
Mon Jul 18 15:43:15 UTC 2011


On Sun, Jul 17, 2011 at 4:21 AM, Moritz Lenz <moritz at faui2k3.org> wrote:
> Question to the Parrot developers: How could I implement DESTROY methods
> in Rakudo? Is there any vtable I can override, or so? Note that such a
> method might itself allocate new GCables. While not urgent, it's
> important for us in the long run.

We do have the ability to override VTABLE_destroy in a C-based PMC
type, but that is not exposed through Object PMC. I suspect this
capability could be exposed through 6model and the Rakudo PMC
infrastructure, and a Sub could be invoked from there. Because of the
sensitive nature of the timing, and because this has obviously not
gotten any good test coverage or developer attention, it probably
won't work so well.

This hasn't been a high-priority issue so far, either amonst users or
developers. If people are interested in seeing this happen, failing
use-cases or even tickets requesting fixes would be a great place to
start. My suggestion so far would be to add in a destroy override to
6model, try to use it, and see what blows up. Then open a ticket with
Parrot and we'll do our best to make it work the way you need.

--Andrew Whitworth


More information about the parrot-dev mailing list