I already implemented it, so I might just drop it in anyways, but I just pushed a PR for an idea that someone asked for literally years ago: system.util.evalExpression
. I'm not sure if anyone would actually find this useful, so I figure I'll ask if anyone has strong opinions.
Usage is pretty simple; provide your expression as the first argument, and any known variables as keyword arguments; your expression can refer to them inside curly braces. Anything in curly braces that isn't a provided variable will be parsed as a tagpath.
E.G:
system.util.evalExpression("123 + {fourFiveSix} + {Realistic0}", fourFiveSix=456)
>>>
[678.6929315736934, Good, Mon Oct 10 15:52:39 PDT 2022 (1665442359536)]
I figure this could be useful to someone trying to do testing, maybe? I think the original request I saw was something related to tag import/export.