McCarthy 91 function by frob

(letrec
  ((x
     (lambda (s n)
       (if (> n 0)
         (begin
           (display s)
           (x s (- n 1))))))
   (l
     (lambda (d n)
       (x "M(" d) (display n) (x ")" d) (newline)
       (if (> d 0)
         (if (> n 100)
           (l (- d 1) (- n 10))
           (l (+ d 1) (+ n 11)))))))
  (l 1 (read)))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page