Graham King <lilyp...@tremagi.org.uk> writes: > I'm trying to convert a naive Scheme function which has been broken by > the new syntax for \note. Some arithmetic gives me the index (in this > MNWE, 96) to a list of pairs, foo, from which I want to extract some > markup. > > The 300-LOC problem seems to boil down to this: > > %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > \version "2.25.7" > > #(define foo '((96 . #{ \markup { \note-by-number #1 #0 #UP }#}))) > > { c'1^\markup {#(cdr (assoc 96 foo))} } > %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Please could a kind Scheme expert point out the stupid and obvious > mistake that has eluded me for several evenings?
Uh, there isn't even \note in there? The problem in the above is a quoting problem: you mustn't quote #{...#}, and you can avoid quoting it using quasiquote and unquote: \version "2.25.7" #(define foo `((96 . ,#{ \markup { \note-by-number #1 #0 #UP }#}))) { c'1^\markup {#(cdr (assoc 96 foo))} } -- David Kastrup