[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: |
Janek Warchoł |
Subject: |
Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050) |
Date: |
Tue, 18 Feb 2014 19:08:38 +0100 |
2014-02-18 18:06 GMT+01:00 <address@hidden>:
> 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'm not sure if this will help you, but i can show you something
closer to a real-life example: i needed this stuff for generating
custom contexts with a fuction.
IIRC, before your improvement (i.e. before issue 3793) i had to do it
like this:
https://github.com/openlilylib/snippets/commit/012328f4caaa192f17f99a2eab7a07b41d095878
Your change should make it possible to use define-scheme-function (and
drop the "(ly:parser-define! parser '$defaultlayout #{" bit) - if i
remember correctly (haven't worked on it for some time).
See also "create custom context definitions using a scheme function"
thread on -user.
> 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.
You mean something like this?
coloredNotes =
#(define-scheme-function (parser location col)(color?)
#{
\layout {
\context {
\Staff
\override NoteHead #'color = #col
}
}
#})
\coloredNotes #blue
{ c' }
This example doesn't compile for me, i get "error: bad expression
type" (using 82bc9ad690, pretty close to current master)
Anyway, i'm sorry but i may not have more time to discuss this right now... :-(
best,
Janek
- Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), dak, 2014/02/08
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), pkx166h, 2014/02/08
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), dak, 2014/02/08
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), pkx166h, 2014/02/08
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), dak, 2014/02/08
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), graham, 2014/02/14
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), janek . lilypond, 2014/02/18
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), dak, 2014/02/18
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050),
Janek Warchoł <=
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), dak, 2014/02/18
- Re: Changes.tely updated - 2.19.x before Feb 4th 2014 (issue 60490050), dak, 2014/02/18