Urs Liska <li...@ursliska.de> writes: > So now the question: > How can I write a function that produces a toplevel expression?
No such thing. > I want to be able to write: > > \debugCurvesOn > > or > > #(debug-curves-on) > > (or something similar) which should then expand to > > \layout { > \context { > \Score > \override Slur #'stencil = #(display-control-points) > \override PhrasingSlur #'stencil = #(display-control-points) > \override Tie #'stencil = #(display-control-points) } > } > > (you see where this is going? ;-) ) debugCurvesOn = \layout { \context { \Score \override Slur #'stencil = #(display-control-points) \override PhrasingSlur #'stencil = #(display-control-points) \override Tie #'stencil = #(display-control-points) } } That created a layout definition (more accurately: an output definition suitable for use in layouts). Which can be used in \layout: \layout { \debugCurvesOn [Other stuff ...] } If you want to turn this into a function, you use define-scheme-function and construct the return value using #{ \layout { ... } #}. > Furthermore I will later want to write functions for the \score block, > and I will want to pass some parameters in there - which doesn't work > with include files. Not clear to me what you want. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user