\version "2.18.2" % What do you want to achieve with this function? % return an object containing markup and score exampleA = #(define-scheme-function (parser location) () ; create a (list (cons 'mup #{ \markup "Test" #}) (cons 'mus #{ \score { c'4 } #}) )) exA = \exampleA % this is much nicer in 2.19.82 ... $(ly:assoc-get 'mup exA) $(ly:assoc-get 'mus exA) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % add the markup and the score immediatly exampleB = #(define-scheme-function (parser location) () (add-score (ly:parser-clone parser) (list #{ \markup "Test" #})) (add-score (ly:parser-clone parser) #{ \score { c'4 } #} )) \exampleB %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % return a function that adds markup and score exampleC = #(define-scheme-function (parser location) () (define-void-function (parser location)() (add-score (ly:parser-clone parser) (list #{ \markup "Test" #})) (add-score (ly:parser-clone parser) #{ \score { c'4 } #} ))) exC = \exampleC \exC