On Sun, 2 Dec 2018, David Sumbler wrote: > > But MusiXTeX can do "if" statements.
> I felt that an "if" would be useful, so I eventually came up with: That is useful for conditional includes, but it can't be embedded in the data structure that LilyPond calls "music" and stores in variables. As soon as something is turned into "music" it has to be data, not code; conditionals must either be evaluated before the input is turned into "music," or by separate code (usually, in Scheme rather than in LilyPond as such) that conditionally modifies the static "music." That latter approach, with tags in the "music" that can be filtered out, is what's usually recommended as a substitute for real conditionals in LilyPond, but it's quite limiting compared to what programming languages can do with "if." For those familiar with programming languages it's not so mysterious why this situation comes about. LilyPond takes care to call its variables variables in the documentation. You reference them; you don't execute them. They contain data, not code. Obviously, data will be the same every time you look at it, unless you externally change it. But I wish that without escaping to Scheme I could have something more like a macro than like a variable, evaluating its conditionals (and doing other programming-language stuff) every time it is used. -- Matthew Skala msk...@ansuz.sooke.bc.ca People before tribes. http://ansuz.sooke.bc.ca/ _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user