University of Washington • CSE583 • D. Notkin © 2000
50
Simple curry example
lWe can think of any two-argument function in terms of two one-argument functions
l(plus 3 5)
l(define (plus3 x) (+ 3 x))
(plus3 5)
(plus3 17)
l(define (plus f) (lambda (g) (+ g f)))
–((plus 3) 5) ® 8
lIn essence we’ve taken a function with signature int ´ int ® int and turned it into int ® (int ® int)