From: Minkoo Seo Date: 2006-06-02T19:26:06+09:00 Subject: Re: Package and Namespace ------=_Part_3062_9155635.1149243561189 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you for the pointer and explanation. Does anybody know exact conclusion of the discussion on ABC::load('abc-point') syntax? My memory is blurred, and if I remember correctly, the suggestion was rejected because ABC::load syntax does not anything but require 'abc-point' module ABC include abc-point end and such an implementation is already there and trivial. And I am curious why namespace capability is not part of Ruby language. Is there any standardized solution for handling two 'Point' classes from two different company? Sincerely, Minkoo Seo On 6/2/06, Victor Shepelev wrote: > > 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 > > > ------=_Part_3062_9155635.1149243561189--