add with-writer-change (all of this is still uncertain and undocumented)
svn: r16061 original commit: 182f89d5806f7c1f648a3a85ff2b589b93cb2212
This commit is contained in:
parent
a5a410fb47
commit
b69db24297
|
@ -153,6 +153,13 @@
|
||||||
(set! write (or (car c) write-string))
|
(set! write (or (car c) write-string))
|
||||||
(for-each loop (cdr c))
|
(for-each loop (cdr c))
|
||||||
(set! write old))]
|
(set! write old))]
|
||||||
|
[(with-writer-change)
|
||||||
|
;; the function gets the old writer and return a new one
|
||||||
|
;; (useful to sabe the current writer then restore it inside)
|
||||||
|
(let ([old write])
|
||||||
|
(set! write ((car c) write))
|
||||||
|
(for-each loop (cdr c))
|
||||||
|
(set! write old))]
|
||||||
[else (error 'output "unknown special value flag: ~e"
|
[else (error 'output "unknown special value flag: ~e"
|
||||||
(special-flag x))]))]
|
(special-flag x))]))]
|
||||||
[else
|
[else
|
||||||
|
@ -202,6 +209,7 @@
|
||||||
(define/provide-special (add-prefix pfx))
|
(define/provide-special (add-prefix pfx))
|
||||||
(define/provide-special (set-prefix pfx))
|
(define/provide-special (set-prefix pfx))
|
||||||
(define/provide-special (with-writer writer))
|
(define/provide-special (with-writer writer))
|
||||||
|
(define/provide-special (with-writer-change writer))
|
||||||
|
|
||||||
(define make-spaces ; (efficiently)
|
(define make-spaces ; (efficiently)
|
||||||
(let ([t (make-hasheq)] [v (make-vector 80 #f)])
|
(let ([t (make-hasheq)] [v (make-vector 80 #f)])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user