Status: Accepted
Owner: ----
Labels: Type-Enhancement Priority-Medium Syntax

New issue 1403 by v.villenave: Enhancement: defining postfix commands in Scheme.
http://code.google.com/p/lilypond/issues/detail?id=1403

This limitation of LilyPond's current parser (as of version 2.13.40) has first been discussed when addressing issue 817: in many cases the only way to modify an EventChord or a music expression, is to pass it as a ly:music? argument to a music function. Said music-function has to be invoked *before* the music expression, which makes it impossible to have a cleaner, more LilyPond-ish looking, postfix syntax.

David as mentioned a possible way of implementing this improvement:
http://lists.gnu.org/archive/html/lilypond-devel/2010-09/msg00161.html

"""
You'd put an appropriate 'syntax property on the music function definition (possibly by allowing a :syntax keyword argument in define-music-function, defaulting to 'SequentialMusic or something else that makes sense), the lexer would check it and return an appropriately different token that would make the parser execute it without finishing the current time step first, using pretty much the same parser for argument lists as normal music functions do.
"

According to Graham, this improvement "almost" qualifies as a "necessity".

(A possible workaround within the current parsing abilities is to manually "attach" a Scheme variable to a NoteEvent, using a dash, as Neil pointed out:
http://lists.gnu.org/archive/html/lilypond-devel/2010-09/msg00162.html
However it is limited and hackish, and doesn't replace a genuine native postfix syntax.)


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

Reply via email to