[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Possible problems in Compiled Macro files for MACSYMA's Transl
- To: JONL at MIT-MC
- Subject: Possible problems in Compiled Macro files for MACSYMA's Transl
- From: George J. Carrette <GJC at MIT-MC>
- Date: Thu, 27 Aug 81 03:08:00 GMT
- Cc: BUG-LISP at MIT-MC, GCOOK at MIT-MC, JPG at MIT-MC, MACSYMA-I at MIT-MC
- Original-date: 26 August 1981 23:08-EDT
JONL, you should know as well as any of us that there are known
bugs in COMPLR in the handling of LAMBDA binding and declarations.
These are what show up in GCOOK's code, not lack of using "SI:GEN-LOCAL-VAR"
Let us look at a simple case:
(defun f (x)
((lambda (x)
(declare (flonum x))
(times x ((lambda (x)
(declare (flonum x))
(times x x))
x)))
(sin x)))
It is completely clear what is going on here. It is called LAMBDA BINDING.
But what does the compiler generate? .. have a look...
(COMMENT **ERROR** (FLONUM G0001)
Local declaration occurs too late in function in function F)
; DATA ERROR - TO PROCEED TYPE $P
Ok, where did the gensym come from? Not from any macros!
Take another case:
(defun f ()
((lambda (x)
(declare (flonum x))
(do ((x (ifix x) (1+ x))
(s x (+$ 1.0 s)))
((= x 10) s)))
(sin 3.3)))
Here your compiler confuses the two names "X" in the DO-LOOP, generating:
(COMMENT **ERROR** ((IFIX X) NOT-OF-TYPE FLONUM)
First item in list is an argument somewhere, but is of the wrong type in function F)
--
JONL, I really do understand lambda binding, and GENSYM, and GENTEMP,
so it is foolish for you to play your game assuming otherwise.
You may go on of course as you wish, but you risk a great deal in doing so.
-gjc