Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Macro stepper does not fully expand out uses of certain user macros under Standard Macro hiding #179

Open
racket-bug-submit opened this Issue Mar 16, 2012 · 0 comments

Comments

Projects
None yet
1 participant
Collaborator

racket-bug-submit commented Mar 16, 2012

Originally submitted by Danny Yoo on: Sun Jan 22 22:08:01 -0500 2012

The following program, when macro expanded using standard Macro hiding, does not fully expand out uses of the user-defined macro:

---
#lang racket
(define-syntax myor
  (syntax-rules ()
    [(_ e) e]
    [(_ e1 . es)
     (let ([r e1]) (if r r (myor . es)))]))
(define (nonzero? r)
  (myor (negative? r)
        (positive? r)))

---

Under Standard macro hiding, this expands out up to:


(module anonymous-module racket
  (#%module-begin
   (define-syntax myor (syntax-rules () [(_ e) e] [(_ e1 . es) (let ([r e1]) (if r r (myor . es)))]))
   (define (nonzero? r) (let ([r (negative? r)]) (if r r (myor (positive? r)))))))

where the second 'myor' still exists there.

There may be a relationship with the syntax tainting mechanisms that syntax-rules enforces. When the module is written using syntax-case rather than syntax-rules, then the macro expands out as expected.

Release:
5.2.0.901
Environment:
Linux i686 / Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko)
 Chrome/12.0.742.124 Safari/534.30
This bug was converted from Gnats bug 12508.

[anon-submit; dyoo at hashcollision dot org]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment