>Johan Vromans <[EMAIL PROTECTED]> writes:

>> =head1 ABSTRACT
>> 
>> Perl distinguishes named operators and functions. For Perl6, this
>> disctinction can be dropped.

>Will this then work?

>  sub foo {
>     my $func = shift;
>     &$func(@_);
>  }

>  foo(\&print, "foo");
>  foo("print", "foo");
>  foo(\&CORE::print, "foo");
>  foo("CORE::print", "foo");

A fine question.  When Larry and Sarathy and I last went round on this,
it really appeared that we could do this (for all values of "do") because
of loss of compile-time context-coercion (née prototype) template information.
For example, consider sub length ($).   You aren't going to get that right
when called indirectly.

Then again, Tim Bunce once had an intriguing proposal for addressing
run-time prototype^Wcontext-coercion issues.  You can read it at

    http://www.perl.com/pub/language/misc/bunce.html

But I don't think Larry was completely (or, perhaps, even partially)
fond of it.

--tom

Reply via email to