lilypond-user
[Top][All Lists]
Advanced

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

Re: how to define a boolean?


From: Carl Sorensen
Subject: Re: how to define a boolean?
Date: Sun, 9 Aug 2009 16:34:04 -0600



On 8/9/09 9:12 AM, "Marc Hohl" <address@hidden> wrote:

> Carl Sorensen schrieb:
>> 
>> So that is why the first value in the callback was #t -- it was left over
>> from the last call of \myMusicFunc.  Then the remaining values were #f,
>> because all of the calls to \myMusicFunc had already been evaluated.
>>  
> Thanks for this detailed explanation! Now I understand (at least I think
> so...)

You're welcome!  Once I understood this, I saw that it was explained in Erik
Sandberg's thesis, but I hadn't really understand it. After my new insight,
things that had never made sense before started to make sense.

>> The *specific* behavior you have requested can be achieved by the following:
>> 
>> #(define myBool #f)
>> 
>> myMusicFunc =
>> #(define-music-function (parser location) ()
>>    #{
>>      \once \override Slur #'dummyProperty = ##t
>>    #})
>> 
>>  
> I didn't know that I can create and use dummy properties; this
> could work for my problem.

You can (although you get a warning); \override creates an override entry in
the parse tree even if the property being overridden doesn't exist.  There
used to not even be a warning, but this caused typos of property names to
fail silently, so the warning was added.

Of course, for your tablature work, you may start with a dummy property, but
when it's added to the code, we'll want it to be an official property.

>> 
>> If you can't make this work and would like to share some more specifics, I
>> might be able to help you.
>>  
> I will play with your code, and if I run into problems, I will gladly
> return to your offer.
> 
> Thank you!

You're very welcome.  Thank you for your ongoing contributions to LilyPond!

Carl


P.S. When you have problems like this, the best place to ask is on
lilypond-devel; the developers generally pay closer attention over there.






reply via email to

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