|
Friday, May 28, 2004 |
Factor has continuations so it would be possible to implement a continuation based web server using it. The following Scheme:
(define test #f)
(define (do-test)
(call/cc (lambda (x) (set! test x)))
(display "here") (newline))
(do-test)
=> "here"
(test #f)
=> "here"
(test #f)
=> "here"
Can be done in Factor with:
: do-test [ "test" swap put ] callcc0 "here" print ;
do-test
=> "here"
"test" get call
=> "here"
"test" get call
=> "here"
An email from Slava describes the continuations support.
3:35:03 PM
|
|
© Copyright 2005 Chris Double.
|
|
|