(j3.2006) Module name class

Malcolm Cohen malcolm
Fri Jan 15 00:33:31 EST 2010

Van Snyder wrote:
> Is there any hope that in the next revision we could treat module names
> in such a way as to allow local names to be the same?

That would compromise any possibility of using them to qualify names.

E.g. perhaps with the syntax
    <module-name> % <entity-name>
where the entity is from that module.

This would be useful for documentary purposes as well as accessing stuff one 
cannot otherwise access (because it would be ambiguous which module it came 

> I now have to do one of four things:
> 1.  Change the module name.  It's used in 38 other modules.
> 2.  Change the declaration and all 23 references to the variable name in
> the using scope.
> 3.  Create another module that has no other purpose than to have a
> different name from the used one, which will contain nothing more than a
> USE statement for the one I really want to use.
> 4.  Use the module in a module where it's not otherwise necessary, so I
> can use things from the desired one in the place I really want to access
> them.

5. Move the stuff you want to access here, or a coherent superset thereof, out 
of the problem module into a new one and have the problem module use the new 

> The first two are tedious and expensive.  The last two are ugly kludges.

Both of the first two might conceivably improve the readability of the code as 
well.  It doesn't look that expensive to me.

> Module names have only four uses:
> 1.  on the module statement
> 2.  on the end module statement
> 3.  on the use statement
> 4.  on the submodule statement.
> None of these conflict in any way with local names.

Not yet, at least in principle; but it's possible doing this might conflict with 
some implementation techniques as well as with the possible extension mentioned 

................................Malcolm Cohen, Nihon NAG, Tokyo.

More information about the J3 mailing list