guix-patches
[Top][All Lists]
Advanced

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

[bug#57460] [PATCH 00/19] Refresh to specific version


From: Ludovic Courtès
Subject: [bug#57460] [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:29:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> * guix/import/gnome.scm(latest-gnome-release): Rename
>   to (import-gnome-release), add keyword-argument 'version'. If version is
>   given, try to find the respective version
>   [find-latest-release]: New function, based on former code.
>   [find-version-release]: New function.

[...]

> +  (define (find-latest-release releases)
> +    (fold (match-lambda*
> +           (((key . value) result)
> +            (cond ((even-minor-version? key)
> +                   (match result
> +                          (#f
> +                           (cons key value))
> +                          ((newest . _)
> +                           (if (version>? key newest)
> +                               (cons key value)
> +                               result))))

Please reindent ‘match’ as it was.

> +  (define (find-version-release releases version)
> +    (fold (match-lambda*
> +           (((key . value) result)
> +            (if (string=? key version)
> +                (cons key value)
> +                result)))
> +          #f
> +          releases))

I guess we could start at the first match instead of traversing all the
list, no?  How about:

  (define (find-version-release releases version)
    (find (match-lambda
            ((key . value)
             (string=? key version)))
          releases))

?

Otherwise LGTM.





reply via email to

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