lilypond-user
[Top][All Lists]
Advanced

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

Re: for-each?


From: David Kastrup
Subject: Re: for-each?
Date: Mon, 03 Jul 2023 23:31:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Jean Abou Samra <jean@abou-samra.fr> writes:

> Le lundi 03 juillet 2023 à 22:08 +0200, David Kastrup a écrit :
>> Ugh, that's a can of worms.  #xxx will only accept a context-dependent
>> set of values and reject values not fitting the context.  But the
>> context includes whether or not, for example, we are in lyrics mode.
>> For that reason \new ... accepts only a rather limited set of
>> expressions, mostly delimited expressions where the mode-switching
>> happens at the delimiters.
>> 
>> So it's more the $... that is problematic, but $... always comes with a
>> warning tag with possibly untimely mode switching because of how parser
>> lookahead works.
>> 
>> So all in all, I'm queasy about touching anything here.  It's not like
>> you cannot just use one level of { } to get a context where #... will be
>> well-defined.
>
>
> On a related note, \new XXX is the only syntactic context I know
> where XXX = \xxx is accepted if xxx was defined with define-music-function,
> but not if it was defined with define-scheme-function, even if
> the function returns music.

Pretty sure there are more.

> I dunno whether that's expected, or improvable. At any rate, it is the
> only case where I am aware of an advantage of define-music-function
> over define-scheme-function.
>
> (And yes, I should really look into the parser code myself, but I
> don't have the time right now.)

If you want to work on consistency and reducing quirks like syntactic
define-xxx-function differentiation, "having the time" sort of requires
a sabbatical.  Certainly beyond GSoC level.

-- 
David Kastrup



reply via email to

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