use define-record-writer to set custom writer to <array> type
This commit is contained in:
parent
75138db4db
commit
fff22f253f
|
@ -89,7 +89,7 @@
|
||||||
(define (array-for-each proc ary)
|
(define (array-for-each proc ary)
|
||||||
(for-each proc (array->list ary)))
|
(for-each proc (array->list ary)))
|
||||||
|
|
||||||
(define (print-array array)
|
(define-record-writer (<array> array)
|
||||||
(call-with-port (open-output-string)
|
(call-with-port (open-output-string)
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(display "#.(array" port)
|
(display "#.(array" port)
|
||||||
|
@ -101,8 +101,6 @@
|
||||||
(display ")" port)
|
(display ")" port)
|
||||||
(get-output-string port))))
|
(get-output-string port))))
|
||||||
|
|
||||||
(record-set! <array> 'writer print-array)
|
|
||||||
|
|
||||||
(export make-array
|
(export make-array
|
||||||
array
|
array
|
||||||
array?
|
array?
|
||||||
|
|
Loading…
Reference in New Issue