|Perl: the Markov chain saw|
|( #3333=superdoc: print w/replies, xml )||Need Help??|
I'm sure that I don't really understand the way that you described that, likely because I have not read the rest of A12 yet.
However if you haven't nailed that part of the specification down, this discussion has convinced me that it would be a definite improvement to have a wildcard decision on whether to handle a method. That is, instead of writing something like an AUTOLOAD, you would write a method named something like CAN, which would dynamically decide whether or not to accept this method, and if it does, returns the subroutine that does it.
In thinking about it, I've had trouble coming up with anything that you'd want to do with a reasonable AUTOLOAD which cannot readily be duplicated by a CAN that works like this. Furthermore while it is very hard to make multiple inheritance and AUTOLOAD cooperate, this CAN strategy cooperates with multiple inheritance rather smoothly. In fact it returns the best possible for can() to "definitely has a method of this name", even in the face of multiple inheritance and wildcard methods.
Unfortunately if a user wanted to implement this in Perl 6, as I understand your paragraph they would not be able to pass the extra information to can() that, "I can really tell you whether I'll do that". Which prevents can() from giving the answer that we probably really wanted it to give.
In fact I'm seriously thinking of writing a module named something like UNIVERSAL::AUTOLOAD_CAN which implements a UNIVERSAL::AUTOLOAD and UNIVERSAL::can that implements this solution in Perl 5. This would make it possible to get can(), AUTOLOAD and multiple inheritance to play together. (But only if you write no other AUTOLOADs!)
In reply to Re: Re: Why breaking can() is acceptable