Random improvement.

The thing that caught my eye is the missing `#:cache-keys?' which should
really be there.  But not too important.

(cherry picked from commit eaa6f85054)
This commit is contained in:
Eli Barzilay 2014-09-21 00:07:08 -04:00 committed by Ryan Culpepper
parent dc4f4f8ee9
commit 91036cea81

View File

@ -58,16 +58,12 @@
;; does t have a type name associated with it currently? ;; does t have a type name associated with it currently?
;; has-name : Type -> Maybe[Listof<Symbol>] ;; has-name : Type -> Maybe[Listof<Symbol>]
(define (has-name? t) (define (has-name? t)
(cond
[print-aliases
(define candidates (define candidates
(for/list ([(n t*) (in-pairs (in-list (force (current-type-names))))] (for/list ([(n t*) (in-pairs (in-list (force (current-type-names))))]
#:when (and (Type? t*) (type-equal? t t*))) #:when (and print-aliases (Type? t*) (type-equal? t t*)))
n)) n))
(if (null? candidates) (and (pair? candidates)
#f (sort candidates string>? #:key symbol->string #:cache-keys? #t)))
(sort candidates string>? #:key symbol->string))]
[else #f]))
;; print-<thing> : <thing> Output-Port Boolean -> Void ;; print-<thing> : <thing> Output-Port Boolean -> Void
;; print-type also takes an optional (Listof Symbol) ;; print-type also takes an optional (Listof Symbol)