[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Ludovic Courtès
Subject: [bug #29860] Macro-generated macros get wrong module context [1.9.10]
Date: Tue, 11 May 2010 20:29:05 +0000
User-agent: Mozilla/5.0 (GNU; rv: Gecko/20100107 IceCat/3.6 (like Firefox/3.6)


                 Summary: Macro-generated macros get wrong module context
                 Project: Guile
            Submitted by: civodul
            Submitted on: Tue 11 May 2010 08:29:05 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any



Here's a macro-generating macro:

(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)))))))

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

(use-modules (mm))

(make-the-macro foo)



ERROR: In procedure module-lookup:
ERROR: Unbound variable: hello

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).



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]