Brent Dax wrote:

method x ($me: $req, ?$opt, +$namedop, *%named, [EMAIL PROTECTED]) { ... }

Yikes. And I thought we were trying to get *away* from line noise? :^)

Seriously, can't we use something rather prettier, like this?

        method x($me: $req, $opt is optional, $namedop is named,
*%named, [EMAIL PROTECTED]) { ... }

It's quite possible that the following equivalences might hold:


        ?$x    same as    $x is optional
        +%y    same as    %y is named

So that you could choose.


I can deal with one really funny character in a signature, but three is
a bit much.

The problem is that if you have multiple optional or named parameters, things start getting uncomfortably prolix, and default values end up a long way from their owners:


multi substr(Str $str, $from is optional = $CALLER::_, $len is optional = Inf, $new is optional) {...}

vs:

multi substr(Str $str, ?$from = $CALLER::_, ?$len = Inf, ?$new) {...}

Damian



Reply via email to