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

CASEQ doesn't do MEMQ



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