Hi,

Let's have a lambda expression:

x->y->x-y

Let's now assign it and invoke it indirectly:

f = x->y->x-y; f(2)(1)

>From the spec we have:

"If the result of evaluating the function name is a LambdaExpression, the
LambdaExpression is invoked with the supplied arguments. If the result of
evaluating the LambdaExpression is another LambdaExpression, and the syntax
contains repeated function invocations, such as func()()..., then the
resultant LambdaExpression is in turn evaluated, and so on."


During evaluation I'm receiving ParseException:

javax.el.ELException: Failed to parse the expression [${(f = x->y->x-y;
f(2)(1)}]
at
org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:143)
at org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:169)
at
org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:230)
at
org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:68)
at javax.el.ELProcessor.getValue(ELProcessor.java:43)
...
Caused by: org.apache.el.parser.ParseException: Encountered " "(" "( "" at
line 1, column 23.
Was expecting one of:
    "." ...
    ")" ...
    "[" ...
    ";" ...
    ">" ...
    "gt" ...
    "<" ...
    "lt" ...
    ">=" ...
    "ge" ...
    "<=" ...
    "le" ...
    "==" ...
    "eq" ...
    "!=" ...
    "ne" ...
    "&&" ...
    "and" ...
    "||" ...
    "or" ...
    "*" ...
    "+" ...
    "-" ...
    "/" ...
    "div" ...
    "%" ...
    "mod" ...
    "+=" ...

at org.apache.el.parser.ELParser.generateParseException(ELParser.java:3083)
at org.apache.el.parser.ELParser.jj_consume_token(ELParser.java:2965)
at org.apache.el.parser.ELParser.NonLiteral(ELParser.java:1539)
at org.apache.el.parser.ELParser.ValuePrefix(ELParser.java:1369)


Regards
Violeta

Reply via email to