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

Re: More 6PAN musings: local namespaces

Thread Previous | Thread Next
From:
Uri Guttman
Date:
June 17, 2002 03:27
Subject:
Re: More 6PAN musings: local namespaces
Message ID:
x7vg8in5s7.fsf@mail.sysarch.com
>>>>> "JS" == John Siracusa <siracusa@mindspring.com> 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 (CPAN.pm), 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
6pan.pm) 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

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
- Damian Conway Perl Classes -- July 1-3 -- http://stemsystems.com/class/ ---
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About