On Sun, Sep 02, 2001 at 07:47:37PM -0400, Bryan C. Warnock wrote:
> Are prototypes going to be checked at runtime now?
>
> The following parses, but doesn't do anything, including warn.
>
> my $a = sub ($) { print };
Warning because you said you take an argument and then did nothing
with it... that could be useful (I can actually think of a few
situations where you'd want to do that, but they're rare) but it would
involve scanning the subroutine at compile time to see if you use @_
and what bits of it you use and if they're the right bits, etc...
But since the current prototyping system... has a highly positive
pressure gradient compared to the surrounding air, hopefully we
won't be saddled with it in Perl 6 and will be able to write something
more sensible, like RFC 57 suggests:
my $a = sub ($foo) { print }
then it's simply a matter of seeing if that declared variable is ever
used in the sub.
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
I'm not actually Kevin Lenzo, but I play him on TV.