Open
Description
The REPL is great for doing trace evaluation at low implementation cost. I was trying it out yesterday and I found it frustrating that I couldn't get the value of my def
s and val
s over the trace.
I wrote:
q::lastTrace.foldl(List(), (acc, state) => acc.append(projectState(state)))
but projectState
has to be a pure operator that manipulates the state record, since it has no actual access to read the variables from each state.
It would be great to have a more user-friendly way of evaluating/projecting traces (that is, without requiring foldl
) that allows projecting the values of def
s and val
s
Workaround
I can rewrite any def
operator as a pure def
operator that receives the state (or part of it) as a parameter, and then use the pure def
in the projection.