lambda

 

 

Description

The lambda special form returns an instance of a Lambda object. When called, the Lambda extends its environment to include the specified argument variables {arg}, the arguments are received and bound to the proper variables {arg}, the expressions {exp} are evaluated from left to right, and the value of the final expression is returned.

An Analytic Information Server Lambda may be defined, with a definite list (fixed) or an indefinite list of arguments (variable). The ellipses at the end of the argument list indicate the function has indefinite arguments. At run time, the Lambda's actual arguments are bound to the specified formal definite arguments respectively. An error is generated if there are too few arguments in the definite argument list. If the number of actual arguments exceed the number of definite arguments, and the function has been defined as having indefinite arguments, the excess arguments can only be accessed during via the argCount and argFetch functions at run time.

The keyword faces:(var...) declares the interfaces feature Structure of the Lambda. The features are specified as lists, faces:((english true) (french false)), the listed feature is initialized to the value specified.

The keyword vars:(var...) declares the temporary variables of the Lambda. The variables are specified as follows vars:(X Y...). If any one of the variables is specified as a list, vars:((X 0) Y...), the listed variable is initialized to the constant value specified. (The variable X is initialized to the constant 0). Unlike the setq or define special forms, the vars special form always evaluates the initialization value as a constant.

The keyword pvars:(var...) declares the persistent variables of the Lambda. The variables are specified as a list pvars:(W Q...). If any one of the variables is specified as a list, pvars:((X 0) Y...), the listed variable is initialized to the constant value specified. (The variable X is initialized to the constant 0). Unlike the setq or define special forms, the pvars special form always evaluates the initialization value as a constant.

The keyword cvars:(var...) declares the persistent class variables of the Lambda. The variables are specified as a list cvars:(W Q...). If any one of the variables is specified as a list, pvars:((X 0) Y...), the listed variable is initialized to the constant value specified. (The variable X is initialized to the constant 0). Unlike the setq or define special forms, the cvars special form always evaluates the initialization value as a constant.

The keyword rvars: (var...) declares the register variables of the Lambda. The variables are specified as a list rvars: (W Q...). If any one of the variables is specified as a list, regs: ((X Integer) Y...), the listed variable is initialized to the type value specified (Integer, Number, CharPointer, ShortPointer, JumpPointer, IntPointer, or NumPointer). The variable X is initialized to the data type Integer (up to fifty register variables are allowed). Unlike the cvars or pvars special forms, the regs special form always evaluates the initialization value as a data type.

The body of the Lambda is a sequence of Lisp expressions {exp}. At run time, each of the expressions is evaluated, in the extended environment, from left to right. The Lambda returns the value of the final expression in the sequence.

When to use

Use the lambda special form when an Lambda is to be created in Lisp. The Lambda is not assigned to a global variable as with the defun macro.

 

Syntax

(lambda(arg...) faces:(var...) vars:(var...) pvars:(var...) cvars:(var...) regs:(var...) exp...)


Name Description AIS Types
(arg...) Optional Argument. Argument list for the Lambda. ---
faces:(var...) Optional Argument. If present, must be followed by a interfaces feature list. Symbol
vars:(var...) Optional Argument. If present, must be followed by a local variable list.Symbol
pvars:(var...) Optional Argument. If present, must be followed by a persistent variable list.Symbol
cvars:(var...) Optional Argument. If present, must be followed by a persistent class variable list.Symbol
regs:(var...) Optional Argument. If present, must be followed by a register variable list (up to fifty register variables are allowed).Symbol
exp... The Lisp statements that forms the Lambdas---


Returns:

An Lambda object.

 

Examples

Here are a number of links to Lambda coding examples which contain this instruction in various use cases.

 

Argument Types

Here are the links to the data types of the function arguments.

Lambda

Here are also a number of links to functions having arguments with any of these data types.

argCount(Lambda) argFetch(Lambda) attachLibrarian(ObjectRepository) balance(Lambda)
callcc(Lambda) compareEQ(BitVector) compareEQ(Boolean) compareEQ(Brick)
compareEQ(Character) compareEQ(Complex) compareEQ(CpxVector) compareEQ(Date)
compareEQ(Dictionary) compareEQ(Directory) compareEQ(FltVector) compareEQ(Function)
compareEQ(IntVector) compareEQ(Lambda) compareEQ(List) compareEQ(Matrix)
compareEQ(NumMatrix) compareEQ(NumVector) compareEQ(Number) compareEQ(ObjVector)
compareEQ(ObjectRepository) compareEQ(Pair) compareEQ(ShortVector) compareEQ(String)
compareEQ(Structure) compareEQ(Symbol) compareEQ(Vector) compareEQ(Void)
compareGE(BitVector) compareGE(Boolean) compareGE(Brick) compareGE(Character)
compareGE(Complex) compareGE(CpxVector) compareGE(Date) compareGE(Dictionary)
compareGE(Directory) compareGE(Function) compareGE(IntVector) compareGE(Lambda)
compareGE(List) compareGE(Matrix) compareGE(NumMatrix) compareGE(Number)
compareGE(ObjVector) compareGE(ObjectRepository) compareGE(Pair) compareGE(ShortVector)
compareGE(String) compareGE(Structure) compareGE(Symbol) compareGE(Vector)
compareGE(Void) compareGT(BitVector) compareGT(Boolean) compareGT(Brick)
compareGT(Character) compareGT(Complex) compareGT(CpxVector) compareGT(Date)
compareGT(Dictionary) compareGT(Directory) compareGT(Function) compareGT(IntVector)
compareGT(Lambda) compareGT(List) compareGT(Matrix) compareGT(NumMatrix)
compareGT(NumVector) compareGT(Number) compareGT(ObjVector) compareGT(ObjectRepository)
compareGT(Pair) compareGT(ShortVector) compareGT(String) compareGT(Structure)
compareGT(Symbol) compareGT(Vector) compareGT(Void) compareLE(BitVector)
compareLE(Boolean) compareLE(Brick) compareLE(Character) compareLE(Complex)
compareLE(CpxVector) compareLE(Date) compareLE(Dictionary) compareLE(Directory)
compareLE(FltVector) compareLE(Function) compareLE(IntVector) compareLE(Lambda)
compareLE(List) compareLE(Matrix) compareLE(NumMatrix) compareLE(NumVector)
compareLE(Number) compareLE(ObjVector) compareLE(ObjectRepository) compareLE(Pair)
compareLE(ShortVector) compareLE(String) compareLE(Structure) compareLE(Symbol)
compareLE(Vector) compareLE(Void) compareLT(BitVector) compareLT(Boolean)
compareLT(Brick) compareLT(Character) compareLT(Complex) compareLT(CpxVector)
compareLT(Date) compareLT(Dictionary) compareLT(Directory) compareLT(FltVector)
compareLT(Function) compareLT(IntVector) compareLT(Lambda) compareLT(List)
compareLT(Matrix) compareLT(NumMatrix) compareLT(NumVector) compareLT(Number)
compareLT(ObjVector) compareLT(ObjectRepository) compareLT(Pair) compareLT(ShortVector)
compareLT(String) compareLT(Structure) compareLT(Symbol) compareLT(Vector)
compareLT(Void) compareNE(BitVector) compareNE(Boolean) compareNE(Brick)
compareNE(Character) compareNE(Complex) compareNE(CpxVector) compareNE(Date)
compareNE(Dictionary) compareNE(Directory) compareNE(FltVector) compareNE(Function)
compareNE(IntVector) compareNE(Lambda) compareNE(List) compareNE(Matrix)
compareNE(NumMatrix) compareNE(NumVector) compareNE(Number) compareNE(ObjVector)
compareNE(ObjectRepository) compareNE(Pair) compareNE(ShortVector) compareNE(String)
compareNE(Structure) compareNE(Symbol) compareNE(Vector) compareNE(Void)
compare(BitVector) compare(Boolean) compare(Brick) compare(Character)
compare(Complex) compare(CpxVector) compare(Date) compare(Dictionary)
compare(Directory) compare(FltVector) compare(Function) compare(IntVector)
compare(Lambda) compare(List) compare(Matrix) compare(NumMatrix)
compare(NumVector) compare(Number) compare(ObjVector) compare(ObjectRepository)
compare(Pair) compare(ShortVector) compare(String) compare(Structure)
compare(Symbol) compare(Vector) compare(Void) compile(Lambda)
compile(List) copy(BitVector) copy(Brick) copy(CpxVector)
copy(Dictionary) copy(Directory) copy(FltVector) copy(IntVector)
copy(Lambda) copy(List) copy(Matrix) copy(NumMatrix)
copy(NumVector) copy(ObjVector) copy(Pair) copy(PcodeVector)
copy(ShortVector) copy(Structure) copy(Vector) debugBrowsableProcs(Context)
debugBrowsableProcs(Lambda) debug(Context) debug(Lambda) defchild(Lambda)
define(macro)(Lambda) define(Lambda) defmacro(Lambda) deforphan(Lambda)
defriend(Lambda) defun(Lambda) detachLibrarian(ObjectRepository) disassemble(Context)
disassemble(Lambda) display(ByteVector) display(FileIO) evalInSyncLocalContext(Context)
eval(Lambda) eval(List) exportTab(Lambda) exportTab(ObjectRepository)
globalBinding(Context) globalBinding(Lambda) importTab(Lambda) importTab(ObjectRepository)
inspect(Context) inspect(Lambda) inspect(ObjectRepository) lambda(Lambda)
lisp(Lambda) lisp(List) macroReplace(String) makeLambda(Lambda)
myself(Lambda) new(BitVector) new(Brick) new(ByteVector)
new(CpxVector) new(Dictionary) new(Directory) new(FltVector)
new(IntVector) new(Lambda) new(Matrix) new(NumMatrix)
new(NumVector) new(ObjVector) new(ObjectRepository) new(PcodeVector)
new(ShortVector) new(String) new(Structure) new(Symbol)
new(Vector) onError(Error) onError(Lambda) refLibrarian(ObjectRepository)
ref(BitVector) ref(Boolean) ref(Brick) ref(Character)
ref(Complex) ref(Date) ref(Dictionary) ref(Directory)
ref(FltVector) ref(Function) ref(IntVector) ref(Lambda)
ref(List) ref(Matrix) ref(NumMatrix) ref(NumVector)
ref(Number) ref(ObjVector) ref(ObjectRepository) ref(PcodeVector)
ref(ShortVector) ref(String) ref(Structure) ref(Symbol)
ref(Vector) ref(Void) send(BitVector) send(Boolean)
send(Brick) send(Character) send(CpxVector) send(Date)
send(Dictionary) send(Directory) send(FltVector) send(Function)
send(IntVector) send(Lambda) send(List) send(Matrix)
send(NumMatrix) send(NumVector) send(Number) send(ObjectRepository)
send(Pair) send(ShortVector) send(String) send(Structure)
send(Symbol) send(Vector) send(Void) setq(BitVector)
setq(Boolean) setq(Brick) setq(Character) setq(Date)
setq(Dictionary) setq(Directory) setq(FltVector) setq(IntVector)
setq(Lambda) setq(List) setq(Matrix) setq(NumVector)
setq(Number) setq(ObjVector) setq(ObjectRepository) setq(PcodeVector)
setq(ShortVector) setq(String) setq(Structure) setq(Symbol)
setq(Vector) setq(Void)

How do I contact the AIS team?

You can always talk with the AIS at aiserver.sourceforge.net.