Re: Workaround for (not-allowed) numbers in variable names?

2021-03-10 Thread Valentin Petzel
Hello Stefano, Here’s an improved version that also allows for Markup between the examples. Cheers, Valentin#(define (string-replace-substring s substring replacement) "Replace every instance of substring in s by replacement." (let ((sublen (string-length substring))) (with-output-to-stri

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-10 Thread Valentin Petzel
Hello Stefano, Here’s a slightly improved example, offering more control. Cheers, Valentin Am Mittwoch, 10. März 2021, 05:31:07 CET schrieben Sie: > Thank you for the example Valentin, > > a very interesting approach. I think I was headed in that direction, in > fact, although you code will ma

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread David Wright
On Sun 07 Mar 2021 at 14:48:08 (+), Peter Toye wrote: > The 2.22 documentation is obviously better here: > > The name of a variable should not contain (ASCII) numbers, multiple > underscores, multiple dashes or space characters. All other characters > Unicode provides are allowed, for exampl

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread Peter Toye
The 2.22 documentation is obviously better here: The name of a variable should not contain (ASCII) numbers, multiple underscores, multiple dashes or space characters. All other characters Unicode provides are allowed, for example Latin, Greek, Chinese or Cyrillic. Non-adjacent single underscore

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread Silvain Dupertuis
(which is also nice...). But anyhow, for this matter, the indications are the same. Best regards /Silvain/ Le 07.03.21 à 12:50, Peter Toye a écrit : Re: Workaround for (not-allowed) numbers in variable names? Yes, it's documented in the Notation Reference Manual section 3.1.5 File Structur

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread David Kastrup
Peter Toye writes: > Thanks for putting me right yet again. I'm not quite sure what you > mean by 'resized'. q4 is surely legal? Sure, but it's two chords, not one. -- David Kastrup

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread Peter Toye
Thanks for putting me right yet again. I'm not quite sure what you mean by 'resized'. q4 is surely legal? Best regards, Peter mailto:lilyp...@ptoye.com www.ptoye.com - Sunday, March 7, 2021, 12:09:30 PM, David Kastrup wrote: > Peter Toye writes: >> I asked this quest

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread Peter Toye
My personal view is that variables are important concepts and deserve a separate section somewhere - possibly 3.1.6 as a separate part of 'File Structure'. I note that the preceding section on markup text does not contain any detailed syntax definition - not even a link to the relevant section.

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread Werner LEMBERG
> Yes, it's documented in the Notation Reference Manual section 3.1.5 > File Structure. It doesn't seem the obvious place to put the syntax > of variable names. Well, there is a proper index entry... However, documentation for the 'foo.1.bar.2' trick is still missing. Do you have a better sug

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread David Kastrup
Peter Toye writes: > I asked this question some time ago, and David Kastrup was kind enough > to put me right. > > The problem , as you mentioned, is in the way that numbers are used > for durations. Consider the following code: > > chord = > chord2= > > c1 \chord2 > > Should the second element

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread Peter Toye
1 21:30:56 +0900 > From: 田村淳 > To: "lilypond-user@gnu.org" > Subject: Re: Workaround for (not-allowed) numbers in variable names? > Message-ID: > Content-Type: text/plain; charset="utf-8" > Wow! This is something I’ve been looking for for a long time. Is

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread Peter Toye
:17:02 +0100 > From: Silvain Dupertuis > To: lilypond-user@gnu.org > Subject: Re: Workaround for (not-allowed) numbers in variable names? > Message-ID: > Content-Type: text/plain; charset="utf-8"; Format="flowed" > I also wondered why numbers are not allowed i

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread David Kastrup
田村淳 writes: > Thank you! > > Now I understand that keys separated by periods, for example, > StaffGrouper.staff-staff-spacing.basic-distance = #7 > is a way to access a nested alist easily. Yes, and it has been like that a long time. Being able to access it with \StaffGrouper.staff-staff-spaci

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread 田村淳
Thank you! Now I understand that keys separated by periods, for example, StaffGrouper.staff-staff-spacing.basic-distance = #7 is a way to access a nested alist easily. Jun > 2021/03/07 17:26、Jean Abou Samra のメール: > > Le 07/03/2021 à 03:03, 田村淳 a écrit : > >> Hello David, >> >>> gamme.1 is not

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-07 Thread Jean Abou Samra
Le 07/03/2021 à 03:03, 田村淳 a écrit : Hello David, gamme.1 is not a variable name. It takes gamme to be an alist, and the entry under key 1 is what is addressed here. Since you showed the Scheme equivalent below, I guess the above is a part of LilyPond syntax, or something the LilyPond parse

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-06 Thread 田村淳
Hello David, > gamme.1 is not a variable name. It takes gamme to be an alist, and the > entry under key 1 is what is addressed here. Since you showed the Scheme equivalent below, I guess the above is a part of LilyPond syntax, or something the LilyPond parser does. Is that documented elsewhere

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-06 Thread David Kastrup
Silvain Dupertuis writes: > I still checked this use of variable with numbers. > *Wonderful to see that it works.* > > One important note, though: > If you use a numbered variable, _you cannot use the same variable > without an additional number_. gamme.1 is not a variable name. It takes gamme

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-06 Thread Silvain Dupertuis
><8><8><8><8><8>< (cautionary note: I haven't examined the code or docs on this, but it seems a dot before and after will do the trick mid-word and a single dot at end of word) A decade or so ago I resorted to converting all the numbers to Roman numerals using

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-06 Thread 田村淳
(cautionary note: I haven't examined the code or docs on this, but it > seems a dot before and after will do the trick mid-word and a single > dot at end of word) > > A decade or so ago I resorted to converting all the numbers to Roman > numerals using a C routine that's k

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-06 Thread Richard Shann
ord and a single dot at end of word) A decade or so ago I resorted to converting all the numbers to Roman numerals using a C routine that's knocking around on the interweb... time I upgraded that. Richard Shann > Regards, > Mogens >   > From: Silvain Dupertuis > Sent:

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-05 Thread Silvain Dupertuis
, CategB-2 = "code for another exercise"}, and so on. Clean structure, easy to maintain and rearrange, etc. Then I discovered that lilypond does not allow numbers in variable names :-( I'd be willing to bet my use case is not particularly weird---there must have been other p

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-05 Thread Valentin Petzel
Hello Stefano, You might try to keep the whole thing dynamic and leave the numbering and stuff to Lilypond. For example you could have just a list of all Examples in one Category and then have a function to print that out. You could even do a list of Categories and print them all at once. This

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-05 Thread Tom Brennan
level variables names for the main musical categories and sub-categories and then assign each score snippet to progressively numbered variable. So I would have, CategA-1 = {"code for one exercise"} , CategB-2 = "code for another exercise"}, and so on. Clean structure, easy to maint

RE: Workaround for (not-allowed) numbers in variable names?

2021-03-05 Thread Mogens Lemvig Hansen
I believe it was David K who made this magic work: \version "2.20.0" mus.1 = { c d e } \score { \new Staff { \mus.1 } } Regards, Mogens From: Silvain Dupertuis Sent: March 5, 2021 10:12 To: lilypond-user@gnu.org Subject: Re: Workaround for (not-allowed) numbers in variable name

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-05 Thread Silvain Dupertuis
I would have, CategA-1 = {"code for one exercise"} , CategB-2 = "code for another exercise"}, and so on. Clean structure, easy to maintain and rearrange, etc. Then I discovered that lilypond does not allow numbers in variable names :-( I'd be willing to bet my use

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-05 Thread Kenneth Wolcott
categories and >> sub-categories and then assign each score snippet to progressively numbered >> variable. So I would have, CategA-1 = {"code for one exercise"} , CategB-2 = >> "code for another exercise"}, and so on. Clean structure, easy to maintain >> and r

Re: Workaround for (not-allowed) numbers in variable names?

2021-03-05 Thread stefano franchi
d rearrange, etc. > > Then I discovered that lilypond does not allow numbers in variable > names :-( > > I'd be willing to bet my use case is not particularly weird---there must > have been other people e

Workaround for (not-allowed) numbers in variable names?

2021-03-05 Thread stefano franchi
"code for another exercise"}, and so on. Clean structure, easy to maintain and rearrange, etc. Then I discovered that lilypond does not allow numbers in variable names :-( I'd be willing to bet my use case is not particularly weird---there must have been other people encounteri

Re: Numbers in variable names Re: thoughts

2007-01-02 Thread Mats Bengtsson
For example, you can define your own music function that has a single numerical argument (for example to modify some spacing parameters). The syntax for such a function would be exacty of the form \myvar 1. /Mats [EMAIL PROTECTED] wrote: I would expect that \myvar1 refers to the variable

Numbers in variable names Re: thoughts

2007-01-01 Thread stk
> I would expect that >\myvar1 refers to the variable myvar1 >\myvar 1 refers to the var myvar followed by 1 As regards the expression \myvar 1 in what context do you use that? -- Tom Andrew Black wrote: I would r

Numbers in variable names Re: thoughts

2007-01-01 Thread Andrew Black - lists
Han-Wen Nienhuys wrote: c4_\staccato_\markup { bla } does this reference \staccato or \staccato_ ? It might be possible to enable numbers, though. I would welcome an analysis. I would really like to see numbers in name of variables. I am not expert on parsers so apologies if this is hard

Re: numbers in variable names

2006-04-19 Thread andrea valle
On 19 Apr 2006, at 19:19, Daniel Johnson wrote: I always use Roman numerals. Interesting, I understand perfectly the weltanschauung behind the technique. Dadaism is the next step. In fact, I automatically convert numbers in letters with a hash table, so you have this Picabian-style varia

Re: numbers in variable names

2006-04-19 Thread Geoff Horton
> > but Lilypond (more likely LaTeX) won't let me. Does anyone know a > > workaround? It's LilyPond. LaTeX isn't even used anymore. Roman numerals or spelling out the numbers ( \globalZeroOne ) are the only ways I know to work around it. Geoff ___ lil

Re: numbers in variable names

2006-04-19 Thread Daniel Johnson
Kieren Richard MacMillan wrote: Hello, all -- I use a lot of variables, especially when breaking larger works across multiple pieces (and thus .ly files). but Lilypond (more likely LaTeX) won't let me. Does anyone know a workaround? I always use Roman numerals. __

numbers in variable names

2006-04-19 Thread Kieren Richard MacMillan
Hello, all -- I use a lot of variables, especially when breaking larger works across multiple pieces (and thus .ly files). I'd like to name my variables numerically, e.g., file01.ly global01 = { ... } notes01 = { ... } file02.ly global02 = { ... } not