lilypond-user
[Top][All Lists]
Advanced

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

Re: include puzzlement


From: Shane Brandes
Subject: Re: include puzzlement
Date: Fri, 29 Dec 2017 15:21:33 -0500

Thanks all, and Kieran that pattern will definitely work for future
projects. Unfortunately that leaves me with unwinding, separating the
music from the score definitions,  200 some such files for a current
one to get it to work. I had anticipated that the whole bookpart thing
simply encapsulated that bit of information in its own little section
and would therefore work. That probably has to do with the idea that
some years ago I used to simply copy each piece in line together and
they would merrily create themselves then at some point the code
operating the headers was change such that that no longer worked. I
thought the whole bookpart was added to restore such functionality,
but the underlying mechanism is oddly different and it must be to do
with with who the lilypond does business and since I have learned
anything other than basic and python not much beyond how it functions
not that I could code my way out of a paper bag. So David is probably
right in that I believed that each bookpart had its own scope, however
that is not a programming term I am familiar with.

regards,
Shane

On Fri, Dec 29, 2017 at 2:59 PM, David Kastrup <address@hidden> wrote:
> Shane Brandes <address@hidden> writes:
>
>> o.k. back to the include with book part problem. Here is my almost
>> minimal code example, which consists of files a.ly, b.ly and test.ly.
>> The two files compile alone correctly but when stuck in the bookpart
>> they go to pieces.
>
> Sigh.  Your original complaint was:
>
>     O.k. having gone in circles trying to figure out the whole bookpart
>     apparatus I discovered that the documentations statement that using
>     include is the same as copying and pasting the include into a document
>     is false if the include consists of a complete lilypond file. Is there
>     a way around that?
>
> This has _nothing_ whatsoever to do with \include, it has to do with
> putting complete documents inside of a \bookpart .  Which does not allow
> for assignments, for example.
>
>> %---- bookpart test.ly
>>
>> \bookpart {\include "a.ly"}
>> \bookpart {\include "b.ly"}
>
> The problem is that bookparts (and books) don't have their own local
> variable scopes so you cannot do local assignments in them.  The
> expectation would be that they don't generally bleed through to outside,
> and indeed your usage pattern sort of demonstrates the expectation of
> such scoping.
>
> Of course, doing the same in Scheme just works in the global scope and
> thus bypasses this consideration anyway.
>
> --
> David Kastrup



reply via email to

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