buffer pretty output to work in columnar

This commit is contained in:
Alex Shinn 2018-01-07 14:42:52 +09:00
parent b9172a366c
commit f29a404324
2 changed files with 18 additions and 12 deletions

View file

@ -40,11 +40,11 @@
(return nothing)))) (return nothing))))
nothing)) nothing))
(define (generate) (define (generate)
(if (and resume (list-queue-empty? queue)) (when (and resume (list-queue-empty? queue))
(call-with-current-continuation (call-with-current-continuation
(lambda (cc) (lambda (cc)
(set! return cc) (set! return cc)
(resume nothing)))) (resume nothing))))
(if (list-queue-empty? queue) (if (list-queue-empty? queue)
eof eof
(list-queue-remove-front! queue))) (list-queue-remove-front! queue)))

View file

@ -1,5 +1,5 @@
;; pretty.scm -- pretty printing format combinator ;; pretty.scm -- pretty printing format combinator
;; Copyright (c) 2006-2013 Alex Shinn. All rights reserved. ;; Copyright (c) 2006-2018 Alex Shinn. All rights reserved.
;; BSD-style license: http://synthcode.com/license.txt ;; BSD-style license: http://synthcode.com/license.txt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -348,15 +348,21 @@
(define (pretty obj) (define (pretty obj)
(fn () (fn ()
(each (pp obj (extract-shared-objects obj #t)) (call-with-output
fl))) (each (pp obj (extract-shared-objects obj #t))
fl)
displayed)))
(define (pretty-shared obj) (define (pretty-shared obj)
(fn () (fn ()
(each (pp obj (extract-shared-objects obj #f)) (call-with-output
fl))) (each (pp obj (extract-shared-objects obj #f))
fl)
displayed)))
(define (pretty-simply obj) (define (pretty-simply obj)
(fn () (fn ()
(each (pp obj (extract-shared-objects #f #f)) (call-with-output
fl))) (each (pp obj (extract-shared-objects #f #f))
fl)
displayed)))