Luke wrote:

I think you're forgetting what language you're talking about.  Those are
numbers.  After this statement:

$x = '345';

C<$x> is a number.

I don't think so. C<$x> is, of course, a variable. And what it contains after that statement will depend on whether the variable is explicitly typed or not.
If C<$x> is explicitly typed, the rvalue will have been converted to that type (if possible). If C<$x> is not explicitly typed (i.e. implicitly typed to C<Any>), then it will contain a string, since that's what the rvalue inherently is.


I should hope it would be treated as one during
multimethod dispatch.

I would expect that the multiple dispatch mechanism would allow the C<Str> in C<$x> to be coerced to a C<Num>, if that's the parameter type it was seeking to match. And I would expect that the "distance" of that coercion would be 1.



However, I'm not saying this with authority.  I'm just extrapolating.
If it's not correct, I'd appreciate that someone who knows correct me.

Ditto. ;-)


Damian

Reply via email to