Open main menu

CDOT Wiki β

Changes

GPU621/Chapel

245 bytes added, 22:03, 29 November 2022
Overloading
The primer covers procedures including overloading, argument intents and dynamic dispatch.
=== Overloading ===
The prime allows the user to do the overload function.
proc factorial(x: int) : int
{
if x < 0 then
halt("factorial -- Sorry, this is not the gamma procedure!");
return if x == 0 then 1 else x * factorial(x-1);
}
= Reference =
73
edits