Idea recursion function 

Forum: Com Sci 221, U Chicago, Autumn 2001, Discuss Classwork
Date: 2001, Nov 16
From: Ben Wolfson wolfson

Professor O'Donnell mentioned in class a function which encapsulates the concept of recursion. I tried to come up with it from memory, and I got
(define Y
  (lambda (f)
    (lambda (x)
      (f f x))))

Then to, e.g., compute n! recursively, you would have to do
((Y (lambda (f x)
      (if (= x 1)
          1
          (* x (f f (- x 1))))))
 n)

So I'm wondering if that's the correct definition of the function.


Messages

1. None as combinators by Ben Wolfson, 2001, Nov 17

to: "recursion function"