default   Racket Bugs
Main PageQuick QueryStandard QueryAdvanced QueryHelp
Log in

View Problem Report: 12508

send email to interested parties or send email followup to audit-trail
Reporter's email: dyoo at hashcollision dot org
Number: 12508
Category: macro-stepper
Synopsis: Macro stepper does not fully expand out uses of certain user macros under Standard Macro hiding
Class: sw-bug
Responsible: ryanc
Notify-List:
Severity: serious
Priority: medium
State: open
Confidential: no
Arrival-Date: Sun Jan 22 22:08:01 -0500 2012
Closed-Date:
Last-Modified: Wed Feb 01 17:24:25 -0500 2012
Originator: Danny Yoo
Organization: plt
Submitter-Id: unknown
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
Description: 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.
File Attachments:
How-To-Repeat:
Fix:
Release-Note:
Unformatted:

send email to interested parties or send email followup to audit-trail

Audit Trail: