Dreams.
Tim Peters
tim_one at email.msn.com
Sun Jul 11 02:13:11 EDT 1999
[Ben Caradoc-Davies]
> Hmmm. I'm not sure what your background is, Scott, but you may
> not be aware of some previous work --- the term you may be looking
> for is "continuation". ...
I don't think so. Continuations capture control-flow state but Scott is
aiming to dream away <wink> changes in data state. Bindings aren't saved or
restored by continuations:
(define cont #f)
(define (test)
(let ((i 0))
(call/cc
(lambda (k)
(set! cont k)))
(set! i (+ i 1))
(print i) (newline)))
Then:
> (test)
1
> (cont)
2
> (cont)
3
> (cont)
4
>
Indeed, if bindings *were* restored, invoking a saved continuation couldn't
do anything other than repeat what it did the first time it ran <wink>.
Fully agreed that SICP is a great book, and functional languages (of which
Scheme is not one) are worth learning too, but Scott has a harder problem in
mind than continuations alone can solve.
you-just-don't-see-many-functional-databases-these-days<wink>-ly y'rs - tim
More information about the Python-list
mailing list