capture-error does (and ,form nil), which means that the value of form is not used, and therefore the compiler can optimize it if it is pure (not destructive). For example, (and (aref <something> <index>) nil) can be optimized to (progn <something><index> nil), because the call to aref cannot validly do anything except returning a value that is not used.
capture-error does
(and ,form nil)
, which means that the value of form is not used, and therefore the compiler can optimize it if it is pure (not destructive). For example,(and (aref <something> <index>) nil)
can be optimized to(progn <something><index> nil)
, because the call to aref cannot validly do anything except returning a value that is not used.Actually cause an issue in the 3d-matrices tests https://github.com/Shinmera/3d-matrices/blob/master/test.lisp, where it wants to see an error from
(fail (mcref (matn 1 2) 1 0))
, but mcref inlines to aref which is optimized away as above.