comp.lang.ada
 help / color / mirror / Atom feed
From: nabbasi@pacbell.net.NOSPAM
Subject: Re: with'ing a "foreign" package or subsystem
Date: 1999/02/28
Date: 1999-02-28T00:00:00+00:00	[thread overview]
Message-ID: <7bcp7l$1qr@drn.newsguy.com> (raw)
In-Reply-To: m3g17qcc3u.fsf@mheaney.ni.net

In article <m3g17qcc3u.fsf@mheaney.ni.net>, Matthew says...
 
>In any case, what is the intended mechanism for resolving library-level
>name-space conflicts?
 
This is a good question. I was thinking about this problem yesterday.
In Java, they solved this on day one by having a convention of 
naming packages based on domain name of company. (private person can make 
up their own domain name I guess.

So a package from ACM, group RD, will be called  com.acm.rd.packageName.

But offocurse in Java this is done simply by having a directory packageName
under some tree  com/acm/rd/ . In Ada package names have nothing to do
with directory structure.

If I am writing a package now, what can I do to make sure its name in unique?

Actually this can be really a problem, becuase If I build
program, depending on which package of that name it finds 'first', in
its search path, it will use.  So by changing the -I order for gnatmake,
one could end up using the other package than the first without
knowing it. (offcourse the change of having 2 packages with same name and
exactly same interface is low, but it can happen).

so If I do

gnatmake -I../dir1 -I../dir2  mymain.adb

and in dir1 and dir2  there is a stack package with same name and interfaces
but different implementation, the one in dir1/ is used. flip the -I order,
and the one in dir2/ is used. 

So, I guess you can solve this problem for now by making the search path 
such that it will see your stack package before the other one. 
If you decide to use the other stack package, switch the order.

So, do:

gnatmake -I$PATH_TO_OUR_COMPANY_STUFF -I$PATH_TO_THE_OTHER_COMPANY_STUFF \
         main.adb

This way, you always sure you'll use your stack :)

Nasser
 




  reply	other threads:[~1999-02-28  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 [this message]
1999-03-01  0:00   ` dennison
1999-03-01  0:00   ` Nick Roberts
1999-03-01  0:00     ` Ehud Lamm
1999-03-01  0:00 ` Samuel Mize
1999-03-02  0:00   ` dennison
1999-03-01  0:00 ` dennison
1999-03-01  0:00 ` robert_dewar
1999-03-01  0:00 ` dennison
replies disabled

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