From: Victor Shepelev Date: 2006-06-02T08:07:51+09:00 Subject: Re: Package and Namespace From: gwtmp01@mac.com [mailto:gwtmp01@mac.com] Sent: Friday, June 02, 2006 1:53 AM > On Jun 1, 2006, at 6:20 PM, Matthew Smillie wrote: > > > > > On Jun 1, 2006, at 23:08, Minkoo Seo wrote: > > > >> Okay, here's another example. > >> > >> I have Point class provided by XYZ company. > >> I also have Point class provided by ABC company. > >> > >> Now, I have to creates an instance of XYZ.Point from an > >> instance of ABC.Point. How can I solve this problem? > >> I have to mention ABC.Point and XYZ.Point in the same file. > > > > abc_point = ABC::Point.new > > xyz_point = XYZ::Point.new > > I think the OR was suggesting that company ABC and company XYZ > neglected to wrap their classes in a containing module/namespace so > you have two top level classes named Point. I think at that point > you suggested politely to both ABC and XYZ that they should > distribute their code within a module. > > You still have the problems of two authors picking the same top level > module name. There were a discussion somewhere in ruby-talk about the syntax like: module ABC end ABC::load('abc-point') #here we have all code from abc-point.rb inside module ABC Or something like this. Moreover, there is already brilliant Script[1] library, which allows to do such kind of things right now. V. 1. http://redshift.sourceforge.net/script/doc/index.html