unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30749: 26.0.91; (cl-)case is confused when a nil atom is used instead of a keylist
@ 2018-03-08 10:28 Alex Bennée
  2018-03-08 11:11 ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Bennée @ 2018-03-08 10:28 UTC (permalink / raw)
  To: 30749


I got confused why my case statement was failing as I'd used the second
form assuming that having nil as an atom would work. I'm not sure why
the quoting fixed it but it's certainly a confusing inconsistency. The
following behaviour shows up on emacs -Q:

(require 'cl)

(case nil
  ((nil) "nil")
  ((t) "default"))
"nil"

(case nil
  (nil "nil")
  (t "default"))
"default"

(case nil
  ('nil "nil")
  ('t "default"))
"nil"

(case t
  ('nil "nil")
  ('t "default"))
"default"

I think this is probably fixable with just making the docstring clearer
as the results of handling the duel atom/list of nil might have
unexpected results.

In GNU Emacs 26.0.91 (build 16, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-03-06 built on zen
Repository revision: 0efe0bd233de20bfb5bd9d06b255fc8ecf04602b
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Ubuntu 16.04.3 LTS

--
Alex Bennée





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-10 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-08 10:28 bug#30749: 26.0.91; (cl-)case is confused when a nil atom is used instead of a keylist Alex Bennée
2018-03-08 11:11 ` Noam Postavsky
2018-03-08 11:34   ` Alex Bennée
2018-03-10 22:57     ` Noam Postavsky

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).