Subject: Re: [bug#40629] [PATCH 4/5] scripts/build: options->things-to-build: Handle .json files.

From: Ludovic Courtès <[email-masked]>
Date: Thu, 16 Apr 2020 23:53:21 +0200

Ricardo Wurmus <[email-masked]> skribis:

> +                 (let ((file (or (and (string-suffix? ".json" file)
> +                                      (json->scheme-file file))
> +                                 file)))
> +                   (ensure-list (load* file (make-user-module '())))))

Actually, perhaps we could have a file handler alist, like:

  `((".json" ,load-json)
    (_ ,(cute load* <> (make-user-module '()))))

That could be shared with (guix scripts package), and ‘load-json’ could
do something that avoids going through a file.

Late feedback, nightly thoughts.  :-)

Ludo’.