comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Mize <smize@imagin.net>
Subject: Re: with'ing a "foreign" package or subsystem
Date: 1999/03/01
Date: 1999-03-01T00:00:00+00:00	[thread overview]
Message-ID: <7beg6a$2o4d@news1.newsguy.com> (raw)
In-Reply-To: m3g17qcc3u.fsf@mheaney.ni.net

Matthew Heaney <matthew_heaney@acm.org> wrote:
> Can both packages coexist in the same application?  Is there a way to
> give a package a "virtual" subsystem, to prevent name-space conflicts
> like this?  Something like:
> 
> package ACME.Stacks renames <ACME company's "Stacks">;

I assume you would also change the name of ACME's Stacks, so your
Stacks and ACME's Stacks would no longer collide.

Having done that, you may as well just use the altered name.  Won't you
have to rework the code that uses them just as much either way?

OLD                : NAME-CHANGED            : RENAMED
                   :                         :
with Stacks;       : with ACME_Stacks;       : with ACME.Stacks;
procedure A is     : procedure A is          : procedure A is
  V: Stacks.Type;  :   V: ACME_Stacks.Type;  :   V: ACME.Stacks;
  use Stacks;      :   use ACME_Stacks;      :   use ACME.Stacks;

Did I miss something here?  I'm not trying to give a smart-ass reply,
I honestly don't see where you're heading.

On one other hand, if the renaming you show works, it could be an
intermediate step in getting the namespace problem corralled with
parent packages (subsystems).

On the other other hand, I don't see why it's more work to just make
it a child package of ACME in one step.

> In any case, what is the intended mechanism for resolving library-level
> name-space conflicts?

Doctor, it hurts when I do this...

I'd say parent packages defining independent name-spaces is the
intended mechanism for preventing conflicts.  To resolve them after
they occur, I think you just have to bite the bullet and rename one
of them.

Best,
Sam Mize

-- 
Samuel Mize -- smize@imagin.net (home email) -- Team Ada
Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam




  parent reply	other threads:[~1999-03-01  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-28  0:00 with'ing a "foreign" package or subsystem Matthew Heaney
1999-02-28  0:00 ` nabbasi
1999-03-01  0:00   ` Nick Roberts
1999-03-01  0:00     ` Ehud Lamm
1999-03-01  0:00   ` dennison
1999-03-01  0:00 ` dennison
1999-03-01  0:00 ` Samuel Mize [this message]
1999-03-02  0:00   ` dennison
1999-03-01  0:00 ` dennison
1999-03-01  0:00 ` robert_dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox