next up previous contents
Next: 4.4.6 Read Errors Up: 4.4 Interpreting Error Messages Previous: 4.4.4 Error Severity

4.4.5 Errors During Macroexpansion

 

The compiler handles errors that happen during macroexpansion, turning them into compiler errors. If you want to debug the error (to debug a macro), you can set *break-on-signals* to error. For example, this definition:

(defun foo (e l)
  (do ((current l (cdr current))
       ((atom current) nil))
      (when (eq (car current) e) (return current))))
gives this error:
In: DEFUN FOO
  (DO ((CURRENT L #) (# NIL)) (WHEN (EQ # E) (RETURN CURRENT)) )
Error: (during macroexpansion)

Error in function LISP::DO-DO-BODY. DO step variable is not a symbol: (ATOM CURRENT)



Raymond Toy
Mon Jul 14 09:11:27 EDT 1997