lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conditional runs


From: Karl Hammar
Subject: Conditional runs
Date: Thu, 11 Feb 2010 08:47:42 +0100 (CET)

--------
I try to do conditional lilypond runs. I can do that by having different 
files which includes the common parts, but I'd like to have just one
source file and specify which version to use (in my case, mostly different
page sizes). So I'm trying out the #(if (defined ..)) construct.

1, what is the rationale for "lilypond -d xx" to be restricted to just 
   a certain list of variables?

2, what is "lilypond -e '...' meant to be used for?

+++++++++++
  I have:

$ cat test.ly
\version "2.13.0"

%#(define flag #t)
#(if (defined? 'flag)
  (display "\n\tYes!\n")
  (display "\n\tNo!\n")
)
$

  Running this gives me:

$ lilypond test.ly
GNU LilyPond 2.13.0
Processing `test.ly'
Parsing...
        No!
$

  Uncommenting the (define..) line gives me:

$ lilypond test.ly
GNU LilyPond 2.13.0
Processing `test.ly'
Parsing...
        Yes!

$

  So far so good. Now back to the commented %#(define...).
  Trying the "obvious" thing:

$ lilypond -d flag test.ly
GNU LilyPond 2.13.0
warning: no such internal option: flag
...
$

  since -d is restricted to internal options, and

$ lilypond -e '(define flag #t)' test.ly
GNU LilyPond 2.13.0
Processing `test.ly'
Parsing...
        No!

$

  does not work either.

Regards,
/Karl

-----------------------------------------------------------------------
Karl Hammar                    Aspö Data               address@hidden
Lilla Aspö 148                                                 Networks
S-742 94 Östhammar          +46  173 140 57                   Computers
Sweden                     +46  70 511 97 84                 Consulting
-----------------------------------------------------------------------






reply via email to

[Prev in Thread] Current Thread [Next in Thread]