pull out the right bindings from the right places
svn: r11882
This commit is contained in:
parent
98c02cb887
commit
c0bc68f35b
|
@ -1,22 +1,5 @@
|
||||||
#lang scheme/base
|
#lang scheme/base
|
||||||
|
|
||||||
(require scheme/promise)
|
(require scheme/promise "text/output.ss" "text/syntax-utils.ss")
|
||||||
|
(provide (all-from-out scheme/promise "text/output.ss")
|
||||||
;; output
|
begin/text include/text)
|
||||||
|
|
||||||
(provide output)
|
|
||||||
(define (output x [p (current-output-port)])
|
|
||||||
(let loop ([x x])
|
|
||||||
(cond [(or (void? x) (not x) (null? x)) (void)]
|
|
||||||
[(pair? x) (loop (car x)) (loop (cdr x))]
|
|
||||||
[(promise? x) (loop (force x))]
|
|
||||||
[(keyword? x) (loop (keyword->string x))]
|
|
||||||
[(and (procedure? x) (procedure-arity-includes? x 0)) (loop (x))]
|
|
||||||
[(bytes? x) (write-bytes x p)]
|
|
||||||
[(string? x) (write-string x p)]
|
|
||||||
[(char? x) (write-char x p)]
|
|
||||||
[(number? x) (write x p)]
|
|
||||||
[(symbol? x) (display x p)]
|
|
||||||
;; generic fallback
|
|
||||||
[else (error 'output "don't know how to render value: ~v" x)]))
|
|
||||||
(void))
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user