From 0a7c65d066695a0b0832392dae5252c688b4a0e6 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 9 Jul 2010 15:11:02 -0500 Subject: [PATCH] improved the code that determines if an identifier is a known predicate or if it is some unknown thing --- collects/drracket/syncheck.rkt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/collects/drracket/syncheck.rkt b/collects/drracket/syncheck.rkt index 0a0f9908db..ea773df640 100644 --- a/collects/drracket/syncheck.rkt +++ b/collects/drracket/syncheck.rkt @@ -2148,13 +2148,11 @@ If the namespace does not, they are colored the unbound color. ;; approximate this by just asking 'did this identifier come from the core?' (which is known ;; to not bind any contracts (I hope)) (define (known-predicate? id) - (eq? (syntax-e id) 'integer?) - #; - (let ([src (syntax-source-module id)]) - (and src - (let-values ([(base rel) (module-path-index-split src)]) - (printf "~s => ~s\n" (syntax-e id) (list base rel)) - (member base '(racket racket/base scheme scheme/base)))))) + (let ([ib (identifier-binding id)]) + (and (list? ib) + (let ([src (list-ref ib 0)]) + (let-values ([(base rel) (module-path-index-split src)]) + (member base '('#%kernel racket racket/base scheme scheme/base))))))) (define (base-color stx polarity) (color stx