[plt-scheme] enclosing-module-name

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Apr 4 17:05:26 EDT 2007

At Wed, 4 Apr 2007 14:55:52 +0000, support at taxupdate.com wrote:
> On Wed, Apr 04, 2007 at 02:31:25PM -0400, Matthias Felleisen wrote:
> 
> > See help desk: 'enclosing-module-name is attached when #%module-begin  
> > is wrapped around module body.
> 
> Thanks.  BTW, I had read the article you referenced.  The wording there
> led me to believe that #%module-begin would automatically wrapped around
> the module body:
> 
>   A #%module-begin is implicitly added around a module body when
>   it contains multiple S-expressions, or when the S-expression
>   expands to a core form other than #%module-begin or 
>   #%plain-module-begin;
>   
> Why doesn't the implicit #%module-begin provide this syntax property?

It does. In Matthias's example:

 (module imp test
    1)

a `#%module-begin' is wrapped around the `1', and the generated
`#%module-begin' form does get the property.


In your original test,

 (test-module-name)      ; => #f

there's no module wrapping the expression, and hence no
`#%module-begin'. Indeed, there is no enclosing module at all.


It's possible that either `syntax-identifier-binding' or
`syntax-source-module' will do what you want, but I'm not sure.

Matthew



Posted on the users mailing list.