by seanmcdirmid · 12y ago · 0 comments
Well, I guess it does fit the requirements of live coding.
I don't know what you mean. Could you give an example of this? What would you like to be able to do?
while true:
renderP()
Now, renderP will get executed afresh each time. Assuming no static data, if you want any state at all it must be global to the loop; e.g. var state = initValue
while true:
renderP(ref state)
Immediate-mode UIs suffer from the same constraint, and really, the author is getting most of their liveness by being immediate. do
var state = init
fn renderP()
...
end
end
Depending on what you wanted the state for, I think it satisfies most of the properties you'd be missing with a persistent, not-in loop state. It wipes itself on refresh, it has a distinct owner, it can be individually refreshed just by re-evaluating everything inside the do-block, etc.