lilypond-devel
[Top][All Lists]
Advanced

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

Add lilypond version predicates/operators (issue 317270043 by address@hi


From: dak
Subject: Add lilypond version predicates/operators (issue 317270043 by address@hidden)
Date: Tue, 14 Feb 2017 06:10:55 -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#newcode894
scm/lily-library.scm:894: (define (calculate-version ref-version)
This seems overly complicated.  Why not just stick with a number list?
Something like
#(define (ly:version? op . rest)
   (let loop ((ver (ly:version)) (rest rest))
     (if (or (null? ver) (null? rest))
         (op 0 0) ;; return #t iff op includes equality
         (let* ((a (car ver)) (b (car rest))
                (axb (op a b)) (bxa (op b a)))
           (if (eq? axb bxa)
               (loop (cdr ver) (cdr rest))
               axb)))))

#(format #t ">2.19 : ~S, >= 2.19 : ~S\n"
         (ly:version? > 2 19)
         (ly:version? >= 2 19))

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



reply via email to

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