From ad2e8ac54e1a2594be9dbbf5d101723fa9b46cc0 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Wed, 28 Nov 2012 09:55:35 -0600 Subject: [PATCH] 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. --- collects/mred/private/wxpanel.rkt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/collects/mred/private/wxpanel.rkt b/collects/mred/private/wxpanel.rkt index 471fe6c906..1fd00cfdc7 100644 --- a/collects/mred/private/wxpanel.rkt +++ b/collects/mred/private/wxpanel.rkt @@ -468,15 +468,21 @@ (if hidden-child (- height (child-info-y-min (car children-info))) ;; 2-pixel border here, too height))]) + (define expected-length (- (length children-info) (if hidden-child 1 0))) (unless (and (list? l) - (= (length l) (- (length children-info) (if hidden-child 1 0))) + (= (length l) expected-length) (andmap (lambda (x) (and (list? x) (= 4 (length x)) - (andmap (lambda (x) (and (integer? x) (exact? x))) x))) + (andmap exact-integer? x))) l)) - (raise-arguments-error 'container-redraw - "result from place-children is not a list of 4-integer lists with the correct length" - "result" l)) + (raise-arguments-error + 'container-redraw + (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 (cons (list 0 0 width height) (let ([dy (child-info-y-min (car children-info))])