[r6rs-discuss] [Formal] syntactic sugar causes cancer of the exports

From: William D Clinger <will>
Date: Fri, 15 Jun 2007 18:17:14 -0400

I wrote:
> (Recall that the endianness, file-options, eol-style,
> and error-handling-mode syntaxes are explicitly
> allowed to recognize implementation-dependent identifiers,
> which will presumably be exported by those libraries.)

AndrevanTonder responded:
> If I understand enumerations correctly, though, the members
> of these universes are quoted symbols, right? So these do not
> need to be exported. If this is correct, these standard libraries
> will not have any nonstandard exports.

The file-options syntax is the only one of the four that
has anything to do with enumeration sets. The enumeration
set type itself is not exported, as programs can obtain
the type from any instance of it. Similarly, the symbols
that belong to the universe need not be exported, since
they are just symbols.

The problem arises because identifiers must be exported
in order for the endianness, file-options, eol-style,
and error-handling-mode syntaxes to recognize their
arguments. The specifications of file-options, eol-style,
and error-handling-mode in the 5.94 draft refer to their
arguments as <identifier>s, which implies matching as
identifiers, not symbols.

The specification of endianness in the 5.94 draft refers
to its argument as a "symbol", not as an identifier,
which could be read to imply matching as symbols, not as
identifiers. I believe that would be the only example of
a syntax that matches on symbols instead of identifiers,
however, so I think the reference to symbols instead of
identifiers in the specification of endianness was just
a mistake; if deliberate, it is inconsistent with the
rest of the report, which is a problem in itself.

If the solution is to change all of these specifications
to match their arguments as symbols, not as identifiers,
then that just serves to illustrate the breakdown of the
general rule that macros should match their arguments as
identifiers.

Any way you read it, the 5.94 draft has a problem here.

Will
Received on Fri Jun 15 2007 - 18:17:14 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC