name ( [expression {[,] expression}] )
qualified-name ( [expression {[,] expression}] )
Calling a function opens a new name space and assigns the (actual parameter) values of the expressions to the (formal) parameter names listed in the function definition. The call need not have the same number of actual parameters as formal parameters. When fewer actual than formal parameters are supplied, the remaining formals are set to Undefined. When more actual parameters than formal parameters are supplied, the surplus values are ignored.
When the formal parameter names have been assigned their values, the corresponding expression (if an expression-function) is evaluated and the result becomes the result of the call, or the sequence of instructions constituting the function body is carried out until a return instruction is reached, or the end of the sequence is reached, in which case an implicit return instruction is carried out. The name space is then closed and the value of result becomes the result of the call.
While a function, specified by instruction sequence, is being evaluated, names not defined in the function body refer to definitions established by, or imported into, the module in which the function has been defined. In other words, static scoping applies.
Functions defined in the same module as the function call, can be called before their defining instruction has been reached (see example). This causes complications when abstract type variables are used to type the function, its parameters, or its local variables, since these variables need to be initialized before calling the function. (See: Type checking.)
See also: Predefined Functions.