Re: RFC 189 (v1) Objects : Hierarchical calls to initializers anddestructors

[email protected] (Damian Conway) Sat, 2 Sep 2000 12:23:45 +1100 (EST)
Newsgroups perl.perl6.language.objects
Message-ID <[email protected]>
   > What happens on reblessing?

An excellent question, and one that has been exercising my mind for
some time now.

I have come to the conclusion that a reblessing must either:

	* invoke the old class's DESTROY(s) and then invoke the
	  new class's SETUP(s), or

	* invoke some other hierarchy of automagic methods
	  (REFIT? RESHAPE? MORPH? TRANSMOGRIFY?), or

	* do nothing.

The first behaviour is by far the safest, but would seem to defeat the entire
purpose of reblessing.

The last behaviour is the most flexible but forfeits guaranteed clean-up.

The middle option is annoying because it adds yet another magic method.
But suspect it is the correct response.

Damian