Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ Confessions Thread

Name: Anonymous 2015-04-26 21:07

I've never really understood the Y combinator.

Name: Anonymous 2015-04-28 3:03

>>30
Terrible!

(define (y f)
(lambda args
(apply f (cons (y f) args))))

(define factorial
(y (lambda (f n)
(if (= n 0)
1
(* n (f (- n 1)))))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List