DescriptionImplement optional music function arguments
This allows, say, to define a substitute for \relative that has an
optional pitch argument defaulting to f rather than c.
pitch = #(define-scheme-function (parser location pitch)
(ly:pitch?) pitch)
myrelative = #(define-music-function (parser location pitch music)
((ly:pitch? #{ \pitch f #}) ly:music?)
#{ \relative $pitch $music #})
\relative c' {c' d e f g a b c}
\relative {c' d e f g a b c}
\myrelative c' {c' d e f g a b c}
\myrelative {c' d e f g a b c}
The first uploaded patch is a separate commit with the following description:
lexer.ll: Allow push_extra_token to take a Scheme value as well.
Patch Set 1 #Patch Set 2 : Optional arguments including several in a row, #Patch Set 3 : Move argument checks into parser, allowing default arguments to go unchecked. #
Total comments: 2
Patch Set 4 : regtests & docs #
MessagesTotal messages: 18
|