lilypond-user
[Top][All Lists]
Advanced

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

Re: variables in \book { }


From: David Kastrup
Subject: Re: variables in \book { }
Date: Wed, 17 Feb 2016 18:51:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Simon Albrecht <address@hidden> writes:

> On 17.02.2016 13:27, David Kastrup wrote:
>> Graham King<address@hidden>  writes:
>>
>>>
>>>            \book {
>>>              music = \relative { c' d e f }
>>>              \score {
>>>               \music
>>>              }
>>>            }
>> The problem is that it would likely be possible to teach LilyPond's
>> parser to accept the latter, but due to book not having a scope of its
>> own for music expressions, it would be perfectly equivalent to the
>> first: any such assignment would change "music" globally.
>
> A possibility to define variables (in proper LilyPond syntax) inside
> of \book or \bookpart environments would be really great to have, in
> order to simplify working with large projects, many includes and
> different target editions. I don’t think that not having a proper
> scope for each book/bookpart is a problem.

I think it is.

> So I’d vote for this change.

I vote against it.  It does not make sense that when I write

mybook =
\book {
   zap = 3
   ...
}

that at the time mybook is actually being interpreted, zap might have a
completely different value.

If you want to make global assignments, make global assignments.

-- 
David Kastrup



reply via email to

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