Clarifications on namespace.plt (was: [plt-scheme] Modules, structs and environments)

From: Joel J. Adamson (jadamson at partners.org)
Date: Wed Nov 21 10:20:59 EST 2007

jadamson at partners.org (Joel J. Adamson) writes:

> Here's some test code:
>
> ;;;;;;;;;;;;;;;;;;;;
> ;; struct.ss
> ;; this is a library that creates the struct and exports
> ;; it.  
> (module struct mzscheme
>   (provide (struct test-struct (f1 f2)))
>   (define-struct test-struct (f1 f2)))
>
> ;; run.ss

;;Replaced with the following:
(module run2 mzscheme
  (require "struct.ss"
           (planet "namespace.ss" ("schematics" "namespace.plt" 1 0)))

  (let ((ns (make-namespace 'initial))) ;based on example in 
    (namespace-attach/require           ;doc.txt for namespace.plt
     ns
     "struct.ss")
    (with-namespace
     ns
     (read-eval-print-loop))))
;; compiled with mzc -v --exe run2 run2.ss

;;And when I run it:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
~/tmp/modtest $ run2
namespace-attach-module: module not instantiated
(in the source namespace): |,/home/joel/tmp/modtest/struct|

 === context ===
namespace.ss:116:2: namespace-attach/require
#f::353: loop
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Now, how do I *instantiate* the module?  Is there more to it than
require?

Thanks,
Joel
-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.




Posted on the users mailing list.