Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 354 Bytes

1.4.md

File metadata and controls

14 lines (9 loc) · 354 Bytes

1.4

Question

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))

Answer

a-plus-abs-b implements $f(a, b) = a + |b|$ by passing procedures as data.