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 #99
cc
changetime
2010-11-18 14:14:34
component
WG1 - Core
description
Email from Thomas Bushnell:
Ah. The usage case is where I want to have a top-level macro which expands into a series of top-level forms. For example, suppose I want `define-many` which looks like this:
{{{
(define-many foo bar baz quux)
}}}
and expands into:
{{{
(define foo #f)
(define bar #f)
(define baz #f)
(define quux #f)
}}}
However, `syntax-rules` doesn't permit a series of forms, so the R5RS solution is to put a `begin` around it, and then specify that `begin` doesn't change the top-level-ness of the forms inside it. So this works:
{{{
(define-syntax define-many
(syntax-rules ()
((_ name names ...) (begin (define name #f) (define names #f) ...))))
}}}
So far so good. But suppose now that the forms inside all need to make use of some special bit of local syntax. That is, I want to define some syntax which will ''not'' be visible at top-level, but will be used by the forms that `define-many` expands into. The solution should be to replace `begin` with `let-syntax` above, but you can't do it according to R5RS. Most Scheme folks that I know regard this as a bug, because a top-level `let-syntax` really can't have any other use.
id
99
keywords
milestone
owner
alexshinn
priority
major
reporter
cowan
resolution
duplicate
severity
status
closed
summary
Allow top-level LET-SYNTAX
time
2010-11-17 06:09:06
type
defect
Changes
Change at time 2010-11-18 14:14:34
author
alexshinn
field
comment
newvalue
`let-syntax` is allowed at top-level, as is any Scheme expression.
Using `let-syntax` to expand into definitions is a grey area,
already brought up by #48.
oldvalue
1
raw-time
1290060874000000
ticket
99
time
2010-11-18 14:14:34
Change at time 2010-11-18 14:14:34
author
alexshinn
field
resolution
newvalue
duplicate
oldvalue
raw-time
1290060874000000
ticket
99
time
2010-11-18 14:14:34
Change at time 2010-11-18 14:14:34
author
alexshinn
field
status
newvalue
closed
oldvalue
new
raw-time
1290060874000000
ticket
99
time
2010-11-18 14:14:34