Cursus Raku / Elementa / Fundamenta functionum / Plus de functionibus / Typis parametra

Quiz — Typis parametra

1

Given the function:

sub f(Rat $x) {
    say 2 * $x;
}

Which calls are correct?

0f(3);Etiamsi 3 in continens Rat convenire potest, vocatio falsa est quia 3 est Int, non Rat.
1f(3.5);
0f(3e0);
0f('3');
1f(<4/5>);Hoc est numerus Rat.

2

Given the function:

sub g(Int $a, Str $b) {
    say "Integer $a, string $b";
}

Which calls are correct?

0g(10, 20);
0g('10', 20);Etiamsi utrumque argumentum converti potest, Raku exactum genus postulat.
1g(10, '20');
0g('10, 20');Una stringa praeterita.
0g('10', '20');

Typis parametra   |   Redonare typus