From 67dd80eb7892c7541f58dea69f5d53350e828a36 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 29 Jul 2007 18:56:32 +0000 Subject: [PATCH] changes noticed by Matthew svn: r6980 --- collects/mzlib/private/contract.ss | 17 +++-------------- collects/tests/mzscheme/contract-test.ss | 5 +---- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/collects/mzlib/private/contract.ss b/collects/mzlib/private/contract.ss index 04114abed3..b85cc910df 100644 --- a/collects/mzlib/private/contract.ss +++ b/collects/mzlib/private/contract.ss @@ -808,7 +808,6 @@ improve method arity mismatch contract violation error messages? not/c =/c >=/c <=/c /c between/c integer-in - exact-integer-in real-in natural-number/c string/len @@ -1305,8 +1304,8 @@ improve method arity mismatch contract violation error messages? [(_ 'sym x-exp) (identifier? #'sym) #'(let ([x x-exp]) - (unless (number? x) - (error 'sym "expected a number, got ~e" x)))])) + (unless (real? x) + (error 'sym "expected a real number, got ~e" x)))])) (define (=/c x) (check-unary-between/c '=/c x) @@ -1479,23 +1478,13 @@ improve method arity mismatch contract violation error messages? (x . >= . 0))))) (define (integer-in start end) - (unless (and (integer? start) - (integer? end)) - (error 'integer-in "expected two integers as arguments, got ~e and ~e" start end)) - (flat-named-contract - `(integer-in ,start ,end) - (λ (x) - (and (integer? x) - (<= start x end))))) - - (define (exact-integer-in start end) (unless (and (integer? start) (exact? start) (integer? end) (exact? end)) (error 'integer-in "expected two exact integers as arguments, got ~e and ~e" start end)) (flat-named-contract - `(exact-integer-in ,start ,end) + `(integer-in ,start ,end) (λ (x) (and (integer? x) (exact? x) diff --git a/collects/tests/mzscheme/contract-test.ss b/collects/tests/mzscheme/contract-test.ss index 7bde8f4225..84b0cdcd61 100644 --- a/collects/tests/mzscheme/contract-test.ss +++ b/collects/tests/mzscheme/contract-test.ss @@ -4133,9 +4133,7 @@ so that propagation occurs. (test-flat-contract '(>/c 5) 10 5) (test-flat-contract '(integer-in 0 10) 0 11) (test-flat-contract '(integer-in 0 10) 10 3/2) - (test-flat-contract '(exact-integer-in 0 10) 0 11) - (test-flat-contract '(exact-integer-in 0 10) 10 3/2) - (test-flat-contract '(exact-integer-in 0 10) 1 1.0) + (test-flat-contract '(integer-in 0 10) 1 1.0) (test-flat-contract '(real-in 1 10) 3/2 20) (test-flat-contract '(string/len 3) "ab" "abc") (test-flat-contract 'natural-number/c 5 -1) @@ -4355,7 +4353,6 @@ so that propagation occurs. (test-name '(>/c 5) (>/c 5)) (test-name '(between/c 5 6) (between/c 5 6)) (test-name '(integer-in 0 10) (integer-in 0 10)) - (test-name '(exact-integer-in 0 10) (exact-integer-in 0 10)) (test-name '(real-in 1 10) (real-in 1 10)) (test-name '(string/len 3) (string/len 3)) (test-name 'natural-number/c natural-number/c)