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

From: Ludovic Courtès <[email-masked]>
Date: Sat, 24 Sep 2022 11:26:19 +0200

Hartmut Goebel <[email-masked]> skribis:

> * guix/import/github.scm(latest-released-version): Add keyword-argument
>   'version'.  If version is given, try to find the respective release.
>   (latest-releease) Rename to (import-release), add keyword-argument 'version'
>   and pass it on to latest-released-version.

(Same comment as before.)

> -     (match (sort (filter-map release->version
> -                              (match (remove pre-release? json)
> -                                (() json)         ; keep everything
> -                                (releases releases)))
> -                  (lambda (x y) (version>? (car x) (car y))))
> +     (let ((releases (filter-map release->version
> +                                 (match (remove pre-release? json)
> +                                        (() json)         ; keep everything
> +                                        (releases releases)))))

Please reindent the ‘match’ form as above.

> +       (match (if version
> +                  ;; find matching release version
> +                  (filter (lambda (x) (string=? version (car x)))
> +                          releases)

Same as earlier: prefer ‘match-lambda’ over ‘car’.

Otherwise LGTM.