Sorry I've been thinking aloud on the list.

My proposal can be simplified more: no need for a round robin for the
pages when there's one for the stencils.  Different master outputters
can have different interfaces, so EPS output may get different
interfaces than the PS and TeX ones.  Suppose for a minute that a page
description is a list of stencils.

What Lilypond does, roughly:

(if do-ps
  (ps-master-output ps-outputter get-page))
(if do-tex
  (tex-master-output tex-outputter get-page))
(if do-eps
  (eps-master-output eps-header-out eps-page-out get-page))

What framework-ps might do (outputter should probably come in through
a module interface, but I don't know Guile modules).  This is somewhat
simplified.

(define (master-output outputter get-page)
  (make-header outputter)
  (let do-page ()
     (output-page (get-page) outputter)
     (do-page))
  (make-footer outputter))

(define (output-page page outputter)
  (outputter [page-header])
  (output-stencils page outputter))

(define (output-stencils s-list outputter)
  (if (null? s-list)
    (outputter [footer])
    (begin
      (outputter (force (car s-list)))
      (output-stencils (cdr s-list)))))


David


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to