double(x) = x * 2;
dd(a, b) = a + b;
double(5) + add(2, 3)
Expected Behavior
- Functions can be defined using a lightweight syntax (e.g. fn name(params) = expression)
- Functions are scoped locally to the expression
- Functions can be reused within the same expression
- No global state pollution unless explicitly allowed
- Backward compatible with existing expressions
🧪 Use Cases
- Dynamic computed fields in UI grids
- Configuration-driven formula systems
- Data transformation pipelines
- Business rule engines
- Reducing duplication in expression-heavy systems
🔄 Alternatives Considered
- External function registry (already supported but not inline)
- Preprocessing expressions before evaluation
- Migrating to AST-based engines such as mathjs
- Wrapping expressions in custom evaluation layers
⚠️ Migration / Compatibility Notes
- Feature should be opt-in (e.g. allowInlineFunctions: true)
- Existing expressions must continue working without changes
- Invalid inline function syntax should fail gracefully when disabled
Expected Behavior
🧪 Use Cases
🔄 Alternatives Considered