lilypond-user
[Top][All Lists]
Advanced

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

Re: unpacking a list


From: David Kastrup
Subject: Re: unpacking a list
Date: Mon, 30 Nov 2015 09:53:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> now finally to this one ...
>
> Am 28.11.2015 um 10:52 schrieb David Kastrup:
>> Urs Liska <address@hidden> writes:
>>
>>> If someone might want to have a second look at the actual code it's
>>> (currently) in
>>> https://github.com/openlilylib/snippets/blob/just-intonation-stub/notation-snippets/just-intonation/definitions.ily,
>>> towards the end where it reads "(append (color-music col) ..."
>> Well, obviously you could just write
>>
>> #{ #@(color-music col) $pitch $duration -#(format "address@hidden" cent) #}
>>
>> instead of
>>
>>     (make-music
[...]

> Indeed, that's much better and produces point-and-click *at all*.

Well, one can use 'origin (*location*) arguments (and the top-level
music returned by a music function gets that automatically, but the top
level here is sequential music and you cannot click that as it is just a
container of other music).  Or equivalently call ly:set-origin! on such
expression that should get point-and-click info.

Or, previously to 2.19.22, use 'origin location arguments to make-music,
assuming that one has used the default (parser location ...) argument
list at the top of the music function.

> And especially it looks much more expandable once I might want to add
> more bells and whistles to the generated music.
>
> How would I find out about that solution? What I came up with was the
> result of taking \displayMusic's result as a model.

Well, the above is likely taking whatever syntax you fed into
\displayMusic as a model.  Which is sort of the point of #{ ... #}.

> Concretely: Can you tell me what the "#@" in front of (color-music
> does?

It's like the difference between , (unquote) and ,@ (unquote-splicing).
The first is for putting a single Scheme expression somewhere, the
second takes a list as argument and turns every list element into a
separate Scheme expression.

-- 
David Kastrup



reply via email to

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