Including a file only once: Difference between revisions
Import snippet from LSR |
m New category Tags: Mobile edit Mobile web edit |
||
| (2 intermediate revisions by 2 users not shown) | |||
| 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 | <lilypond version="2.24"> | ||
%% http://lsr.di.unimi.it/LSR/Item?id=657 | %% http://lsr.di.unimi.it/LSR/Item?id=657 | ||
| Line 100: | Line 100: | ||
[[Category:Version-specific]] | [[Category:Version-specific]] | ||
[[Category:Preparing parts]] | [[Category:Preparing parts]] | ||
[[Category:Snippet]] | |||