From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMCBV-0003iq-VN for guix-patches@gnu.org; Fri, 25 May 2018 08:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMCBS-0007LZ-1g for guix-patches@gnu.org; Fri, 25 May 2018 08:51:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:39688) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMCBR-0007LK-Ts for guix-patches@gnu.org; Fri, 25 May 2018 08:51:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fMCBR-0003p3-Jf for guix-patches@gnu.org; Fri, 25 May 2018 08:51:01 -0400 Subject: [bug#31399] [PATCH] import: elpa: Implement recursive import. Resent-Message-ID: References: <87y3grykhx.fsf@gmail.com> <87wovs2bdq.fsf@gnu.org> From: Ricardo Wurmus In-Reply-To: <87wovs2bdq.fsf@gnu.org> Date: Fri, 25 May 2018 14:50:30 +0200 Message-ID: <87603bc31l.fsf@mdc-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Ricardo Wurmus , 31399@debbugs.gnu.org Hi, Ludovic Courtès writes: > Oleg Pykhalov skribis: > >> I stole recursive importer from ‘cran’ and made it for ‘elpa’, the patch >> is attached. I don't like it and want to share the code with ‘cran’ >> 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 “recursive-import” to “(guix import utils)” and let it take the package generator procedure (e.g. “cran->guix-package”) as an argument. It looks like this patch copied “recursive-import” and changed little more than “cran->guix-package” to “elpa->guix-package”, so this seems like a simple change. -- Ricardo