lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple optional arguments


From: David Kastrup
Subject: Re: Multiple optional arguments
Date: Thu, 10 Nov 2016 13:30:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Hi all,
>
> I would like to have two optional arguments in a music function. My
> current approach fails, and I don't know if I'm doing anything wrong or
> if I'm trying the wrong thing in the first place.

When all else fails, read the manual, in this case the extension guide.


2.2.2 Scheme function usage
---------------------------

Scheme functions can be called pretty much anywhere where a Scheme
expression starting with ‘#’ can be written.  You call a scheme function
from LilyPond by writing its name preceded by ‘\’, followed by its
arguments.  Once an optional argument predicate does not match an
argument, LilyPond skips this and all following optional arguments,
replacing them with their specified default, and ‘backs up’ the argument
that did not match to the place of the next mandatory argument.  Since
the backed up argument needs to go somewhere, optional arguments are not
actually considered optional unless followed by a mandatory argument.

[...]

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]