"Bryan C. Warnock" wrote:
> {
>     my $a = sub ($$) { code };
>     gork($a);
> }
> 
> sub gork {
>     my ($a) = shift;
>     $a->(@some_list);  # <- Here
> }
> 
> The reason prototypes aren't checked at "Here" is because there really
> isn't a way to know what the prototype was.

Um, that's not true. ML can do stuff like that -- all automatically and
without any type declarations.

What happens is the type of gork's $a is determined, which cascades
to the type of gork's $_[0], which cascade's to your first block's $a.
ML even has polymorphic functions where the output type depends on the
input type.

It is possible. It's just a question of whether we want to do it.

- Ken

Reply via email to