Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; Rectangle=?: Rectangle Rectangle-> boolean
- ;; Given two Rectangles, produces whether they are
- ;; the same.
- (define (Rectangle=? a-Rectangle b-Rectangle)
- (and (posn=? (Rectangle-tl-corner a-Rectangle)
- (Rectangle-tl-corner b-Rectangle))
- (= (Rectangle-width a-Rectangle)
- (Rectangle-width b-Rectangle))
- (= (Rectangle-height a-Rectangle)
- (Rectangle-height b-Rectangle))
- (string=? (Rectangle-clr a-Rectangle)
- (Rectangle-clr b-Rectangle))))
- (check-expect (Rectangle=? R1 R2) false)
- (check-expect (Rectangle=? R2 R3) true)
Add Comment
Please, Sign In to add comment