First, what's the recommended reference for learning how dispatching to
the right 'multi' sub is resolved. ?

I'd like to know the expected behavior in this case:

multi sub foo () { say "b: " }
multi sub foo () { say "a: " }
foo();

I would expect it would throw an error or at least a warning, since
there's no clear way to choose a correct sub to dispatch to.

Pugs currently dispatches to one anyway, without a warning.

A more insidious version of the same case is the following, which
I accidentally wrote more than once already...and then wondered why
my code wasn't working as expected...

multi sub foo (%names?) { say "b: " }
multi sub foo (@pos?) { say "a: " }

There, I have distinct arguments, but they are both optional, making
them the same as the case above.

   Mark.

Reply via email to