bug-lilypond
[Top][All Lists]
Advanced

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

Re: Variable names of the form section.N.S core dump the parser


From: Aaron Hill
Subject: Re: Variable names of the form section.N.S core dump the parser
Date: Tue, 24 May 2022 09:06:52 -0700

On 2022-05-24 7:40 am, Jean Abou Samra wrote:
Because there is now a command called \section, so this
is trying to set a key inside a music function, which is
not an alist ... This is unfortunate but unavoidable.

Would it be practical for LilyPond to detect and warn when a built-in is being redefined?

Granted, one thing I really like about LilyPond is that one can easily redefine things as needed. But would it be burdensome to require a little bit of extra syntax that makes clear the user's intention to redefine something that already exists?

%%%%
\version "future"

foo = { c2 }     % Works, providing \foo does not exist.
bar = { c4 4 }   % Warns, since \bar does exist.
                 % (Could be made to fail in a "pedantic" mode.)

\redefine bar = { c8 4. }  % Explicitly redefine, no warning needed.
bar := { c8 4. }           % Same, with a possible syntactic shorthand.
%%%%


-- Aaron Hill



reply via email to

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