all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sarah Morgensen <iskarian@mgsn.dev>
To: pinoaffe <pinoaffe@airmail.cc>
Cc: 50755@debbugs.gnu.org
Subject: [bug#50755] [PATCH] import: Generate list of importers based on available modules
Date: Thu, 23 Sep 2021 11:07:40 -0700	[thread overview]
Message-ID: <86pmszkvwz.fsf@mgsn.dev> (raw)
In-Reply-To: <87tuibh43w.fsf@airmail.cc> (pinoaffe@airmail.cc's message of "Thu, 23 Sep 2021 14:24:19 +0200 (5 hours, 37 minutes, 21 seconds ago)")

Hello,

This looks like a good improvement! Thanks for submitting the patch.
Just reading ths, I have a couple comments.

pinoaffe <pinoaffe@airmail.cc> writes:

> * guix/scripts/import.scm (importers): Generate a list of all importers by
> looping over available guile modules, allowing for extensibility.
> ---
>  guix/scripts/import.scm | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
> index 40fa6759ae..44cbaf13d6 100644
> --- a/guix/scripts/import.scm
> +++ b/guix/scripts/import.scm
> @@ -23,6 +23,7 @@
>  
>  (define-module (guix scripts import)
>    #:use-module (guix ui)
> +  #:use-module (guix discovery)
>    #:use-module (guix scripts)
>    #:use-module (guix utils)
>    #:use-module (srfi srfi-1)
> @@ -78,9 +79,11 @@ rather than \\n."
>  ;;; Entry point.
>  ;;;
>  
> -(define importers '("gnu" "pypi" "cpan" "hackage" "stackage" "egg" "elpa"
> -                    "gem" "go" "cran" "crate" "texlive" "json" "opam"
> -                    "minetest"))
> +(define importers (map (lambda (module)
> +                         (symbol->string (caddr (module-name module))))

Prefer ice-9 'match'/'match-lambda' over 'car'/'cadr'/'caddr'/etc, or if
necessary, SRFI-1 'first', 'second', ..., 'last'.

> +                       (all-modules (map (lambda (entry)
> +                                           `(,entry . "guix/import"))
                         should this be guix/scripts/import? ^

> +                                         %load-path))))
>  
>  (define (resolve-importer name)
>    (let ((module (resolve-interface

--
Sarah




  reply	other threads:[~2021-09-23 18:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 12:24 [bug#50755] [PATCH] import: Generate list of importers based on available modules pinoaffe
2021-09-23 18:07 ` Sarah Morgensen [this message]
2021-09-23 21:17   ` pinoaffe
2021-09-23 21:19 ` [bug#50755] [PATCH v2] " pinoaffe
2021-09-27 14:28   ` zimoun
2021-09-27 18:27     ` pinoaffe
2021-09-27 18:20 ` [bug#50755] [PATCH v3] " pinoaffe
2021-09-27 20:09   ` zimoun
2021-09-28  9:51     ` Maxime Devos
2021-09-28 14:39       ` pinoaffe
2021-09-29 20:59         ` Maxime Devos
2021-09-30  8:17           ` pinoaffe
2021-09-30  8:37             ` Maxime Devos
2021-10-11 11:51               ` zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86pmszkvwz.fsf@mgsn.dev \
    --to=iskarian@mgsn.dev \
    --cc=50755@debbugs.gnu.org \
    --cc=pinoaffe@airmail.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.