This is a bit off-topic, but I've been itching to ask this question for a long time, and since we're discussing Gambit's namespacing mechanism... You can't re-define identifiers that are imported. That is, when you do re-define them, they are changed in the original identifier's namespace instead of the current one. Is this suppose to happen? --- test.scm ---- (namespace ("foo#")) (##include "~~/lib/gambit#.scm") (define (run) (display "doing something important in namespace FOO") (newline)) (namespace ("bar#")) (##include "~~/lib/gambit#.scm") (namespace ("foo#" run)) (define (run) (display "doing something important in namespace BAR") (newline)) (namespace ("")) --------- Gambit v4.3.2
(include "test.scm") (run) *** ERROR IN (console)@2.2 -- Unbound variable: run 1> (foo#run) doing something important in namespace BAR (bar#run) *** ERROR IN (console)@4.2 -- Unbound variable: bar#run 1>
More importantly, since all primitive functions are defined in the global namespace, there's no way of overriding primitive procedures locally for separate namespaces. For example, --- test2.scm --- (namespace ("foo#")) (##include "~~/lib/gambit#.scm") (define (integer->char i) 'error) (namespace ("")) ------
(include "test2.scm") (foo#integer->char 5) *** ERROR IN (console)@6.2 -- Unbound variable: foo#integer->char 1> (integer->char 5) error
This seems to violate a rather basic principle of namespaces and modules. - James