Would it be feasible to add full continuation support to CMU CL?
I know there are some code walkers in existence which claim to provide
just this, e.g. the one in UncommonWeb. However, I am not aware of a
single one that would be able to provide proper call/cc semantics and
handle situations like the following correctly:
====>
(define cont '())
(let* ((a 5)
(b (call-with-current-continuation
(lambda (x) (set! cont x) (x (+ a 3)))))
(c 10))
(list a b c))
<=====
I've had a very superficial look at the multithreading code in CMUCL.
Wouldn't it be possible to use the techniques employed there just as well
to implement a good (even if maybe somewhat wasteful in terms of memory
requirements) call/cc as we all know and love it? Having dynamic-wind in
addition to call/cc would be just too good to be true. :-)
The question why I am asking is the following: I am just about to write
some logic that relies on a large body of quite efficient CMUCL code,
but requires a mild variant of nondeterministic choice as well.
Essentially, I want to express ideas like "take any combination of five
elements out of twelve, order does not matter here" and "take any
combination of three of the remaining seven there". It doesn't have to be
fast, but as the application requires some quite entangled logic, I would
be very very glad if I could shift much of that complexity to the
language by defining appropriate notions. And full continuation support
would help *a lot* there.
--
regards, [EMAIL PROTECTED] (o_
Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)