From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:42167) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPCSR-0000LG-In for guix-patches@gnu.org; Thu, 16 Apr 2020 17:54:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPCSQ-0007SQ-In for guix-patches@gnu.org; Thu, 16 Apr 2020 17:54:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56204) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPCSQ-0007SG-FY for guix-patches@gnu.org; Thu, 16 Apr 2020 17:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jPCSQ-0001uY-EN for guix-patches@gnu.org; Thu, 16 Apr 2020 17:54:02 -0400 Subject: [bug#40629] [PATCH 4/5] scripts/build: options->things-to-build: Handle .json files. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200414171959.3428-1-rekado@elephly.net> <20200414171959.3428-4-rekado@elephly.net> Date: Thu, 16 Apr 2020 23:53:21 +0200 In-Reply-To: <20200414171959.3428-4-rekado@elephly.net> (Ricardo Wurmus's message of "Tue, 14 Apr 2020 19:19:58 +0200") Message-ID: <87k12fdrn2.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ricardo Wurmus Cc: 40629@debbugs.gnu.org Ricardo Wurmus 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 =E2=80=98load-json=E2= =80=99 could do something that avoids going through a file. Late feedback, nightly thoughts. :-) Ludo=E2=80=99.