[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strings as variable names
From: |
David Kastrup |
Subject: |
Re: Strings as variable names |
Date: |
Mon, 28 Dec 2015 18:49:30 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
David Sumbler <address@hidden> writes:
>> > From: David Kastrup <address@hidden>
>> > To: Andrew Bernard <address@hidden>
>> > Cc: address@hidden
>> > Subject: Re: Strings as variable names
>> > Date: Mon, 28 Dec 2015 12:51:51 +0100
>> >
>> > Andrew Bernard <address@hidden> writes:
>> >
>> > > <address@hidden on
>> > > behalf of address@hidden> wrote:
>> > >>
>> > >> The quote syntax is a bit of an ugliness which was added for sort-of
>> > >> consistency reasons.
>> > >
>> > > Consistency with what actually?
>> >
>> > After
>> >
>> > xxx = ...
>> >
>> > you can refer to \xxx. And
>> >
>> > "xxx" = ...
>> >
>> > has always been allowed for arbitrary strings.
>> >
>> > > And so the NR should in fact therefore be updated?
>> >
>> > It's not really making stuff more readable.
>
> I think it would be useful to have it added to the NR.
>
> I have always been frustrated by the fact that I can't (or thought I
> couldn't) use underscores in variable names,
Well, that is hopefully more or less documented though probably not
everywhere.
> and also that numbers are not allowed.
But really, \"violin1" is so much more ugly than \violinI or if you must
\violin_I.
> Using the syntax with quotes is rather ugly, I agree. But it is
> nonetheless potentially useful for two reasons:
> (1) it enables us to use numbers etc. in variable names
Why would that be desirable?
> (2) the quotes help to distinguish our own defined variables from
> Lilypond's own.
Absolutely not. The quote marks don't become part of the variables or
identifiers. \bing is absolutely identical to \"bing".
Reading people's ideas about those things make them appear like
something we would be better without. They only lead to confusion.
--
David Kastrup
- Re: Strings as variable names, (continued)
- Re: Strings as variable names, David Kastrup, 2015/12/28
- Re: Strings as variable names, Johan Vromans, 2015/12/28
- Re: Strings as variable names, Urs Liska, 2015/12/28
- 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/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, David Kastrup, 2015/12/29
Re: Strings as variable names, David Sumbler, 2015/12/28
- Re: Strings as variable names,
David Kastrup <=
- 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, 2015/12/28
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