Skip to content
Spreadsheet Engine

Lambda

new Lambda(
parameterNames,
expression,
outer?,
parameterSymbols?,
letScope?
): Lambda;

string[]

ASTRootNode

LambdaBindings | null

Map<string, LambdaParameterSymbol> | null

LambdaLetScope | null

Lambda

readonly boundArgs: Map<LambdaParameterSymbol, LambdaArg> | undefined;

readonly expression: ASTRootNode;

readonly letScope: LambdaLetScope | null;

readonly ownParameterSymbols: DefaultMap<string, LambdaParameterSymbol>;

readonly parameterNames: string[];

readonly parameterSymbols: Map<string, LambdaParameterSymbol>;
get numParams(): number;

number

argCountError(numArgs, _mode): string | null;

Why this lambda refuses a call with numArgs arguments in the given mode, as an error detail, or null where it accepts the call. A LAMBDA takes exactly its parameters; a subclass wrapping a built-in function accepts what the function’s signature in that mode accepts.

number

ModeBit

string | null


call(ctx, args): MaybeBoxedFormulaArgument;

EvaluationContext

MaybeBoxedFormulaArgument[]

MaybeBoxedFormulaArgument


callWithAST(ctx, args): MaybeBoxedFormulaArgument;

EvaluationContext

ASTNode[]

MaybeBoxedFormulaArgument


toString(): string;

string


withBoundArgs(outer?, letScope?): Lambda;

LambdaBindings | null

the parameter bindings of the enclosing lambdas

LambdaLetScope | null

the name resolution of the LET scope in which the lambda is defined

Lambda

a lambda with this one’s parameters and body, bound to outer and letScope


static fromAST(
ast,
outer?,
ctx?
): Lambda;

ASTLambdaNode

the lambda definition

LambdaBindings | null

the parameter bindings of the enclosing lambdas

EvaluationContext

the context in which the lambda is defined, to resolve names in its LET scope

Lambda

the lambda, bound to outer and to the LET scope of ctx where there is one