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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user