[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automated processing of multiple books
From: |
David Kastrup |
Subject: |
Re: Automated processing of multiple books |
Date: |
Wed, 04 Nov 2015 19:24:08 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Simon Albrecht <address@hidden> writes:
> Hello,
>
> I have written a Scheme function to automatically produce all parts
> given through a symbol-list. Here is a boiled-down, dummy example:
> %%%%%%%%%%%%
> \version "2.19.28"
> printParts =
> #(define-scheme-function (abbrs) (symbol-list-or-symbol?)
> (let ((abbrs (if (symbol? abbrs) (list abbrs) abbrs))
> (process-part (lambda (abbr)
> (print-book-with-defaults
> #{
> \book {
> \bookOutputName #(string-append
> "wrap-multiple-books-"
> (symbol->string abbr))
> \score { c }
> \paper { #(set-paper-size "a10") indent = 0 }
> \header { tagline = ##f }
> }
> #}))))
> (map process-part abbrs)))
> \printParts one.two
> %%%%%%%%%%%%
>
> This compiles fine inasmuch as the output is just as intended, but it
> does sport a:
>
> <0>"/home/simon/lilypond/tests/wrap-multiple-books.ly:17:1: error: bad
> expression type
>
> \printParts one.two"
>
> Is this worth a bug report about this error appearing too easily?
No. You use map instead of for-each, you use define-scheme-function
instead of define-void-function.
If you bend over backwards in order to pass a value to LilyPond, it
seems absurd to complain about LilyPond trying to make sense of it.
define-scheme-function is _explicitly_ a function returning a value for
LilyPond to interpret.
--
David Kastrup