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

Issue 262980043: Issue 4572: Remove the number of arguments from callback macros (Closed)

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

Description

The compiler is capable of counting the number of arguments in a callback. It can also check that the number of optional arguments does not exceed the total number of arguments. I've put the code that accomplishes these things in lily-guile-macros.hh, but it is generic enough that it might make more sense to create a new file for it. Suggestions are welcome. Changes in lily-guile-macros.hh are manual. Everything else is automated with this script: for FILE in $(git grep -l '^MAKE_[_A-Z]*SCHEME_CALLBACK[_A-Z]* ' lily) do sed -i 's/\(MAKE_[_A-Z]*SCHEME_CALLBACK[_A-Z]*\) *(\([^,]*\), *\([^,]*\), *\([^,)]*\)/\1 (\2, \3/' $FILE done

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+312 lines, -278 lines) Patch
M lily/accidental.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M lily/accidental-placement.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/align-interface.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/arpeggio.cc View 7 chunks +7 lines, -7 lines 0 comments Download
M lily/axis-group-interface.cc View 12 chunks +13 lines, -13 lines 0 comments Download
M lily/balloon.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/beam.cc View 12 chunks +12 lines, -12 lines 0 comments Download
M lily/break-alignment-interface.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M lily/breathing-sign.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M lily/chord-name.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/clef.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/clef-modifier.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/cluster.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M lily/custos.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/dot-column.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/dots.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/duration-scheme.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/enclosing-bracket.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/figured-bass-continuation.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/fingering-column.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/flag.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M lily/grace-music.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/grid-line-interface.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/grob.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M lily/hairpin.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M lily/hara-kiri-group-spanner.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M lily/horizontal-bracket.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/include/lily-guile-macros.hh View 2 chunks +40 lines, -6 lines 0 comments Download
M lily/key-signature-interface.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/kievan-ligature.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/ledger-line-spanner.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/line-spanner.cc View 3 chunks +5 lines, -5 lines 0 comments Download
M lily/lyric-combine-music.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/lyric-extender.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/lyric-hyphen.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/measure-grouping-spanner.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/melody-spanner.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/mensural-ligature.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/multi-measure-rest.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M lily/music.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/music-sequence.cc View 7 chunks +7 lines, -7 lines 0 comments Download
M lily/music-wrapper.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/note-collision.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/note-head.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M lily/ottava-bracket.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/paper-column.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/partial-iterator.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/percent-repeat-item.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/piano-pedal-bracket.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/pitch.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/property-iterator.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/pure-from-neighbor-interface.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/relative-octave-check.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/relative-octave-music.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/repeated-music.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M lily/rest.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M lily/rest-collision.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/script-column.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/script-interface.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M lily/self-alignment-interface.cc View 2 chunks +7 lines, -7 lines 0 comments Download
M lily/semi-tie.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/semi-tie-column.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/separation-item.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/side-position-interface.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M lily/skyline.cc View 3 chunks +5 lines, -5 lines 0 comments Download
M lily/skyline-pair.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/slur.cc View 9 chunks +9 lines, -9 lines 0 comments Download
M lily/slur-scoring.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/spacing-spanner.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/spanner.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M lily/staff-symbol.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/staff-symbol-referencer.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/stem.cc View 16 chunks +16 lines, -16 lines 0 comments Download
M lily/stem-tremolo.cc View 9 chunks +9 lines, -9 lines 0 comments Download
M lily/stencil-integral.cc View 10 chunks +10 lines, -10 lines 0 comments Download
M lily/stream-event.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M lily/sustain-pedal.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/system.cc View 7 chunks +10 lines, -10 lines 0 comments Download
M lily/system-start-delimiter.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/text-interface.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M lily/tie.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M lily/tie-column.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/tuplet-bracket.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M lily/tuplet-number.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M lily/vaticana-ligature.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/volta-bracket.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 2
Dan Eble
8 years, 8 months ago (2015-08-21 20:11:18 UTC) #1
dak
8 years, 8 months ago (2015-08-22 07:19:24 UTC) #2
That's overengineering in my opinion.  GUILE's own header macros take all the
given parameters so we get a discrepancy when LilyPond's equivalents don't do
so.

Unless there is a very compelling reason to indulge in this sort of thing (and
the template pokery-trickery in lily-guile-macros.hh is of unprecedented level
for what looks like rather immaterial gains), I'd strongly recommend not going
there.
Sign in to reply to this message.

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