Subject: bug#13995: closed (Re: bug#13995: Problem with macros whose expansions define and use auxiliary macros)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 20 Jun 2016 20:23:02 +0000

Your bug report

#13995: Problem with macros whose expansions define and use auxiliary macros

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
13995: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13995
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#13995: Problem with macros whose expansions define and use auxiliary macros
From: Andy Wingo <[email-masked]>
To: Mark H Weaver <[email-masked]>
Cc: [email-masked]
Date: Mon, 20 Jun 2016 22:22:00 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

So, this example works on master, but for reasons you don't like.  We
can't fix it on 2.0.  If you feel that the solution for macro-introduced
identifiers in 2.2 is a release blocker, let's open a thread on -devel
again and talk about it, see if we can find some solutions :)

In the meantime, closing this one, as there's no 2.0 task and the code
"works" in 2.2.

Andy

On Tue 19 Mar 2013 00:11, Mark H Weaver <[email-masked]> writes:

> Consider the following module:
>
> (define-module (foo)
>   #:export (foo))
>
> (define-syntax-rule (foo bar)
>   (begin
>     (define-syntax-rule (blah x) x)
>     (define (bar val) (blah val))))
>
> and the following session with v2.0.7-204-g1ea3762:
>
> scheme@(guile-user)> ,use (foo)
> scheme@(guile-user)> (foo bar)
> scheme@(guile-user)> (bar 5)
> ERROR: In procedure #<syntax-transformer blah>:
> ERROR: Wrong type to apply: #<syntax-transformer blah>
>
> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
> scheme@(guile-user) [1]> 
>
> Note that it works when the same 'foo' macro is entered directly
> at a fresh REPL:
>
> scheme@(guile-user)> 
> (define-syntax-rule (foo bar)
>   (begin
>     (define-syntax-rule (blah x) x)
>     (define (bar val) (blah val))))
> scheme@(guile-user)> (foo bar)
> scheme@(guile-user)> (bar 5)
> $1 = 5
> scheme@(guile-user)> 
>
>        Mark

Subject: Problem with macros whose expansions define and use auxiliary macros
From: Mark H Weaver <[email-masked]>
To: [email-masked]
Date: Mon, 18 Mar 2013 19:11:17 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Consider the following module:

--8<---------------cut here---------------start------------->8---
(define-module (foo)
  #:export (foo))

(define-syntax-rule (foo bar)
  (begin
    (define-syntax-rule (blah x) x)
    (define (bar val) (blah val))))
--8<---------------cut here---------------end--------------->8---

and the following session with v2.0.7-204-g1ea3762:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use (foo)
scheme@(guile-user)> (foo bar)
scheme@(guile-user)> (bar 5)
ERROR: In procedure #<syntax-transformer blah>:
ERROR: Wrong type to apply: #<syntax-transformer blah>

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> 
--8<---------------cut here---------------end--------------->8---

Note that it works when the same 'foo' macro is entered directly
at a fresh REPL:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> 
(define-syntax-rule (foo bar)
  (begin
    (define-syntax-rule (blah x) x)
    (define (bar val) (blah val))))
scheme@(guile-user)> (foo bar)
scheme@(guile-user)> (bar 5)
$1 = 5
scheme@(guile-user)> 
--8<---------------cut here---------------end--------------->8---

       Mark