Re: choice of signatures

2006-01-04 Thread Miroslav Silovic

[EMAIL PROTECTED] wrote:


Jonathan Lang wrote:


Instead of

multi sub *infix:<~>(ArabicStr $s1, ArabicStr $s2) {...}
multi sub *infix:<~>(Str $s1, ArabicStr $s2) {...}
multi sub *infix:<~>(ArabicStr $s1, Str $s2) {...}



as S13 say

 multi sub infix:<+> (Us $us, Them $them) is commutative { 
myadd($us,$them) }


I believe this declares that $a + $b == $b + $a, not just that you can 
swap the types of the arguments. I.e. it implements


multi sub infix:<+> (Them $them, Us $us) { $us + $them }

for you. And string concatenation isn't commutative.

   Miro




Re: choice of signatures

2006-01-04 Thread Fayland Lam

Jonathan Lang wrote:

Instead of

multi sub *infix:<~>(ArabicStr $s1, ArabicStr $s2) {...}
multi sub *infix:<~>(Str $s1, ArabicStr $s2) {...}
multi sub *infix:<~>(ArabicStr $s1, Str $s2) {...}


as S13 say

 multi sub infix:<+> (Us $us, Them $them) is commutative { 
myadd($us,$them) }




could you say

multi sub *infix:<~>(ArabicStr $s1, ArabicStr | Str $s2) | (Str
$s1, ArabicStr $s2) {...}

or something to that effect?

--
Jonathan "Dataweaver" Lang