The embed / url function is the argument of the response generator:
(define (response-generator embed/url) ...)
(send/suspend/dispatch response-generator), :
1. a procedure `p` given a "continuation" (here next-number-handler)"
generates an url
2. the function `response-generator` is called with `p` as argument.
3. the page `(html ... ,(embed-url next-number-handler)) is generated
(note: (embed-url next-number-handler) calls `p` and the resulting url is inserted into the page)
4. [send] the page is sent to the client
5. [suspend] the server suspends the program
6. [dispatch] receives an request generated by clicking link whose url were
generated in 3. The handler associated to the url
(here next-number-handler) is looked up, and the handler
is called.
send/suspend/dispatch, :
(define (send/suspend/dispatch response-generator )
(let/ec escape
(define (callback->url callback)
(let/ec return-url
(escape (callback (send/suspend return-url)))))
(send/back (response-generator callback->url))))