From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,58339537c87ee272 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-11 18:45:25 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!newscore.gigabell.net!fu-berlin.de!cpk-news-hub1.bbnplanet.com!news.gtei.net!europa.netcrusader.net!64.152.100.70!cyclone-sjo1.usenetserver.com!cyclone2.usenetserver.com!news-out.usenetserver.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Marin David Condic Newsgroups: comp.lang.ada Subject: Re: question on objects/package relationships Date: Mon, 11 Dec 2000 21:44:03 -0500 Organization: Quadrus Corporation Message-ID: <3A3590F3.E890B10A@acm.org> References: <20001211195143.22219.00004738@ng-da1.aol.com> NNTP-Posting-Host: d1.56.b8.f2 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 12 Dec 2000 02:43:31 GMT X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:2965 Date: 2000-12-12T02:43:31+00:00 List-Id: It depends a little on what you are trying to accomplish and exactly how you define your A and B objects. It would be legal to do something like this: package X is A : Integer ; end X ; package Y is B : Integer ; function What_Is_A return Integer ; end Y ; with X ; package body Y is function What_Is_A return Integer is begin return X.A ; end What_Is_A ; end Y ; Note that if A gets defined in the private part of X, you could not do this. As long as you have visibility it should be just fine. The compiler will definitely tell you if you don't have visibility of A. Hope this answers your question. MDC HDhil wrote: > Another newbie question. If i define object A in Ada using > a package specification, and then have to define another > another object B in a separate specification... > > ...is it possible i can have a function that uses object A > (or returns object A) within the package specifying object B? > If so, what's the general methodt for doing that? > > Many thanks, > Harry -- ====================================================================== Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Giving money and power to Government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke ======================================================================