Transcendence Wiki

Documenting the Universe.

User Tools

Site Tools


modding:function:lambda

lambda

lambda

lambda

Syntax (lambda args exp) → lambda
Arguments args: A list of arguments you want to pass into the function. Can also be Nil.
exp: The code you want to pass the arguments to. It is not evaluated.
Returns The new function.
Category function operator
Description Function allowing you to create a function for later use.

Example

(block (number fun)
	(setq number 5)
	(setq fun (lambda (adder)
		(add 1 adder)
		))
	(dbgOutput number)
	(setq number (fun number))
	(dbgOutput number)
	(setq number (fun number))
	(dbgOutput number)
	)

This displays on the debug console. 5 6 7 True Return to Functions list

modding/function/lambda.txt · Last modified: 2014/12/27 04:40 (external edit)