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

[no subject]



Re the long-standing COMPLR failure:
    Date: 29 January 1981 20:28-EST
    From: David C. Plummer <DCP at MIT-MC>
    Will somebody please fix this? PLEASE?? This ==> BUG <== hit me today, 
	 Date: 16 Jan 1981 0319-PST
	 From: Rod Brooks <ROD at SU-AI>
	 Subject: COMPLR can't do DO 
	 I have vague memories of complaining about something like this years 
	 ago but maybe this is different. In any case I wish it didn't happen 
	 this way.
	 (defun baz (n)
		(do ((old 1 new)
		     (new 2 (1+ new))
		     (l () (cons (list old new) l))
		     (i 0 (1+ i)))
		    ((= i n) l)))
	 interpreted:
	 (baz 4) ==> ((4 5) (3 4) (2 3) (1 2)) 
	 compiled (both 905 and 924):
	 (baz 4) ==> ((5 5) (4 4) (2 3) (1 2)) 
    Perhaps COMPLR thinks it is too smart. 
This is a long-standing bug which fortunately has hit only a very few
persons (notably, GLR twice, GSB once I believe, and now ROD and DCP).
The problem occurs precisely if there are local variables being SETQ'd in
parallel, such as in a DO loop, which haven't been declared numeric, 
*** but which in fact are being used a numeric variables ***.  Possibly 
the reason so few instances of this lossage occur is that most persons 
would have already done (DECLARE (FIXNUM OLD NEW)).  I don't think anyone 
wants to work on correcting this bug now (for lack of time mainly),
so maybe it should be 'documented'.