Clarify contract comparison for characters.

This commit is contained in:
Sam Tobin-Hochstadt 2016-06-13 10:26:47 -04:00
parent 6454f85397
commit 547ddaa6f5
2 changed files with 6 additions and 4 deletions

View File

@ -52,13 +52,13 @@ constraints.
various operations listed in this section of the manual, and various
ordinary Racket values that double as contracts, including
@itemize[
@item{@tech{symbols}, @tech{booleans}, @tech{characters}, @tech{keywords}, and
@item{@tech{symbols}, @tech{booleans}, @tech{keywords}, and
@racket[null], which are treated as contracts that recognize
themselves, using @racket[eq?], }
@item{@tech{strings}, @tech{byte strings}, @racket[+nan.0], and
@racket[+nan.f], which are treated as contracts
that recognize themselves using @racket[equal?], }
@item{@tech{strings}, @tech{byte strings}, @tech{characters},
@racket[+nan.0], and @racket[+nan.f], which are treated
as contracts that recognize themselves using @racket[equal?], }
@item{@tech{numbers} (except @racket[+nan.0] and
@racket[+nan.f]), which are treated as contracts

View File

@ -59,6 +59,8 @@
(test-flat-contract #\a #\a #\b)
(test-flat-contract #\a #\a 'a)
(test-flat-contract ''a 'a 'b)
(let ([a #\⊢])
(test-flat-contract a (integer->char (char->integer a)) #\a))
(test-flat-contract ''a 'a #\a)
(test-flat-contract "x" "x" "y")
(test-flat-contract "x" "x" 'x)