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

Jim Meehan Comments



    Date: Thu, 18 Sep 86 13:24:42 edt
    From: James R. Meehan <csi!meehan@UUCP>

    CLtL doesn't say whether DOTIMES actually "uses" the loop-variable, as
    opposed to its value, and this ambiguity causes problems with portable
    code.

    I've seen several implementations where DOTIMES actually uses the
    loop-variable, thus permitting horrors like using SETQ to change the
    value of the loop-variable and therefore control the iterations.  The
    implementation above would prevent that.

Oh yes it does, page 128 of CLtL says:
	Altering the value of VAR in the body of the loop (by using SETQ, for
	example) will have unpredictable, possibly implementation-dependent results.  
	A Common Lisp compiler may choose to issue a warning if such a variable 
	appears in a SETQ.

This clearly means that if you do things like SETQ then you are going to run
in to portability problems.  

--Dan