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: David Kastrup
Subject: Re: Add lilypond version predicates/operators (issue 317270043 by address@hidden)
Date: Wed, 15 Feb 2017 00:25:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

address@hidden writes:

> To throw in my own 2cts.
>
> Why not compare strings, looks more straight forward to me.
>
> (define (calculate-version-harm ref-version)
>   (cond ((string? ref-version) ref-version)
>         ((number-list? ref-version)
>          (string-concatenate (list-join (map number->string ref-version)
> ".")))
>         (else (ly:error "whatever-massage"))))
>
> (define (version-compare? op v1 v2)
> "Compare two versions @var{v1} and @var{v2} with the operator @var{op}.
>   The operator would typically be
>   string=?, string<?, string<=? , string>? , string>=? , etc."
>  (op (calculate-version-harm v1) (calculate-version-harm v2)))
>
> The issue I can imagine: probably more expensive, especially with
> guilev2

Because (string<? "2.18.27" "2.18.4") => #t

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


-- 
David Kastrup



reply via email to

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