From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: nesting with-imported-modules Date: Wed, 05 Feb 2020 15:07:09 +0100 Message-ID: <8736bpp1pu.fsf@gnu.org> References: <874kwat0a8.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35790) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izLKk-00066j-D5 for guix-devel@gnu.org; Wed, 05 Feb 2020 09:07:15 -0500 In-Reply-To: <874kwat0a8.fsf@elephly.net> (Ricardo Wurmus's message of "Sat, 01 Feb 2020 23:23:11 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org Hello! Ricardo Wurmus skribis: > it seems that it is impossible to nest with-imported-modules. A gexp > that is wrapped in multiple layers of with-imported-modules won=E2=80=99t= depend > on the list of all mentioned modules but only on the outermost. > > This is because with-imported-modules sets the current-imported-modules > parameter without checking if the parameter already has a value. > > Should nesting be supported? It seems useful. Is it? :-) My impression is that one would always write: (with-imported-modules =E2=80=A6 #~(=E2=80=A6)) or possibly combining multiple expressions: (define e1 (with-imported-modules =E2=80=A6 #~(=E2=80=A6))) (define e2 (with-imported-modules =E2=80=A6 #~(=E2=80=A6 #$e1 =E2=80=A6))) in which case modules are appended. I couldn=E2=80=99t think of a use case where one would literally write: (with-imported-modules =E2=80=A6 (with-imported-modules =E2=80=A6 #~(=E2=80=A6))) Perhaps I=E2=80=99m missing some pattern where it could be useful though? Thanks, Ludo=E2=80=99.