unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #29860] Macro-generated macros get wrong module context [1.9.10]
@ 2010-05-11 20:29 Ludovic Courtès
  2010-05-21 11:18 ` Andy Wingo
  2010-06-06 15:38 ` Andy Wingo
  0 siblings, 2 replies; 5+ messages in thread
From: Ludovic Courtès @ 2010-05-11 20:29 UTC (permalink / raw)
  To: Ludovic Courtès, bug-guile


URL:
  <http://savannah.gnu.org/bugs/?29860>

                 Summary: Macro-generated macros get wrong module context
[1.9.10]
                 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

    _______________________________________________________

Details:

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




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29860>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug #29860] Macro-generated macros get wrong module context [1.9.10]
  2010-05-11 20:29 [bug #29860] Macro-generated macros get wrong module context [1.9.10] Ludovic Courtès
@ 2010-05-21 11:18 ` Andy Wingo
  2010-05-22  9:35   ` Ludovic Courtès
  2010-06-06 15:38 ` Andy Wingo
  1 sibling, 1 reply; 5+ messages in thread
From: Andy Wingo @ 2010-05-21 11:18 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guile

On Tue 11 May 2010 22:29, Ludovic Courtès <INVALID.NOREPLY@gnu.org> writes:

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

Wow, that's a nasty one. Will poke.

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug #29860] Macro-generated macros get wrong module context [1.9.10]
  2010-05-21 11:18 ` Andy Wingo
@ 2010-05-22  9:35   ` Ludovic Courtès
  2010-05-22 14:40     ` Andy Wingo
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2010-05-22  9:35 UTC (permalink / raw)
  To: Andy Wingo; +Cc: bug-guile

Hi!

Andy Wingo <wingo@pobox.com> writes:

> On Tue 11 May 2010 22:29, Ludovic Courtès <INVALID.NOREPLY@gnu.org> writes:
>
>> Wherever the macro generated by `make-the-macro' is expanded, it should look
>> up `hello' in the context of (mm), but it does not:
>
> Wow, that's a nasty one. Will poke.

Please assign it to you in the bug tracker.

Yes, we’ll start using a bug tracker again!  :-)

Thanks,
Ludo’.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug #29860] Macro-generated macros get wrong module context [1.9.10]
  2010-05-22  9:35   ` Ludovic Courtès
@ 2010-05-22 14:40     ` Andy Wingo
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Wingo @ 2010-05-22 14:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guile

On Sat 22 May 2010 11:35, ludo@gnu.org (Ludovic Courtès) writes:

>> Wow, that's a nasty one. Will poke.
>
> Please assign it to you in the bug tracker.
>
> Yes, we’ll start using a bug tracker again!  :-)

Apparently we will, though I will not interact with it regularly ;-)

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug #29860] Macro-generated macros get wrong module context [1.9.10]
  2010-05-11 20:29 [bug #29860] Macro-generated macros get wrong module context [1.9.10] Ludovic Courtès
  2010-05-21 11:18 ` Andy Wingo
@ 2010-06-06 15:38 ` Andy Wingo
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Wingo @ 2010-06-06 15:38 UTC (permalink / raw)
  To: Ludovic Courtès, Andy Wingo, bug-guile


Update of bug #29860 (project guile):

                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

Fixed in git, thanks for the report!

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29860>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-06 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11 20:29 [bug #29860] Macro-generated macros get wrong module context [1.9.10] Ludovic Courtès
2010-05-21 11:18 ` Andy Wingo
2010-05-22  9:35   ` Ludovic Courtès
2010-05-22 14:40     ` Andy Wingo
2010-06-06 15:38 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).