[R6RS] Modules

Matthew Flatt mflatt
Thu Nov 4 10:51:36 EST 2004


At Thu, 4 Nov 2004 16:26:51 +0100, Manuel Serrano wrote:
> There is something that I still don't understand. You suppose that
> your interpreter/compiler knows enough about modules so that it knows
> that a module is a list whose third element is a symbol representing a
> module identifier that is actually required.

That's true.

> You not going a step
> further and state that your interpreter/compiler knows about r6rs modules!

I'm not sure what you mean. I'm imaging that the interpreter/compiler
knows about the `module' form, but it makes no assumption about the
bindings in the `module' body after the language declaration.

> > Or, if you have `include':
> > 
> >  (module very-interesting-r4rs-implementation r4rs+provide+include
> >    (provide ...)
> >    (include "interesting.scm"))
> >  
> >  interesting.scm:
> >  <your very interesting r4rs code>
> This is a solution, I agree. It is more or less equivalent to the Mike's 
> (CODE ...) form. I don't like it very much it supposes that two files
> are required for every modules.

Well, I have in mind that `include' is a form that you can put in any
expression or definition context, and it gets replaced with the content
of the file. So you wouldn't have to use a separate file.

> I don't like very much the INCLUDE of CODE solution because it forces you
> to right in FILENAME in your code. As I have said, I think that we should
> avoid that.

Ok, we fundamentally disagree on this one.

> > I still believe that this should be put into a library, but my opinion
> > relies on being able to write macros that expand to `provide'.
> Being able to right macros that expand to PROVIDE is in contradiction 
> with the Mike's proposal.

Yes.

> However, I don't see how it is related to
> exporting types. Could you elaborate on that?

A library could provide a new `provide' form that supports type
declarations. An implementation of the library might expand to the R6RS
`provide' and simply drop the type information. The Bigloo
implementation of the library would ensure that the type information
gets to the compiler.

This is probably a moot point, because I don't think we're going to
agree on a system where a macro can expand to `provide'.

Matthew



More information about the R6RS mailing list