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

Re: Issue: DECLARE-TYPE-FREE (Version 1)



> Well, it just occurred to me that there is an interpretation to even a disjoint
> type declaration. Consider that the paranoid programmer might try to help out
> the compiler's storage allocation phase by recycling a variable for a new type
> using SETQ because he knows it won't be used further in the program but doesn't
> know for sure that the compiler will realize this fact. Here's an example of
> that style:
> 
>  (DEFUN FOO (X Y)
>    (DECLARE (FLOAT X Y))
>    (LET ((SUM (+ X Y)))
>      (DECLARE (FLOAT SUM))
>      (COND ((> SUM 3.0)
> 	    (LOCALLY (DECLARE (FIXNUM X))
> 	      ; X won't be used any more, so let's recycle its home...
> 	      (SETQ X (TRUNCATE SUM))
> 	      (+ (* X X) (* SUM Y))))
> 	   (T
> 	    (* X Y SUM)))))

Gag!  This is an example of what we most definitely want to prohibit.
This is a highly misguided programming style and can be made meaningful
only if the compiler is prohibited from using specialized storage for
variables.