lilypond-user
[Top][All Lists]
Advanced

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

Re: Is there an equivalent of #define ... #ifndef ... #endif in lilypond


From: David Kastrup
Subject: Re: Is there an equivalent of #define ... #ifndef ... #endif in lilypond?
Date: Sat, 25 Feb 2012 07:56:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Francisco Vila <address@hidden> writes:

> 2012/2/24 Michael Hendry <address@hidden>:
>> David Kastrup wrote:
>>> You can use
>>> includeGuitar = ##t
>>> includeConcert = ##f
>>> includeTrumpet = ##t
>>> includeAlto = ##f
>>> at the top and then do
>>> $(if includeGuitar GuitarBook)
>>> $(if includeConcert ConcertBook)
>>> $(if includeTrumpet TrumpetBook)
>>> $(if includeAlto AltoBook)
>>>
>>> at the bottom.
>>
>> I'm beginning to think I'm terminally dim, but I can't get this to work, and
>> I can't find any reference to $(if...), (nor indeed to any kind of "if ...
>> then ... else") in the Lilypond manuals, despite several hours of hunting.
>>
>> The error message I get is "syntax error, unexpected $undefined".
>
> The "(if ..." part is Scheme. It works in latest development version.
> Here is another working minimal example.
>
> whether = ##t
> musica = { d' }
> {
>   c'
>   $(if whether musica)
>   e'
> }

Oh.  If his version is older than that, he can use

#(ly:export (if includeAlto AltoBook))

...  But it is not really fun with those old versions.

-- 
David Kastrup




reply via email to

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