lilypond-devel
[Top][All Lists]
Advanced

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

Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050)


From: dak
Subject: Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050)
Date: Tue, 18 Feb 2014 17:06:31 +0000

On 2014/02/18 16:27:25, janek wrote:
LGTM with a suggestion


https://codereview.appspot.com/60490050/diff/90001/Documentation/changes.tely
File Documentation/changes.tely (right):


https://codereview.appspot.com/60490050/diff/90001/Documentation/changes.tely#newcode122
Documentation/changes.tely:122: Scheme functions and identifiers can
now be used
as output definitions.
An example would be probably nice - here's one:


coloredNotes =
#(define-scheme-function (parser location col)(color?)
    #{
      \layout {
        \context {
          \Staff
          \override NoteHead #'color = #col
        }
      }
    #})

\layout { \coloredNotes #blue }

{ c' }

That example is disturbing since it is not really about using a function
as an output definition, but rather about using a function as a
_context_ definition.  You usually would not expect the above to work
but
\layout { indent = #0 \coloredNotes #blue }
to fail.  But exactly that will happen.  The actual purpose is more like
\layout {
\some-parameterized-function-from-my-standard-include-file-generating-the-whole-layout-block
          #first-parameter #second-parameter #third-parameter
          possibly additional tweaking
}

I think that turning \coloredNotes into a context definition producer by
just removing the \layout { and matching } without any other change
would work fine and make a nice example.  Just not an example for this
particular item.  And it turns out that a music function doing that
override would work equally well in this location, so even for context
definitions it might make more sense to use an example including
engravers (since you can't do _that_ with a music function).

Maybe something setting up completion engravers with some parameters?
On the other hand, you might want to do this using a context
_modification_ since that is easy to use in _different_ contexts.

It's suprisingly hard to find some really good and _necessary_ use for
all of those.  Still, it's better to have them working as expected
rather than not.

https://codereview.appspot.com/60490050/



reply via email to

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