[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I hate to tell you but...
- To: JONL at MIT-MC
- Subject: I hate to tell you but...
- From: George J. Carrette <GJC at MIT-MC>
- Date: Sat, 1 Aug 81 16:14:00 GMT
- Cc: BUG-LISP at MIT-MC
- Original-date: 1 August 1981 12:14-EDT
DEFUN still doesn't work even though you have patched some cases.
(DEFVAR X 0)
(DEFUN F (&OPTIONAL (X X)) X)
; you have fixed the above case, but the next one:
(DEFUN G (Y) (SETQ X (+ X Y)))
(DEFUN H (&OPTIONAL (X (G X))) X)
In the function H, G gets called with X in a new binding context
bound to what it was in the outside binding context, this is of
course not the same thing as being in the outer binding context.
I'll admit that the example is contrived, however, note well
that it used to work, when the code generated was a simple
use of LET* we had ==>
(DEFUN H *NARGS*
(LET* ((X (IF (> *NARGS* 0) (ARG 1) (G X))))
Note also, that the above simple code compiles into better
machine language than the more complex incorrect code
that is the result of optimizations that try to use
a LET instead of a LET*. I'll admit that it is worth doing
the optimizations in most cases, but I question, "Is it
worth giving up correctness?"