Lecture overview -- Keyboard shortcut: 'u'  Previous page: The idea of currying -- Keyboard shortcut: 'p'  Next page: Examples of currying -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home    Lecture 4 - Page 22 : 34
Functional Programming in Scheme
Higher-order Functions
Currying in Scheme

It is possible to generate curried functions in Scheme.

But the parenthesis notation of Lisp does not fit very well with the idea of currying

(define (curry2 f)
  (lambda(x)
    (lambda(y)
      (f x y))))

(define (curry3 f)
  (lambda(x)
    (lambda(y)
      (lambda(z)
       (f x y z)))))

(define (uncurry2 f)
  (lambda (x y)
    ((f x) y)))

(define (uncurry3 f)
  (lambda (x y z)
    (((f x) y) z)))

Generation of curried and uncurried functions in Scheme.

Go to exercisePlaying with curried functions in Scheme