lilypond-devel
[Top][All Lists]
Advanced

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

Re: Add lilypond version predicates/operators (issue 317270043 by addres


From: git
Subject: Re: Add lilypond version predicates/operators (issue 317270043 by address@hidden)
Date: Tue, 14 Feb 2017 07:15:07 -0800

On 2017/02/14 15:00:10, pwm wrote:
https://codereview.appspot.com/317270043/diff/1/scm/lily-library.scm
File scm/lily-library.scm (right):


https://codereview.appspot.com/317270043/diff/1/scm/lily-library.scm#newcode909
scm/lily-library.scm:909: (define-public (lilypond>? ref-version)
Instead of a separate procedure for each comparison, what about making
it
generic:

(define-public (version-compare v1 proc v2)
   "Compare two versions @var{v1} and @var{v2} with the
    procedure @var{proc}.  The versions are lists of
    three numbers like @code{'(2 18 0)}.  The procedure
    would typically be <, >, <=, >=, =, etc."
   (proc (calculate-version v1) (calculate-version v2)))

Usage looks like:

(version-compare (ly:version) >= '(2 18 0))

Then it can be used to compare any two versions, not necessarily
LilyPond (might
also be useful for packages some day?) and the user learns ly:version.


(Having done this, I see David's suggestion... haven't looked at it
closely
yet.)

I like this more because it's more of a typical procedure invocation.
I think I'll create a new patch with this and a simplified
calculate-version
(that doesn't accept string lists)

https://codereview.appspot.com/317270043/



reply via email to

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