add with-writer-change (all of this is still uncertain and undocumented)

svn: r16061

original commit: 182f89d5806f7c1f648a3a85ff2b589b93cb2212
This commit is contained in:
Eli Barzilay 2009-09-18 05:56:41 +00:00
parent a5a410fb47
commit b69db24297

View File

@ -153,6 +153,13 @@
(set! write (or (car c) write-string))
(for-each loop (cdr c))
(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"
(special-flag x))]))]
[else
@ -202,6 +209,7 @@
(define/provide-special (add-prefix pfx))
(define/provide-special (set-prefix pfx))
(define/provide-special (with-writer writer))
(define/provide-special (with-writer-change writer))
(define make-spaces ; (efficiently)
(let ([t (make-hasheq)] [v (make-vector 80 #f)])