MKCL icon indicating copy to clipboard operation
MKCL copied to clipboard

`walker:macroexpand-all` doesn't handle declarations in symbol-macrolet correctly

Open Gleefre opened this issue 1 year ago • 0 comments

walker:macroexpand-all signals incorrect warnings when processing symbol-macrolet with declarations:

(require :walker)
(walker:macroexpand-all '(symbol-macrolet () (declare)))
; >> ;;; Warning: Encountered declare (DECLARE) in a place where a declare was not expected.
; => (SYMBOL-MACROLET ()
;      (DECLARE))

This warning is incorrectly signaled.

CLHS (symbol-macrolet) allows declarations in symbol-macrolet:

Syntax: symbol-macrolet ((symbol expansion)) declaration form*

Tested on MKCL 1.1.11.206 (current head):

(lisp-implementation-version)  ; => "1.1.11.206-b414811"

This also affects ECL, see https://gitlab.com/embeddable-common-lisp/ecl/-/issues/764.

Gleefre avatar Nov 01 '24 18:11 Gleefre