next up previous contents index
Next: Running the Y-Combinator test Up: Testing the Y-Combinator in Previous: Testing the Y-Combinator in   Contents   Start

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)
      (if (equaln n zero)
           one
           (mult n (fac (sub n one)))))))
;;
(define FAC (Y M))
;;
(ndisp! (FAC five))



Georg P. Loczewski 2004-03-05


Impressum und Datenschutz