From: Jeremiah Dodds <jeremiah.dodds@gmail.com>
To: Bastien <bzg@altern.org>
Cc: emacs-devel@gnu.org
Subject: Re: Usefulness of (t nil) as the last sexp in (cond ...) constructs?
Date: Sun, 19 Aug 2012 06:23:15 -0400 [thread overview]
Message-ID: <87ipcf6uzw.fsf@friendface.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <87mx1rthxb.fsf@altern.org> (Bastien's message of "Sun, 19 Aug 2012 09:07:09 +0200")
Bastien <bzg@altern.org> writes:
> There are many places in *.el elisp files where we have this construct
>
> (cond (...)
> (...)
> (t nil))
>
> My understanding is that (t nil) is useless, since the ̀t' condition
> is only tested if other conditions are `nil'.
>
> What is the purpose of (t nil)?
IIRC, it's mostly there to make it explicit that "this cond is expected
to return nil sometimes".
> Can we safely remove it?
Again, IIRC, it shouldn't affect behaviour to do so, but it might not be
preferable.
--
Jeremiah Dodds
blog : http://jdodds.github.com
github : https://github.com/jdodds
freenode : exhortatory
twitter : kaens
next prev parent reply other threads:[~2012-08-19 10:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-19 7:07 Usefulness of (t nil) as the last sexp in (cond ...) constructs? Bastien
2012-08-19 10:23 ` Jeremiah Dodds [this message]
2012-08-19 11:29 ` Achim Gratz
2012-08-19 12:00 ` Thien-Thi Nguyen
2012-08-19 12:45 ` Bastien
2012-08-19 12:06 ` Juanma Barranquero
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=87ipcf6uzw.fsf@friendface.i-did-not-set--mail-host-address--so-tickle-me \
--to=jeremiah.dodds@gmail.com \
--cc=bzg@altern.org \
--cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).