Errors During Macroexpansion - SBCL 1.0.31 User Manual
Description: SBCL 1.0.31 User Manual

Next: Read Errors, Previous: Type Errors at Compile Time, Up: Compiler Errors

#### 4.4.2 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 (CDR CURRENT))
         ;        ((ATOM CURRENT) NIL))
         ;       (WHEN (EQ (CAR CURRENT) E) (RETURN CURRENT)))
         ;
         ; caught ERROR:
         ;   (in macroexpansion of (DO # #))
         ;   (hint: For more precise location, try *BREAK-ON-SIGNALS*.)
         ;   DO step variable is not a symbol: (ATOM CURRENT)