From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sAGwNOw5H1+HawAA0tVLHw (envelope-from ) for ; Mon, 27 Jul 2020 20:32:44 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uIyAMOw5H1+0ZQAAB5/wlQ (envelope-from ) for ; Mon, 27 Jul 2020 20:32:44 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E72369403D6 for ; Mon, 27 Jul 2020 20:32:43 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id F354327C31; Mon, 27 Jul 2020 16:32:37 -0400 (EDT) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id ACCF81F70D for ; Mon, 27 Jul 2020 16:32:35 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id CA4F3165E2; Mon, 27 Jul 2020 22:32:34 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id ssz81eM7MlPQ; Mon, 27 Jul 2020 22:32:34 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id A222D165C4; Mon, 27 Jul 2020 22:32:34 +0200 (CEST) From: Jonas Bernoulli To: Sean Whitton , notmuch@notmuchmail.org Subject: Re: [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters In-Reply-To: <87mu3kc3iv.fsf@iris.silentflame.com> References: <20200726165818.400-1-jonas@bernoul.li> <20200726165818.400-8-jonas@bernoul.li> <87365ege67.fsf@iris.silentflame.com> <871rkykk8w.fsf@bernoul.li> <87mu3kc3iv.fsf@iris.silentflame.com> Date: Mon, 27 Jul 2020 22:32:34 +0200 Message-ID: <875za81yxp.fsf@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: 3CBGCT7VPTDGYHQKHE2RKRGTEMWT3X6U X-Message-ID-Hash: 3CBGCT7VPTDGYHQKHE2RKRGTEMWT3X6U X-MailFrom: jonas@bernoul.li X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -0.97 X-TUID: TBnP0S8vkq/S Sean Whitton writes: > Hello, > > On Mon 27 Jul 2020 at 12:02AM +02, Jonas Bernoulli wrote: > >> Sean Whitton writes: >> >>> On Sun 26 Jul 2020 at 06:58PM +02, Jonas Bernoulli wrote: >>> >>>> Also do so for some 'if' forms that lack an ELSE part. >>>> Even go as far as using 'and' and 'not' instead of 'unless'. >>> >>> I don't follow "when the return value matters", could you explain? >> >> As in "when the caller consumes the returned value". The alternative >> would be for the caller to not care about the value returned by the >> callee and to instead call it for the side-effects only. >> >> By using `and' we can signal that care about the return value and by >> using `when' that we care about the side-effects instead. > > Thank you for your reply. Just to confirm, this is just a convention, > right? I hadn't come across it yet. Yes, just a convention. Here's one place that talks about this convention: https://emacs.stackexchange.com/questions/14195/and-vs-when-for-conditionals