bug-guix
[Top][All Lists]
Advanced

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

bug#35588: [PATCH] ui: Search matches additional package outputs.


From: Ludovic Courtès
Subject: bug#35588: [PATCH] ui: Search matches additional package outputs.
Date: Tue, 07 May 2019 10:25:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Hello,

Chris Marusich <address@hidden> skribis:

> From c1150a217a416ef4ceccf87c56e36e8e921f873a Mon Sep 17 00:00:00 2001
> From: Chris Marusich <address@hidden>
> Date: Mon, 6 May 2019 01:51:30 -0700
> Subject: [PATCH] ui: Make package outputs searchable.
>
> * guix/ui.scm (relevance): Allow the "field" procedure of a metric to
> return a list, and handle that case appropriately.  Update docstring.
> (%package-metrics): Add a metric for package outputs.
> * guix/scripts/package.scm (find-packages-by-description): Update
> docstring.
>
> Co-authored-by: Tobias Geerinckx-Rice <address@hidden>

[...]

>               (match (field obj)
>                 (#f  relevance)
> -               (str (+ relevance
> -                       (* (score str) weight)))))))
> +               ((? string? str) (+ relevance
> +                                   (* (score str) weight)))
> +               ((? list? lst) (+ relevance
> +                                 (* weight
> +                                    (apply + (map score lst)))))))))

Nitpick: it’s a bit subjective, but I think this clause might be
slightly nicer like this:

  ((lst ...)
   (+ relevance (* weight (reduce + 0 (map score lst)))))

Anyway, LGTM!

Thanks,
Ludo’.





reply via email to

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