declareLambda
declareLambda(s_name1...s_nameN) =>s_nameN
Description
Tells the evaluator that certain (forward referenced) functions are of lambda type (as opposed to nlambda or macro).
Declares s_name1 ... s_nameN as procedures (lambdas) to be defined later. This is much like C’s “extern” declarations. Because the calling sequence for nlambdas is different from that of lambdas, the evaluator needs to know the function type in order to generate more efficient code. Without the declarations, the evaluator can still handle things properly, but with some performance penalty. The result of evaluating this form is the last name given (in addition to the side-effects to the evaluator).
This (and declareNLambda) form has effect only on undefined function names, otherwise it is ignored. Also, when the definition is provided later, if it is of a different function type (for example, declared as lambda but defined as nlambda) a warning will be given and the definition is used regardless of the declaration. In this case (definition is inconsistent with declaration), if there is any code already loaded that made forward references to these names, that part of code should be reloaded in order to use the correct calling sequence.
Arguments
Value Returned
Examples
declareLambda(fun1 fun2 fun3)
=> fun3
Related Topics
Function and Program Structure
Return to top