Opened 4 years ago
Closed 2 years ago
#1793 closed defect (worksforme)
r7rs incompatibility regarding identifier renames in macro expansion
| Reported by: | sjamaan | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 6.0.0 |
| 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 (3)
comment:1 Changed 4 years ago by
comment:2 Changed 2 years ago by
| Milestone: | 5.4 → 6.0.0 |
|---|
comment:3 Changed 2 years ago by
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
I can't reproduce this with the current version, perhaps this was fixed in the meantime by a correction related to this.
Note: See
TracTickets for help on using
tickets.

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