From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Xiyue Deng Newsgroups: gmane.emacs.bugs Subject: bug#67669: 29.1; Drop text suggesting using `and' to replace `if' Date: Fri, 08 Dec 2023 14:41:52 -0800 Message-ID: <87msuk8ggf.fsf@debian-hx90.lan> References: <87v89buhpl.fsf@debian-hx90.lan> <83sf4e34s8.fsf@gnu.org> <87r0jytm58.fsf@debian-hx90.lan> <83a5qm2u8v.fsf@gnu.org> <87fs0ducme.fsf@debian-hx90.lan> <87il596kht.fsf@zephyr.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40950"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67669@debbugs.gnu.org, Eli Zaretskii To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 08 23:43:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rBjZ8-000AQK-WF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Dec 2023 23:43:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBjYY-0007Zn-4F; Fri, 08 Dec 2023 17:42:50 -0500 Original-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 1rBjYX-0007Zf-HU for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 17:42:49 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBjYX-0007hl-9G for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 17:42:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBjYk-0000RP-6I for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 17:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Xiyue Deng Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Dec 2023 22:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67669 X-GNU-PR-Package: emacs Original-Received: via spool by 67669-submit@debbugs.gnu.org id=B67669.17020753371637 (code B ref 67669); Fri, 08 Dec 2023 22:43:02 +0000 Original-Received: (at 67669) by debbugs.gnu.org; 8 Dec 2023 22:42:17 +0000 Original-Received: from localhost ([127.0.0.1]:46441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBjY0-0000QL-Ki for submit@debbugs.gnu.org; Fri, 08 Dec 2023 17:42:16 -0500 Original-Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:48590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBjXy-0000Q7-0h for 67669@debbugs.gnu.org; Fri, 08 Dec 2023 17:42:15 -0500 Original-Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5c690c3d113so2117456a12.1 for <67669@debbugs.gnu.org>; Fri, 08 Dec 2023 14:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702075314; x=1702680114; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=GuooEymkFRbq6yFRI5EasvI5pBLlECvihqG+yE0fBNk=; b=YPniqf9X1oWuzqx8nL+l0pgDNLMuZVJfzF2fAmzo4ya+BsSzatkSZJLNllPMYJbjXa VnyQYXX/UQm5SQIdWpDj1RKBtQr1XbAnMCBtM3axUJnX8e9h+M91HM6+Ao0Zj4Oz3MRy 2kHYRi03stX3/IO2Js6yLJC2jFQdPWWpmElW4+zLi38ZK9RqH5g2GTznRMWxQShnMy9m ykdLo/tUE1D2Ywn8tryJu8Hf00Mrt4HqBeBZLuukJHOfYQQ6TzA3CtX4+TEx3KXNLt5r RKd//nzNWk98hOyj28EbO/JdmCM/X/rlFhTejcfsHdVsyrlJCIIi960kX7VkHfXcnUBh Lxog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702075314; x=1702680114; h=mime-version:user-agent: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=GuooEymkFRbq6yFRI5EasvI5pBLlECvihqG+yE0fBNk=; b=qCnbFAWdSkTNqMBZ6vzpwtQHsONfwmcrs0Ee/PUUm7+nIPjuztRf9fnQIKnQWs9Dit 9ujcGKkYc/ziykv39aZy78UoYtkbcunB/0ZCwMTOx9zX96EjmmCisiRI87naioI87f1v XlttZGzgMS8aNYA7FAqjESiIWXDxmn0e8G/S17J8fqL7Vkw/gI+6Joh5Zab2XeR0CT32 UJ7l9BJrGqEH6bTmcIR7I9YIG7AuF/uZDOOaefN6uJHe/uwguLTbh19osS2Qqo7ipQz3 dmGiK/z1yu2O0B55m8cnTexH9y74aDXD7UpidBwJoLvuweKd7BxOHeoKVKY+NaZqhA9O qZ2A== X-Gm-Message-State: AOJu0YxVsDL92VufBn4SfuScmBvZ0+2RoRN1FP1qH5LmI6/KBp9H0p6o g+4RqA+j2nCrYihXRhiWCziCeXpzfE1rzw== X-Google-Smtp-Source: AGHT+IFNrRFgpdvZZ+gks/0OjdpcclKq/1PwcnQgaPHm5dRv7XoG7V/h0N6CBkhRQazaAfDQI3Xz7Q== X-Received: by 2002:a05:6a20:3d93:b0:18c:8ff1:f16 with SMTP id s19-20020a056a203d9300b0018c8ff10f16mr852128pzi.1.1702075314340; Fri, 08 Dec 2023 14:41:54 -0800 (PST) Original-Received: from debian-hx90 (2603-8000-a400-0cdc-05b7-1692-5cbe-65ea.res6.spectrum.com. [2603:8000:a400:cdc:5b7:1692:5cbe:65ea]) by smtp.gmail.com with ESMTPSA id ka8-20020a056a00938800b006ce7f7f1a94sm2084460pfb.208.2023.12.08.14.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 14:41:54 -0800 (PST) In-Reply-To: <87il596kht.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Fri, 08 Dec 2023 10:45:18 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275812 Archived-At: Sean Whitton writes: > Hello, > > On Thu 07 Dec 2023 at 09:49am -08, Xiyue Deng wrote: > >> Agreed on the point of being educational, and of course in the end >> coding style is mostly a matter of personal preference. However, I >> would argue a bit that in such case we wouldn't need `if' or `when' at >> all as both can be emulated by `and' and `or' if you are careful enough. >> On the other hand, `if' and `when' should exist for a reason. I quite >> like this suggestion[1] that `if' and `when' are used to guard side >> effects, whereas `and' and `or' are used for pure functions. >> Interestingly the current example you quoted changed from using `and' >> (as in the old version I quoted) to `if' probably based on this >> reasoning. Similarly I wouldn't suggest to replace `if' with `and' in >> the original example around the text we are discussing: > > It's an old Lisp convention, not Emacs-specific, to use 'and' for return > value and 'when' for side-effects, and not to use 'if' when there is no > 'else' clause. Ack. Thanks for the historical tip! -- Xiyue Deng