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 QHNEHI9xdmPGTAEAbAwnHQ (envelope-from ) for ; Thu, 17 Nov 2022 18:38:23 +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 QCtWG49xdmPjlwAAG6o9tA (envelope-from ) for ; Thu, 17 Nov 2022 18:38:23 +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 23B8B2BF0C for ; Thu, 17 Nov 2022 18:38:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovipv-0001ni-TA; Thu, 17 Nov 2022 12:38:03 -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 1ovipv-0001nS-5F for guix-patches@gnu.org; Thu, 17 Nov 2022 12:38: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 1ovipu-0008Jy-P7 for guix-patches@gnu.org; Thu, 17 Nov 2022 12:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovipu-0005PT-LF for guix-patches@gnu.org; Thu, 17 Nov 2022 12:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59164] 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: Thu, 17 Nov 2022 17:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59164 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 59164-submit@debbugs.gnu.org id=B59164.166870666920768 (code B ref 59164); Thu, 17 Nov 2022 17:38:02 +0000 Received: (at 59164) by debbugs.gnu.org; 17 Nov 2022 17:37:49 +0000 Received: from localhost ([127.0.0.1]:34259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovipg-0005Oo-RM for submit@debbugs.gnu.org; Thu, 17 Nov 2022 12:37:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovipf-0005OQ-6U; Thu, 17 Nov 2022 12:37:47 -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 1ovipZ-0008I5-Qo; Thu, 17 Nov 2022 12:37:41 -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=XIQC+g9JaYt78aJpubTEMWT/cz5ilH7L1mEsvIwcf2s=; b=nU7G5Cn/iwnTvTw0iq3N WIMD6U9l2zRniK1RtyPY+iD/qJ4e92H65a3eiuw94jhel5dW8XVUulTPXOtWEGM4UZIXcohzlEW7M 2k25ur3p1q2vBtgbLRLUFcvZnbDMQQExrs0vZIYn7z/Qgv9s2xaUH9pNguJeTR+BJ7yUGFccbfpwG 3cBzh7AM9a12pZiCIGg8SQCr9U3nsLIRWhX8EkqxYvV7Gu5MUiP3Fj9xLD3LnNzyZZf2Be+YfKOPP m4lI30xC+kKugzJgwinWrqZYHv1pnnwvYQv8c54G1McE3Q+lAwjj/9pmoVYTfgq2RAS4i9sfsuhTf X3gI0DbUfj5LXQ==; 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 1ovipY-0006rn-SZ; Thu, 17 Nov 2022 12:37:41 -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> Date: Thu, 17 Nov 2022 18:37:39 +0100 In-Reply-To: <877d03xywl.fsf@gmail.com> (Maxim Cournoyer's message of "Wed, 09 Nov 2022 22:37:46 -0500") Message-ID: <87sfihfpng.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=1668706703; 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=XIQC+g9JaYt78aJpubTEMWT/cz5ilH7L1mEsvIwcf2s=; b=BwYAZvfJ0R2vS4f/7SWCCjhuPL6JzqFwAFdGBKuSxtSIuE/igedzAtOT3zYGEJiWQ89zRY hVbCitGLglK1pHpS7VD1Zfv8gsDd9I2Ere+ixrBMnaXoe/yTzxtOnWsCU+wsnPIciQmkjD aMl4tl+vw9HIuKaOw/tXO26vsLWTIYF/kpLjqvXQF3dirJTEQVptLPwtx8JbqkqvziHvlC lLVJqyYs08CGISRfeEQ3Id9CvWly3wGe6MuB74FGnVvBY7fBWjQDutwY/vikjGv4vi/vwr JWaKtu0k6mZVa420NI72+fG8IXL86p276jxvGrfvPs7KR0jGX7DbicQJYGJWew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668706703; a=rsa-sha256; cv=none; b=PR96LClw/Yfem0CU4P93xec3t4gR0m6h8kC1FeLdBHGZBiy3tDCQhT9y+cVvhvrGl6Ca+h BzPaYo+pGTC+PghoHIZykNPrgS71aFgslulgZDlhiXBMPJuf4FkmAiXJN6aSLtL36oMcoA HJRGHCFanEChjzEKS496HXBydDyM0pvpODHio0TnyFcxEjeEJLOJzyopsfDdBnTgXEn0+w 089KDWXG5bOZlw2soIHeRGKk5OE7jaU5ONjGfCjI+h+uBJ4BVoSI7XnVh7ZtaXZDirGqxI qZuIE9mY9Eqfnf+ABhN7h5IUg/I+GckHpPer6errkm+L7zlTZhNH9LdQTwS5Xw== 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="nU7G5Cn/"; 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.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="nU7G5Cn/"; 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: 23B8B2BF0C X-Spam-Score: -3.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: AGfJtC2h00Lz Hi, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: > >> Maxim Cournoyer skribis: >> >>> * gnu/build/install.scm (evaluate-populate-directive): By default, erro= r when >>> the target of a symlink doesn't exist. Always ensure TARGET ends with = "/". >>> (populate-root-file-system): Call evaluate-populate-directive with >>> #:error-on-dangling-symlink #t and add comment. >> >> [...] >> >>> + (define target* (if (string-suffix? "/" target) >>> + target >>> + (string-append target "/"))) >> >> Maybe make it: >> >> (let ((target (if =E2=80=A6))) >> =E2=80=A6) >> >> so there=E2=80=99s only one =E2=80=98target=E2=80=99 in scope (and no = =E2=80=98target*=E2=80=99); otherwise it=E2=80=99s >> easy to forget the =E2=80=98*=E2=80=99 and refer to wrong one. > > 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 using = the =E2=80=9Cwrong=E2=80=9D variable. As long as the =E2=80=9Cwrong=E2=80=9D v= ariable 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? Ludo=E2=80=99.