Skip to content

Instantly share code, notes, and snippets.

@Isaac-Kleinman
Created December 18, 2015 17:01
Show Gist options
  • Save Isaac-Kleinman/0712a58303f932fc84e7 to your computer and use it in GitHub Desktop.
Save Isaac-Kleinman/0712a58303f932fc84e7 to your computer and use it in GitHub Desktop.
SICP - Solution to Exercise 2.54
(define (equal? a b)
(or (and
(not (pair? a))
(not (pair? b))
(eq? a b))
(and
(pair? a)
(pair? b)
(equal? (car a) (car b))
(equal? (cdr a) (cdr b)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment