lilypond-user
[Top][All Lists]
Advanced

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

Re: How to use optional arguments / parameters in a define-markup-comman


From: Thomas Morley
Subject: Re: How to use optional arguments / parameters in a define-markup-command
Date: Mon, 4 Nov 2019 23:06:55 +0100

Am Mo., 4. Nov. 2019 um 18:00 Uhr schrieb Karsten Reincke <address@hidden>:
>
> Dear friends
>
> A few days ago, I asked whether anyone knows how one can use variable 
> parameter
> lists = optional arguments = flexible argumentlists in a markup function. I 
> was
> told that such an opportunity does not exist (Thomas Morley)

Let me quote another part of my reply:

Am Fr., 1. Nov. 2019 um 16:01 Uhr schrieb Thomas Morley
<address@hidden>:

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

And that's basically what you do in your example-code.

> resp. must be
> simulated by some embedded property features (Urs Liska).

That's not exactly what Urs wrote...

> #(define (assign keyValue assocList defaultValue)
>   (string? list?)
^^^^^^^^^^^^^^^^^^
As far as I can tell this line is superfluous, returning #f.

>   (let* ((localPair (assoc keyValue assocList)))
>     (if localPair (cdr localPair) defaultValue)
>   )
> )

Check for assoc-get resp. ly:assoc-get doing.


Cheers,
  Harm



reply via email to

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