Course of Raku / Essentials / Functions essentials / Creating and calling functions / Positional parameters

Quiz — Calling a function

1

Having the following function:

sub abc($a, $b, $c) {
    return $a ~ $b ~ $c;
}

How do you call it?

, ,say abc($a␣ $b␣ $c);
=my $s ␣ abc('a', 'b', 'c');
= abc )my $z ␣ ␣␣␣($a, $b, $c␣;
, ,say abc $a␣ $b␣ $c;

2

For the following function:

sub x {
    return 42;
}

Select the correct calls of it.

1say x;
1say(x);
1say x();Parentheses around the arguments of say are omitted.
1say(x());
0my $v = x ();A space before () makes the () an argument.
1my $w = x();
1my $u = x;

Course navigation

Positional parameters   |   Named parameters

Translations of this page: EnglishDeutschEspañolItalianoLatviešuNederlandsБългарскиРусскийУкраїнська