Course of Raku / Essentials / More about functions / Multi-functions
Quiz 3 — Calling multi-functions
Here are the three variants of the function.
multi sub func(Int $a) { 1 }
multi sub func(Rat $a) { 2 }
multi sub func(Num $a) { 3 }
Which calls are valid?
func(4) | ||
func(4e4) | ||
func(4/4) | ||
func('4') | ||
func(4.4) |
What do the calls return?
func(4) returns |
|
func(4.4) returns |
|
func(4/4) returns |
|
func(4e4) returns |
Course navigation
← More about functions / Return type | 💪 Exercise: Factorial with multi-functions →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська