[Scheme-reports] 5. Program Structure
Andy Wingo 05 Jan 2013 21:19 UTC
I would encourage readers to take a look at section 5, as it is _the_
new section of the R7RS, and as such deserves a closer look. It's only
a few pages long. Print the pages out and enjoy them over coffee.
I think the division of valid kinds of declarations as "variable
definitions, syntax definitions, or record-type definitions" is pretty
nasty. I don't see why record-type definitions can't be defined as a
sequence of variable and syntax definitions. What is the intention
here? I assume you should still be able to define new record types in
lexical environments?
The description of "begin" should simple be a link back to the original
section on "begin" and its two functions.
The typesetting of the "rename" kind of import declaration would benefit
by a newline after <import set 1>.
In the paragraph Marc mentioned:
In a program or library declaration, it is an error to import the
same identifier more than once with different bindings, or to
redefine or mutate an imported binding with a definition or with
set!, or to refer to an identifier before it is imported.
How does one refer to an identifier before it is imported?
In 5.3.1, I think introducing `define' as `set!' is pretty wrong. I
would reverse the order of the presentation and treat the
existing-binding case as special.
In 5.3.2, it says:
An expanded body containing internal definitions (but not syntax
definitions or record definitions) can always be converted into a
completely equivalent letrec* expression.
The parenthetical statement is unnecessary, as an expanded body has no
syntax definitions.
Also it's not true, unfortunately! Because in the next section, "5.3.3
Multiple-value definitions", we see the introduction of `define-values'
with an optimistically short specification and no corresponding
expansion. I think you _cannot_ introduce define-values without
`letrec-values' and `letrec*-values' and corresponding semantics -- and
since it's so late in the WG1 process it's best to just remove
define-values, unfortunately. Implementations can (as always) do as
they like.
Finally, in 5.5, the lack of specification of whether the
record-type-descriptor is a syntactic or value binding is unfortunate, I
think. But OK!
This is getting long so I'll write another mail for the rest.
Andy
--
http://wingolog.org/
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports