Closed Ovid closed 2 years ago
Roles will need some accommodation here. The pattern for handling destruction in Moo/Moose is:
sub DEMOLISH {}
after DEMOLISH => sub { ... };
This is not particularly obvious, and relies on method modifiers, which aren't intended to be supported in Cor.
DEMOLISH
is not called like a normal method. It may make more sense to stop defining them as methods. DESTRUCT
could be more like a keyword defining a callback, rather than a method.
Currently in Perl i find it very hard to work with DESTROY (or DEMOLISH for that matter) since the order in which "slots" are destroyed varies each time (probably due to random hash order). Ensuring the same order, based on the order in which the slots were defined would make the destruction much more predictable.
(and i believe that using ${^GLOBAL_PHASE} instead of a dedicated global-destruction argument is perfectly fine)
Closing old tickets because the MVP has been accepted. We'll start fresh with real code.
Use this issue to provide feedback on the Cor Destructor Proposal.