20-CS-4003-001 Organization of Programming Languages Fall 2017
Lambda

Lambda calculus, Type theory, Formal semantics, Program analysis

    Prev     Next     All lectures           Code

Lambda - Y Combinator

(define y-combinator
  (lambda (rec-fun)
    ((lambda (rec-gen) (rec-gen rec-gen))
     (lambda (rec-gen) 
       (rec-fun 
         (lambda (arguments) 
           ((rec-gen rec-gen) arguments)))))))

(define y-combinator
  (lambda (c)
    ((lambda (f)
       (lambda (a)
         ((f f) a))) c)))
				 
(define y-combinator
  (lambda (func)
    ((lambda (k) (k k)) func)))
 -  There is not just one way to implement the Y-combinator. These are examples that came from some students at UC.