[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: DECLARE-TYPE-FREE (Version 1)
- To: Gray@DSG.csc.ti.com
- Subject: Issue: DECLARE-TYPE-FREE (Version 1)
- From: Jon L White <email@example.com>
- Date: Sat, 24 Sep 88 16:32:19 PDT
- Cc: KMP@STONY-BROOK.SCRC.Symbolics.COM, Moon@STONY-BROOK.SCRC.Symbolics.COM, CL-Cleanup@SAIL.STANFORD.EDU
- In-reply-to: David N Gray's message of Wed, 21 Sep 88 11:50:27 CDT <2799852627-13866831@Kelvin>
re: > (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))))
> (* 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
Right! You've put it very well. However, not everyone is aware of the
compiler techniques for "using specialized storage" to good advantage. I
doubt seriously whether the Symbolics lisp compiler would be concerned with
these questions, since it is reputed to ignore all type declarations anyway.
[I wonder if the CLOE treatment is significantly more advanced.]
Does the TI compiler do any of "these techniques"? Of course, Lucid
does something like PDP10 MacLisp did for certain numeric types, and
I'm sure that is why CLtL p158 has such an odd restriction on the
scope of type declarations -- i.e., to hinder just such gross programs
as the one you gagged upon above.
-- JonL -