[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- To: BAK at MIT-MC, (BUG LISP) at MIT-MC
- From: HIC at MIT-MC (Howard I. Cannon)
- Date: Tue, 19 Dec 78 18:38:00 GMT
- Original-date: 19 DEC 1978 1338-EST
Date: 18 DEC 1978 2056-EST
From: BAK at MIT-MC (William A. Kornfeld)
In general, when you evaluate (memq <atom> <atom>) you get nil. However
evaluating (memq 4 2) seems to cause an infinite loop!
-----
Right!! This is the canonical "Use NIL check, not atom check for end of lists".
What happens is that normally it ends up doing CDR's to randomness and
since 0 is so common eventually gets NIL. BUT, probably AC 2 contains a value
that MEMQ sets up, and so it CDR's back to 2, which might point to itself, etc...
Basically, don't pass it atoms!
--howard