EvalEx 3.0 early preview #291
Replies: 2 comments 1 reply
-
I didn't have much time to look at it, but I'm not a friend of annotations. If they are there to allow lambda/method-reference expressions, I'd rather like to see factory methods for expressions than annotations. Or did I misunderstand why you went for annotations? |
Beta Was this translation helpful? Give feedback.
-
Is #156 something to be considered in the rewrite? I've a PoC library that distinguishes the language (the operators, global functions and constants) from a parsed expression (parsed AST, referenced variables and used language) and the expression factory. Thus, Language language = new LanguageBuilder()
.addOperators(CommonOperators.PEMDAS)
.addFunctions(new Function(
"successor",
/* parameters */ 1,
(es, parameters) -> parameters[0].add(BigDecimal.ONE))
)
.build();
Expression exp = language.parseExpression("a + b + successor(b)", new SyntaxTreeInterpreter(language));
Map<String, BigDecimal> scope = Map.of(
"a", BigDecimal.TEN,
"b", BigDecimal.ONE
);
EvaluationSettings settings = new EvaluationSettings(MathContext.DECIMAL32, /* stripTrailingZeros */ true, /* requireAllVariablesInScope */ false);
exp.eval(settings, scope);
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I have just published the source code for the upcoming version 3 of EvalEx.
For version 3, I will move the project to a new repository location: https://github.com/ezylang/evalex-core
Version 3 is not release ready by now, but I think the main work has been done and only some bells and whistles are missing for the release.
At this point in the project, I therefore would like to share the code with you. Hopefully to get some feedback.
Version 3 is a complete rewrite from scratch and I took the opportunity of a new major version to:
The existing unit tests provide a code coverage of 100%, but this does not mean that there are no bugs. ;-)
I expect some bugs, especially when it comes to more complex and rare use cases. Testers and bug reports are welcome!
Contributions are also very much appreciated.
General discussion about concepts, features etc. should be started at the new location in the discussion area
For bugs, please open an issue.
More administrative things like CI/CD and Sonar code analysis etc. will come soon.
Some things that are missing:
Beta Was this translation helpful? Give feedback.
All reactions