20-CS-4003-001 Organization of Programming Languages Fall 2018

Lambda calculus, Type theory, Formal semantics, Program analysis

    Prev     Next     All lectures           Code

Lambda - Y Combinator

(define fact-maker
  (lambda (procedure)
    (lambda (n)
      (if (zero? n)
          (* n ((procedure procedure) (- n 1)))))))
 -  The solution is shown to the left. Try this, for example, with
   prompt> ((fact-maker fact-maker) 5)

Well, we got the name out of the body of the procedure but we still have to pass the procedure in and so far we have been using a name to do that. So let's try to get the whole dependence on a name out.