Mark J. Reed wrote:

Is it possible with the new parameter declaration syntax to declare
a mandatory name-only parameter?

Probably. I think that the '?', '*', and '+ prefixes are abbreviations for traits (C<is optional>, C<is List>, C<is optional is named>). So a named, mandatory parameter would be:


sub foo($bar is named) {...}

Alternatively, you could just specify a mandatory parameter that has to be a Pair:

sub foo(Pair $bar) {...}

(though then you'd have to use C<$bar.value> for the value).

Damian



Reply via email to