lilypond-devel
[Top][All Lists]
Advanced

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

Re: Markup module patch (Issue 2026)


From: Ian Hulin
Subject: Re: Markup module patch (Issue 2026)
Date: Fri, 16 Dec 2011 17:11:14 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0

Hi Han-Wen,
Sorry for taking a while to answer this but I've been caught up in the
normal teacher end-of-Christmas-term insanity. . .

On 14/12/11 12:11, Han-Wen Nienhuys wrote:
> On Tue, Dec 13, 2011 at 5:56 PM, Ian Hulin <address@hidden>
> wrote:
> 
>> I pulled out and tested the examples in separate .ly file and
>> the format that fails is #(define-markup-command (double-box
>> layout props text) (markup?) "Draw a double box around text." 
>> (interpret-markup layout props #{\markup \override #'(box-padding
>> . 0.4) \box \override #'(box-padding . 0.6) \box { $text }#})) 
>> \markup \double-box A
> 
> Since the person writing the code is writing Scheme already,
> requiring the inner markups to be in Scheme is a reasonable
> restriction, IMO. That said, it would be nice if #{ #} could be
> made to work, but I not enough insight into how it works.
> 
> What is the rationale for putting the markups in a separate
> module?
> 
Basically, it boils down to "hygiene".

Guile V2 insists on some thing, particularly macros being defined
before they are used.
When Patrick M. first tried out using Lily with Guile 2, the only way
we could use it was by relying on the equivalent of the Guile
--auto-compile option.

During initialization on the first pass through lily.scm, when we're
building the (lily) module, we got an awful lot of barfs from Guile
that various things, almost always from the markup stuff were unbound
variables. We could code round this by fiddling with the order of
loading the component .scm files in the list for processing by
ly:load, and sometimes by splitting out bits of a file (e.g. migrating
bits of markup.scm -> markup-macros.scm.  We did this for one round
round of changes in 2.15, and it kinda worked - e.g. Jan was able to
get schekkers-list to run up a prototype.

However, I felt this was a potential maintainability swamp: the
search-order could easily need changing again because some developer
somewhere wanted to change one of the component modules, i.e. somebody
could do a perfectly respectable and well-behaved change in Lily with
Guile V1.8, and it would meanwhile blow up that version of lily.scm in
Guile V2 without even knowing it.

So it seemed to me the neatest way of avoiding this was to make all
the markup macros and procedures live in their own module, to be
referenced via (use-modules (scm markup-facility-defs)) in the lily
module, and then all the component *.scm files would have the markup
definitions available when the (lily) module was being built, whatever
position its source file occupied in the load list for ly:load in
lily.scm.

I know you have another query about forcing the markup definitions
into the (lily) module, but I'll talk about that in a separate post.

Cheers,

Ian








reply via email to

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