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

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

    Date: Wed, 21 Sep 88  10:56:05 CDT
    From: David N Gray <Gray@DSG.csc.ti.com>

    >     Should add that if there is both a binding declaration and a local
    >     declaration for the type of the same variable, then, within the scope of
    >     the local declaration, it is an error for the variable to contain a value
    >     which is not a member of the intersection of the two types.  (This implies
    >     that it would be desirable for the compiler to complain if the two types
    >     are disjoint.)
    > True.  Does the proposal really need to say this?  It's a pretty obvious
    > consequence.

    It may be obvious to us, but it probably wouldn't be to the average user.
    Anyway, I had to stop and think about whether it should be a subtype or
    just non-disjoint. ...

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:

   (LET ((SUM (+ X Y)))
     (COND ((> SUM 3.0)
	      ; X won't be used any more, so let's recycle its home...
	      (+ (* X X) (* SUM Y))))
	    (* X Y SUM)))))