On Fri, Aug 11, 2000 at 06:22:46AM +1000, Damian Conway wrote:
> I don't *dislike* your proposal, except that it interposes another layer of
> indirection on a process that is already too slow.
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> 
>    > =head2 $AUTOLOAD
>    > 
>    > While we're at it, it *may* be a good idea to remove the global
>    > $AUTOLOAD variable and instead pass it as the first parameter of the
>    > AUTOLOAD subroutine call. For: general global drought, the fact that
>    > perlsub's argument "because, er, well, just because, that's why..." is
>    > a bit weak. Against: makes AUTOLOAD more complicated, breaking the
>    > "subroutine parameters end up as @_" paradigm (apparently).
> 
> This, I really like.

But it will slow things down. Firstly because it must be added to the stack
then removed inside the sub.

I don't see any issue keeping $AUTOLOAD as the way the sub name is passed.

>    > =head2 UNIVERSAL->can
>    > 
>    > This proposal has the added bonus that the UNIVERSAL->can method (or
>    > whatever replaces it) will now work with AUTOLOAD-ed methods, whereas
>    > in Perl 5 it used to fail.
> 
> But how would it know whether a particular AUTOLOAD can handle the requested
> method without calling that AUTOLOAD and seeing what it returns? Oh, I get
> it: it *would* call every AUTOLOAD it found until one of them returned
> something? If so, the RFC ought to explain this explicitly.

But you cannot do that as the AUTOLOAD subs may not just be defining the sub,
they may be doing the work.

And ->can can already be used with AUTOLOADed methods if there is a stub
in place.

Graham.

Reply via email to