fix overly pessimistic 'in-naturals' when an argument is supplied

svn: r17292
This commit is contained in:
Matthew Flatt 2009-12-14 17:51:36 +00:00
parent 147f55b690
commit 294e593dd2

View File

@ -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