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

Function parameters

Choose those options where the function signature is correct.

1sub f($x) {. . .}
1sub f() {. . .}No parameters is a valid situation.
1sub f {. . .}Parentheses are not required here.
0sub f $x {. . .}But they are required if there are parameters.
1sub f($x, $y) {. . .}
0sub f($x $y) {. . .}Parameters are a comma-separated list.
1sub f($x,$y) {. . .}It is up to you to put or omit space between parameters.
1sub f($y, $x) {. . .}Parameters can have any names in any order.
0sub f ($x), ($y) {. . .}Non-existing syntax.

Course navigation

Function parameters   |   Passing arguments

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