vjovanov/mpde — pull request #11 by vsalvis (2013-07-30 16:00:17+00:00)
Title: Flexible per-variable guards, fixed size code cache

The DSL author can provide custom guard functions defining when recompilation is triggered. The functions are per variable, and compose automatically. Added EvenOddOptimizedPrintDSL as example, where compilation only cares about parity.

Changed taxonomy of variables. The requiredHoles() function is now called compilationVars(), since it returns the variables that are needed for compilation together with their guards. There are static and dynamic compilationVars, also marked by their guards. Static is what we had before, dynamic are lifted and holes at the same time, so the lifted value is available at code generation time (e.g. to decide between even and odd), but the generated code then contains the hole so that the different values are picked up. So this is the hierarchy of variables:
allCaptured - nonCompilVars -> hole
- compilVars - static -> lift(value)
- dynamic -> lift(value, hole)

Added a simple code cache of static size, with test.