[R6RS] Re: Slides for "modules talk"

Matthew Flatt mflatt
Tue Sep 28 09:03:12 EDT 2004


At Tue, 28 Sep 2004 11:56:37 +0200, Manuel Serrano wrote:
> * What is a derived-definition?

A definition that is produced by a macro expansion. For example:

 (define-syntax def-10 (syntax-rules () [(_ id) (define id 10)]))
 (def-10 y)

The definition that is produced by expanding `(def-10 y)' is a derived
definition.

> * what is a begin definition?

I'm less sure about this one, since I'm unsure of the context, but I
think it's

 (begin
  (define y 10)
  (define z 20))

which would be the same as 

 (define y 10)
 (define z 20)

in a module body.

> -----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----
> A modules' inits and non-keyword definitions are evaluated at least
> the first time a require form naming the module is evaluated, a 
> require also-for-syntax form naming the module is expanded, or a 
> require only-for-syntax form naming the module is expanded.
> -----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----
> 
> I don't really understand what all that means. First, what is a
> keyword-definition? I presume that it is a macro definition?

Yes.

> Then, the first sentence seems to mean that evaluating an "require"
> form returns a value.

I don't think that's the intent. The definitions are evaluated for
side-effects.

> What confuses me a lot in the paragraph above is that the word
> "evaluation" which seems to be applied in very different
> contexts. When a require form is evaluated for import. I presume that
> you are talking of execution time (when the program runs). When a
> require form is evaluated for syntax, I presume that you are talking
> of compile time (when the module is being macro expanded or compiled).
> These are totally unrelated.

Yes.

A particular interaction model might evaluate a module once for both
compile time and run time, though. (I think that's a bad thing, but I'm
willing to compromise.)

Matthew



More information about the R6RS mailing list