cs & io: fix ellipses printing in structs that are partially opaque
This commit is contained in:
parent
98f0c16b8c
commit
0e87b8a73f
|
@ -442,6 +442,15 @@
|
||||||
(struct s () #:transparent)
|
(struct s () #:transparent)
|
||||||
(define x (s)) ; a shared value to use in the test
|
(define x (s)) ; a shared value to use in the test
|
||||||
|
|
||||||
|
(struct s+ (v) #:transparent)
|
||||||
|
(struct sub s+ ())
|
||||||
|
(test-print/all (sub '(x))
|
||||||
|
"#(struct:sub (x) ...)"
|
||||||
|
"#(struct:sub (x) ...)"
|
||||||
|
"#(struct:sub (x) ...)"
|
||||||
|
"(sub '(x) ...)"
|
||||||
|
"#(struct:sub (x) ...)")
|
||||||
|
|
||||||
(parameterize ([print-graph #t])
|
(parameterize ([print-graph #t])
|
||||||
(for*/parameterize ([print-pair-curly-braces (in-list '(#t #f))]
|
(for*/parameterize ([print-pair-curly-braces (in-list '(#t #f))]
|
||||||
[print-mpair-curly-braces (in-list '(#t #f))])
|
[print-mpair-curly-braces (in-list '(#t #f))])
|
||||||
|
|
|
@ -306,7 +306,7 @@
|
||||||
(config-get config print-struct))
|
(config-get config print-struct))
|
||||||
(cond
|
(cond
|
||||||
[(eq? mode PRINT-MODE/UNQUOTED)
|
[(eq? mode PRINT-MODE/UNQUOTED)
|
||||||
(define l (vector->list (struct->vector v)))
|
(define l (vector->list (struct->vector v struct-dots)))
|
||||||
(define alt-list-constructor
|
(define alt-list-constructor
|
||||||
;; strip "struct:" from the first element of `l`:
|
;; strip "struct:" from the first element of `l`:
|
||||||
(string-append "(" (substring (symbol->string (car l)) 7)))
|
(string-append "(" (substring (symbol->string (car l)) 7)))
|
||||||
|
@ -350,3 +350,5 @@
|
||||||
(when (and (eq? mode WRITE-MODE)
|
(when (and (eq? mode WRITE-MODE)
|
||||||
(not (config-get config print-unreadable)))
|
(not (config-get config print-unreadable)))
|
||||||
(fail-unreadable who v)))
|
(fail-unreadable who v)))
|
||||||
|
|
||||||
|
(define struct-dots (unquoted-printing-string "..."))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user