I've been playing with pugs a little bit. I like it a lot. I'm especially
interested in passing parameters to subs and giving them defaults.
While trying to Curry in the default of a Code reference parameter, I ran into
the following oddity (it seems odd to me). It looks like I must fully qualify
the package name in order to specify a default sub. Here's a reduced example:
package MyModule;
use v6;
sub doubler( Num $x ) {
return 2 * $x;
}
sub value_v( Code +$func = &MyModule::doubler ) is export {
return $func( 5 );
}
This works. But I think I should be able to say:
sub value_v( Code +$func = doubler ) is export {
or at least:
sub value_v( Code +$func = &doubler ) is export {
I'm using Pugs 6.2.8. Am I missing something?
Phil Crow