-
Notifications
You must be signed in to change notification settings - Fork 8
Routines
Brom Bresenham edited this page Mar 19, 2025
·
4 revisions
routine name
...
return # optional
endRoutine
routine name->ReturnType
...
return result
endRoutine
routine name( alpha:Alpha, beta=default_value:Beta, ... )
routine name( ... )->ReturnType
name
name()
name( arg1, arg2, ... )
name( ..., &named_arg, &!named_arg, &named_arg2=value, &=named_arg_3 )
local result = name(...)
See also: Named Arguments.
- A
routine
is a library-global procedure (AKA function). - A routine with no return type "returns nil".
- When a return type is given,
return some-value
immediately terminates execution of the routine and yields the specified result in place of the routine call. - For nil-return routines,
return
is optional and will immediately terminate routine execution.