fix error check on the result of place-children

The main problem is that it asked exact? on an unknown
value and exact? works only on numbers.

But since I was here, also try to clarify the error message a bit.
This commit is contained in:
Robby Findler 2012-11-28 09:55:35 -06:00
parent 52d0b7e352
commit ad2e8ac54e

View File

@ -468,15 +468,21 @@
(if hidden-child (if hidden-child
(- height (child-info-y-min (car children-info))) ;; 2-pixel border here, too (- height (child-info-y-min (car children-info))) ;; 2-pixel border here, too
height))]) height))])
(define expected-length (- (length children-info) (if hidden-child 1 0)))
(unless (and (list? l) (unless (and (list? l)
(= (length l) (- (length children-info) (if hidden-child 1 0))) (= (length l) expected-length)
(andmap (lambda (x) (and (list? x) (andmap (lambda (x) (and (list? x)
(= 4 (length x)) (= 4 (length x))
(andmap (lambda (x) (and (integer? x) (exact? x))) x))) (andmap exact-integer? x)))
l)) l))
(raise-arguments-error 'container-redraw (raise-arguments-error
"result from place-children is not a list of 4-integer lists with the correct length" 'container-redraw
"result" l)) (format
(string-append
"result from place-children is not a list of length ~a (matching the"
" input list length) whose elements are lists of length 4 of exact integers")
expected-length)
"result" l))
(panel-redraw children children-info (if hidden-child (panel-redraw children children-info (if hidden-child
(cons (list 0 0 width height) (cons (list 0 0 width height)
(let ([dy (child-info-y-min (car children-info))]) (let ([dy (child-info-y-min (car children-info))])