Created
January 8, 2021 02:12
-
-
Save yanfeng42/61b03e4cc669415298f7471354b0be07 to your computer and use it in GitHub Desktop.
sicp 1.5 检测 解释器 是 正则序还是应用序求值
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (p) (p)) | |
(define (test x y) | |
(if (= x 0) | |
0 | |
y) | |
) | |
; 应用序求值(先求值参数而后应用), 会陷入死循环; 正则序求值(完全展开而后归约), 会输出0. | |
(test 0 (p)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
已知的, 应都是 应用序求值, 期待遇到 正则序解释器的一天.
究竟是什么实际场景下, 正则序会更有价值呢?