[R6RS] Yet another question (to Matthew I guess)

Manuel Serrano Manuel.Serrano
Tue Sep 28 08:35:25 EDT 2004


I have a concern with the following sentence of the MzScheme manual:

-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----
At run time, expressions and definitions are evaluated in order as
they appear within the module. Accessing a (non-syntax) identifier
before it is initialized signals a run-time error, just like accessing
an undefined global variable.
-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----

Does it mean that the following program *must* raise an error:

-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----
(module foo r6rs

 (display (foo 3))

 (define (foo x) x)
 )
-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----

If it does I don't see how the compiler will be able to do a good job
when compiling function calls...

-- 
Manuel

ps: As a matter of personal feeling (and I don't expect all of you to
agree on that) I found the syntactic scoping of modules rather ugly.

I would really prefer to write:

-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----
(module foo r6rs)

(define (foo 3))

(define (foo x) x)
-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----

This syntax avoids wasting characters at the left side of the screen
and it gets rid of this ugly closing parenthesis after the last
definition of the last expression.


More information about the R6RS mailing list