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: Michael Hendry
Subject: Re: Is there an equivalent of #define ... #ifndef ... #endif in lilypond?
Date: Fri, 24 Feb 2012 15:24:23 -0800 (PST)



Francisco Vila wrote:
> 
> 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'
> }
> 
> %%%END
> 
> -- 
> Francisco Vila. Badajoz (Spain)
> www.paconet.org , www.csmbadajoz.com
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 
Thanks Francisco and David.

I've compiled and installed lilypond-2.15.9 (the latest version I could
find) but still get the same error message with my file, and with the
minimal example above, with a report:

[terminal output]
GNU LilyPond 2.15.9
Processing `test.ly'
Parsing...
test.ly:5:2: error: syntax error, unexpected $undefined
  
  $(if whether musica)
test.ly:3:0: error: errors found, ignoring music expression

{
test.ly:0: warning: no \version statement found, please add

\version "2.15.9"

for future compatibility
fatal error: failed files: "test.ly"
[/terminal output]

I must say, I had understood that it was necessary to precede Scheme
statements with a hash character, but now that I read further I see that a
dollar-sign is also used to inform Lilypond that a Scheme statement is
coming.
-- 
View this message in context: 
http://old.nabble.com/Is-there-an-equivalent-of--define-...--ifndef-...--endif-in-lilypond--tp33346188p33388543.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.




reply via email to

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