Including a file only once: Difference between revisions

Import snippet from LSR
 
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
Line 1: Line 1:
Some files of definitions should be included only once in a project, but they need to be mentioned by all of the files that require them. I defined \includeIfAbsent to include a file if and only if it has not already been included by \includeIfAbsent. It works in a different scope from \include, so definitions in the included file need to be made global with define-public-toplevel in order to be effective.
Some files of definitions should be included only once in a project, but they need to be mentioned by all of the files that require them. I defined \includeIfAbsent to include a file if and only if it has not already been included by \includeIfAbsent. It works in a different scope from \include, so definitions in the included file need to be made global with define-public-toplevel in order to be effective.


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=657
%% http://lsr.di.unimi.it/LSR/Item?id=657