Skip to content

Instantly share code, notes, and snippets.

@mmitou
Created February 26, 2015 06:44
Show Gist options
  • Select an option

  • Save mmitou/2fe0ad856d322494ed13 to your computer and use it in GitHub Desktop.

Select an option

Save mmitou/2fe0ad856d322494ed13 to your computer and use it in GitHub Desktop.
(define (plus3 x y)
(+ (+ x y) 3))
(define (plus3&co x y co)
(let ((plus&co (lambda (x y co)
(co (+ x y)))))
(plus&co x y (lambda (z)
(co (+ z 3))))))
(plus3&co 1 2 (lambda (x) x))
(define (x^2_plus_y^2 x y)
(+ (* x x) (* y y)))
(define (x^2_plus_y^2&co x y co)
(let ((p2&co
(lambda (x co0) (co0 (* x x)))))
(p2&co x (lambda (x^2)
(p2&co y (lambda (y^2)
(co (+ x^2 y^2))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment