Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

choice of signatures

Visto 0 veces
Saltar al primer mensaje no leído

Jonathan Lang

no leída,
4 ene 2006, 4:34:314/1/06
a perl6-language@perl.org List
Instead of

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

could you say

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

or something to that effect?

--
Jonathan "Dataweaver" Lang

Fayland Lam

no leída,
4 ene 2006, 8:52:144/1/06
a perl6-l...@perl.org
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) }

Miroslav Silovic

no leída,
4 ene 2006, 10:26:514/1/06
a fay...@gmail.com,perl6-l...@perl.org
fay...@gmail.com 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


0 mensajes nuevos