use chaperone-of? instead of eq? to find list?, null?, and pair?

This commit is contained in:
Robby Findler 2016-01-27 08:47:14 -06:00
parent 70cefc60bc
commit 5214b06a86

View File

@ -299,12 +299,12 @@
[(contract-struct? x) #f] ;; this has to come first, since some of these are procedure?. [(contract-struct? x) #f] ;; this has to come first, since some of these are procedure?.
[(and (procedure? x) (procedure-arity-includes? x 1)) [(and (procedure? x) (procedure-arity-includes? x 1))
(cond (cond
[(eq? x null?) list/c-empty] [(chaperone-of? x null?) list/c-empty]
[(eq? x list?) [(chaperone-of? x list?)
(unless listof-any (unless listof-any
(error 'coerce-contract/f::listof-any "too soon!")) (error 'coerce-contract/f::listof-any "too soon!"))
listof-any] listof-any]
[(eq? x pair?) [(chaperone-of? x pair?)
(unless consc-anyany (unless consc-anyany
(error 'coerce-contract/f::consc-anyany "too soon!")) (error 'coerce-contract/f::consc-anyany "too soon!"))
consc-anyany] consc-anyany]