Splitting book and bookpart types

David Kastrup <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.devel
Organization Organization?!?
Message-ID <[email protected]>
In order to separate functionality and use of books and bookparts
cleanly, I am splitting the concepts into separate types with a common
Book_base ancestor.

The problem is what to do on the Scheme interface level.  All
ly:book-... functions will retain their functionality and most will work
on either.

The question is what to do with ly:book? .  Backward compatibility would
suggest taking the predicate to work on either book and book parts.  It
is not clear that the backward compatibility is important: in our own
code base, there is exactly one use, and that works on the output of
checking $current-book and thus would not even be called for bookparts,
meaning that this one use would work exactly the same with either
interpretation.

What predicate names would we use for checking for the three types
Bookpart, Book, Book_base ?

ly:bookpart? ly:book? ly:book-or-bookpart?  (no backward compatibility)

ly:bookpart? ly:wholebook? ly:book?  (backward compatibility)

What would be the clear text descriptions for type errors and predicate
types?

"A bookpart" "A book" "A book or bookpart"

Better suggestions?

-- 
David Kastrup
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.