Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: The value of declarationsby TimToady (Parson) |
on Apr 07, 2009 at 16:45 UTC ( [id://756075]=note: print w/replies, xml ) | Need Help?? |
The one place where the design of Perl 6 doesn't quite jibe with this meditation is that, while Perl 6 can do compile-time checking of named arguments on subroutines, it refuses to do so for method calls. (It does this by supplying a default slurpy
%_ parameter to methods.) The reasoning for this is that base methods should be allowed to ignore named parameters that are intended only for derived methods, and vice versa.
Perhaps there is some way to check named arguments against all the candidates at run time, but it seems as though this could get expensive, and we're at least trying to maintain the hope that Perl 6 could be very fast in theory, even if 6.0.0 doesn't actually achieve that. (And we don't expect it to, since we're optimizing for correct over fast for now.) Anyway, we're still open to ideas in this area, maybe an optional check that only runs first time when dispatch order is established (or reestablished).
In Section
Meditations
|
|