bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Page breaking fails for multiline embedded score


From: Boris Shingarov
Subject: Re: Page breaking fails for multiline embedded score
Date: Wed, 17 Feb 2010 01:27:37 -0500
User-agent: Webmail 5.0

Another change I was thinking about, is to redesign the API contracts
around interpret-markup-list.
Right now, we start from the list of markups, and for-each markup,
apply the markup function and destructively append! the resulting
stencil to the result list under construction.
The procedural nature of this design, is somewhat limiting in terms of
expressive power. For what I am trying to do -- building a more
flexible/general markup formatting facility -- the formatting of a
markup may sometimes be context-controlled, i.e. formatting of the next
piece of markup may depend on how the previous markups were formatted. For this, the design where the markup's stencil is completely defined
by the single markup element in the list fed into
interpret-markup-list, is not sufficient. One way to address it, is simply to pass another argument to the markup
procedure, containing the context where we are along the way. A more
elegant way is to do it in continuation passing style: the markup
function, which represents one step in building of the stencils list,
takes the tail of the markup list (the head is the current markup
function itself) and the partially-built list of stencils, formats the
current piece pf markup, tucks it on to to the stencils-list being
built, and tail-recursively executes the rest of the markup with list
of stencils grown by the just-now-formatted stencil. This way, each
step can reason about what has been already built, looking backward
(although only in terms of stencils), and what is yet to be built,
looking forward (although only in terms of markups).
Quoting Boris Shingarov <address@hidden>:

Ok, I created a patch:
http://codereview.appspot.com/207105





reply via email to

[Prev in Thread] Current Thread [Next in Thread]