[gambit-list] ##namespace fun

Ben Weaver ben at orangesoda.net
Tue Jul 14 23:56:04 EDT 2009


On Tue, Jul 14, 2009 at 10:09 PM, Ben Weaver<ben at orangesoda.net> wrote:
> Try using `##define-macro' instead of `define-macro'.

Apologies, I was hasty and didn't try my suggestion before replying.
It seems that you need to use identifers bound in the gambit namespace
(##) to make this macro work; otherwise an "Ill-defined 'namespace'"
error keeps cropping up.  The following works for me:

(##namespace ("module-system#"))

(##define-macro (module name)
  (##quasiquote
   (##begin
     (##namespace (,(##string-append (##symbol->string name) "#")))
     (##include "~~lib/gambit#.scm"))))

(module bar)

(define quux 1)

quux ; ==> 1
bar#quux ; ==> 1



More information about the Gambit-list mailing list