From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-devel@gnu.org
Subject: Re: Usefulness of (t nil) as the last sexp in (cond ...) constructs?
Date: Sun, 19 Aug 2012 13:29:52 +0200 [thread overview]
Message-ID: <87a9xrazm7.fsf@Rainer.invalid> (raw)
In-Reply-To: 87mx1rthxb.fsf@altern.org
Bastien 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)?
It's a nice (redundant) reminder that "if none of the other conditions
is true, this form returns nil".
> Can we safely remove it?
I don't know if any checkers rely on it. I'd expect it is optimized
away when the byte-compiler gets to it anyway, so why would you want to
remove it?
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves
next prev parent reply other threads:[~2012-08-19 11:29 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
2012-08-19 11:29 ` Achim Gratz [this message]
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=87a9xrazm7.fsf@Rainer.invalid \
--to=stromeko@nexgo.de \
--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).