Re: (case 'quote ('lambda 1) (otherwise 2))
- From: "Tim Bradshaw" <tfb+google@xxxxxxxx>
- Date: 30 Jan 2007 01:34:38 -0800
On Jan 29, 9:48 pm, "David Wragg" <d...@xxxxxxxxx> wrote:
I have found 2 Common Lisp implementations that think that the above
code evaluates to 1. This is quite surprising to me.
It should not be. If expand the syntactic sugar what you have is
(case (quote quote) ((quote lambda) 1) (otherwise 2))
and I think it's now clear what the answer is: because QUOTE is EQL to
QUOTE, so the first clause matches. The mistake you've made is to
assume that the keys in a CASE clause are evaluated and therefore need
quoted: they're not (and in fact, you've not been quite consistent,
since you didn't quote OTHERWISE...).
--tim
.
- References:
- (case 'quote ('lambda 1) (otherwise 2))
- From: David Wragg
- (case 'quote ('lambda 1) (otherwise 2))
- Prev by Date: Automatic parallelization - was Re: LISP Object Oriented?
- Next by Date: Re: Automatic parallelization - was Re: LISP Object Oriented?
- Previous by thread: Re: (case 'quote ('lambda 1) (otherwise 2))
- Next by thread: Replacing Xaml with Lisp on Windows Vista
- Index(es):
Relevant Pages
|