[archives] [homepage]

Problem 2.4
Friday, August 23, 2019; ago; Download .md

SICP Exercise 2.4

Using applicative-order evaluation on car:

(car (cons x y)) 
(car (lambda (m) (m x y))) 
((lambda (m) (m x y)) (lambda (p q) p)) 
((lambda (p q) p) x y) 
x 

Similarly, cdr is:

(define (cdr z)
  (z (lambda (p q) q)))