lilypond-user
[Top][All Lists]
Advanced

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

Re: define-markup-command with variable number of arguments


From: Thomas Morley
Subject: Re: define-markup-command with variable number of arguments
Date: Fri, 1 Nov 2019 16:01:27 +0100

Am Fr., 1. Nov. 2019 um 15:34 Uhr schrieb Karsten Reincke <address@hidden>:

> does anyone has / know about an example of a define-markup-command 
> implementation
> using a variable number of arguments / parameters?

Nope, optional arguments are not possible using define-markup-command.

> Unfortunately, in my system (Linux Ubuntu 19.10 with Lilypond 2.18...) the 
> normal
> GUILE / scheme syntax (define (x y . args) ) (doanythingwith args) ) seems to
> executable.
>
> The tutorial LilyPond Extending mentions that there exist such an opportunity
> (page 19.), but does not contain any example.

The section of the Extending-tutorial refers to functions, not to the
define-markup-command which is a macro.
(At least if I've identified the section you refer to correctly, I
usually use the big-page-html-version of the docs.)

You could go for properties (see define-markup-commands.scm), but the
syntax in coding and calling it differs ofcourse and you may encounter
unwished side-effects (if namings interfer with grob-properties).

For variable amount of args I'd go for list? (or the like) and let the
body of your code sort it out.


Cheers,
  Harm



reply via email to

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