From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 KHVpCL0FemObWgEAbAwnHQ (envelope-from ) for ; Sun, 20 Nov 2022 11:47:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AICRB70FemN+bQAAG6o9tA (envelope-from ) for ; Sun, 20 Nov 2022 11:47:25 +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 E11E939659 for ; Sun, 20 Nov 2022 11:47:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owhqq-0002b0-Qd; Sun, 20 Nov 2022 05:47:04 -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 1owhqp-0002Z1-Ak for guix-patches@gnu.org; Sun, 20 Nov 2022 05:47: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 1owhqo-0002wu-LN for guix-patches@gnu.org; Sun, 20 Nov 2022 05:47:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owhqo-0006Ot-AD for guix-patches@gnu.org; Sun, 20 Nov 2022 05:47:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#58812] Coding style: similarly-named variables Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 20 Nov 2022 10:47: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: Maxim Cournoyer Cc: 59164@debbugs.gnu.org, 58812@debbugs.gnu.org Received: via spool by 58812-submit@debbugs.gnu.org id=B58812.166894117224537 (code B ref 58812); Sun, 20 Nov 2022 10:47:02 +0000 Received: (at 58812) by debbugs.gnu.org; 20 Nov 2022 10:46:12 +0000 Received: from localhost ([127.0.0.1]:42449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owhq0-0006Nf-9t for submit@debbugs.gnu.org; Sun, 20 Nov 2022 05:46:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owhpx-0006NP-Tk; Sun, 20 Nov 2022 05:46:10 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owhps-0002nG-K7; Sun, 20 Nov 2022 05:46:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=AooPTJittKMtshp5EuVjLkXx8fWHzSCbkMVx/nIIrhw=; b=iBDKxyNmXsw0UQ/wDKSG g8Llmpirl017MxFQR5E6y5WhVlyYkJZW1gcY6zsxxpdscE+y9QEnczmpbH9YUHYKOuVSCq+Kriajk 7fdQwNn/AgjbGlmTd40CD/VL7rJiMOfVDOKEgK6pK3TvWsCoAxej4kT3pV4B/kT+P5/1Ot9TLtcko GktuPf0roU/5ScHocqfYkngyaRbrdewhq35QoCAT1Ws6+PKEvsiIaV6fjALw1FeFIlLC5ZKdkISqa MOSmbYnYxa8nEAuBOV4jDkTyPe3nF0tqIhBPDXgAdbyogAQ0ueg44l/ZzmPFJHDFi7XgbnqI6Dxqi iJw/umTtdAVHag==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owhps-0004Xx-5R; Sun, 20 Nov 2022 05:46:04 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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> <87v8ndtj58.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?UTF-8?Q?D=C3=A9cadi?= 30 Brumaire an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Rouleau X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 20 Nov 2022 11:46:00 +0100 In-Reply-To: <87v8ndtj58.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 17 Nov 2022 15:34:27 -0500") Message-ID: <87pmdh7vkn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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-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=1668941244; 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=AooPTJittKMtshp5EuVjLkXx8fWHzSCbkMVx/nIIrhw=; b=tErPRBBmZOtKaJbDabv/okYy9yhfHqM2tPNSyd97Qdqry4jJcWqcJhTwQ5L0yAePHJ0ZOF MycOu3DJ2i4rA908buEqIfEjRPxaPMhv60h43FJsSufC4z6Mh7Ev27PdLqCeGEYX2hgY0o jiQHvG/HZ1yXsWcQnZfmK/UsbomXOUu1ME2oCeKEQ/bE4qg0Qj3iTv+hpgGCMP2h3bAGgP PFg6jhcpRi9uAS65BlNQkPDn3LPIvj9KToYsbWyOeyVSGonUlBxOxP2DdLrpPQSs3tIHho LjvniFNH4qdNwiif4vp7xHM5RqXifD1KTjRmsvcHQR6jYyghNvzj95x44dfqVw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668941244; a=rsa-sha256; cv=none; b=tPD/wskS4NGTLbHFtCo4aeSca5GmJ/t8QlgaE9XJqueEKs3/BlUB80aTVxXunimb9TcfCA DOrksABNznvqwQnrIdogVM1nJXTOlidmiCCAeV9LbI49z0NSv9ou17a+yacip5VxmfQzLQ yx6zSjRvvnxsgYM1+92ekYFAJB/NVxLCUI7zK1n9JoLqHDAB3qy/9gyA4VNnD/3/ygYbj3 qO/tXh/BPwSh54UnsZv+0aiCnGDZWSo162ilYwtRqBihl5RQBZ/rEEHKH5sS1hGwK5e9Qu sGYyrP/VSJhO9Zm+Cd7FKEwYLNGGg14b4xkYj/IhZWDq7Y+1CBcdupB9BnEnXA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=iBDKxyNm; dmarc=pass (policy=none) header.from=gnu.org; 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: -3.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=iBDKxyNm; dmarc=pass (policy=none) header.from=gnu.org; 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: E11E939659 X-Spam-Score: -3.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: a7QUQaYA7FSV Hi, Maxim Cournoyer skribis: [...] >>> 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 usi= ng 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. > > I'm surprised you're not buying it, given we're writing Scheme in a more > functional style, and mutating same-named variables clearly goes against > that style :-). There=E2=80=99s no mutation here, only lexical scoping. Anyway, I find it = clear that the risk of typing =E2=80=98x=E2=80=99 instead of =E2=80=98x*=E2=80=99= , especially in relatively long functions, justifies shadowing in situations like this one. WDYT? >> 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? > > That's more of a coding style guidelines than "formatting" code Sorry I meant =E2=80=9CCoding Style=E2=80=9D, which is the section that doc= uments the project=E2=80=99s conventions. > (when I read "formatting", I think of a mechanical process like 'guix > style' or 'rust-fmt' can do), but yes, that could be nice to have. > Better yet, something basic to share across the whole Guile/Scheme > community and include in the Guile user manual, like Python has PEP 8 > they can refer to, to save every Guile/Scheme project from having to > reinvent the wheel. I won=E2=80=99t do it, but sure, why not! My immediate concern is to make = sure we have a shared understanding, within Guix, of some of the conventions we follow. It=E2=80=99s a minor issue, but minor issues are what our day-t= o-day work is made of. :-) Thanks, Ludo=E2=80=99.