next up previous contents index
Next: Adding two numbers: add Up: Arithmetic Operations Previous: Arithmetic Operations   Contents   Start


compose


(define compose 
   (lambda (f g)
      (lambda (x)
         (f (g x)))))

This abstraction is a functional utility abstraction which makes addition and multiplication of Church Numerals a simple task, even if the understanding of this code might not be that easy. `compose' belongs to the category of `higher order functions' because it takes functions as arguments and returns a new function composed of the two arguments. See also section basic:compose.

Georg P. Loczewski 2004-03-05


Impressum und Datenschutz