ILCalc v0.9.4.0

Rating:        Based on 1 rating
Reviewed:  0 reviews
Downloads: 133
Released: Jul 17, 2009
Updated: Jul 24, 2009 by Pelmen64
Dev status: Stable Help Icon

Recommended Download

Source Code Source Code
source code, 273K, uploaded Jul 17, 2009 - 32 downloads

Other Available Downloads

Application Library (.NET 2.0)
application, 99K, uploaded Jul 17, 2009 - 18 downloads
Application Library (.NET CF 2.0)
application, 77K, uploaded Jul 17, 2009 - 12 downloads
Application Library (.NET CF 3.5)
application, 78K, uploaded Jul 17, 2009 - 12 downloads
Application Library (Silverlight 2.0)
application, 78K, uploaded Jul 17, 2009 - 11 downloads
Documentation Documentation
documentation, 408K, uploaded Jul 17, 2009 - 22 downloads
Example Demo Application
example, 129K, uploaded Jul 17, 2009 - 26 downloads

Release Notes

New release, focused on instance calls support and some library design improvements.

Changes:
  • Engine: support for instance method calls!
  • Engine: support for DynamicMethod calls!
  • Engine: faster literals names lookup.
  • Solution: global design improvements.
  • CalcContext: collection properties now read-only.
  • Collections: AddRange() methods.
  • Collections: rename 'FunctionDictionary' back to 'FunctionCollection' and now doesn't implement IDictionary interface.
  • Collections: FunctionCollections re-design.
  • Collections: no public constructors in FunctionGroup.
  • Engine: compilation is now 2-pass.
  • Bugfix: not valid tabulation when >3 ranges.
  • Bugfix: added some forgotten arguments checks.
  • Solution: new pack of unit tests.

Instance call support adds ability to import ILCalc-generated methods into context and compose them in other expressions:

private static void Main( )
{
	// initialize context:
	var calc = new CalcContext("x");
	calc.Functions.Add(Math.Sin);
	calc.Functions.Add(Math.Cos);

	// compile evaluator and add to context:
	Evaluator eval1 = calc.CreateEvaluator("2sin(x)");
	calc.Functions.Add("dsin", eval1.Evaluate1);

	// create interpreter and add to context:
	Interpret intr = calc.CreateInterpret("dsin(x) + 4");
	calc.Functions.Add("dsinplus4", (EvalFunc1) intr.Evaluate);

	// evaluate some expression with argument x = pi / 2:
	double result = calc.Evaluate("(dsinplus4(x) - 4) / 2", Math.PI / 2);

	Console.WriteLine("result = {0}", result); // writes 'result = 1'
}
In the code above, last evaluation causes the interpreter to evaluate "dsin(x) + 4" by calling compiled method for evaluating "2sin(x)"!
And it is possible now to use lambda expressions / anonymous methods with closures!

Known bugs:
  • Missed some methods check while importing.
  • Interpret may use wrong targets for instance calls (when expression contains more than one call of the same method, but with the different targets).

Reviews for this release