[gambit-list] Namespaces

Christian Jaeger christian at pflanze.mine.nu
Tue Feb 12 06:54:22 EST 2008


Joel J. Adamson wrote:
> ... syntax-rules macros
>   

syntax-rules is incompatible with most Gambit specialities. Maybe search 
the mailing list for more details, or wait until Marc can give you more 
specifics.

(I've never really used syntax-rules with Gambit. Currently I'm using 
define-macro and whole-sourcefile transformers for my stuff, and am 
planning on reading about and understanding s48's macro system and maybe 
work on implementing that for Gambit/chjmodule/Snow.)

> * The wiki page mentions something about the namespace functions not
>   being supported in the future.  

Hm, I think there are roughly four levels of support or removal of a 
feature:

0. having decided that a feature is not to be removed any time.
1. not being sure whether something is the one and true way to do 
forever, but not having any reason to actually think of removing it.
2. having found actual reasons to believe something should be removed or 
replaced.
3. having decided to remove something.

The wording in the wiki is supposed to refer only to level 1. Not going 
to level 0 means leaving room for further decisions. That's just how I 
understand it, of course, and it has been the thinking behind writing 
that particular statement in the wiki.

> What is the status of the namespace
>   mechanism supported or not?  Will it be in the future?  

Speaking for myself, I'm currently counting on it being there for 
chjmodule. Should I/we find ways to achieve the things I/we want in 
other ways, I'll have no issue changing to those.

(BTW you could always reimplement namespaces for yourself if the 
following points are true:
(1) you can filter the code coming from file and repl inputs, 
maintaining source location information
(2) you've got a code analyzer (lexical analysis)
(3) possibly for convenience, filter also the output of the debugging 
functions

Point 1 is already there in Gambit (undocumented, though; btw that's 
something I think would have made more sense standardizing in R*RS than 
an actual module system). Point 2 isn't hard, if you're going to handle 
imports/exports anyway. Point (3) may be achievable through overriding 
some pretty-print hook, I haven't tried yet.

It's not clear yet to me how well layering would/will work, e.g. mixing 
code using both the namespaces feature and future chjmodule 
functionality; you're seeing such problems currently with syntax-case, 
but that may be rather just because nobody has spent much effort on 
integrating syntax-case better (well, I could be wrong, I don't know 
about the issues).)

> It seems like
>   I need to use it if I am going to use syntax-case, or will that change
>   too?
>   

(I rather think there's something fishy going on in the way you're 
trying to use the not very deeply integrated syntax-case.)

Christian.




More information about the Gambit-list mailing list