I see that both SML/NJ and MLTon provide continuations, however
their usage is somewhat different than in Scheme. Can somebody
provide a translation of the following toy Scheme program into SML?
(define-macro (store/cc! name . body)
(let ((k (gensym)))
`(call-with-current-continuation
(lambda (,k) (set! ,name ,k) ,@[EMAIL PROTECTED]
))))
(define cont #f); make room for the continuation
(display (+ 1 (store/cc! cont 0))) ;=> displays 1
(cont 1) ;=> displays 2
That would help me quite a lot in figuring out the correspondence
Scheme <-> SML. TIA,
Michele Simionato