Skip to content

Instantly share code, notes, and snippets.

@monmon
Created September 26, 2012 05:24
Show Gist options
  • Select an option

  • Save monmon/3786266 to your computer and use it in GitHub Desktop.

Select an option

Save monmon/3786266 to your computer and use it in GitHub Desktop.
SICP q1.42
; p.39の脚注58より
; x |-> f(g(x))
; は
; (lambda (x) (f (g x)))
(define (compose f g)
(lambda (x) (f (g x))))
(define (square i) (* i i))
(define (inc i) (+ i 1))
(print ((compose square inc) 6)) ; 49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment