next up previous contents
Next: Running the Y-Combinator test Up: Testing the Y-Combinator in Previous: Testing the Y-Combinator in   Contents
New book on A++ and the Lambda Calculus available!

A++ Source code of Y-Combinator test program


;;; Testing the Y Combinator in A++
;;;    
(define Y
  (lambda(f)
    ((lambda(x)
       (f (x x)))
     (lambda(x)
       (f (x x)))))) 
;;
(define M
  (lambda(fac)
    (lambda(n)
      (lif (equaln n zero)
           one
           (mult n (fac (sub n one)))))))
;;
(define FAC (Y M))
;;
(ndisp! (FAC five))



Georg Loczewski 2003-08-07

Impressum und Datenschutz