I have a namespace behind a particular API. I'd love to hook into the module system to control compilation, visibility, etc. of all the definitions and references.
Here's an example. 'a' is available in the top level module even though it was defined by module 'm1' and not provided by any explicit mechanism. (Also, order dependencies seem imminent.) #lang racket (module base racket (define my-table (make-hasheq)) (define-syntax (my-define stx) (syntax-case stx () [(_ my-id expr) (identifier? #'my-id) #'(hash-set! my-table 'my-id expr)])) (define-syntax (my-eval stx) (syntax-case stx () [(_ my-id) #'(hash-ref my-table my-id #f)])) (provide my-define my-eval) ) (module m1 racket (require (submod ".." base)) (my-define a (+ 1 2)) ) (require 'base 'm1) (my-eval 'a) Is there any example of doing something like this using the module system without polluting the top level namespace? Am I correct in assuming that this will not work under separate module compilation? -- Dan Liebgold [dan.liebg...@gmail.com]
_________________________ Racket Developers list: http://lists.racket-lang.org/dev