[plt-scheme] Attaching uninstantiated modules

From: Lauri Alanko (la at iki.fi)
Date: Wed Jul 24 04:42:27 EDT 2002

Hello. Thus spake mzscheme:

Welcome to MzScheme version 200, Copyright (c) 1995-2002 PLT
> (define ns1 (make-namespace))                         
> (define ns2 (make-namespace))                         
> (eval '(module foo mzscheme (provide bar) (define bar 42)) ns1)
> (parameterize ((current-namespace ns2)) (namespace-attach-module ns1 'foo))
namespace-attach-module: module not instantiated (in the source namespace): foo
> (parameterize ((current-namespace ns1)) (namespace-require 'foo))
> (parameterize ((current-namespace ns2)) (namespace-attach-module ns1 'foo))

What's the problem here? Why couldn't an uninstantiated module be
attached so that it would be instantiated by whichever namespace
happened to require it first?

Lauri Alanko
la at iki.fi

Posted on the users mailing list.