Whilst reviewing answers in the Late Answers queue I came across an answer on this question:
Could someone of you show me how to effectively use "Scripting Engine" inside Java?
What are all the right use-case to use scripting engine?
Is there any open source project using "Scripting Engine"?
One thing comes to mind is "Closure, Functional programming" support is possible, but it is more of technical use than "Application Requirement"
Edit Added: Configurable, Plugins are ok. But still so many patterns (visitor, decorator) on high level can do the same.
I don't know the requirement well... how effectively it could be used in J2EE patterns... where it could complement with the existing patterns.
Moreover I would like to see more answers with some business usecases may be like finding complex discount for a product during sale based on membership or location. finding ranking for a complex algorithm. Especially why not java in some scenario? (or C# in .Net world)
The question is now quite old and back then it may have been on topic however according to the guidelines now I feel this if off-topic falling under:
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
It may also be considered too broad.
The answer:
You should use Math.pow(2,3) instead of using cap symbol.
So the final syntax will be like,
engine.eval("print((5 * Math.pow(2,3) + 2 * 3 % 2) * 4)");
To me this doesn't do anything to answer the question so I did flag as NAA leaving a comment for the OP.
Should this question be closed as such so no other answers can be added? As in my opinion this question is off-topic and/or too broad which doesn't lend itself to attracting good answers.
I don't believe this question is a duplicate of this question. My issue isn't understanding too broad. My issue is should we close this specific question? Commenting on the question and asking them to be more specific would seem senseless given the age of it and that it has existing answers.