[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Variable names
From: |
Hans Aberg |
Subject: |
Re: Variable names |
Date: |
Fri, 13 May 2011 18:14:13 +0200 |
On 13 May 2011, at 16:05, Carl Sorensen wrote:
>>>> I have tried to find some description of the valid syntax of LilyPond
>>>> variables and haven't found any. I would like to use variable names with
>>>> numbers and possibly with underscores - is it somehow possible?
>>>
>>> Unfortunately, no.
>>
>> I'm just curious... Do you know how much work would it take to change
>> it? Like, some work, a lot of work, tons of work or rewriting whole
>> Lily?
>
>
> It would introduce a bunch of shift/reduce conflicts in the parser, as I
> understand it.
>
> http://article.gmane.org/gmane.comp.gnu.lilypond.devel/16481
Normally, one would try changing the lexer, in which case the work is minimal.
Since a number can follow directly as another token after a letter-identifier,
extending identifiers with numbers would force one entering a space after an
identifier followed by a number. That is, not upwards compatible.
But one can seek for other solutions. One I have used is admitting arbitrary
identifier names within single quotes '...'. Such a solution is practical when
calling Guile names, and does not affect the parser at all, as it is just
another form of an identifier.
Hans