Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2.1
-
None
Description
WHAT:
It is often convenient to reuse pieces of code in multiple places. This is easy to do with namespaces and Java classes (or objects) but impossible through scripts. The workaround Is to use maps that contain the various functions and use an object but it requires re-evaluating the script each time this is needed which is costly.
Ideally, there should be a way to declare a namespace whose bound object would be the result of the evaluation of JEXL code.
HOW:
By adding a new pragma imaginatively called 'module' behaving as namespace declaration but whose value must be an expression (as a string) that will be evaluated during pragma processing.
One important usage warning here is the idem-potence of the expression whose result should be stable to avoid any bizarre behaviour.
Attachments
Issue Links
- links to