From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6Lw8HrqrdmNnRAAAbAwnHQ (envelope-from ) for ; Thu, 17 Nov 2022 22:46:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OLVJHrqrdmNw6gAA9RJhRA (envelope-from ) for ; Thu, 17 Nov 2022 22:46:34 +0100 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 EA0D53D1DE for ; Thu, 17 Nov 2022 22:46:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovmhx-0001N5-2R; Thu, 17 Nov 2022 16:46:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovmhv-0001Ml-4r for guix-patches@gnu.org; Thu, 17 Nov 2022 16:46:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovmhu-0004U3-Ps for guix-patches@gnu.org; Thu, 17 Nov 2022 16:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovmhu-0005OY-AB for guix-patches@gnu.org; Thu, 17 Nov 2022 16:46:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#58812] [bug#59164] Coding style: similarly-named variables Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Nov 2022 21:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58812 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Cc: 59164@debbugs.gnu.org, 58812@debbugs.gnu.org Received: via spool by 58812-submit@debbugs.gnu.org id=B58812.166872151320664 (code B ref 58812); Thu, 17 Nov 2022 21:46:02 +0000 Received: (at 58812) by debbugs.gnu.org; 17 Nov 2022 21:45:13 +0000 Received: from localhost ([127.0.0.1]:34550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovmh6-0005ND-O3 for submit@debbugs.gnu.org; Thu, 17 Nov 2022 16:45:13 -0500 Received: from mail-wm1-f46.google.com ([209.85.128.46]:51099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovmh4-0005Mv-JG; Thu, 17 Nov 2022 16:45:11 -0500 Received: by mail-wm1-f46.google.com with SMTP id v7so2346744wmn.0; Thu, 17 Nov 2022 13:45:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=PzRSbKNYHGFmGVEiTRsmCY5EiTxuiy/jAs2zx6ddK90=; b=KPFNGPc+FC/NWmPLz0lfBeGw5e2ddkafxrVGeXzgH6jcRnlR/O8zyKEeBnbo9gmiwv tc/jLMJLA7H7PnqYFGpQQIi09YTjpnJYVV9Bmf1I2RFK/0ZPjJQp9cYKIld1Df+j7nnQ YglRcDhd5a6FTkOjZRSqKTVfiRxS2QWlaVoZPQ0fnWN1OAZJZEU7Eh6cj+JuDnGSXRMx tF7TflGo5QHmO6799i/5Uq2a9gEckHOo8XtSFM35kNfweCYHi7vr1QOp/HHDFWI/tRcw lBToaUXNWm0ZWuYz4x/fR2MYP+dfDoRZW1Ho1lyiOidEnx9acqzqXr7tTIu7KkYrj4QO R2Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PzRSbKNYHGFmGVEiTRsmCY5EiTxuiy/jAs2zx6ddK90=; b=2Jlw1awhsiV3Bv/xoI4q8JWF2hMeqvqePDGCpDBcPFxIJ4L4Q/g62Zv9aPUVQG93gk CZY47G/rN0tL3Rck0JHEaSxjyKhu64gd0KI2TtmzXT0wEKgVtAu0uNfxcRCaW6tuG4n8 rQoaozHO4zV2OMq3PKelj76wG6jH8/gqOTBLZXIQdRVPYkXxlwsfxo1ELSdG99qWiGEl UTuPJv2A0cd0YKtJEh53savbEQtk9a8JZOhlzqaBeFT3wW3U6a6VURwaaINTmGB/z97g rU6ukW6I4HEZyPQ2pwu4BKA0xQqt2T51JLPNzalTACBzf84iubSCF9CQJyDipwUMEujW q5HQ== X-Gm-Message-State: ANoB5plJy9pW+llmM+Gf28TvxDtNW8OtWIOkFdR7+p0I8TjdmKnUnDpa Q5YrdF0dYorzz3UPDrEh1NPgIknsszA= X-Google-Smtp-Source: AA0mqf4zHmMFabRqQX4SGm0dM1S//Fffo4VfQRkDWLiuXgjxv8Lt6Waw6FhyxyYk12/hyl9xf5laXA== X-Received: by 2002:a7b:c84a:0:b0:3cf:5d41:b74b with SMTP id c10-20020a7bc84a000000b003cf5d41b74bmr6319729wml.184.1668721503468; Thu, 17 Nov 2022 13:45:03 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id 6-20020a05600c024600b003b50428cf66sm2340271wmj.33.2022.11.17.13.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 13:45:03 -0800 (PST) From: zimoun In-Reply-To: <87sfihfpng.fsf_-_@gnu.org> References: <20221027035100.28852-1-maxim.cournoyer@gmail.com> <20221027035100.28852-3-maxim.cournoyer@gmail.com> <87leojon1z.fsf_-_@gnu.org> <877d03xywl.fsf@gmail.com> <87sfihfpng.fsf_-_@gnu.org> Date: Thu, 17 Nov 2022 19:44:18 +0100 Message-ID: <86zgcpju9p.fsf@gmail.com> 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668721594; 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:dkim-signature; bh=PzRSbKNYHGFmGVEiTRsmCY5EiTxuiy/jAs2zx6ddK90=; b=HJ44I/bxpdMQwGNjpQEjg3oXAzEdoB6OLJhPIs0ZJBnfa1KiAJlurbWy7wQuw2DUN/bmfH jI4diaF5Vi7enD0ZN8MAAMQLNDcwS26wvhbOFMqm9G6auSp0HMidos7eTAxakSDmzRbwN2 ZTdU1CJ4qgMxcmFw1n851/20WGcpX7gHroX3XUsJODllLAkE8DAb3zM+3B7HTbHzQPL2ih nYZp7R7bGbh8S0Y4rESnmG0kB4efHGRaU93m0Ljdh73HV/1qiSCkAiKTOKbFnJByile3qh ueUm2GGIFxIZrkPj37twz7GNw09ZsIto1HidVgdY9WPq//ynfwWiH3zBBYqtQg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668721594; a=rsa-sha256; cv=none; b=GKsiUqiR19D9FeWONB3YzVTcBi0u7YvaohjW97d+tZ2eLYOwb8mfWfxv5dyq/4Q4bv8E4n 9gYNbuvPY65IwdNEcoaCVXF/hHsdwtpzVVK6B/On2RoeD/uPKt5Oi1uqF0+Tj1QWPjtVAa kfY/5ZLSWFv6KKYgZTFGuFZdOY4fnx3kbO5eT6UnlteGUk7zL/I4qHqIL5Vtr47a2Abaoi /6hK8XCSopkpaXSF3VYefubirtnnmo7Ijx57IdwNa/eRsrowBNvRH4pWSJCiLMXIFw81EA ejfTr8fJlqa0Z8u5pZj57fWoOxVI7P4VWXa4Teyol3NEgTp4LWVwnEeSq4LrLg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=KPFNGPc+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.47 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=KPFNGPc+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: EA0D53D1DE X-Spam-Score: 7.47 X-Migadu-Scanner: scn1.migadu.com X-TUID: dZJXnDrINowW Hi, On Thu, 17 Nov 2022 at 18:37, Ludovic Court=C3=A8s wrote: >> It's a pattern I've used at other places; I find it more hygienic to not >> shadow existing variables; it signal to the reader "be careful, this is >> not the same as the argument-bound one, though they are closely >> related". > > I don=E2=80=99t buy it. :-) The reader might be careful yet end up usin= g the > =E2=80=9Cwrong=E2=80=9D variable. As long as the =E2=80=9Cwrong=E2=80=9D= variable has no use, I think > it=E2=80=99s best to shadow it so that mistakes cannot happen. > > Of course the details vary depending on context, but I think we should > not start introducing this pattern in different places. Perhaps > something to discuss and codify under =E2=80=9CFormatting Code=E2=80=9D? I agree with Ludo. For another instance than target*, the previous was, --8<---------------cut here---------------start------------->8--- ((new '-> old) [...] - (symlink old (string-append target new))) [...] - (delete-file (string-append target new)) --8<---------------cut here---------------end--------------->8--- then replaced by, --8<---------------cut here---------------start------------->8--- ((new '-> old) [...] + (let ((new* (string-append target* new))) [...] + (error (format #f "symlink `~a' points to nonexis= tent \ +file `~a'" new* old))))) + (symlink old new*)) --8<---------------cut here---------------end--------------->8--- Well, it seems a Star War. ;-) As Ludo, I am not convinced that it is less error-prone, maybe the contrary. Cheers, simon