Le 24/05/2022 à 16:37, Trevor Bača a écrit :
Hi,

The dot-chained variable names that became available in recent versions of
LilyPond are great, particularly because they allow numerals:

%%% EXAMPLE 1 %%%

\version "2.23.8"
movement.1.notes = { g'4 }
\new Staff { \movement.1.notes }

%%% END %%%

But LilyPond's parser errors when a variable is named like this:

%%% EXAMPLE 2 %%%

\version "2.23.8"
section.1.notes = { g'4 }
\new Staff { \section.1.notes }

%%% END %%%

GNU LilyPond 2.23.8 (running Guile 2.2)
Processing `test.ly'
Parsing...ERROR: In procedure ly:parse-file:
In procedure caar: Wrong type (expecting pair): #<Prob: Music C++:
Music((origin . #<location
/Users/trevor/lilypond-2.23.8/share/lilypond/2.23.8/ly/declarations-init.ly:77:11>))((display-methods
#<procedure method (expr)>) (name . SectionEvent) (types section-event
event)) >

The error appears to be very narrow.

Because this works ...

%%% EXAMPLE 3 %%%

\version "2.23.8"
section = { a'4 }
\new Staff { \section }

%%% END %%%

... and so does this ...

%%% EXAMPLE 4 %%%

\version "2.23.8"
section.1 = { b'4 }
\new Staff { \section.1 }

%%% END %%%

... which appears to mean that the error occurs only when a variable is
named in the form ...

    section.N.S

... with numeric N and string S.

The workaround is to use a different variable name, and so the issue is
probably low priority.

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.

(Note that the error is not a core dump, just a regular Scheme
error. If you get a core dump, that means LilyPond crashed
more seriously, usually without much indication of what
happened, and it is normally a bug.)

Jean




_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to