bugGuile - Bugs: bug #29860, Macro-generated macros get wrong...

 
 

bug #29860: Macro-generated macros get wrong module context [1.9.10]

Submitted by:  Ludovic Courtès <civodul>
Submitted on:  Tue 11 May 2010 08:29:05 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 06 Jun 2010 03:38:58 PM UTC, comment #1:

Fixed in git, thanks for the report!

Andy Wingo <wingo>
Project Administrator
Tue 11 May 2010 08:29:05 PM UTC, original submission:

Here's a macro-generating macro:

#v+
(define-module (mm)
#:export (make-the-macro))

(define (hello)
(display "hello\n"))

(define-syntax make-the-macro
(syntax-rules ()
((_ name)
(define-syntax name
(syntax-rules ()
((_) (hello)))))))
#v-

Wherever the macro generated by `make-the-macro' is expanded, it should look up `hello' in the context of (mm), but it does not:

#v+
(use-modules (mm))

(make-the-macro foo)

(foo)
#v-

=>

#v+
ERROR: In procedure module-lookup:
ERROR: Unbound variable: hello
#v-

The problem manifests itself when expanding `ssax:make-parser' (from (sxml ssax)): the expanded code looks up `ssax:warn', `nl', etc., in the context of the expansion point, not in the context of (sxml ssax).

Ludo'.

Ludovic Courtès <civodul>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wingo (Posted a comment)
  • -unavailable- added by civodul (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 06 Jun 2010 03:38:58 PM UTCwingoStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1