lilypond-user
[Top][All Lists]
Advanced

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

Re: Pull in external LilyPond files into a score of movements


From: Jérôme Plût
Subject: Re: Pull in external LilyPond files into a score of movements
Date: Tue, 4 Aug 2015 14:22:27 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

Pridie Nonas Augustas MMXV scripsit unlabeled :
> Thank you all so much, i'm just getting into lilypond and trying to figure
> out how to make it work for my workflow. i have a solution i like to this,
> or similar, issue, which i will share soon. meanwhile, i have a question
> that will help me finish it: 
> is there such a thing as a null0if, or a ternary operator that can be used
> inline? I want to do something like this:
> 
> \header {
>     title = \title
>   }
> 
> but if \title hasn't been defined (because I'm running an ily outside its
> container), then it fails. Would like to do something like title = \title ||
> "" (to borrow javascript syntax - use \title var if it exists, else use an
> empty string).
> 
> I guess if not, I can write a scheme function, but haven't delved into that
> yet, and trying to figure out the simplest approach. 

I think the easiest way is to scheme it:
(warning, I cannot test the code below right now):

#(if (not (defined? 'title)) (set! title ""))

You can even meta-scheme it:

#(define (define-default symbol)
  (if (not (defined? symbol)) (module-add! (current-module) symbol "")))

#(map define-default '(title subtitle instrument composer))




reply via email to

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