Course of Raku / Essentials / Functions essentials / Creating and calling functions
Positional parameters
The order of function parameters is important. For example, create a function that computes the difference between two numbers:
sub diff($a, $b) { $a - $b }It is obvious that the result of calling diff(10, 20)
differs from diff(20, 10).
Parameters that are listed as a comma-separated list like in the function above are called positional. Their meaning depends on the order in which the arguments are passed to the function when it is called.
Practice
Complete the quiz that covers the contents of this topic.
Course navigation
← Quiz — Return from a function | Quiz — Calling a function →
💪 Or jump directly to the exercises in this
section.
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська