This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Source for ticket #178

cc


    

changetime

2012-11-06 02:05:50

component

WG1 - Core

description

From Andre Von Tonder:

On p 19, some shadowing problems that would break lexical scope are declared to 
be errors.  However, I believe there are otehr examples that shold be errors 
that are not covered by the report.
 
In R6RS a more general criterion was used - please see R6RS for details.
 
Here is an example that does not violate the WG1 report but should be an error 
becasue it violates lexical scoping.  It does not violate the WG1 criterion 
because the meaning of x is not needed to determine whether (foo x p ) is a 
definition.

{{{
    (let ((x #f))
      (let-syntax ((foo (syntax-rules (x)
                          ((_ x y) (define y 'outer))
                          ((_ _ y) (define y 'inner)))))
        (let ()
          (foo x p)
          (define x #f) ;; this should be an error because
                        ;; it shadows the previous line where
                        ;; x has already been used in its outer sense
                        ;; during expansion
          p)))
}}}

Here is another example that WG1 allows but that would cause violation of 
lexical scoping, because the macro would be evaluated first and treat ... as a 
placeholder in a region where it is shadowed to be the variable bound to 1:

{{{
    (let ()
      (define-syntax list-macro
        (syntax-rules ()
          ((_ x ...) (list x ...))))
      (define ... 1)    ;; This shadows ... in previously expanded macro
                        ;; body and will be a violation of lexical scoping
      (list-macro 1 2)) ;; if the last line evaluates to (1 2)
}}}

OTOH, it is unclear to me if WG1 allows this or not.

{{{
    (let ((x #f))
      (let-syntax ((foo (syntax-rules (x)
                          ((_ x y) (define y 'outer))
                          ((_ _ y) (define y 'inner)))))
        (let ()
          (define x #f)
          (foo x p)
          p)))
}}}

id

178

keywords


    

milestone


    

owner

alexshinn

priority

major

reporter

arcfide

resolution

wontfix

severity


    

status

closed

summary

Shadowing with internal definitions

time

2011-05-13 06:26:38

type

defect

Changes

Change at time 2012-11-06 02:05:50

author

cowan

field

comment

newvalue


    

oldvalue

4

raw-time

1352138750455177

ticket

178

time

2012-11-06 02:05:50

Change at time 2012-11-06 02:05:50

author

cowan

field

resolution

newvalue

wontfix

oldvalue


    

raw-time

1352138750455177

ticket

178

time

2012-11-06 02:05:50

Change at time 2012-11-06 02:05:50

author

cowan

field

status

newvalue

closed

oldvalue

writing

raw-time

1352138750455177

ticket

178

time

2012-11-06 02:05:50

Change at time 2012-11-06 01:59:34

author

cowan

field

comment

newvalue

None of the editors understand how to implement this one, and it's the Very Last Ticket, so I'm closing it.

oldvalue

3

raw-time

1352138374071197

ticket

178

time

2012-11-06 01:59:34

Change at time 2011-07-18 17:43:59

author

alexshinn

field

comment

newvalue


    

oldvalue

2

raw-time

1310985839000000

ticket

178

time

2011-07-18 17:43:59

Change at time 2011-07-18 17:43:59

author

alexshinn

field

status

newvalue

writing

oldvalue

decided

raw-time

1310985839000000

ticket

178

time

2011-07-18 17:43:59

Change at time 2011-07-10 18:30:31

author

alexshinn

field

comment

newvalue

We voted for the R6RS semantics.

oldvalue

1

raw-time

1310297431000000

ticket

178

time

2011-07-10 18:30:31

Change at time 2011-07-10 18:30:31

author

alexshinn

field

resolution

newvalue


    

oldvalue


    

raw-time

1310297431000000

ticket

178

time

2011-07-10 18:30:31

Change at time 2011-07-10 18:30:31

author

alexshinn

field

status

newvalue

decided

oldvalue

new

raw-time

1310297431000000

ticket

178

time

2011-07-10 18:30:31