[racket] Scoped require

From: Maxim Romashchenko (max at anahoret.com)
Date: Mon Aug 22 08:16:59 EDT 2011

Hello.

Is there a way in Racket to have a module (say, "my-module") which 
provides just one form (say, "my-begin"), and this form works the same 
way as standard begin, but inside it all the bindings from the 
my-module become visible.

So the module may look like this:

--- my-module.rkt ---
#lang racket
(provide my-begin)

(define foo
   ...
---------------------

And the code using the module may look like this:

--- main.rkt ---
#lang racket
(require "my-module.rkt")

(my-begin
   (foo
     ...
-----------------

Thank you.

-- 
Best regards, Maxim.


Posted on the users mailing list.