lilypond-user
[Top][All Lists]
Advanced

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

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


From: David Kastrup
Subject: Re: Workaround for (not-allowed) numbers in variable names?
Date: Sun, 07 Mar 2021 13:09:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Peter Toye <lilypond@ptoye.com> 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 = <c e g>
> chord2= <d f a>
>
> c1 \chord2
>
> Should the second element be interpreted as <c e g>2 or <d f a>1? I
> imagine this would confuse the lexer horribly.

The lexer follows rules.  It's never confused.  The user is something
different.  Incidentally, chords cannot be resized, so \chord2 would be
interpreted as

<c e g> <c e g>2

due to how isolated durations in music are interpreted.

> No doubt some rules could be written to resolve this, but it would
> need some recoding.

Durations generally don't require space separation, like with a4 and so
on.  Balancing conflicting desires and requirements and consistency is
always tricky.  TeX has also chosen not to admit numbers into
identifiers and people tend to complain it cramps their style.

-- 
David Kastrup



reply via email to

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