Exercise 1.4. Observe that our model of evaluation allows for combinations whose operators are compound expressions. Use this observation to describe the behavior of the following procedure:
(define (a-plus-abs-b a b)
((if (> b 0) + -) a b))
题目中的过程会首先判断 b 的值,然后返回另外一个过程。b 为正则返回过程 +,b 为负则返回过程 -,然后将这个过程用到参数 a b 上。
在 scheme 中,过程也和数值一样可以作为一个过程的结果返回。