Steel Bank Common Lisp

sb-cltl2::macroexpand-all doesn't track the lexenv properly

Reported by Attila Lendvai on 2010-06-05
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Medium
Unassigned

Bug Description

on 1.0.39.4

see the pasted form below (the macro is expanded twice, although that's not illegal in itself).

the lexenv passed to the macrolet does not contain the tags of the tagbody, nor the blocks, and a throughout test would probably uncover other missing things.

(sb-cltl2::macroexpand-all
       '(BLOCK B1
         (TAGBODY
          T1
            (PROGN)
          T2
            (BLOCK B2
              (MACROLET ((INJECTOR-MACRO2131 (&ENVIRONMENT ENV)
                           (print env)
                           (VALUES)))
                (INJECTOR-MACRO2131))))))

will print this:

#S(SB-KERNEL:LEXENV
   :FUNS ((INJECTOR-MACRO2131 SB-SYS:MACRO . #) (#:G4 SB-SYS:MACRO . #) (#:G4 SB-SYS:MACRO . #))
   :VARS NIL
   :BLOCKS NIL
   :TAGS NIL
   :TYPE-RESTRICTIONS NIL
   :LAMBDA NIL
   :CLEANUP NIL
   :HANDLED-CONDITIONS NIL
   :DISABLED-PACKAGE-LOCKS NIL
   :%POLICY ((COMPILATION-SPEED . 1) (DEBUG . 3) (SB-EXT:INHIBIT-WARNINGS . 1) (SAFETY . 1) (SPACE . 1) (SPEED . 1))
   :USER-DATA NIL)
#S(SB-KERNEL:LEXENV
   :FUNS ((#:G4 SB-SYS:MACRO . #) (INJECTOR-MACRO2131 SB-SYS:MACRO . #) (#:G4 SB-SYS:MACRO . #) (#:G4 SB-SYS:MACRO . #))
   :VARS NIL
   :BLOCKS NIL
   :TAGS NIL
   :TYPE-RESTRICTIONS NIL
   :LAMBDA NIL
   :CLEANUP NIL
   :HANDLED-CONDITIONS NIL
   :DISABLED-PACKAGE-LOCKS NIL
   :%POLICY ((COMPILATION-SPEED . 1) (DEBUG . 3) (SB-EXT:INHIBIT-WARNINGS . 1) (SAFETY . 1) (SPACE . 1) (SPEED . 1))
   :USER-DATA NIL)

tags: added: sb-cltl2
Changed in sbcl:
importance: Undecided → Medium
status: New → Triaged
Nikodemus Siivola (nikodemus) wrote :

This is clearly suboptimal, but given that there's no supported way (via sb-cltl2) to access block and tag names, non-critical.

The issue is with SB-WALKER not adding block and tag names into the environment in the first place.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers