[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strings as variable names
From: |
Werner LEMBERG |
Subject: |
Re: Strings as variable names |
Date: |
Mon, 28 Dec 2015 21:39:05 +0100 (CET) |
> Whenever you have variables pointing to indexed parts or to
> consecutive snippets you may want to use variables like
>
> violin1 =
> violin2 =
>
> or
>
> flute_phrase01 =
> flute_phrase02 =
>
> or similar. This is expressive as LilyPond code per se, and would
> be accessible for scripting, e.g. to generate stub files with empty
> varialbes.
>
> The workaround using roman numbers is pretty cumbersome, and I think
>
> violin_02_34 would be much more comprehensible to most users than
> violinIIxxxiv
I suggest to use the m4 preprocessor
[https://en.wikipedia.org/wiki/M4_(computer_language)] to convert,
say, `violin1' to `violinI'. Add the line
define(`violin1', `violinI')
at the very beginning of your input file, then run
m4 < infile > outfile
Werner
- Re: Strings as variable names, (continued)
Re: Strings as variable names, David Sumbler, 2015/12/28
- Re: Strings as variable names, David Kastrup, 2015/12/28
- Re: Strings as variable names, Urs Liska, 2015/12/28
- Re: Strings as variable names, David Kastrup, 2015/12/28
- Re: Strings as variable names, Kieren MacMillan, 2015/12/28
- Re: Strings as variable names, Malte Meyn, 2015/12/28
- Re: Strings as variable names, David Kastrup, 2015/12/28
- Re: Strings as variable names, Malte Meyn, 2015/12/28
Re: Strings as variable names,
Werner LEMBERG <=
Re: Strings as variable names, Johan Vromans, 2015/12/28
Re: Strings as variable names, David Kastrup, 2015/12/28
Re: Strings as variable names, Johan Vromans, 2015/12/29
Re: Strings as variable names, Marc Hohl, 2015/12/28
Re: Strings as variable names, Thomas Morley, 2015/12/28
Re: Strings as variable names, Johan Vromans, 2015/12/28
Re: Strings as variable names, Simon Albrecht, 2015/12/28
Re: Strings as variable names, David Kastrup, 2015/12/28
Re: Strings as variable names, Simon Albrecht, 2015/12/29
Re: Strings as variable names, David Kastrup, 2015/12/29