lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>      I'm not sure I'm following you. Continuations have state, just
> like closures do, in the form of local variables and lexically-scoped
> variables.

When you capture a continuation you capture its local variables, not the
current values of these variables (at least in Scheme). If you modify
a local variable and later call the captured continuation, the variable
does not "roll back" to its value when the continuation was saved.

But more important, as Mike Pall just pointed out, is that real programs
in non-functional languages have lots of state outside its local
variables (globals, mutable objects, files, etc.). None of them are part
of a continuation.

-- Roberto