Jean Abou Samra <j...@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