思考如下表达式:
(cond (p1 (some_complex_expression1))
(p2 (some_complex_expression2))
(p3 (some_complex_expression3))
...
(else (some_complex_expressionN)))
那些(some_complex_expressionX)
是按需评估的吗?(即 '(some_complex_expressionX)' 仅在其自身之前的谓词为真时才被评估pX
)或者,它们是否遵循应用顺序(在尝试谓词之前,它们以某种方式尽可能多地被评估)
如果那是依赖于实现的,那么下面的实现呢?
mit-scheme
guile
racket
that scheme for sicp
r5rs