From: Pisin Bootvong
Subject: Duplicate case warning of symbol in CLISP
Date: 
Message-ID: <1127275889.819306.279020@o13g2000cwo.googlegroups.com>
CL-USER> (defun foo (s)
	   (case s
	     ('a "a")
	     ('b "b")))
FOO
CL-USER> (compile 'foo)
WARNING in FOO :
Duplicate CASE label QUOTE : (CASE S ('A "a") ('B "b"))
FOO
1
NIL
CL-USER>

Running with CLISP 2.35.
Is that the appropriate warning? Or did I misunderstand anything?

From: Barry Margolin
Subject: Re: Duplicate case warning of symbol in CLISP
Date: 
Message-ID: <barmar-19A6D3.01054121092005@comcast.dca.giganews.com>
In article <························@o13g2000cwo.googlegroups.com>,
 "Pisin Bootvong" <··········@gmail.com> wrote:

> CL-USER> (defun foo (s)
> 	   (case s
> 	     ('a "a")
> 	     ('b "b")))
> FOO
> CL-USER> (compile 'foo)
> WARNING in FOO :
> Duplicate CASE label QUOTE : (CASE S ('A "a") ('B "b"))
> FOO
> 1
> NIL
> CL-USER>
> 
> Running with CLISP 2.35.
> Is that the appropriate warning? Or did I misunderstand anything?

The notation 'something is actually an abbreviation for the list (quote 
something), so your expression is being treated as:

(case s
  ((quote a) "a")
  ((quote b) "b"))

This means that if the value of S is EQL to QUOTE or A, return "a", if 
it's EQL to QUOTE or B, return "b", otherwise return NIL.  Notice that 
you have QUOTE in both cases.

So you forgot two things: the keys in case clauses are not evaluated (so 
you don't need to quote them), and they can be a list of items.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
From: Wade Humeniuk
Subject: Re: Duplicate case warning of symbol in CLISP
Date: 
Message-ID: <1q5Ye.268680$tt5.125734@edtnps90>
Pisin Bootvong wrote:
> CL-USER> (defun foo (s)
> 	   (case s
> 	     ('a "a")
> 	     ('b "b")))
> FOO
> CL-USER> (compile 'foo)
> WARNING in FOO :
> Duplicate CASE label QUOTE : (CASE S ('A "a") ('B "b"))
> FOO
> 1
> NIL
> CL-USER>
> 
> Running with CLISP 2.35.
> Is that the appropriate warning? Or did I misunderstand anything?
> 

It should just be

(defun foo (s)
    (case s
       (a "a")
       (b "b")))

Wade