pretty-print: order hash keys in common cases

This commit is contained in:
Matthew Flatt 2018-02-06 10:35:23 -07:00
parent 9fe03ff6d9
commit 60b6b43485

View File

@ -734,10 +734,12 @@
[else (list (make-unquoted 'cons) (car obj) (cdr obj))])) [else (list (make-unquoted 'cons) (car obj) (cdr obj))]))
(define (convert-hash obj expr?) (define (convert-hash obj expr?)
(let ([l (hash-map obj (lambda (k v) (let ([l (hash-map obj
(lambda (k v)
(if expr? (if expr?
(list k v) (list k v)
(cons k (make-hide v)))))]) (cons k (make-hide v))))
#t)])
(if expr? (if expr?
(cons (make-unquoted (cons (make-unquoted
(if (hash-eq? obj) (if (hash-eq? obj)