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: paulwmorris
Subject: Re: Add lilypond version predicates/operators (issue 317270043 by address@hidden)
Date: Tue, 14 Feb 2017 07:00:09 -0800


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.)

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



reply via email to

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