[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Location of definitions inside libraries

Peter Bex scripsit:

> I suppose the confusion here is due to the fact that there are two
> separate types of BEGIN.  One is part of the library language, which
> consists of only import, export, begin and include (modulo a few
> others), and one as part of the Scheme language.

Three, in fact; there are already two types of `begin` that are
part of the Scheme language, which we may call "expression `begin`"
and "declaration `begin`".  An expression `begin` can only contain
expressions, and can appear wherever an expression is permitted.
A declaration `begin` can contain both declarations and expressions,
and can appear as part of the body of a expression type that has a body,
or at the outermost level of a program, or at the REPL, or directly
within another declaration `begin`.

I have added cross-references between sections 4.2.3 and 5.6.1 to draft 9.

> It's important to remember that they're really two separate languages
> that happen to be covered by the same specification because one is
> designed as a "container" for the other.  That they both use BEGIN may
> be confusing.  More confusing is that you can rename one to something
> completely different.  The other can't be renamed at all, AFAIK.

That is correct.  The library language has no capacity to define new
library declarations, though new ones may be added to the large language.
I have in mind the following (these are just my ideas, not anything that
WG2 has blessed): speed, space, safety, compilation-speed, debuggability,
reexport, inline, notinline, unused, undefined, verbose, terse, silent.

In addition, I have proposed a new type of import-set, `drop-prefix`,
which specifies a prefix to be removed from all names which start with it:
Chibi already supports this.

I have also added two sub-proposals for trivial pattern-matching macros
in the library language, like syntax-rules but with no hygiene issues,
and for named interfaces (groups of names to export simultaneously).

See LibraryDeclarationsCowan for details, and please comment.

John Cowan  cowan@x  http://ccil.org/~cowan
Linguistics is arguably the most hotly contested property in the academic
realm. It is soaked with the blood of poets, theologians, philosophers,
philologists, psychologists, biologists and neurologists, along with
whatever blood can be got out of grammarians. - Russ Rymer

Scheme-reports mailing list