emacs 29.1
sbcl 2.4.0
slime 2.29.1
Here's my function:
(defun my-case ()
(case 'a
(b "hello")
(a "world")
(otherwise "mars")))
When I compile it, C-c C-k, I see the following in the mini-buffer:
In the slime repl, I see:
; processing (DEFUN MY-CASE ...)
; file: /var/tmp/slimeckqotJ
; in: DEFUN MY-CASE
; (CASE 'A (B "hello") (A "world") (OTHERWISE "mars"))
; --> COND IF PROGN
; ==>
; "hello"
;
; note: deleting unreachable code
; --> COND IF IF THE PROGN
; ==>
; "mars"
;
; note: deleting unreachable code
;
; compilation unit finished
; printed 2 notes
And, in my source file, the word "case" is underlined:
However, my function runs fine:
CL-USER> (my-case)
"world"
What are "notes"?


The notes are telling you that the clauses
(b "hello")and(otherwise "mars")are unreachable.The first argument to a
caseform is evaluated to produce a key for testing the clauses. Inmy-casethat keyform argument always evaluates to the symbola, so the compiler can see that there is only one possible result.A
caseform is not much use when there is only one possible outcome. Here is a version that does not trigger the compiler notes and removal of unreachable code: