Either I've found a bug, or (more likely) I don't understand how variables are passed between Lilypond and Scheme.

Below is an example, where a #(define-music-function...) block receives a variable, stringone. That variable seems to be accessible (i.e. bound, if I have my terminology straight) in two places, but not accesible (i.e. unbound) in the third place.

1. Accesible by Scheme code within #(define-music-function) but outside of #{ #} block
2. Accessible by Lilypond input within #{ #} block
3. Not accesible by Scheme code within #{ #} block

Why is this, and is there any way to pass a variable, received by define-music-function, to Scheme code within the #{ #} block?

Thanks in advance,
Marcus



\version "2.9.23"

function = #(define-music-function
              (parser location stringone)
              (string?)
              (let ((stringone (string-append stringone " foo")))
                   #{
% uncommenting the following line yields "ERROR: Unbound variable: stringone"
%                        #(string-append stringone " bar")
                        c1^\markup { $stringone }
                   #}))

\relative c'' { \function #"one" }


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

Reply via email to