Skip to content

Instantly share code, notes, and snippets.

@benknoble
Created February 2, 2022 19:25
Show Gist options
  • Save benknoble/0e33f876bd254deedf959c29175b51d6 to your computer and use it in GitHub Desktop.
Save benknoble/0e33f876bd254deedf959c29175b51d6 to your computer and use it in GitHub Desktop.
REPL with return
#lang racket
(define-namespace-anchor this-module)
(displayln 'start)
(displayln `(repl ,(call/ec (λ (return-k)
(parameterize ([current-namespace (namespace-anchor->namespace this-module)])
(namespace-set-variable-value! 'return return-k #f (current-namespace) #t)
(read-eval-print-loop))))))
(displayln 'end)
@benknoble
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment