[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CASEQ doesn't do MEMQ



It would be even more confusing than it already is if it did MEMQ.
Eg, CASEQ allows the form

	(CASEQ q ((item1) consequent) ...)

to contract to

	(CASEQ q (item1 consequent) ...)

except in the case of item1=T, where (CASEQ ... (T ...)) has special
meaning and hence if you want to compare to T you have to do 
(CASEQ ... ((T) ...)). If you allowed arbitrary things to compare against,
you'd see

	(CASEQ '(FOO BAR) ((FOO BAR) X) (((FOO BAR) Y) XX) ...)

and you'd have even more special cases to worry about.

As with the recent discussion with DOLIST, I Have to say that I think the
right thing is simplicity. While perhaps CASEQ should allow any kind of atomic
things, I don't buy its accepting arbitrary forms. That destroys the sense of
simplicity it meant to achieve. If its syntax gets so hairy that you
can't see what it is doing at a glance, you oughta be using COND or
write your own GCASEQ, I think.

-kmp

ps As a side note, (CASEQ '(FOO BAR) '((X) 8)) reads in as
   (CASEQ '(FOO BAR) (QUOTE ((X) 8)))
   so I suspect you didn't mean the second "'" in your example.