Opened 20 months ago

Last modified 20 months ago

#1793 new defect

r7rs incompatibility regarding identifier renames in macro expansion

Reported by: sjamaan Owned by:
Priority: major Milestone: 5.4
Component: expander Version: 5.2.0
Keywords: Cc:
Estimated difficulty: hard

Description

See this post:

(let ([x 'outer])
   (define-syntax m
     (syntax-rules ()
       ((m a)
        (let ([a 'inner]) x))))
   (m x)) ;; Should return 'outer, which we do
(let ([x 'outer])
   (define-syntax m
     (syntax-rules ()
       ((m a)
        (begin
          (define a 'inner)
          x))))
   (m x)) ;; Should return 'inner, which we don't

It makes sense, because the outer x variable is passed in as a, which is then redefined to inner, and whether we return a or x should not matter, the result should be the same.

Not sure why this wouldn't be valid in R5RS though...

Change History (1)

comment:1 Changed 20 months ago by sjamaan

NOTE: This might be due to the duplicate lookup in ##sys#current-environment as mentioned in #1131

Note: See TracTickets for help on using tickets.