From 0772cdf2e37a6ce4a634704816fef784d19d58cd Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 26 Nov 2011 16:33:22 -0700 Subject: [PATCH] fix `print-convert' on cyclic hash key Closes PR 12373 --- collects/mzlib/pconvert.rkt | 1 + collects/tests/racket/pconvert.rktl | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/collects/mzlib/pconvert.rkt b/collects/mzlib/pconvert.rkt index 88f9deb36a..ecd0f2f0db 100644 --- a/collects/mzlib/pconvert.rkt +++ b/collects/mzlib/pconvert.rkt @@ -144,6 +144,7 @@ (hash-table-for-each expr (lambda (key value) + (build key) (build value))))] [(pair? expr) (unless (build-sub expr) diff --git a/collects/tests/racket/pconvert.rktl b/collects/tests/racket/pconvert.rktl index 0d2a67fe84..523a24ddb3 100644 --- a/collects/tests/racket/pconvert.rktl +++ b/collects/tests/racket/pconvert.rktl @@ -319,7 +319,15 @@ (-4- `(1 . ,-5-)) (-5- `(2 3)) (-8- `(,-4- ,-5- (2 3)))) - -0-)))) + -0-)) + (make-pctest (read (open-input-string "#hasheq((#0=(1 . #0#) . a))")) + '(shared ((-1- (cons 1 -1-))) (make-hasheq (list (cons -1- 'a)))) + '(shared ((-1- (cons 1 -1-))) (make-hasheq (list (cons -1- 'a)))) + '(shared ((-1- (cons 1 -1-))) (make-hasheq (list (cons -1- 'a)))) + '(shared ((-1- `(1 unquote -1-))) (make-hasheq (list (cons -1- 'a)))) + '(shared ((-1- `(1 unquote -1-))) (make-hasheq (list (cons -1- 'a)))) + '(shared ((-1- `(1 unquote -1-))) (make-hasheq (list (cons -1- 'a)))) + '(shared ((-1- (cons 1 -1-))) (make-hasheq (list (cons -1- 'a))))))) (for-each run-test tests)) (let ()