I expected the outcome of the following small program:
(progn
(setq x 1)
(case x
(x 'Yes)
(t 'No)))
to be Yes, given that case compares things with eql, and surely x is eql to itself. However the outcome is No and I am completely puzzzled by this!
This is a long comment, not an answer!
Thanks to everybody for making everything perfectly clear. My original intention was to use 'case' to simulate something like
(cond
((equal x a) 'this)
((equal x b) 'that)
((equal x c) 'something-else))
which would look much cleaner if it were equivalent to
(case x
(a 'this)
(b 'that)
(c 'something-else))
But, alas, I understand that these are not equivalent forms due to the fact that case evaluates x but does not evaluates the keys in each clause.
I thought of faking things, such as in
(let ( (x 2) (a 1) (b 2) (c 3) ) (flet ( (eql (x y) (equal x (eval y))) )
(case x
(a 'this)
(b 'that)
(c 'something-else))
))
which does work as I'd like but I suppose it is a bit blasphemous to alter the meaning of something as basic as 'eql', even if only temporarily!