lilypond-user
[Top][All Lists]
Advanced

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

Re: Variable names


From: David Kastrup
Subject: Re: Variable names
Date: Thu, 07 Jan 2016 22:55:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

"H. S. Teoh" <address@hidden> writes:

> On Thu, Jan 07, 2016 at 08:59:22PM +0100, Johan Vromans wrote:
>> I assume there have been discussions on extending the syntax for LP
>> identifiers to include dashes and underscores. My personal opinion is
>> that a non-alpha separator is good to have, but two different
>> separators may quickly become confusing. Is it 'set_variable' or
>> 'set-variable'?
>> 
>> Given the relation between LP and Guile, I'd suggest to only allow the
>> dash and disallow the underscore (by syntax rule, not just by
>> convention).
> [...]
>
> I think extending identifiers to include '-' and '_' is a bad idea. They
> introduce ambiguities in cases like:
>
>       c1\myCustomMarkup_"text"-\pp-\moreCustomMarkup-.

Sigh.  This is an extremely dead horse to beat.  Markups have included -
signs 10 years ago already, engravers have included _ signs 10 years ago
already.  The above is perfectly well interpreted by current LilyPond
which allows - and _ in identifier names even inside of music since
version 2.15.43 in August 2012, as of

commit 70a153b14ba32767e1ecbe680f435bdd533ae819
Author:     David Kastrup <address@hidden>
AuthorDate: Sun Jul 29 16:05:10 2012 +0200
Commit:     David Kastrup <address@hidden>
CommitDate: Mon Aug 6 01:28:01 2012 +0200

    Unify the lexer's idea of words and commands across all modes.
    
    A "word" (a string recognized even when not quoted) and a "command"
    (something starting with \ and followed by letters and other folderol,
    indicating a Scheme control sequence or similar) get the same syntax
    in all modes:
    
    A "word" is a sequence of alphabetic characters possibly containing
    single dashes or underlines inside (not at the beginning or end).
    
    A "command" is a "word" preceded by a backslash.


-- 
David Kastrup



reply via email to

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