Created
January 2, 2021 08:41
-
-
Save leafac/bd595f3226e9148bfcaa327b896b84d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
; call/cc : ((α → β) → α) → α | |
; call/cc : ? | |
(+ 2 3) | |
(+ 2 (call/cc (λ (continuation) 3))) | |
; call/cc : (? → ?) → Number | |
(+ 2 (call/cc (λ (continuation) (continuation 3)))) | |
; (define (continuation x) (+ 2 x)) | |
; call/cc : ((Number → ?) → ?) → Number | |
(+ 2 (call/cc (λ (continuation) (continuation 3) 6))) | |
; call/cc : ((Number → ?) → Number) → Number | |
(+ 2 (call/cc (λ (continuation) (zero? (continuation 3)) 6))) | |
(+ 2 (call/cc (λ (continuation) (string-length (continuation 3)) 6))) | |
; call/cc : ((Number → β) → Number) → Number | |
(string-append "Hello " (call/cc (λ (continuation) (zero? (continuation "World")) "NOT ME"))) | |
; call/cc : ((α → β) → α) → α | |
(write (if #t 23 "Hello")) | |
(string-append "Hello " (call/cc (λ (continuation) (zero? (continuation "World")) #f))) | |
; call/cc : ((α → β) → γ) → (α ∪ γ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment