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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: What is your opinion on Global Objects? Date: Mon, 17 Nov 2014 22:09:23 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 18 Nov 2014 05:09:13 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e1e8835fd7030ec2a5463beff662d0eb"; logging-data="16034"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AcZ0Rtg68mslt21puWvxQ+QBMI/p0b4U=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: Cancel-Lock: sha1:qk9ZxT7hNYdhezjaLnpLuUE7mBk= Xref: news.eternal-september.org comp.lang.ada:23505 Date: 2014-11-17T22:09:23-07:00 List-Id: On 11/17/2014 08:08 PM, Hubert wrote: >> > Perhaps I didn't make myself clear enough. I am talking about something like > > class A > { > void function1(); > ...... > } > > A s_object_a; > > > and then other code being able to access the object like > s_object.a.function1(); That may be necessary in C++, but not in Ada. > I guess in Ada you could have a package with a type and a variable in the body > but you would still need a way to access that variable somehow in other > packages, either through a parameter or globally and that's my question. What is > the best way to access such an object Through the operations exported by the package. This is a very common Ada paradigm. -- Jeff Carter "So if I understand 'The Matrix Reloaded' correctly, the Matrix is basically a Microsoft operating system--it runs for a while and then crashes and reboots. By design, no less. Neo is just a memory leak that's too hard to fix, so they left him in ... The users don't complain because they're packed in slush and kept sedated." Marin D. Condic 65