lilypond-user
[Top][All Lists]
Advanced

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

Scoping of variables - converting scores to songbook


From: Colin Campbell
Subject: Scoping of variables - converting scores to songbook
Date: Sat, 02 Jan 2010 20:01:23 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070403 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0

I'm working on converting a collection of single scores into a song-book, by \including the .ly files, and seem to have run across a problem with scoping of variables: in some of my scores, I use no variables, neither for notes nor lyrics. Other scores, using variables defined outside a \score block, will error off the compile of the book, throwing "unexpected STRING" errors at every variable definition. Moving the variables inside the \score block doesn't help.

I haven't found a clear definition of variable scoping in the NR, nor have I found a specification of what can and cannot be in a \included file. The docs seem to say I can have an arbitrary number of \score blocks in a file. They also say that variables can be defined at top level ( outside a \score block ), and become visible to all lower level contexts.

My questions are probably best put as:

1. if I'm \including files containing variable definitions, must the variable names be globally unique? 2. if I define variables inside a \score block, do they become globally visible when I \include the file in another?
3. is there any way of refining variable scope to define local or global?

Colin
--
When you find a big kettle of crazy, it's best not to stir it.
 - Scott Adams, "Dilbert" Sept 22,'09




reply via email to

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