Package io.prestosql.sql.tree
Class BindExpression
- java.lang.Object
-
- io.prestosql.sql.tree.Node
-
- io.prestosql.sql.tree.Expression
-
- io.prestosql.sql.tree.BindExpression
-
public class BindExpression extends Expression
"$INTERNAL$BIND"(value, targetFunction)When invoked, the returned function inserts the given value as the leading argument to the targetFunction. The other arguments are passed unchanged.
Bind is fundamentally first class, just like function applications. It requires special treatment from the type system. There is no way to write out the type of `bind`. The return type of `bind` is function. Its type looks somewhat like:
- X, (X) -> Y => () -> Y
- X1, (X1, X2) -> Y => (X2) -> Y
- X1, (X1, X2, X3) -> Y => (X2, X3) -> Y
- X1, (X1, X2, X3, X4) -> Y => (X2, X3, X4) -> Y
- ...
Lambda capturing is implemented through desugaring in Presto. This expression facilitates desugaring.
-
-
Constructor Summary
Constructors Constructor Description BindExpression(NodeLocation location, java.util.List<Expression> values, Expression function)BindExpression(java.util.List<Expression> values, Expression function)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,C>
Raccept(AstVisitor<R,C> visitor, C context)Accessible forAstVisitor, useAstVisitor.process(Node, Object)instead.booleanequals(java.lang.Object o)java.util.List<Node>getChildren()ExpressiongetFunction()java.util.List<Expression>getValues()inthashCode()-
Methods inherited from class io.prestosql.sql.tree.Expression
toString
-
Methods inherited from class io.prestosql.sql.tree.Node
getLocation
-
-
-
-
Constructor Detail
-
BindExpression
public BindExpression(java.util.List<Expression> values, Expression function)
-
BindExpression
public BindExpression(NodeLocation location, java.util.List<Expression> values, Expression function)
-
-
Method Detail
-
getValues
public java.util.List<Expression> getValues()
-
getFunction
public Expression getFunction()
-
accept
public <R,C> R accept(AstVisitor<R,C> visitor, C context)
Description copied from class:ExpressionAccessible forAstVisitor, useAstVisitor.process(Node, Object)instead.- Overrides:
acceptin classExpression
-
getChildren
public java.util.List<Node> getChildren()
- Specified by:
getChildrenin classNode
-
-