From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:36062) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAAQd-0001NO-Km for guix-patches@gnu.org; Fri, 06 Mar 2020 05:42:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAAQc-0005sm-Jc for guix-patches@gnu.org; Fri, 06 Mar 2020 05:42:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:38155) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAAQc-0005qm-G7 for guix-patches@gnu.org; Fri, 06 Mar 2020 05:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jAAQc-0007Rw-CQ for guix-patches@gnu.org; Fri, 06 Mar 2020 05:42:02 -0500 Subject: [bug#39945] [PATCH 0/1] Introducing 'with-parameters' for gexp dynamic binding Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:34555) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAAPz-0001Mq-8y for guix-patches@gnu.org; Fri, 06 Mar 2020 05:41:24 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 6 Mar 2020 11:41:08 +0100 Message-Id: <20200306104108.19503-1-ludo@gnu.org> 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: 39945@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Hello Guix! This patch adds a new ‘with-parameters’ form. It is like ‘parameterize’ except that it takes effect when a file-like object is lowered, as in: ;; Return coreutils for i686. (with-parameters ((%current-system "i686-linux")) coreutils) ‘with-parameters’ is necessary because if you would use ‘parameterize’ in the example above, it wouldn’t have any effect at all: the dynamic binding would be installed at the wrong time. It works for any SRFI-39 parameter, though ‘%current-system’ is my main use case. It makes it possible to have gexps or manifests that include things explicitly targeting a given system. (For instance, I’d like to have a manifest for release-critical things that explicitly pins the targeted systems.) Note that ‘with-parameters’ applies to file-like objects; it is _not_ a property of the gexp itself. So one cannot, for example, write: (with-parameters ((%current-system "i686-linux")) #~(a b c d)) I feel like it’s better this way, though it could be confusing. Thoughts? Besides, ‘with-parameters’ is the dual of what was discussed at . Thanks, Ludo’. Ludovic Courtès (1): gexp: Add 'with-parameters'. .dir-locals.el | 1 + doc/guix.texi | 19 ++++++++++++++++ guix/gexp.scm | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/gexp.scm | 28 ++++++++++++++++++++++++ 4 files changed, 107 insertions(+) -- 2.25.1