David Nalesnik <[email protected]> writes:

>     An optional argument can be skipped only if there is some place in
>     the argument list where it can go.  So in final position, optional
>     arguments are indistinguishable from mandatory arguments (actually
>     not quite, since they make preceding optional arguments also
>     mandatory).  You can, however, still explicitly skip them by
>     writing \default in the actual argument list, like commands like
>     \key and \mark let you do.
>     
>
> Ah, OK!  So (for the record) writing
>
> \test #'color #blue \default
>
> works perfectly with the test function.  And
>
> \test #'color #@(list green red)
>
> does too.

This use of \default for skipping optional arguments even in end
position may appear a bit contrived.

However, \key \default and \mark \default existed (hardwired in the
parser) even before music functions ever heard of optional arguments, so
I consider it an accomplishment to have made this preexisting syntax fit
into a coherent whole.

-- 
David Kastrup


_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to