Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct answer for 22.8 to reflect original text #192

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions docs/chapter22.md
Original file line number Diff line number Diff line change
Expand Up @@ -1127,13 +1127,10 @@ Explain how this would be done both for the first version of the interpreter and
**Answer 22.2** There is no way to implement a full `call/cc` to Common Lisp, but the following works for cases where the continuation is only used with dynamic extent:

```lisp
(defun call/cc (cc computation)
"Make the continuation accessible to a Scheme procedure."
(funcall computation cc
;; Package up CC into a Scheme function:
#'(lambda (cont val)
(declare (ignore cont))
(funcall cc val))))
(defun call/cc (computation)
"Call the computation, passing it the current continuation.
The continuation has only dynamic extent."
(funcall computation #'(lambda (x) (return-from call/cc x))))
```

**Answer 22.3** No.
Expand Down