Guest User

Untitled

a guest
May 20th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. ;; Rectangle=?: Rectangle Rectangle-> boolean
  2. ;; Given two Rectangles, produces whether they are
  3. ;; the same.
  4. (define (Rectangle=? a-Rectangle b-Rectangle)
  5. (and (posn=? (Rectangle-tl-corner a-Rectangle)
  6. (Rectangle-tl-corner b-Rectangle))
  7. (= (Rectangle-width a-Rectangle)
  8. (Rectangle-width b-Rectangle))
  9. (= (Rectangle-height a-Rectangle)
  10. (Rectangle-height b-Rectangle))
  11. (string=? (Rectangle-clr a-Rectangle)
  12. (Rectangle-clr b-Rectangle))))
  13.  
  14. (check-expect (Rectangle=? R1 R2) false)
  15. (check-expect (Rectangle=? R2 R3) true)
Add Comment
Please, Sign In to add comment