Something went wrong while setting issue due date.
define-compiler-macro wrt lexical macrolet is not clhs compliant
CL-USER> (progn
(define-compiler-macro x ())
(macrolet ((env (&environment env) `',env) (x ()))
(compiler-macro-function 'x (env))))
#<bytecompiled-function X>
T ; should be nil
(defun foo ())
(define-compiler-macro foo () nil)
(defun test ()
(macrolet ((foo (&rest args)
`(list ,@args)))
(foo 1 2 3)))
(compile 'test)
16:31 < stassats> beach: do you think that (progn (define-compiler-macro x ()) (macrolet ((env (&environment env) `',env) (x ()))
(compiler-macro-function 'x (env)))) should return NIL?
16:32 < stassats> beach: i think it should, so do SBCL and CCL
16:32 < stassats> and lispworks
16:32 < beach> stassats: I was going to say "no". What makes you think it should.
16:32 < stassats> other implementations disagree
16:32 < stassats> beach: based on what the standard says
16:33 < beach> What part of the standard specifically?
16:34 < stassats> several, none says directly, except for the non-standard issues
16:34 < stassats> clhs 3.1.1.3
16:34 < specbot> Lexical Environments: http://www.lispworks.com/reference/HyperSpec/Body/03_aac.htm
16:34 < stassats> * bindings of functions and macros. (Implicit in this is information about those compiler macros that are
locally disabled.)
16:35 < stassats> clhs 3.2.2.1
16:35 < specbot> Compiler Macros: http://www.lispworks.com/reference/HyperSpec/Body/03_bba.htm
16:35 < beach> Oh, wait. x is in a macrolet?
16:35 < beach> Yes, then yes, NIL.
16:35 < stassats> "local function or macro definition, but also shadows[2] the compiler macro."
16:35 < stassats> clhs glossary/shadow
16:35 < specbot> http://www.lispworks.com/reference/HyperSpec/Body/26_glo_s.htm#shadow
16:35 < beach> Didn't see the (x ())
16:35 < stassats> "to hide the presence of."
16:36 < stassats> clhs 3.2.2.1.2
16:36 < specbot> Naming of Compiler Macros: http://www.lispworks.com/reference/HyperSpec/Body/03_bbab.htm
16:36 < beach> I understand the issue.
16:36 < stassats> "Compiler macros are global, and the function compiler-macro-function is sufficient to resolve their
interaction with other lexical and global definitions."
16:37 < beach> Yes, I agree.
16:37 < stassats> while Issue DEFINE-COMPILER-MACRO:X3J13-NOV89 directly says it should return NIL
16:37 < stassats> why couldn't the standard just say so?
16:37 < beach> Probably an omission.