On 15 July 2011 23:06, Matthew Collett <m_coll...@ihug.co.nz> wrote: > On 15/07/2011, at 11:07 pm, Matthew Collett wrote: > >> I still don't understand why I can use 'last-page' (defined in >> titling-init.ly) with no problem, but cannot use 'book-last-page?' (also >> defined in titling-init.ly) unless I redefine it myself. > > Some further investigation: > > 'titling-init' is included by 'paper-defaults-init' which is included by > 'declarations-init' which is included by 'init'. > > Adding an explicit (and apparently redundant) > \include "titling-init.ly" > to my original file solves the problem; that is, it makes 'book-last-page?' > available for use as expected. > > Going up one level, and instead saying > \include "paper-defaults-init.ly" > makes the original problem reappear ('ERROR: Unbound variable: > book-last-page?').
The contents of titling-init.ly is within the scope of a \paper block; this is a different module from the one where you put your .ly code. Since none of the defines are public, they aren't exported as part of the public interface for the module, so they're invisible outside the \paper block. > Is there a rule in Scheme that names ending in '?' have restricted scope? No. It's just a naming convention. Cheers, Neil _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user