chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

#1793: r7rs incompatibility regarding identifier renames in macro expans


From: Chicken Trac
Subject: #1793: r7rs incompatibility regarding identifier renames in macro expansion
Date: Fri, 15 Oct 2021 06:11:40 -0000

#1793: r7rs incompatibility regarding identifier renames in macro expansion
--------------------------------+----------------------
            Reporter:  sjamaan  |       Type:  defect
              Status:  new      |   Priority:  major
           Milestone:  5.4      |  Component:  expander
             Version:  5.2.0    |   Keywords:
Estimated difficulty:  hard     |
--------------------------------+----------------------
 See [https://srfi-email.schemers.org/srfi-211/msg/17138733/ 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...

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/1793>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]