>>>>> "PRL" == Perl6 RFC Librarian <[EMAIL PROTECTED]> writes:

  PRL> Instead of calling the right thing or actually doing the right thing,
  PRL> AUTOLOAD subroutines should return a coderef which will be run as if
  PRL> it were the method called. If an AUTOLOAD subroutine does not wish to
  PRL> cope with a method call, it should return undef. Perl would then walk
  PRL> the OO hierarchy and find the next AUTOLOAD to call, eventually failing
  PRL> with an error if no AUTOLOAD method is found which will accept the
  PRL> call.

what about when you want to install that coderef in the symbol table?
does your new AUTOLOAD do that or is is still done manually? and there
are times when you really want the AUTOLOAD to always do the work and
not build a coderef. so maybe you need multiple return values: coderef
means execute it, undef means declined and pass the buck up the @ISA
tree and 0 means accepted but no coderef returned.

another issue is who is calling AUTOLOAD (perl guts or mainline code)?
this is because the return VALUE of AUTOLOAD is passed back to the
original caller as the return value of the missing method. say that
method was generating coderefs (e.g. closures) then how can you tell the
difference between an AUTOLOAD returning a coderef to be executed as if
it was there or a coderef to be returned to the caller.

so i think the mechanism of how AUTOLOAD can decline needs further
work. 

uri

-- 
Uri Guttman  ---------  [EMAIL PROTECTED]  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com

Reply via email to