On 9/2/00 12:12 PM, Nathan Wiger wrote:
> I think this RFC could work for this, but as I noted in a private email
> to Damian I'd rather see a whole new keyword made, maybe "setup"?
>
> sub new { setup {}, @_ }
> sub SETUP { ... }
Sure, but does setup() bless? That's the question... :) In other words,
are we just renaming Damian's bless or is this a whole new way to mark
something as an object?
> One thing nobody's brought up is this: What if you decide you want the
> standard Perl 5 bless behavior, and you want to tweak the order of
> calls. So, you don't define a SETUP. BUT, the author of a module you're
> inheriting from defined a SETUP, not to your knowledge? This gets called
> automatically by bless(), with no way to override it, either making you
> manually undo it all or decide not to subclass it anymore. This is bad.
No worse that the current situation in which you have no clue what the
guy you're inheriting from expects. Better to have SETUPs called
below you than to not even know that there's some terribly important init
stuff that needs to be done by a parent class and that you neglect to
manually invoke. Determined individuals can always stop it from
happening by nefariously blanking out sub ParentClass::SETUP {}
> I think the RFC would be fine intact with the change that a new keyword
> "setup" should be added that:
>
> 1. Automatically blesses stuff
>
> 2. Recursively calls SETUP in the method described
>
> That way, Perl 5 bless remains unchanged (good), and we get all the new
> features Damian's proposing (also good). This RFC is a *big change*. I
> think it deserves a new keyword.
I'd buy that I guess.
-John