From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNfgN-0004CO-72 for guix-patches@gnu.org; Tue, 29 May 2018 10:33:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNfgM-0007je-1o for guix-patches@gnu.org; Tue, 29 May 2018 10:33:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46230) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNfgL-0007jV-Uu for guix-patches@gnu.org; Tue, 29 May 2018 10:33:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fNfgL-0006jy-Pb for guix-patches@gnu.org; Tue, 29 May 2018 10:33:01 -0400 Subject: [bug#31399] [PATCH] import: elpa: Implement recursive import. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87y3grykhx.fsf@gmail.com> <87wovs2bdq.fsf@gnu.org> <87603bc31l.fsf@mdc-berlin.de> Date: Tue, 29 May 2018 16:31:54 +0200 In-Reply-To: <87603bc31l.fsf@mdc-berlin.de> (Ricardo Wurmus's message of "Fri, 25 May 2018 14:50:30 +0200") Message-ID: <877enmzg6d.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: Ricardo Wurmus , 31399@debbugs.gnu.org Hello, Ricardo Wurmus skribis: > Ludovic Court=C3=A8s writes: > >> Oleg Pykhalov skribis: >> >>> I stole recursive importer from =E2=80=98cran=E2=80=99 and made it for = =E2=80=98elpa=E2=80=99, the patch >>> is attached. I don't like it and want to share the code with =E2=80=98= cran=E2=80=99 >>> importer, but I don't know how to do it without increasing complexity. >> >> Indeed. Ricardo and I discussed this in the past and Ricardo started >> implementing something: >> >> http://lists.gnu.org/archive/html/guix-devel/2016-08/msg00381.html >> >> It would be great to resume work on this, especially since we have other >> importers that would immediately benefit from it (CRAN, Go, Crates). >> >> The solution I proposed back then was to have importers return a SRFI-41 >> lazy stream of package definitions. > > The CRAN importer supports recursion and it is implemented with SRFI-41 > lazy streams and AIUI this is what this patch does for the elpa > importer. > > We should move =E2=80=9Crecursive-import=E2=80=9D to =E2=80=9C(guix impor= t utils)=E2=80=9D and let it > take the package generator procedure (e.g. =E2=80=9Ccran->guix-package=E2= =80=9D) as an > argument. It looks like this patch copied =E2=80=9Crecursive-import=E2= =80=9D and > changed little more than =E2=80=9Ccran->guix-package=E2=80=9D to =E2=80= =9Celpa->guix-package=E2=80=9D, > so this seems like a simple change. Sounds like a plan. Oleg, could you factorize what=E2=80=99s common between the two importers in (guix import utils) like Ricardo suggests? Thanks, Ludo=E2=80=99.