=> David K., do you know why the parser balks at such a top-level ly:book?
How can a book be distinguished from a bookpart?
Are they both ly:book? behind the scenes? If so, I can see the problem.
Without an answer to that question, we cannot implement this. But have you tried explicitly using \book { ... } for getting a book?
I suspect I am misunderstanding you. Here is what else I have tried: %%%% \version "2.20" bookFunc = #(define-scheme-function () () #{ \book { \score { { b'4 } } } #}) % \bookFunc % fails - bad expression type % \book { \bookFunc } % fails - bad expression type $#{ \bookFunc #} % works?! %%%% -- Aaron Hill