Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

练习 2.4 疑问 #60

Open
bfjei2825401 opened this issue May 9, 2019 · 1 comment
Open

练习 2.4 疑问 #60

bfjei2825401 opened this issue May 9, 2019 · 1 comment

Comments

@bfjei2825401
Copy link

大佬的答案:

(car (cons 1 2))

(car (lambda (m) (m 1 2)))          ; 展开 cons

((lambda (z) (z (lambda (p q) p)))  ; 展开 car ,代换 z
    (lambda (m) (m 1 2)))

((lambda (m) (m 1 2))               ; 代换 m
    (lambda (p q) p))

((lambda (p q) p)                   ; 代换 p
    1 2)

1

第二步 展开 car,代换 z 不是很理解,为什么把 z 变成了 lambda 表达式,而不是把 z 看作一个过程,随后是把过程 (lambda (p q) p)) 当做过程 z 的参数?

下面是我的理解:

(car (cons 1 2))

(car (lambda (m) (m 1 2)))          ; 展开 cons

((lambda (m) (m 1 2)) (lambda (p q) p)))  ; 展开 car

((lambda (p q) p)                   ; 过程参数代入 m
    1 2)

1
@wuzehao16
Copy link

大佬答案看了好久都没看懂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants