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





_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to