On Tue, Nov 06, 2007 at 06:54:13AM -0800, Josh Jore wrote:
> On Tue, Nov 06, 2007 at 06:25:51AM -0500, John Peacock
wrote:
> } Linda Walsh (via RT) wrote:
> } > Perl has runtime features that can turn what may
seem to be an undefined
> } > function stub, and turn it into something useful
via Perl's AUTOLOAD
> } > functionality that can catch, undefined
subroutines and load them at
> } > runtime.
> }
> } There's nothing wrong with Perl's OO design. It
isn't going to change (except
> } in so much as what Perl6 does). There is no point in
opening this
> } bug/enhancement request, because you are [apparently]
the only person who thinks
> } the current behavior is a problem. Sorry to be
harsh, but you have been told
> } repeatedly that the problem is your interpretation of
how Perl's object design
> } works. Perhaps you want the Java or C++ offices down
the hall...
>
> Gosh, I dunno. I'm pretty sympathetic to the idea of
method resolution
> silently skipping over undefined bodies. I've gotten
the impression
> that the people responding to her are more out to
brow-beat Linda than
> argue about anything technical.
I wouldn't want it to skip over undefined bodies in the
general case.
If you write (the equivalent of)
sub Foo::bar;
then I'd expect it to try Foo::AUTOLOAD, and if that fails,
fail.
Otherwise it might silently hide a bug in Foo's AUTOLOAD
Else why would you stub subroutine bar in package Foo.
But for the case of taking a reference to an undefined
subroutine, I can see
why that might want to behave differently, and (implied)
internally be
represented by something different and distinguishable from
a stub.
As this is just for the case of methods, I'm not sure what
it really gains
over making method calls by name (which has been around,
IIRC, since 5.005),
but it would introduce both implementation and conceptual
complexity.
Nicholas Clark
|