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: Sat, 8 Aug 2009 14:29:59 -0600



On 8/8/09 2:20 PM, "Marc Hohl" <address@hidden> wrote:

> Carl Sorensen schrieb:
>> [...]
>>>> For the music-function you can do this:
>>>> 
>>>> % you can also do:
>>>> % mybool = ##f
>>>> #(define mybool #f)
>>>>      
>> 
>> Why not just change this to
>> 
>> #(define-public mybool #f)
>> 
>> then  use mybool everywhere else?
>>  
> I tried this first, but it seems that it doesn't work inside a
> music-function.
> 

This seems to work for me:

#(define-public myBool #t)

myMusicFunc =
#(define-music-function (parser location) ()
    (display "\nIn myMusicFunc\n")
    (display "myBool: ")(display myBool)(newline)
    (set! myBool #f)
    (display "myBool: ")(display myBool)(newline)
    (make-music 'SequentialMusic 'void #t))

\relative c'' {
  c4  
    \myMusicFunc
    c c c 
}


Was there something else you were trying to do?

Carl





reply via email to

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