fix `print-convert' on cyclic hash key

Closes PR 12373
This commit is contained in:
Matthew Flatt 2011-11-26 16:33:22 -07:00
parent dd0a49bc62
commit 0772cdf2e3
2 changed files with 10 additions and 1 deletions

View File

@ -144,6 +144,7 @@
(hash-table-for-each
expr
(lambda (key value)
(build key)
(build value))))]
[(pair? expr)
(unless (build-sub expr)

View File

@ -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 ()