fix bug in error checking code

This commit is contained in:
Robby Findler 2012-11-26 07:54:50 -06:00
parent 569af52ffc
commit ba89a5da92

View File

@ -42,12 +42,14 @@
(define-struct rectangle (left top right bottom style color) #:inspector #f)
(define (build-rectangle left top right bottom style color)
(unless (or (symbol? right) (symbol? left))
(when (right . < . left)
(error 'build-rectangle "found right to the right of left: ~s"
(list left top right bottom style color)))
(list left top right bottom style color))))
(unless (or (symbol? top) (symbol? bottom))
(when (bottom . < . top)
(error 'build-rectangle "found bottom above top: ~s"
(list left top right bottom style color)))
(list left top right bottom style color))))
(make-rectangle left top right bottom style color))