Hi, I'm running into an issue with including files using ly:parser-include-string.
The underlying task is that I want to conditionally include files, so I have the pseudo-code: #(if (some-condition) (ly:parser-include-string "\\include \"some-file.ily\"")) This works pretty well for single items. It is also possible to insert multiple \include-s in the string, and all files are loaded. However, when a file defines anything, subsequently included files don't have access to it. It seems the whole conditional expression has to be evaluated until the new definitions are available. And if I only include this single some-file.ily this can again include multiple files (with regular LilyPond syntax). And again, files included that way don't have access to definitions (variables, functions) that are in files included earlier. The same is true for modules. If this some-file.ily uses a module-1 and later a module-2 module-2 doesn't have access to items defined in module-1. In a way I need something like the (let* construct but for ly:parser-include-string. Can someone confirm that my observation is correct (and intentional)? And is there a solution for my original problem: conditionally including files with multiple secondary includes? TIA Urs _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user