From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YFUyIgfpNWFuhAEAgWs5BA (envelope-from ) for ; Mon, 06 Sep 2021 12:10:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id aHkoHgfpNWGiTAAA1q6Kng (envelope-from ) for ; Mon, 06 Sep 2021 10:10:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4380510ED0 for ; Mon, 6 Sep 2021 12:10:15 +0200 (CEST) Received: from localhost ([::1]:47252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNBZu-0004Ct-B5 for larch@yhetil.org; Mon, 06 Sep 2021 06:10:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNBXm-0000XK-9Z for guix-patches@gnu.org; Mon, 06 Sep 2021 06:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40434) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNBXm-0000cJ-1V for guix-patches@gnu.org; Mon, 06 Sep 2021 06:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNBXl-0005rr-ST for guix-patches@gnu.org; Mon, 06 Sep 2021 06:08:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50286] [RFC PATCH] Let 'package-location' returns location of surrounding 'let'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 10:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50286 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: iskarian@mgsn.dev, 50286@debbugs.gnu.org Received: via spool by 50286-submit@debbugs.gnu.org id=B50286.163092283522494 (code B ref 50286); Mon, 06 Sep 2021 10:08:01 +0000 Received: (at 50286) by debbugs.gnu.org; 6 Sep 2021 10:07:15 +0000 Received: from localhost ([127.0.0.1]:51980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNBX1-0005qk-Hw for submit@debbugs.gnu.org; Mon, 06 Sep 2021 06:07:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNBWz-0005qV-SC for 50286@debbugs.gnu.org; Mon, 06 Sep 2021 06:07:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34012) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNBWt-0008Nk-RG; Mon, 06 Sep 2021 06:07:07 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=47196 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNBWs-0001Ta-T9; Mon, 06 Sep 2021 06:07:07 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <0b61652d751633f78e876a27be88ed14e47527b6.camel@telenet.be> Date: Mon, 06 Sep 2021 12:07:04 +0200 In-Reply-To: <0b61652d751633f78e876a27be88ed14e47527b6.camel@telenet.be> (Maxime Devos's message of "Mon, 30 Aug 2021 23:26:43 +0200") Message-ID: <87o89681br.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630923015; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=BdNKpSctgkPn42/ZxlF+lGX1gsJlChQmGQcoNNcdOpY=; b=auEXluhdR99DE2WYKckYy/A8BMzw4nYm6544L4k4YgitNpFxcDb8AZigTYkQOgezXn9oax 3Fw8em/Me1EE6+1LMbUQORlRftDJOsJBhdMxkCEK9MdgYzwKqK1uNL9sUok5bmBQy82R/l c8Ndqn9f4m9HykKSuxMnxB4hqVpVtKv1sOdQAwMeBnGeKRhxC/waif1QJxKFbkG3b8yJXd oCY1VxhryYNRGyByCaZnDQ/NumYqVFiDje+v6aMMjYdAugblMCUjOq2t43i3CXYEzmbKOH QDy5DjDJ8clSxvtJ8z5TOZ3Tt7Ff68Wc8s/8SOPFN2+R9nS9Z2PDHnGmzzaxiQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630923015; a=rsa-sha256; cv=none; b=Oh2PRNwkvOqHyd9dRdUe7mwrdtzKF2OcgIxCc/3lEtRm5CWInwiUqJiLKHQG+MBbscjbTQ 7hOp7uhNTlh7ufGFSqpPDCF0R4nZHcNAacrPz6w0OrtVMepBe6YdqMV7nbNjWCtj1D0CQr ocdkWBTPzvPtdB4Yi0hBDd7C+KbF9guBfZZhxVUpmC4iWBZGPWxU6+oINPY2SaXbVB82Xz Q1BcUWAeEhaB+wnQQQEh/XtBegas7Cvtl0ehgvVvcQbz8j29on82CxRiEgWz4qouNglTmA 659dRZOzjUcQbI0uIXmG+fFaiuNJF3yXsDayqHPXdDe0wLx/owFQ5Hw+Nr7dsQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.91 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 4380510ED0 X-Spam-Score: -2.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: jlvWqmXo7xJr Hello, Maxime Devos skribis: > These three patches allows (guix upstream) to replace the values in the s= urrounding 'let' > form, if any. It's important for constructs like: > > (define-public gnash > (let ((version "0.8.11") > (commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > (revision "0")) > (package > (name "gnash") > (version (git-version version revision commit)) > (source (git-reference > (url "https://example.org") > (commit commit))) > [...]))) > > such that it can update the version, commit, revision. (Currently only the > version will be updatable, but see > and for work on making 'commit' upd= atable). This is smart! I wonder if we=E2=80=99re going overboard, though. Intuitively, I would ra= ther leave =E2=80=98location=E2=80=99 fields dumb, and instead add editing featu= res to do things like getting the location of the parent sexp. It does add some overhead, but it also makes things more explicit and preserves separation of concern. (Also, in =E2=80=98core-updates-frozen=E2=80=99, =E2=80=98go-to-location=E2=80=99 uses a location cache that makes it less e= xpensive than on =E2=80=98master=E2=80=99.) But yeah, it=E2=80=99s trickier=E2=80=A6 Hmm, thinking out loud, what about this: use the same trick as you did, but replace =E2=80=98define-public=E2=80=99 instead of =E2=80=98let=E2=80= =99 & co., so as to be less intrusive. (define-syntax-parameter current-definition-location (identifier-syntax #f)) (define-syntax define-public* (syntax-rules () ((_ prototype body) (define-public prototype (syntax-parameterize ((current-definition-location (identifier-syntax (current-source-location= )))) body))))) Since there=E2=80=99s code that assumes =E2=80=98package-location=E2=80=99 = returns the location of the (package =E2=80=A6) sexp, we could add a =E2=80=98definition-locatio= n=E2=80=99 field in , defaulting to =E2=80=98current-definition-location=E2=80=99, or = tweak =E2=80=98location=E2=80=99 to include both. WDYT? Thanks, Ludo=E2=80=99.