[archives] [homepage]

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

SICP Exercise 2.27

This implementation makes use of the reverse procedure defined earlier in 2.18.

(define (deep-reverse x)
  (if (pair? x)
      (append (deep-reverse (cdr x))
              (list (deep-reverse (car x))))
      x))