lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ly:parser-parse-string again


From: David Kastrup
Subject: Re: ly:parser-parse-string again
Date: Tue, 05 Jul 2016 15:27:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Urs Liska <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]