develooper Front page | perl.perl6.stdlib | Postings from June 2002

Re: More 6PAN musings: local namespaces

Thread Previous | Thread Next
Uri Guttman
June 17, 2002 03:27
Re: More 6PAN musings: local namespaces
Message ID:
>>>>> "JS" == John Siracusa <> writes:

  JS> But what if they use Local:: and then want to use someone else's
  JS> Local:: modules?  (Say they purchased another company or are
  JS> partnering with someone.)  What if they want to release their code
  JS> to CPAN, despite the fact that it may still be vendor-specific?
  JS> (e.g. a parser for Acme's electronic widget order receipt or
  JS> something.)  I think there are real problems to be solved here.

one idea i have seen but could be formalized is a way to load a module
which is named Foo::Bar and have it not affect the actual current symbol
tables. instead another namespace is installed which maps to the loaded
file's space. that module could be loaded as Local::Foo::Bar. all
mentions of Foo::Bar in that module are changed (compile or runtime?) to
the newly mapped namespace. so you can do module space renaming/aliasing
at load time. this doesn't solve the issue with stopping or managing
collisions but it allows any application to work around them.

this load and rename needs a way to force a load path since the
colliding modules would need to be installed under different load
paths. this means the whole module load mechanism (which directly
affects 6pan, its 6pan++ download tool module (, and namespace
management) will need a high level design to handle all these and other
issues. larry wants to be able to load a selected version of installed
modules. this involves a specialized file search and load operation
which could share much design and code with searching for one of
colliding pair of modules. similarly installing from 6pan (using should allow installation of multiple versions and also
colliding modules. it may have to create special subdirs that perl6
would know to search for the variant or collided modules.

so the design of 6pan, the mechanism for installing modules from there
and how modules get loaded in perl are all a tangled hierarchy. nothing
should be fixed in one of them before a quality high level design is
done for the whole module subsystem.


Uri Guttman  ------  --------
- Damian Conway Perl Classes -- July 1-3 -- ---
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About