pvaneynd: (Default)
pvaneynd ([personal profile] pvaneynd) wrote2006-06-07 11:50 am

stupid CL errors

  • Do not assume :always does a check on an empty list:
    [1]> (loop :for x :in '() :always (oddp x))
    T
    is the correct result. But deep inside logic involving "have all entries that property?" it can be surprising.
  • 0 is not NIL. Stop laughing, it took me 2 days to find that one part of the program thought it was talking T/NIL while the other talked 0/1 or 2. One (declare (type boolean result)) and a few runtime errors later the program gives sane results again.