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: Marc Hohl
Subject: Re: how to define a boolean?
Date: Sun, 09 Aug 2009 13:21:05 +0200
User-agent: Thunderbird 2.0.0.22 (X11/20090608)

Trevor Daniels schrieb:
[...]


From what I see on the console output, the calls of \myMusicFunc
are evaluated first, so myBool is #t  and the callbacks come in action
afterwards (the first slur claims #t, every other slur reads #f), so
apparently they don't influence each other the way I expected them to do.

That's right.  AIUI, Music functions act on
the music stream, before layout commences, so
all music functions have completed before the
first callback.  I don't know what you are
trying to do, but the example looks rather
like overriding a grob property might achieve
it.
Thank for clarification.
I think I have a solution for my specific problem, because it seems that the callback can change the value and for the next time called, he uses the proper value, like this:

#(define-public (slur::boolean grob)
 ;; just a test function to try and switch boolean values
   (display "\nWithin callback\n")
   (display "myBool: ")(display myBool)(newline)
   (if myBool
       (set! myBool #f)
       (set! myBool #t))
   (display "myBool: ")(display myBool)(newline)
   (ly:slur::print grob))

With this mechanism and some workarounds, I think I can solve my problem.

Marc

Trevor







reply via email to

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