[plt-scheme] Example of Inspectors and Modules?

From: Doug Orleans (dougorleans at gmail.com)
Date: Thu Jul 13 15:31:00 EDT 2006

Jos Koot writes:
 > Does someone have a simple example of how to use parameter 
 > current-code-inspector for protection of modules? I dont grasp what section 
 > Inspectors and Modules of the MzScheme Language Manual is telling me. 

I don't grasp it either, and would also appreciate an example.  But I
have a different use case: when I am developing a module, I want to be
able to access any definition in a module from the REPL.  But when I
publish the module, I only want to provide the definitions that are
part of the public interface.  Lately I've been having all my modules
do "(provide (all-defined))", and then have both a "private.ss" that
provides everything from all modules in the collection and a
"<collection>.ss" that only provides the public interface.  It seems
like "(provide (protect ...))" would be a cleaner solution, but I
haven't been able to figure out how or where to deal with code
inspectors to make this work.

--dougorleans at gmail.com

Posted on the users mailing list.