lilypond-devel
[Top][All Lists]
Advanced

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

Re: Solution for including a file only once


From: Carl Sorensen
Subject: Re: Solution for including a file only once
Date: Thu, 11 Feb 2010 12:09:46 -0700



On 2/11/10 11:05 AM, "Michael J. O'Donnell" <address@hidden>
wrote:

> Here's what I *now think* is correct code O:-) :
> 
> includeIfAbsent =
> 
> #(define-music-function (parser location fileName) (string?)
> 
> (let ((guardName (string-append "Already Got " fileName)))
> 
> (if (not (defined? (string->symbol guardName)))
> (begin
> 
> (primitive-eval (list 'define (string->symbol guardName) #t))
> 
> (ly:parser-parse-string (ly:parser-clone parser) (string-concatenate
> (list "\\include \"" fileName "\"")))
> 
> #{ #}

When I see #{ #}, I suspect that instead of using the substitution syntax,
you should be using void  music functions (i.e. your return should be
(make-music 'SequentialMusic 'void #t)).  This is the empty music you refer
to below.

You can read more about void music functions in Notation Reference 6.1.5 for
version 2.12 or in Extending LilyPond 2.1.5 for version 2.13.

Thanks,

Carl





reply via email to

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