Re: [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters

Subject: Re: [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters

Date: Mon, 27 Jul 2020 00:02:39 +0200

To: Sean Whitton, notmuch@notmuchmail.org

Cc:

From: Jonas Bernoulli


Sean Whitton <spwhitton@spwhitton.name> 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.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: