lilypond-devel
[Top][All Lists]
Advanced

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

Re: LP version predicates


From: Ian Hulin
Subject: Re: LP version predicates
Date: Sat, 11 Jan 2014 01:25:49 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Hi Urs,

On 09/01/14 11:01, Urs Liska wrote:
> Is there already a clean way to let LilyPond/Scheme code be executed
> depending on the version number of the currently executed LilyPond?
> 
> If not, would it be useful/acceptable to include something like
> https://github.com/openlilylib/snippets/blob/master/general-tools/lilypond-version-predicates/definitions.ily
> 
> 
> into LilyPond?
> 
> That makes possible to write something like
> 
> (if (lilypond-greater-than? '(2 16 0)) ... )
> 
Compare with scheme variable lilypond-version:

address@hidden ~/src/lilypond (master)$ lilypond ly/scheme-sandbox.ly
GNU LilyPond 2.18.0
Processing `ly/scheme-sandbox.ly'
Parsing...
guile> (lilypond-version)
"2.18.0"
guile> (quit)

Success: compilation successfully completed
address@hidden ~/src/lilypond (master)$
You could probably write some stuff to parse out the major-version and
minor-version fields e.g.
guile> (define ly-major-version (substring (lilypond-version) 0 1))

guile> ly-major-version
"2"
guile> (define ly-minor-version (substring (lilypond-version) 2 4))
guile> ly-minor-version
"18"
guile> (define ly-update-version (substring (lilypond-version) 5
(string-length (lilypond-version))))
guile> ly-update-version
"0"
guile> (quit 0)

Success: compilation successfully completed
address@hidden ~/src/lilypond (master)$

... and play with those.

HTH
Cheers,

Ian





reply via email to

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