[R6RS] libraries

Manuel Serrano Manuel.Serrano
Tue Dec 6 10:07:24 EST 2005

Hello there,

I have started to implement a compiler for libraries so I have a couple
of questions and remarks. 

Question 1: Is this a legal library?

(library <lib-path> <language>
   (define (import x) x)
   (import 5))

Question 1b: The SRFI states that "An error is signalled if a macro
expands to an <impexp-form>."

Does it implies that import, export, ... are reserved identifiers?

Question 2: From your perspective, is this a legal library?

(library <lib-path> <language>
   (display x)
   (define x 5)

Question 3: From your perspective, is this a legal library?

(library <lib-path> <language>
   (display x)
   (define (x) 5)

Remark 1: In general I'm wondering if it is reasonable to be so vague 
on the semantics of the body execution. If we are trying to get
portability I think that we will have a problem here.

Question 4: Unless I have missed something, in the library SRFI, you
don't specify that exported bindings are immutable. As far as I remember
we have all agreed on that point. So, is it on purpose that you don't 
mention it?

Remark 2: I don't understand why the library SRFI should specify 
that macro-expansion obeys lexical scope. For me, it is one step too far. 
The library SRFI could be more neutral on this topic. Speaking for myself,
I don't sure that I agree with this rule.

Remark 3:  It is not clear to me (unless I have missed that too) that the
library semantics clearly bans cyclic import dependencies. Is it on purpose? 
(I don't remember if we had a agreement on cyclic vs acyclic imports.)

I agree that it's just a matter a personal taste but, in the risk of
repeating myself, I really strongly dislike nesting bodies inside
library declarations (I read that someone share this feeling on the
SRFI mailling list). I really strongly disklike loosing at least one
character on left column and I disklike the lonesome ending closing


More information about the R6RS mailing list