[racket-dev] Determining if a resolved module path is a real module name

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri May 16 10:44:09 EDT 2014

At Fri, 16 May 2014 10:40:44 -0400, Sam Tobin-Hochstadt wrote:
> On Fri, May 16, 2014 at 10:23 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> > The result of `expand` does not keep track of it source. You may want
> > to use `resolve-module-path-index` from `syntax/modresolve`, providing
> > the original module path as the second argument. The
> > `resolve-module-path-index` function detects the "self" module path
> > index (which is giving you '|expanded module|) and uses the second
> > argument in its place.
> 
> Ok, thanks.
> 
> I'd actually prefer to know that a particular identifier is a
> reference to "the current module", so if '|expanded module| is only
> (and always) produced for this case, that's plenty for me.

You should look for #f as the first result of
`module-path-index-split`, instead, since that's defined to indicate
the "self" module path index.


> > At Fri, 16 May 2014 09:58:12 -0400, Sam Tobin-Hochstadt wrote:
> >> Sometimes, `resolved-module-path-name` produces the symbol '|expanded
> >> module|. Is this the only symbol that's produced that _isn't_ the
> >> actual name of a module?
> >>
> >> Also, given that I'm calling `expand` on a module form, is it possible
> >> to do something so that I _don't_ end up with '|expanded module| as
> >> the name?
> >>
> >> Sam


Posted on the dev mailing list.