Hi.

Is there a standard way of conditional compilation,
e.g., to turn parts (on any level) of a score on and off?

>From a programmer's standpoint,
I'd want booleans, and branching, something like

let foo = true % or false, somewhere at the top of the file,
               % or even on the command line

% and then (just to show the idea)

...
<<  % (possibly deeply nested)
  { c d
  if foo then   e f  else  c d  endif
  g }
  { e f
  if foo then g a else ... endif
  }
>>

I know I can define variables,
and then (un)comment the use of the variables,
but that does not solve my problem
because then I had to (un)comment all uses of one variable.

I also know I can just use CPP (external preprocessor).
However that seems like a work-around because lilypond
has LISP inside and that sure has booleans and conditionals.

Oh, and I looked up "conditional" in the docs
(D. LilyPond command index) (no results).


... Then I looked it up in the mailing list archive, and found
https://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00786.html

this seems to indicate that I can only switch named parts:
$(if foo thing)  seems to require  \thing?
Then how can I avoid this definition?


- J.

Thanks for answers on the "unfold" question.

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to