lilypond-user
[Top][All Lists]
Advanced

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

Re: conditional include


From: Jan-Peter Voigt
Subject: Re: conditional include
Date: Tue, 05 Feb 2013 11:18:10 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

Am 05.02.2013 11:07, schrieb David Kastrup:
Jan-Peter Voigt <address@hidden> writes:

Hi Urs,

you can write a music-function that conditionally includes files.
I use a function to include a file, if it exists. The if statement can
of course also test for a option with ly:get-option.
\version "2.16.0"

includeIfExists =
#(define-music-function (parser location file)(string?)
    (if (file-exists? file)
        (ly:parser-include-string parser (format "\\include \"~A\"\n" file)))
    (make-music 'SequentialMusic 'void #t))
Any reason you don't use define-void-function here?  Saves the somewhat
weird make-music call and is likely usable in more places.

I'm just not used to it ... thanks for the hint & reminder




reply via email to

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