lilypond-user
[Top][All Lists]
Advanced

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

Re: Making markup functions parametric


From: Ralf Mattes
Subject: Re: Making markup functions parametric
Date: Fri, 03 Jul 2020 22:55:17 +0200
User-agent: SOGoMail 2.3.20

Am Freitag, 03. Juli 2020 22:07 CEST, Urs Liska <lists@openlilylib.org> schrieb:


> > Syntacilally? That would be a scheme keyword.
>
> So that would be difficult to inject from a variable/argument, isn't
> it?

No, why? You can of course store a keyword in a variable and/or pass it as an 
argument.

> I can of course do
>
>   (cond
>    ((eq? enclosure 'circle)
>     (markup #:circle "CC"))
>    ((eq? enclosure 'box)
>     (markup #:box "CC)))

Looks a bit too complicated - iff you insist on using symbols as parameters you
could use guile's symbol->keyword function.

> But I'd rather do something like
>
>   (markup (assq-ref enclosures enclosure) "CC")
>
> i.e. looking up the appropriate function instead of creating a
> conditional chain.

But #:circle isn't a function ...

 Cheers RalfD

> Any ideas?
>
> ThanksUrs
>
> >
> >  Cheers, RalfD
> >
> > > BestUrs
> > >
> > >
> >
> >
> >
>
>



--
Ralf Mattes

Hochschule für Musik Freiburg
Projektleitung HISinOne
Schwarzwaldstr. 141, D-79102 Freiburg
http://www.mh-freiburg.de






reply via email to

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