[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Conditional compilation
From: |
Jérôme Plût |
Subject: |
Conditional compilation |
Date: |
Wed, 30 Jan 2013 22:29:16 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
I am writing some ensemble music and want the file to compile in two
modes: with -dfull, compile all individual parts; without it, compile
only the conductor part (for debugging). This is probably a FAQ but I
cannot find an answer on the site: what is the preferred way to
implement conditional compilation in Lilypond-guile? I naively tried
several variants of
\bookpart { \relative c' { c4 e g } }
#(if (ly:get-option 'full) #{
\bookpart { \relative c' { c4 d e } }
#})
but it looks like the second \bookpart is not exported to the
top-level lilypond. I can more or less reimplement \bookpart in Scheme
(why is it not already a Scheme construct anyway?) but there is
certainly a simpler solution.
Also, bonus points for shortness of solution: I am actually writing
lots of small pieces and don't mind including some Scheme in all of
them as the files already include a common header, but I would very
much like to keep the files themelves short and human-readable.
Thanks in advance!
--
Jérôme Plût
- Conditional compilation,
Jérôme Plût <=