On 17/09/2023 00:11, Jean Abou Samra wrote:
Is is possible to conditionally execute the #@ expression based on
whether the 'textArray' variable is bound?


\version "2.24.2"

textArray = <<
   { \lyricmode { \set stanza = "1" fo -- o bar } }
   { \lyricmode { \set stanza = "2" fo -- o bar } }


\score {
   <<
     \new Voice = "soprano" { c'1 1 1 }
     #@(if (defined? 'textArray)
           (map (lambda (mus) #{ \new Lyrics { \lyricsto "soprano" { #mus } } 
#})
                (ly:music-property textArray 'elements))
           '())
   >>
}



Thank you very much Jean.

I was missing the '().
Without the empty '() in the else branch, when the if condition is false nothing is returned to the #@ operator.

Reply via email to