changed real-in to be an alias for between/c

This commit is contained in:
Robby Findler 2011-01-04 09:48:55 -06:00
parent e35603988a
commit 51ad306af2
4 changed files with 4 additions and 12 deletions

View File

@ -715,11 +715,7 @@
(unless (and (real? start)
(real? end))
(error 'real-in "expected two real numbers as arguments, got ~e and ~e" start end))
(flat-named-contract
`(real-in ,start ,end)
(λ (x)
(and (real? x)
(<= start x end)))))
(between/c start end))
(define/final-prop (not/c f)
(let* ([ctc (coerce-flat-contract 'not/c f)]

View File

@ -1,4 +1,3 @@
#lang scribble/doc
@(require "mz.rkt")
@(require (for-label syntax/modcollapse))
@ -183,10 +182,7 @@ input to be a real number between @racket[n] and @racket[m] or equal to
one of them.}
@defproc[(real-in [n real?] [m real?]) flat-contract?]{
Returns a flat contract that requires the input to be a real number
between @racket[n] and @racket[m], inclusive.}
This is an alias for @racket[between/c].}
@defproc[(integer-in [j exact-integer?] [k exact-integer?]) flat-contract?]{

View File

@ -4164,7 +4164,7 @@ 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 '(real-in 1 10) (real-in 1 10))
(test-name '(between/c 1 10) (real-in 1 10))
(test-name '(string-len/c 3) (string/len 3))
(test-name 'natural-number/c natural-number/c)
(test-name #f false/c)

View File

@ -9460,7 +9460,7 @@ so that propagation occurs.
(test-name '(between/c 5 6) (between/c 5 6))
(test-name '(between/c -inf.0 +inf.0) (between/c -inf.0 +inf.0))
(test-name '(integer-in 0 10) (integer-in 0 10))
(test-name '(real-in 1 10) (real-in 1 10))
(test-name '(between/c 1 10) (real-in 1 10))
(test-name '(string-len/c 3) (string-len/c 3))
(test-name 'natural-number/c natural-number/c)
(test-name #f false/c)