Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3011)

Issue 249670043: Implement partial function calls and markups (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 9 months ago by dak
Modified:
8 years, 7 months ago
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Implement partial function calls. Contains three commits, see particularly the regtests as examples. I'm not convinced this idea is as good as I thought when coming up with it: it may be that this particular use case is not frequent enough to warrant the complexity. It seems nice for defining aliases like tagv = \tag '(violinI violinII) \incomplete or important = \tweak color #red \tweak font-size 3 \incomplete but I'm not sure that this warrants the effort. Discuss. Allow for chaining of several partial functions in a row Chaining only works when all function calls except the last one have all arguments supplied already, with their last argument being the rest of the chained call. Implement partial function calls A partial function call acts as a function where the start of the argument list has already been supplied. For example: makeRed = \tweak color #red \incomplete Then one can use this as { c' \makeRed d' e'-\makeRed -. } Also contains partial markups: A partial markup acts as a chain of markup commands where everything but the final markup has already been supplied. For example: bold-red-markup = \markup \bold \with-color #red \incomplete \markup \bold-red "text" \markuplist \column-lines \bold-red { One Two Three } Please note that in order for \markup to recognize the resulting markup command inside of markup expressions, the identifier to which the resulting markup command is assigned needs to have "-markup" appended to its name: LilyPond encodes markup command names in this manner so that markup commands can use the same name as other entities outside of markup mode. Note also that this will not work with the markup macro since the latter additionally requires the definition of a suitable make-bold-red-markup command.

Patch Set 1 #

Patch Set 2 : Implement partial markups #

Patch Set 3 : \incomplete -> \etc, add Changes entry #

Unified diffs Side-by-side diffs Delta from patch set Stats (+224 lines, -4 lines) Patch
M Documentation/changes.tely View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
A input/regression/markup-partial.ly View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
A input/regression/music-function-incomplete.ly View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M lily/include/lily-imports.hh View 1 1 chunk +2 lines, -0 lines 0 comments Download
M lily/lily-imports.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M lily/lily-lexer.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M lily/parser.yy View 1 2 5 chunks +122 lines, -4 lines 0 comments Download
M scm/ly-syntax-constructors.scm View 1 2 chunks +53 lines, -0 lines 0 comments Download

Messages

Total messages: 15
Trevor Daniels
If I understand this correctly it permits a variable definition to be used in some ...
8 years, 9 months ago (2015-07-10 10:34:24 UTC) #1
mark_opus11.net
On 2015/07/10 10:34:24, Trevor Daniels wrote: > If I understand this correctly it permits a ...
8 years, 9 months ago (2015-07-10 10:50:55 UTC) #2
dak
On 2015/07/10 10:34:24, Trevor Daniels wrote: > If I understand this correctly it permits a ...
8 years, 9 months ago (2015-07-10 11:00:26 UTC) #3
dak
On 2015/07/10 10:50:55, mark_opus11.net wrote: > On 2015/07/10 10:34:24, Trevor Daniels wrote: > > If ...
8 years, 9 months ago (2015-07-10 11:17:37 UTC) #4
dak
On 2015/07/10 11:17:37, dak wrote: > On 2015/07/10 10:50:55, http://mark_opus11.net wrote: > > On 2015/07/10 ...
8 years, 9 months ago (2015-07-10 11:44:56 UTC) #5
dak
On 2015/07/10 11:44:56, dak wrote: > redBold = ... > > cannot define a markup ...
8 years, 9 months ago (2015-07-10 12:56:10 UTC) #6
dak
Implement partial markups
8 years, 9 months ago (2015-07-10 14:52:42 UTC) #7
Dan Eble
I appreciate your comment about this opening a can of worms, but I do like ...
8 years, 9 months ago (2015-07-11 02:24:58 UTC) #8
dak
On 2015/07/11 02:24:58, Dan Eble wrote: > I appreciate your comment about this opening a ...
8 years, 9 months ago (2015-07-11 05:11:07 UTC) #9
dak
On 2015/07/11 02:24:58, Dan Eble wrote: > I appreciate your comment about this opening a ...
8 years, 9 months ago (2015-07-11 06:48:17 UTC) #10
thomasmorley651
Will this allow trans-cis = \transpose c cis \etc ? Then I'd say it's a ...
8 years, 9 months ago (2015-07-11 11:18:52 UTC) #11
dak
On 2015/07/11 11:18:52, thomasmorley651 wrote: > Will this allow > trans-cis = \transpose c cis ...
8 years, 9 months ago (2015-07-11 12:51:04 UTC) #12
wl_gnu.org
> And \{ ... \} seem nice to leave open for used-defined > articulations. I ...
8 years, 9 months ago (2015-07-11 18:37:02 UTC) #13
treda_treda.co.uk
Werner LEMBERG wrote Saturday, July 11, 2015 7:36 PM >> And \{ ... \} seem ...
8 years, 9 months ago (2015-07-11 18:53:57 UTC) #14
dak
8 years, 9 months ago (2015-07-12 23:24:46 UTC) #15
\incomplete -> \etc, add Changes entry
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b