Combining engine and dynamic variables

Apr 3, 2010 at 4:52 PM


Sorry if my question is naive, but I can't find out how to create an engine that accepts "dynamic variables" as entries.

What I would like to do is the following:

  • Add a series of expressions to an engine
  • Add a series of variables to the engine
  • Compile the engine (to become a mega-function)
  • At runtime:
    • Provide the variables' values
    • Get the result of the compiled engine

The twist is that I don't want to re-compile the engine each time I change one of the variable's value.

Could someone give me a hint on how to do this?

Thanks in advance!

May 16, 2010 at 2:34 AM


This Might Be what you are looking for

Search for 

Custom Expression Engine for Payroll

Discussion, as I Used this Library for a payroll Engine,


Best Regards

Arturo Ruvalcaba

May 16, 2010 at 7:39 AM

Hi aruvalcaba,

Thanks for your answer, it finally helped me.

I could tremendously speed up the engine by asking to recalculate the topmost variable instead of the lowermost one. I never anticipated this would impact the engine speed to such extend.

In my case, I don't know the order in which the expressions have to be evaluated but I do know what are the input (lowermost) variables and the output (topmost) ones. The Flee engine is therefore very handy as it allows to not care about the order of the expressions, while still benefiting from the Flee performance at each re-evaluation of the output variables.

This piece of code is a very nice one... Is it still supported by eciloci?