Urs Liska <u...@openlilylib.org> writes: > Hi, > > I'm once more struggling with the commands to include files within > Scheme functions. > > In the attached .ily files one defines a music expression while the > other uses it in a Staff definition. > > I can happily make that work using regular \includes or by calling > ly:parser-include-string twice. But I need to wrap this into a Scheme > function to include multiple files from within a function and process > the results (the music expressions from the files) within the same function. > > I am not surprised that the second approach (using > ly:parser-include-string twice within the function) doesn't work. Last > time this question popped up I learned that any definition from inside > the included file will only be visible after the function has returned. > (uncomment second example to see it "in action").
Perhaps you should unlearn that. It's nonsensical. The problem rather is that ly:parser-include-string pushes a string on the input stack, so your includes are processed in reversed order. Why would you even do multiple ly:parser-include-string calls in one function instead of building _one_ string and including that? -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user