lilypond-devel
[Top][All Lists]
Advanced

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

Re: [GLISS] differentiating pre/post/neutral commands


From: Nicolas Sceaux
Subject: Re: [GLISS] differentiating pre/post/neutral commands
Date: Sat, 1 Sep 2012 22:58:31 +0200

Le 1 sept. 2012 à 18:25, Graham Percival a écrit :

> Continuing to brainstorm on the problem of it not being obvious to
> which note a particular \command refers to, what if we used:
> 
> \postfix:      c2 d\p  is unchanged
> /prefix: for music functions like   c2 /parenthesize d
> .neutral: for commands which aren't attached to notes, such
>  as .clef or .times.
> 
>   .version "2.16.0"
>   .score {
>     /new Staff {
>       .clef "bass"
>       .times 3/4
>       c4 /parenthesize d\p g .bar "|."
>     }
>   }

In most languages, the way you format things (naming, spacing, indentation,
etc.) is important, so that a reader can tell what something most probably
means, without knowing all the details.  When someone does not respect
conventions, then reading the code becomes painful.

If a prefix music function is consistently named according to some rule
(e.g. a verb, as was proposed), and variables to that other rule, then
the reading problem is solved.
Moreover, if you consistently write a postfix variable next to the thing it is
related to, without space, then you cannot confuse it with a prefix function.

   c\p b              <--- no space before => postfix
   c -\p b            <--- explicitely postfix, space is no problem
   c \parenthesize b  <--- verb with a space before => prefix function
   c \mymusic b       <--- a noun with a space before => a variable

That's not a syntax/parser issue, imho.

Nicolas




reply via email to

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