On Mon, Jul 27, 2009 at 6:32 PM, Han-Wen Nienhuys<hanw...@gmail.com> wrote: >>> http://codereview.appspot.com/97119/diff/1/22 >>> File lily/staff-grouper-engraver.cc (right): >>> >>> http://codereview.appspot.com/97119/diff/1/22#newcode21 >>> Line 21: { >>> Are engravers allowed to inherit code from other classes? >> >> Good question. In this forbidden, Han-Wen? > > An engraver is a really a small finite state machine that acts on > receiving music events and grobs. You have to plug the notation rules > as C++ in the right virtual methods, and C++ inheritance (typically: > overriding acknowledge_xxx or process_music in derived classes) does > not fit well with how commonality in rules should be encoded. At least > that has been my experience; it's not strictly forbidden, though.
In this case, you could probably move the relevant code into the base class, with a switch or a get_property() to configure one of the two behaviors. -- Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel