[Top][All Lists]

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

Issue 1403 in lilypond: Enhancement: defining postfix commands in Scheme

From: lilypond
Subject: Issue 1403 in lilypond: Enhancement: defining postfix commands in Scheme.
Date: Mon, 15 Nov 2010 11:51:03 +0000

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

New issue 1403 by v.villenave: Enhancement: defining postfix commands in Scheme.

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:

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:
However it is limited and hackish, and doesn't replace a genuine native postfix syntax.)

reply via email to

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