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

Issue 10965043: Create a two-argument form of define-event-class (Closed)

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

Description

Create a two-argument form of define-event-class This definition of define-event-class just specifies the event class symbol itself as well as its immediate parent class. Redefining existing event classes is not (yet?) supported. I've come to the persuasion that the \DefineEventClass interface was not a good idea as it introduces a separate event class hierarchy for every Global context. Since Global contexts share iterators (which are part of the music types), that does not make sense. The previous approach tried to address the problem of permanent changes transgressing the lifetime of a session: session variables make for a better match to that problem. The old definition of define-event-class was needlessly contorted for what it allowed: this one is reasonably straightforward. Also contains commits: Reinitialize all-event-classes and all-grob-descriptions after session Revert "Make EventClass hierarchy a property of Global context" This reverts commit ae2db5b21bf232f5145f3a3e091689c8fc7247e9. Conflicts: lily/context-scheme.cc lily/global-context.cc lily/music.cc lily/part-combine-iterator.cc scm/define-event-classes.scm scm/document-music.scm Independently introduced conflict: lily/footnote-engraver.cc

Patch Set 1 #

Total comments: 7

Patch Set 2 : Fix tabs reintroduced by revert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -94 lines) Patch
M input/regression/scheme-text-spanner.ly View 3 chunks +4 lines, -25 lines 0 comments Download
M lily/context.cc View 4 chunks +3 lines, -12 lines 0 comments Download
M lily/context-scheme.cc View 1 chunk +0 lines, -12 lines 0 comments Download
M lily/engraver.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/footnote-engraver.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/global-context.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M lily/include/context.hh View 1 chunk +0 lines, -7 lines 0 comments Download
M lily/include/music.hh View 2 chunks +1 line, -2 lines 0 comments Download
M lily/music.cc View 4 chunks +6 lines, -5 lines 0 comments Download
M lily/part-combine-iterator.cc View 1 4 chunks +10 lines, -9 lines 0 comments Download
M lily/rhythmic-music-iterator.cc View 1 chunk +1 line, -1 line 0 comments Download
M ly/engraver-init.ly View 1 chunk +0 lines, -1 line 0 comments Download
M ly/performer-init.ly View 1 chunk +0 lines, -1 line 0 comments Download
M scm/define-context-properties.scm View 1 chunk +0 lines, -1 line 0 comments Download
M scm/define-event-classes.scm View 1 1 chunk +35 lines, -5 lines 0 comments Download
M scm/define-grobs.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/document-music.scm View 1 3 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 4
thomasmorley651
I didn't apply the patch and I can't review C++, though, after a first quick ...
10 years, 9 months ago (2013-07-05 23:20:48 UTC) #1
dak
https://codereview.appspot.com/10965043/diff/1/scm/define-event-classes.scm File scm/define-event-classes.scm (right): https://codereview.appspot.com/10965043/diff/1/scm/define-event-classes.scm#newcode87 scm/define-event-classes.scm:87: (define ancestor-lookup (make-hash-table (length all-event-classes))) AOn 2013/07/05 23:20:48, thomasmorley651 ...
10 years, 9 months ago (2013-07-06 00:05:35 UTC) #2
dak
Fix tabs reintroduced by revert
10 years, 9 months ago (2013-07-06 00:48:03 UTC) #3
thomasmorley651
10 years, 9 months ago (2013-07-06 11:01:24 UTC) #4
On 2013/07/06 00:05:35, dak wrote:
> https://codereview.appspot.com/10965043/diff/1/scm/define-event-classes.scm
> File scm/define-event-classes.scm (right):
> 
>
https://codereview.appspot.com/10965043/diff/1/scm/define-event-classes.scm#n...
> scm/define-event-classes.scm:87: (define ancestor-lookup (make-hash-table
> (length all-event-classes)))
> AOn 2013/07/05 23:20:48, thomasmorley651 wrote:
> > I'm not convinced about the naming.
> > 
> > 'ancestor' is defined in titling-init.ly, ofcourse with different
> functionality.
> > 'ancestor-lookup' is a _very_ generic naming, and it's usage _is_ generic in
a
> > certain way.
> > Though, I'd prefer something like 'ancestor-all-event-classes-lookup'.
> > No, that's to long.
> > But you get the point.
> 
> Actually, I don't get the point.  This is not a public variable, so there is
not
> much chance for collision.  It's local to the lily module, and come Guilev2,
it
> will be local to this file.

True. Ofcourse.
It's more that I'd prefer namings which mirrors more exactly what the defined
stuff will do.
(Though, that would mean to rename a the definition in titling-init.ly, too. And
probably a lot of others throughout our source-code.)

> https://codereview.appspot.com/10965043/diff/1/scm/document-music.scm
> File scm/document-music.scm (right):
> 
>
https://codereview.appspot.com/10965043/diff/1/scm/document-music.scm#newcode33
> scm/document-music.scm:33: (let* ((class (ly:camel-case->lisp-identifier (car
> entry)))
> On 2013/07/05 23:20:48, thomasmorley651 wrote:
> > Apart from using tabs I'm not able to see any difference to the old file.
> 
> The call to ly:make-event-class takes one argument less, and doc-context is no
> longer defined.

Ahh, I've overlooked it.

> > No offense, just curious about it:
> > I was told not to use tabs, what's the reason for using them here?
> 
> The first commit in the series is a revert.  It brought the tabs back from the
> dead: apparently I untabified as part of the commit in question.  I can
probably
> rerun the Scheme indenter.  The "revert" commit is not a clean revert anyway.

Thanks for your explication.

>
https://codereview.appspot.com/10965043/diff/1/scm/document-music.scm#newcode91
> scm/document-music.scm:91: (classes (ly:make-event-class class))
> Again: this line has changed non-trivially, and the context around it is then
a
> large merge conflict because of having gotten untabified in the original
commit
> that has now been reverted.
Sign in to reply to this message.

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