[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CASEQ doesn't do MEMQ
- To: KMP at MIT-MC
- Subject: CASEQ doesn't do MEMQ
- From: George J. Carrette <GJC at MIT-MC>
- Date: Sun, 5 Apr 81 16:31:00 GMT
- Cc: BUG-LISP at MIT-MC
- Original-date: 5 April 1981 11:31-EST
Hold it. I meant CASEQ does a MEMQ *after* some syntactic sugar
has been applied, e.g. (CASEQ q (item ...)) => (CASEQ q ((item) ...)).
You did not address the most important point, the incompatibility
introduced between interpreter and compiler. If I write
(Defun foo (form)
(if (atom form) form
(caseq (car form)
((if) (if (foo (cadr form)) (foo (caddr form))
(foo (cadddr form))))
((quote) (cadr form))
((lambda) ..something..)
(t
(apply (foo (car form)) (mapcar #'foo (cdr form)))))))
then it is clear what I am doing. If the car of the form is
not EQ to one of '(IF QUOTE LAMBDA) then it gets handled by the T case.
This includes forms like '((LAMBDA (X Y) ...) ....).
I expect a simple syntactic transformation from that CASEQ,
into (LET ((TEMP (CAR FORM)))
(COND ((EQ TEMP 'IF) ...)
((EQ TEMP 'QUOTE) ...)
((EQ TEMP 'LAMBDA) ...)
('ELSE ...)))
And this is what is does in the compiler!
You had better have an INCREDIBLY good reason to give up the game here by
writing a FEXPR for CASEQ which I can't seem to understand.
-gjc