From 294e593dd26dc15677f3f57fb8f15fdeccf95485 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 14 Dec 2009 17:51:36 +0000 Subject: [PATCH] fix overly pessimistic 'in-naturals' when an argument is supplied svn: r17292 --- collects/scheme/private/for.ss | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/collects/scheme/private/for.ss b/collects/scheme/private/for.ss index c658501b74..3035f90758 100644 --- a/collects/scheme/private/for.ss +++ b/collects/scheme/private/for.ss @@ -1004,16 +1004,15 @@ (lambda (stx) (let loop ([stx stx]) (syntax-case stx () - [[(id) (_ start)] - (and (integer? (syntax-e #'start)) - (exact? (syntax-e #'start)) - ((syntax-e #'start) . >= . 0)) + [[(id) (_ start-expr)] #`[(id) (:do-in ;; outer bindings: - () + ([(start) start-expr]) ;; outer check: - (void) + (unless (exact-nonnegative-integer? start) + ;; let `in-naturals' report the error: + (in-naturals start)) ;; loop bindings: ([pos start]) ;; pos check