[plt-scheme] Listing all exported symbols/structures of a modul e/extension

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Aug 29 09:48:40 EDT 2004

At Sat, 28 Aug 2004 21:47:12 -0700, Dmitriy Zavin wrote:
> When I try to do that, it lists ALL symbols visible by the namespace:
> (parameterize ((current-namespace (module->namespace '(lib
> "mymodule"))))
> 	(namespace-mapped-symbols))
> 
> What am i missing?

For a module that is implemented as an extension, I get only the
module's definitions/exports:

 localhost.localdomain% mzscheme -L mzssl.ss openssl
 Welcome to MzScheme version 299.14, Copyright (c) 2004 PLT Scheme, Inc.
 > (parameterize ([current-namespace (module->namespace '(lib "mzssl.ss"
   "openssl"))]) (namespace-mapped-symbols))
 (ssl-close ssl-listen ssl-make-context ssl-connect ssl-accept/enable-break
  ssl-make-client-context ssl-load-certificate-chain! ssl-client-context? 
  ssl-available? ssl-connect/enable-break ssl-load-private-key! 
  ssl-load-suggested-certificate-authorities! ssl-addresses ssl-accept 
  ssl-load-verify-root-certificates! ssl-set-verify! ssl-listener?)

I thought that would be the case for SWIG-built modules, too.

For a Scheme-implemented module, it's true that all of the module's
imports are listed (as well as the identifiers that are defined in the
module). In that case, other functions --- such as `identifier-binding'
combined with `namespace-syntax-introduce' --- could be used to
distinguish definitions from imports.

Matthew



Posted on the users mailing list.