Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [epsilon-dev] Epsilon lambdas and ANTLR 3.2

Hi Sina,

Thanks for your work on this! Just one thing: I see that we check the number of arguments and that we seem to use proxy instances for the various parameter values, but I don't see any check on the actual types. Shouldn't we check the types of the parameters as well?

I suppose you are taking advantage of the fact that functional interfaces in Java should really only have one method, but at least we could complain when somebody tries to pass the wrong type to the functional interface.

Kind regards,
Antonio


On Fri, 2 Nov 2018 at 15:10, Sina Madani <sinadoom@xxxxxxxxxxxxxx> wrote:

Hi all,

 

In the “lambda-support” branch, I have fixed Bug 464793 [1] by changing the manifest of org.eclipse.epsilon.dependencies to depend on org.antlr.runtime version 3.2.0.

 

Furthermore, I have also added capabilities to use first-order operation call _expression_ syntax to invoke functional interfaces on native types. Examples of this can be found in org.eclipse.epsilon.eol.engine.test.acceptance.firstOrder.lambda.LambdaExpressionTest.eol, which demonstrates the use Functions, Predicates, BiFunctions, Suppliers and Consumers.

I managed to get around modifying the EOL grammar to support Suppliers by using the underscore to signify a non-parameter. This will only affect lambda expressions on native types, not existing first-order operation expressions.

 

For anyone interested in the implementation, please see org.eclipse.epsilon.eol.execute.operations.DynamicOperation and org.eclipse.epsilon.eol.dom.FeatureCallExpression#getAbstractOperation.

 

If there are no objections or suggestions, I propose to merge these changes into the main branch and also document this on the website and/or Epsilon book.

 

Thanks,

Sina

 

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=464793

 

_______________________________________________
epsilon-dev mailing list
epsilon-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/epsilon-dev


--
Antonio Garcia-Dominguez

Back to the top