Imagine:

    pugs> '1.28' * '2.56'
    3.2768

What is (or should be) going on here here?

[1] role NumRole {
        method infix:<*> returns Num (NumRole $x, NumRole $y: ) { ... }
    }
    Str.does(NumRole);

[2] multi sub infix:<*> (Str $x, Str $y) returns Num { ... }

[3] multi sub prefix:<+> (Str $x) returns Num { ... }
    multi sub infix:<*> (Num $x, Num $y) returns Num { ... }
    multi sub infix:<*> (Any $x, Any $y) returns Num { +$x * +$y }

[4] multi sub infix:<*> (Num $x, Num $y) returns Num { +$x * +$y }
    # ...and the MMD dispatcher forces incompatible type into
    # the type with shared ancestors and closest distance...

[5] none of the above -- that should be a type error. ;)

[6] something else?

Thanks
/Autrijus/

Attachment: pgp4AcX2zxMFU.pgp
Description: PGP signature

Reply via email to