nlambda
nlambda( (s_formalArgument)g_expr1... ) =>u_result
Description
(SKILL mode only) Allows nlambda functions to be defined without having names. In all other respects, nlambda is identical to nprocedure. This is a syntax form that is not supported in SKILL++ mode.
Allowing nlambda functions to be defined without having names is useful for writing temporary or local functions. In all other respects nlambda is identical to nprocedure.
An nlambda function should be declared to have a single formal argument. When evaluating an nlambda function, SKILL collects all the argument expressions unevaluated into a list and binds that list to the single formal argument. The body of the nlambda can selectively evaluate the elements of the argument list.
In general, it is preferable to use lambda instead of nlambda because lambda is more efficient. In most cases, nlambdas can be easily replaced by macros (and perhaps helper functions).
Arguments
|
SKILL expressions to be evaluated when the function is called. |
Value Returned
Examples
putd( 'foo nlambda( (x) println( x )))
=> funobj:0x309128
apply( nlambda((y) foreach(x y printf(x))) '("Hello" "World\n"))
HelloWorld
=> ("Hello" "World\n")
Related Topics
Function and Program Structure
Return to top