Re: [Scheme-reports] ANN: first draft of R7RS small language available Alex Shinn (17 Apr 2011 00:14 UTC)
[Scheme-reports] DELAY AND FORCE Andre van Tonder (23 Apr 2011 22:20 UTC)
[Scheme-reports] Regions of imports unspecified Andre van Tonder (23 Apr 2011 22:31 UTC)
Re: [Scheme-reports] Regions of imports unspecified John Cowan (23 Apr 2011 22:43 UTC)
Re: [Scheme-reports] Regions of imports unspecified Alex Shinn (24 Apr 2011 01:59 UTC)
[Scheme-reports] What are regions of toplevel imports? Andre van Tonder (23 Apr 2011 23:41 UTC)
[Scheme-reports] Internal syntax definition order problem Andre van Tonder (23 Apr 2011 22:39 UTC)
[Scheme-reports] Mutable exports Andre van Tonder (23 Apr 2011 22:48 UTC)
Re: [Scheme-reports] Mutable exports Alex Shinn (24 Apr 2011 02:00 UTC)
[Scheme-reports] Internal definition shadowing problems Andre van Tonder (23 Apr 2011 23:19 UTC)
[Scheme-reports] Importing identifier more than once Andre van Tonder (23 Apr 2011 23:37 UTC)

Re: [Scheme-reports] ANN: first draft of R7RS small language available Alex Shinn 17 Apr 2011 00:13 UTC

On Sun, Apr 17, 2011 at 2:09 AM, Andre van Tonder <andre@het.brown.edu> wrote:
>
> This discussion has been had in R6RS and based on the discussion there the
> decision was made to make it and other literals bound in the base.  There
> were many reasons for it, among others:

Thanks, Andre, I had read through the R6RS discussions
but somehow forgotten this one when the issue came up
in WG1.

> - There is a very strong argument for requiring these literals to be bound.
> If they refer to bindings, they can be exported, imported, prefixed, renamed,
> or excluded. These are useful operations, and I think it is important for
> users to be able to rely on them to work portably.

This and most of your arguments confused me
greatly for a while, because a different identifier
should never match a syntax-rules literal.

Then I realized you're assuming that any imported
binding from another module should count as having
the "same lexical binding," not simply be bound to
the same value, in which case they would match.

The module system does not make this requirement,
in deference to the many types of module systems
out there which may simply copy the bindings, so in
general you can't assume you can rename =>.

I'll add a ticket raising the question of whether we
make this requirement.

> - We cannot easily create a teaching language where => clauses are not
> allowed in COND unless => is bound.

Sure you can, just bind =>.

> - The semantics of FREE-IDENTIFIER=? which is used to compare literals -
> unbound identitifiers in different modules be free-identifier=? if they have
> the same symbol?  This is not obvious to me, and as an implemento I know
> from experience that it can complicate a macro explansion system to insist
> upon it

There is no free-identifier=? in WG1 Scheme, nor at the present
time is there likely to be in WG2 Scheme.  The syntax-rules
semantics makes it clear that unbound symbols in two modules
must match, even if the implementation has a broken free-identifier=?.

> - Typically, such literals mcan be bound to a macro expanding to a syntax
> error, which is extremely useful for error checking.

If they are unbound we also get a descriptive error.

> - A lot of these literals are common enough names that users are likely to
>  stop on them by accident.  Fi they are bound, the expander will thorw an
>  redefinition error.

Not if they are locally shadowed, and some module systems
allow redefinition of imports.  The WG1 module system doesn't
explicitly forbid this, though I'll add a new ticket for it.

--
Alex

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports