[plt-scheme] domain language hacking, and arguing with the module system

From: Daniel Silva (dansilva at lynx.dac.neu.edu)
Date: Fri May 2 04:31:29 EDT 2003

Have you tried namespace-require and dynamic-require?

On Thu, 2003-05-01 at 14:30, Daniel Hagerty wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>     I've been hacking on a domain language in my copious free time;
> mzscheme seems rather well suited for this.  I only wish I were more
> competent at it.
>     I'm having a lot of trouble with how I would like to interact with
> the module system.  mzscheme's module system looks like it'll give me
> exactly what I want, but there are devils in the details -- I need to
> name the modules I want to require with a little indirection.
>     I want to be able to say things like
> (define foo-release
>   "foo_stable_2003_02_19_beta_RELEASE_2003_03_12")
> (define bar-release
>   "bar_stable_2003_02_19_beta_RELEASE_2003_02_19")
> (require (release foo-release "foo.ss"))
> (require (release foo-release "baz.ss"))
> (require (release bar-release "bar.ss"))
> where the require form effectively becomes
> (require (file "./release/foo_stable_2003_02_19_beta_RELEASE_2003_03_12/foo.ss"))
> (by way of fiddling with the module-name-resolver)
>     However, this approach seems a little problematic given the
> compile time nature of require.  I've been flailing around at this,
> but thus far have failed to come up something that actually works.  I
> can get something that works a little further with something like
> (define-release ...)
> where define-release is a macro that communicates with the
> module-namespace-resolver through a shared module, but that still doesn't
> work.
> I'm playing around with printf'ing the world.  The exact sequence of
> when modules get compiled/evaled and particurlarly the
> module-name-resolver and its data module give hints as to the nature
> of the problem, but I'm at a loss how to get What I Want from all
> this.  I don't know if I'm going about this the right way, or if I
> want is readily achievable.
> Any free clues for the clueless?  If I need to explain the bigger
> picture of "why are you trying to do this to yourself?", I can do so.

Posted on the users mailing list.