unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Garreau, Alexandre" <galex-713@galex-713.eu>
Cc: help-gnu-emacs@gnu.org
Subject: RE: `when' vs. `and' / `unless' vs `or'
Date: Tue, 16 Oct 2018 17:16:14 -0700 (PDT)	[thread overview]
Message-ID: <db21ea5f-21db-4ddd-9b66-37163a7e7faa@default> (raw)
In-Reply-To: <871s8pl9t7.fsf@portable.galex-713.eu>

> (if (or cond cond) then else) than, canonically (and (not (and (or cond
> cond) then)) else) (not sure about a simplified version), which is the
> way to write it without an `if', as you said you didn’t use it if the
> condition was more than a single sexp.

As I (think I) said, I use (if (or cond cond) then else), if THEN is a single sexp.

If THEN is not a single step I don't bother to use
(if (or cond cond) (progn THEN1 THEN2...)) else).

---

BTW, for transforming sexps with `not', `and', and `or', for readability
or for performance reasons, I sometimes use `notandor.el'.

https://www.emacswiki.org/emacs/NotAndOr

Also, package `el-search.el' has similar possibilities (and many other
good things).



  reply	other threads:[~2018-10-17  0:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16 21:05 `when' vs. `and' / `unless' vs `or' Garreau, Alexandre
2018-10-16 22:13 ` Drew Adams
2018-10-16 22:38   ` Garreau, Alexandre
2018-10-16 23:21     ` Drew Adams
2018-10-17  0:02       ` Garreau, Alexandre
2018-10-17  0:16         ` Drew Adams [this message]
2018-10-17  1:25           ` Garreau, Alexandre
2018-10-17  1:58             ` Drew Adams
2018-10-17  9:00               ` Garreau, Alexandre
     [not found]               ` <mailman.2299.1539766826.1284.help-gnu-emacs@gnu.org>
2018-10-17  9:49                 ` Emanuel Berg
2018-10-17 15:42             ` Michael Heerdegen

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=db21ea5f-21db-4ddd-9b66-37163a7e7faa@default \
    --to=drew.adams@oracle.com \
    --cc=galex-713@galex-713.eu \
    --cc=help-gnu-emacs@gnu.org \
    /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).