[R6RS] library syntax

Michael Sperber sperber at informatik.uni-tuebingen.de
Thu Aug 17 01:17:43 EDT 2006

dyb at cs.indiana.edu writes:

>> I've got a tiny change request for the library syntax:
>> dyb at cs.indiana.edu writes:
>> >   (library <lib-name>
>> >     (import <import-spec>*)
>> >     (export <export-spec>*)
>> >     <library body>)
>> Could we swap the "import" and "export" forms?  Arguably, the exports
>> is what I want to read first, whereas the "exports" are more of an
>                                             ^^^^^^^^^
>> implementation aspect, as is the body itself.
> I think you mean "imports" in the marked case, right?


> I prefer the order as given.  The export form is perhaps the more
> interesting form, but it is also likely to be longer.  I suspect that the
> import form will be no more than a few lines in most cases, 

That depends on the programmer.  I expect it to be longer for me than
for you.

> and quite often just one, but for large libraries, the export form
> could get pretty long, burrying the import form.

And that's OK.  For large libraries, the body might also get pretty long.

> I also think the import-export order is more intuitive.  The imports are
> the raw materials, and the exports are produced from the imports.

The exports are produced from the imports plus the implementation.  By
that reasoning the imports should be at the very end.

Doesn't Chez's `module' form also effectively have the exports first?

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

More information about the R6RS mailing list