Open
Description
(call-with-current-continuation
(lambda (return)
(begin
(display "One ")
(return #t)
(display "Two ")
#f)))
The lambda-expression evaluates to an anonymous function of one parameter. This anonymous function gets invoked by call-with-current-continuation and the parameter - here called return - gets bound to an escape procedure, i.e. a procedure value that encapsulates the current continuation. The function prints "One " and then returns #t without ever printing "Two " because the second display-expression is part of the abandoned continuation.
Metadata
Metadata
Assignees
Labels
No labels