Am 30.11.2015 um 10:03 schrieb David Kastrup: > Urs Liska <[email protected]> writes: > >> Am 30.11.2015 um 09:27 schrieb Urs Liska: >> >> Maybe, not for having someone else do the work for me but as an >> incentive to learn: >> >> I assume I could also rewrite the following code in a similar fashion? >> >> % Produce the code for coloring one grob in a (make-music) expression >> #(define (color-element grob color) >> (make-music >> 'ContextSpeccedMusic >> 'context-type >> 'Bottom >> 'element >> (make-music >> 'OverrideProperty >> 'once >> #t >> 'pop-first >> #t >> 'grob-value >> color >> 'grob-property-path >> (list (quote color)) >> 'symbol >> grob))) >> >> What would that be in the newer, LilyPond-ish syntax? > Oh, #{ ... #} is not new. It's been there since basically forever at > least for straightforward music expressions (rather than layout > definitions, markups, and other stuff). It became more versatile around > 2.14 and started to work nicely with lexical closures at a similar point > of time. > > The above would roughly be > > #(define (color-element grob color) > #{ \once \override #grob . color = #color #}) > > Note that the default context for overrides is Bottom anyway, so you > don't need to write \override Bottom . #grob . color here. >
Oh, seems like a typical case of not seeing the forest for the trees ... Thanks for the explanations Urs _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
