JEval Update
Since my JEval open source project was released on February 21, 2007, it has been downloaded 464 times. Far from staggering numbers. I doubt I will writing a book on it anytime soon. However, shortly after the release I got some positive feedback, which was cool and its still nice to see downloads every week.
What does JEval do you ask? Its a simple, lightweight functional expression parser and evaluator. And It has NO dependencies to any other libraries.
A few quick code examples:
Evaluator evaluator = new Evaluator();
String result = null;
// A mathematical expression.
result = evaluator.evaluate(”4 + (3 * 1) - (3 + 1) + 1″);
System.out.println(result);
// A built-in mathematical function.
result = evaluator.evaluate(”1 + abs(-1)”) ;
System.out.println(result);
// A string expression.
result = evaluator.evaluate(”‘A’ + ‘C’”);
System.out.println(result);
// A built-in string function.
result = evaluator.evaluate(”trim(’abc ‘) + ‘d’”);
System.out.println(result);
// A boolean expression.
result = evaluator.evaluate(”((2 < 3) || (1 == 1)) && (3 < 3)”) ;
System.out.println(result);
// A variable.
evaluator.putVariable(”a”, “‘Hello’”);
evaluator.putVariable(”b”, “‘World’”);
evaluator.evaluate(”#{a} + ‘ ‘ + #{b} + ‘!’”);
System.out.println(result);
// A nested function using a built-in mathematical function.
result = evaluator.evaluate(”atan2(atan2(1, 1), 1)”);
System.out.println(result);
// A custom function.
evaluator.putFunction(new StringReverseFunction());
result = evaluator.evaluate(”stringReverse(’Hello World!’)”);
System.out.println(result);
Download here.
Who Would Have Thunk
Craig McClanahan, the creator of Struts and Java Server Faces, is singing the praises of Ruby on Rails. This is awesome PR for Rails, that’s for sure.