News for hackers. Stuff that matters.
Re:Why Are Continuations So Confusing, and What Do They Real... by jules on Friday March 14, 2008 @07:47PM (#137251)
State genererally means the state of mutable things. Invoking a continuation will not reset the things you mutated, it will only reset the variables to their memory locations (in fact it does not "reset", the variables are still there). It's the same as with a closure:

    (let ((x 2))
      (let ((closure (lambda () (print x))))
        (set! x 4)
        (closure))) ; prints 4 not 2
The closure doesn't remember the old value of x, it just remembers the memory location.
Re:Why Are Continuations So Confusing, and What Do They Real... by SwellJoe on Friday March 14, 2008 @10:39PM (#137340)
I never said anything about resetting variables, and in fact, I emphatically mentioned copying the stack by way of clarification. I'm surprised you would misinterpret me to be saying anything about resetting variables. I'll try to refrain from using "state" in the future, when speaking to someone that could be from a functional programming background, since it seems to be so easy to misinterpret as "variables". I wasn't aware anyone used the term "state" to mean "variables", but I come from a C-derived lineage, and may have missed that memo.

I'll also try to refrain from commenting in language weenie threads. It's not my forte.