At 10:51 AM -0400 4/20/04, John Siracusa wrote:
On 4/20/04 10:42 AM, Dan Sugalski wrote:
At 9:50 AM -0400 4/20/04, John Siracusa wrote:
On 4/19/04 7:16 PM, Larry Wall wrote:
 Well, no, we're still stuck at run-time validation of that.  In the case
  of methods you can't really do anything else anyway, generally speaking.

Why is that?

Because at compile time all you have is a generic thing, a (possibly indirectly accessed) method name, and a list of parameters. There's no good way to tell which method will ultimately be called, and validating against all declared methods of that name won't get you anything useful there since the result's likely going to be pretty contradictory.

Hm, so how would the "is required" trait that Damian posted work? Would it simply be shorthand for a run-time check that I don't have to write myself?

Yes. It may have the added advantage of continuing the search for a sub that matches--that is, we could continue on as if we'd not found the sub and then hit MMD. Or not. I could see it going either way.


It really is a shame about the inability to do it at compile-time with
methods, but shorthand for a run-time check in that case would be welcome
too :)

Everybody's OO gets hit this way, unless you get really vicious with the signatures of overridden methods. (If they're all the same it's easier) Perl's really dynamic nature makes it tough for subs, too.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to