DescriptionImplement partial function calls.
Contains three commits, see particularly the regtests as examples.
I'm not convinced this idea is as good as I thought when coming up
with it: it may be that this particular use case is not frequent
enough to warrant the complexity.
It seems nice for defining aliases like
tagv = \tag '(violinI violinII) \incomplete
or
important = \tweak color #red \tweak font-size 3 \incomplete
but I'm not sure that this warrants the effort.
Discuss.
Allow for chaining of several partial functions in a row
Chaining only works when all function calls except the last one have all
arguments supplied already, with their last argument being the rest of
the chained call.
Implement partial function calls
A partial function call acts as a function where the start of the
argument list has already been supplied. For example:
makeRed = \tweak color #red \incomplete
Then one can use this as
{ c' \makeRed d' e'-\makeRed -. }
Also contains partial markups:
A partial markup acts as a chain of markup commands where everything but
the final markup has already been supplied.
For example:
bold-red-markup = \markup \bold \with-color #red \incomplete
\markup \bold-red "text"
\markuplist \column-lines \bold-red { One Two Three }
Please note that in order for \markup to recognize the resulting markup command inside of markup expressions, the identifier to which the resulting markup command is assigned needs to have "-markup" appended to its name: LilyPond encodes markup command names in this manner so that markup commands can use the same name as other entities outside of markup mode.
Note also that this will not work with the markup macro since the latter additionally requires the definition of a suitable make-bold-red-markup command.
Patch Set 1 #Patch Set 2 : Implement partial markups #Patch Set 3 : \incomplete -> \etc, add Changes entry #
MessagesTotal messages: 15
|