[prev in list] [next in list] [prev in thread] [next in thread] 

List:       racket-users
Subject:    [plt-scheme] getting list of identifiers exported by a module?
From:       mflatt () cs ! utah ! edu (Matthew Flatt)
Date:       2006-08-28 5:43:03
Message-ID: 20060827214225.D6F1165007A () mail-svr1 ! cs ! utah ! edu
[Download RAW message or body]

At Sun, 27 Aug 2006 11:46:20 -0400, "Kimberley Burchett" wrote:
> Is there a good way to get the list of identifiers exported by a
> module?

If you have the module source or its compiled form, you can use
`module-compiled-exports' on the compiled `module' expression.
(Expansion of `module' attaches properties with similar information.)

> Also, while I'm on the subject, is there a reason for the distinction
> between module-path and module-path-index?  The decision of when to
> require one versus the other seems somewhat arbitrary to me.

I think only `module-provide-exported?' requires a module path index,
and that was probably a mistake.

A function produces a module path index (instead of a module path) when
the path is extracted form expanded or compiled code. In that case, a
relative path like "utils.ss" might be relative to an imported module
instead of the original module (because the imported module re-exported
an identifier, or because it exported a macro that expanded into the
identifier), and a simple path can't represent the information.

Matthew



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic