What should the relation between \book / \bookpart be?
David Kastrup <[email protected]>
| Newsgroups | gmane.comp.gnu.lilypond.devel |
|---|---|
| Organization | Organization?!? |
| Message-ID | <[email protected]> |
I am currently working on books, and with regard to what books and
bookparts contain, there is almost no structural difference (a bookpart
may even contain a paper block using, for example, different page break
algorithms to the rest of the book).
Right now, most of the functionality is determined ad-hoc which is why
you cannot really write something like
bookA = \book { ... }
\bookA
but have to write
\bookA = \book { ... }
\book { \bookA }
instead. Similar with scheme functions returning a book: they cannot be
used at top level.
So there is a case for not distinguishing them at all in structure and
always require an enclosing \book / \bookpart block for any use outside
of assignments. Which is more or less what we have now.
That saves us from having to distinguish between
bookA = \book { ... }
bookB = \bookpart { ... }
\book { \bookA ... }
which would mean to create a book as an amended copy of \bookA and
\book { \bookB }
which would mean to create a book containing \bookB as a bookpart.
I am not sure whether our current implementation is perfectly agnostic
in that regard.
So there is some incentive to be able to use either as either. However,
there is one complication: a book _can_ contain bookparts (but does not
need to). A bookpart can't.
If one would use a book already having bookparts as a bookpart, it would
need to shed its own bookparts.
The other possibility is to nail down the distinction book/bookpart in
the type/structure. Either as a default when not explicitly recast, or
hardwired.
Problem either way is that the ability not to specify one's wanted
manner of use makes something like
\book { \bookpartA ...
ambiguous: are we recasting \bookpartA into a book type and amending the
resulting book, or are we creating a book from scratch containing
\bookpartA as its first bookpart?
For rearranging an existing source into something that is only a part of
a larger document, the current relative fluidity between book and
bookpart may be convenient.
On the other hand, expectations are likely that whether something is a
\book/bookpart is more ingrained.
Where to go?
--
David Kastrup