Even though I’ve done this for years, this still gets me at times (because I come from a functional programming background.)
As far as I can tell:
A “variable node” is a reference to the VARIABLE, not to the VALUE of that variable.
A “return slot” from a pure function, is a reference to invoking that pure function.
However, a “return slot” from a function node with sequence connector, is a cache of the value. That cache is valid only for a current synchronous invocation – in an event graph, the return value of one node is not available if the control flow involves some other event or delay node.
Thus, any node with a sequence connector (white control flow) will be calculated only once (when the execution flow gets there,) but any node that’s “pure” will be re-evaluated for each user.
EXCEPT: The “store value to variable” node, has a sequence connector, but re-evaluates the variable each time, because it’s really a combination of a sequenced “store the value” and a pure “read the value” operation.
They could have made this a lot clearer when they started out, if they had done a little more research into previous dataflow and functional programming systems, or, if they did the research, learned some different lessons, but, hey, here we are!
(And even though I think the above are the rules – I may still be getting something wrong. I haven’t seen the semantics of time-of-evaluation and duration-of-cached-value actually written out as a clear rule anywhere. If that exists, please, I’d love to see it!)