unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Hongyi Zhao <hongyi.zhao@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: (unless ...) vs (when (not ...))
Date: Fri, 16 Jul 2021 16:12:19 -0700	[thread overview]
Message-ID: <87mtqlua3w.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <CAGP6POJ2y3fo=cNzM0=RZbS788mfMiVRJ3xNnHe+BCQgaVnzrA@mail.gmail.com> (Hongyi Zhao's message of "Sat, 17 Jul 2021 06:42:40 +0800")

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> Should I use (unless ...) or (when (not ...))? Which one is preferable?

In terms of compilation, they both turn into `if' statements, so there's
no real difference there. Personally I find that, when I'm "reading" the
code out loud in my head, one approach will sound more natural than the
other, which can make things a little quicker to parse mentally. But it
really depends on what the condition is and how it's tested.



  reply	other threads:[~2021-07-16 23:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 22:42 (unless ...) vs (when (not ...)) Hongyi Zhao
2021-07-16 23:12 ` Eric Abrahamsen [this message]
2021-07-17 17:52 ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtqlua3w.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).