huangzworks / SICP-answers

我的 SICP 解题集

Home Page:http://sicp.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

练习1.10

KushNee opened this issue · comments

commented

不知道什么原因,书中示例和维基百科上关于阿克曼函数的定义是不一致的。我修改了代码,但是不知道是否正确,希望能有人看一下。

(define (A x y)
    (cond ((= y 0) (A (- x 1) 1))
        ((= x 0) (+ y 1))
        (else (A (- x 1) (A x (- y 1)))))
)