From: Logan Capaldo Date: 2006-06-03T03:24:07+09:00 Subject: Re: Package and Namespace On Jun 2, 2006, at 6:26 AM, Minkoo Seo wrote: > 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. I'm confused. In what language would these two companies putting their code outside of a namespace declaration _not_ be a problem then? As far as I can tell ruby provides as much namespace support as any other language, and no language (AFAIK)has a way to make two top- level Point classes work the right way if they aren't inside different namespaces.