From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 19 17:00:57 2019 Received: (at 38408) by debbugs.gnu.org; 19 Dec 2019 22:00:57 +0000 Received: from localhost ([127.0.0.1]:45630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ii3qq-0005GF-TO for submit@debbugs.gnu.org; Thu, 19 Dec 2019 17:00:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ii3qo-0005G1-Ju for 38408@debbugs.gnu.org; Thu, 19 Dec 2019 17:00:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ii3qb-0004gh-RF; Thu, 19 Dec 2019 17:00:45 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36016 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ii3qY-0006Lv-8A; Thu, 19 Dec 2019 17:00:39 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Martin Becze Subject: Re: [bug#38408] [PATCH v4 1/6] gnu: added new function, find-packages-by-name*/direct References: Date: Thu, 19 Dec 2019 23:00:36 +0100 In-Reply-To: (Martin Becze's message of "Tue, 10 Dec 2019 14:23:38 -0500") Message-ID: <877e2sm0vv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38408 Cc: 38408@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello! I=E2=80=99m not a Crate expert so I=E2=80=99m only commenting on non-Crate-= specific bits. Martin Becze skribis: > * gnu/packages.scm (find-packages-by-naem*/direct) [...] > +(define* (fold-packages* proc init > + #:optional > + (modules (all-modules (%package-module-path) > + #:warn > + warn-about-load-error)) > + #:key (select? (negate hidden-package?))) > + "Call (PROC PACKAGE RESULT) for each available package defined in one = of > +MODULES that matches SELECT?, using INIT as the initial value of RESULT.= It > +is guaranteed to never traverse the same package twice." > + (fold-module-public-variables* (lambda (module symbol var result) > + (let ((object (variable-ref var))) > + (if (and (package? object) (select?= object)) > + (proc module symbol object res= ult) I=E2=80=99m wary of exposing variable names, especially in such a central A= PI. > +(define find-packages-by-name*/direct ;bypass the cache Providing an explicit cache bypassing method also sounds worrying to me: the cache is supposed to be transparent and semantics-preserving. More generally, I think adding new features to an importer shouldn=E2=80=99t require modifications in this area, as a matter of separating concerns. WDYT? Thanks, Ludo=E2=80=99.