Jean Abou Samra <[email protected]> writes: > Le 30/12/2022 à 00:19, Alasdair McAndrew a écrit : >> Thank you SO very much! Such a simple thing ... (as is so often the >> case, certainly with my queries). It now works perfectly. > > > Well, as a matter of fact, you're not the first one tripped up by this. > > Makes me wonder if we should make it possible to do it like > > dStop = > #(define-music-function > (topnote bottomnote) > (ly:music? ly:music?) > #{ > << {\topnote} \\ {\bottomnote} >> > #})
It would be quite absurd to involve the cost of $/# for a native construct used as often as \ . > Unlike # which starts a block in Scheme syntax, \ is LilyPond > syntax and stops at a brace or such. It also makes a copy, which > avoids problems like the one explained here: > https://lilypond.org/doc/v2.25/Documentation/notation/how-to-prevent-sharing-of-music-expressions $ is exactly the same in that respect. > However, it doesn't work right now for local variables, > like function parameters, in #{ ... #}. I think you may underestimate the cost of magic involved with making #/$ integrate into local Scheme scoping. If you want Scheme semantics, $ offers those along with Scheme syntax. -- David Kastrup
