-
-
Notifications
You must be signed in to change notification settings - Fork 9
Function Aliases
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Function aliases can be used to have multiple names refer to the same function definition
func alias myFunctionAlias => realFunction
func alias myFunctionAlias(ArgType1, ArgType2, ArgTypeN) => realFunction
If the argument types of the function alias are specified, then they will be used to determine which implementation function to use. Otherwise, the first function that has the specified implementation name will be chosen.
If no argument types are specified and there are multiple implementation possibilities, then a warning will be raised.
Alternative syntax can be used with function aliases as expected.
myFunctionAlias :: func alias => realFunction
myFunctionAlias :: func alias (ArgType1, ArgType2, ArgTypeN) => realFunction
If a real function and a function alias have the same name and arguments, then the first to be declared will be used.