Bug: defmacro environment variable declaration

Willem Broekema metawilm at gmail.com
Sun Nov 5 16:32:35 UTC 2017


In the following form:

(defmacro m (&environment e)                                                                                         
  (declare (ignore e))                                                                                                                                  
  'm)))

The declaration ends up in the wrong place after macro expansion:

(LAMBDA (#:WHOLE-5584 #:ENVIRONMENT-5585)
  (LET* ((E #:ENVIRONMENT-5585))
    ;; the  (DECLARE (IGNORE E)) should go here
    (UNLESS (<= 0 (SYSTEM::DOT-LENGTH (CDR #:WHOLE-5584)) 0)
      (SYSTEM::ARG-COUNT-ERROR 'DEFMACRO
                               'M
                               (CDR #:WHOLE-5584)
                               '(&ENVIRONMENT E)
                               0
                               0))
    (LET* ()
      (DECLARE (IGNORE E)) ;; but it ends up here
      (BLOCK M 'M))))

Using Armed Bear Common Lisp 1.5.0

- Willem


More information about the armedbear-devel mailing list