4 ms·
> When a blocking operation is invoked, Jactl creates a Continuation object that captures the state of the running script such as the value of all local variabl
by gus_massa 3y ago
> When a blocking operation is invoked, Jactl creates a Continuation object that captures the state of the running script such as the value of all local variables and the current call stack. When the long-running operation completes, the script state is restored and the script continues from where it left off.
I don't understand this. Is it possible that some code runs twice? (I know continuations from Racket/Scheme, but perhaps I'm misunderstanding the implementation.)
a = slow(7)
print(5)
somethingelse()
print(a)
Can 5 be printed twice?
- jaccomo 3y agoThe continuation is only invoked once when a blocking operation completes so the print(5) would only be run once.