lilypond-devel
[Top][All Lists]
Advanced

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

Version guard comments


From: David Kastrup
Subject: Version guard comments
Date: Wed, 05 Mar 2014 19:34:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Just now I wrote in a file intended for Mutopia

\version "2.18.0"
[...]
  } \alternative {
    { d2. | d4 r4 }
    { \set Timing.measurePosition = #(ly:make-moment 0) % remove for 2.19.0
      d2. | d2 r4 | r2. }

But who is going to actually remove the \set command, come 2.19.0 ?

The obvious solution for this kind of "I know what a later version
should look like" is to _formalize_ this kind of comment, and then teach
convert-ly to see those comments and interpret them.  If I have a
comment for < 2.19.0 guarding some code, that comment will get removed
including the guarded code when converting to 2.19.0 or later, and if I
have a comment for >= 2.19.0 guarding some outcommented code, the
comment guard will get removed come version 2.19.0, and the outcommented
code will get activated.

This will make it possible to contribute snippets to Mutopia or LSR that
are already manually prepared for automatic conversion to later versions
than the nominal version.  It would probably help delaying obsoleted
coding for about 2 years (since that is the typical time lag of those
archives) and would make the code an advertisement for new features.

We just need to come up with a good, clean comment convention and then
teach convert-ly about it.

-- 
David Kastrup



reply via email to

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