Luca Fascione <[email protected]> writes: > Luca Fascione > > > On Wed, 26 Aug 2026, 18:42 David Kastrup, <[email protected]> wrote: > >> >> >> In this case it would be a fairly full base class (there are quite few >> members particular to only book or bookpart). I have no idea whether >> that would make a difference regarding the undesirability. >> > > > I would call it "base" if it made not much sense to use it that level of > the class hierarchy: it seems to me in this context you'd have book objects > and bookpart objects flowing around, and that you'd love to be able to say > "I just need to tell book-ish things apart from... other stuff" but you'd > never want to make a book_base object per-se. This would be the criterion > I'd use to select this naming pattern.
In this case, the base class would have abstract members so you _could_ not create a Book_base object. But you can check whether a pointer is static_cast-able to Book_base. If you derive both a rhombus and a rectangle class from a quadrilateral class, a valid question would be "is this a quadrilateral?". You would not ask "is this a book base?" though, but there are no actual Book_base objects. There would be no Book_item objects either since a Book_item is too unspecific. I like that from an English language standpoint. It suffers from the fact that we derive both Item and Spanner from Grob, so LilyPond already uses "Item" for something more specific rather than something less specific. At least an "Item" again is too unspecific on its own and falls into lots of different grob types even if they are not distinguished through the C++ type lattice. -- David Kastrup
