You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, I have an ExpressionContext owner that has a concept of a DateTime as part of its instance data. I'm trying to write an expression such as:
metric(123) - yesterday(metric(123))
Where metric() is a function that performs a query, using the current date as an input. When the runtime hits the yesterday outer function, I'd like to modify the owner's instance data before the inner expression is evaluated, and then restore it when the inner expression is complete. (Basic push/pop behavior)
Does Flee support this kind of behavior?
The text was updated successfully, but these errors were encountered:
so, the compiled expression would generate something like this:
load 123
call metric
load 123
call metric
call yesterday
subtract
"Yesterday" is the next to last thing evaluated, after metric has completed. Flee isn't really designed to change state, so modifying a variable in the middle of evaluating the expression may have unpredictable results.
But, if you wanted to try, you'd have to put a method inside the call to metric:
yesterday(pop(metric(push(123))))
you'd implement your push/pop methods to change the owner value and return whatever was passed to it.
In this example, I have an ExpressionContext owner that has a concept of a DateTime as part of its instance data. I'm trying to write an expression such as:
metric(123) - yesterday(metric(123))
Where
metric()
is a function that performs a query, using the current date as an input. When the runtime hits theyesterday
outer function, I'd like to modify the owner's instance data before the inner expression is evaluated, and then restore it when the inner expression is complete. (Basic push/pop behavior)Does Flee support this kind of behavior?
The text was updated successfully, but these errors were encountered: