-
Notifications
You must be signed in to change notification settings - Fork 0
Function
A function is a Callable UnitOfCode whose Arguments and ReturnValue are Values, and whose implementation does not refer to any FreeVariables (though it may refer to Value-typed FreeConstants) and does not have any Process-external Effects.
Functions are a Static concept. The runtime representation of a function is a FunctionClosure.
Because a function may not refer to FreeVariables, it always returns Equal outputs given equal inputs.
Theoretically, a FunctionClosure is a Value. Two FunctionClosures are Equal if they are instances of the same Function and the FreeConstants they reference have Equal values. However, most programming languages do not implement equality of FunctionClosures this way, because they fail to distinguish between functions and Methods (which have different equality semantics).