John Siracusa asked:

Well, actually, we saved you last summer when we decided to make +
mean that the parameter must be named.

...named and required, or named and optional?

Named and optional, by default.


IOW, is this all true?

sub foo(+$a, +$b) { ... }

foo(); # compile-time error!

No.


foo(1, 2); # compile-time error!

Yes.


foo(a => 1, 2); # compile-time error!

Yes.


foo(a => 1); # compile-time error!

No.



    foo(a => 5, b => 7); # ok
    foo(b => 1, a => 2); # ok

Yes. Yes.


You want:

sub foo(+$a is required, +$b is required) { ... }

Damian



Reply via email to