Class LambdaExpression
java.lang.Object
dev.frostlake.executor.expressions.LambdaExpression
- All Implemented Interfaces:
Expression
A lambda argument to a higher-order function —
<param> -> <body> or
(<param>, …) -> <body> (e.g. x -> x + 1, (acc, val) -> acc + val). Parameter
names are kept alongside any DECLARED parameter type, which is significant: an element normally binds
as a VARIANT, so arithmetic on it yields FLOAT, while a declared type casts it first. Live-verified
on a real account: TRANSFORM([1,2], a -> a * 2) is
[2.000000000000000e+00,4.000000000000000e+00] but TRANSFORM([1,2], a INT -> a * 2) is
[2,4]. It is not evaluated on its own — TRANSFORM/FILTER/REDUCE apply
the body per array element with the parameters bound to the element (and accumulator).-
Constructor Summary
ConstructorsConstructorDescriptionLambdaExpression(List<String> parameters, List<String> parameterTypes, Expression body) -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(ExpressionVisitor<T> visitor) Accept a visitor for the visitor patterngetBody()The declared type of each parameter, positionally —nullwhere the parameter was written without one.toString()
-
Constructor Details
-
LambdaExpression
-
-
Method Details
-
getParameters
-
getParameterTypes
The declared type of each parameter, positionally —nullwhere the parameter was written without one. -
getBody
-
accept
Description copied from interface:ExpressionAccept a visitor for the visitor pattern- Specified by:
acceptin interfaceExpression
-
toString
-