comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: What is your opinion on Global Objects?
Date: Mon, 17 Nov 2014 22:09:23 -0700
Date: 2014-11-17T22:09:23-07:00	[thread overview]
Message-ID: <m4ek9n$fl2$1@dont-email.me> (raw)
In-Reply-To: <jKyaw.452871$_r4.180027@fx25.iad>

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

  parent reply	other threads:[~2014-11-18  5:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18  1:36 What is your opinion on Global Objects? Hubert
2014-11-18  2:52 ` Jeffrey Carter
2014-11-18  3:08   ` Hubert
2014-11-18  3:16     ` Shark8
2014-11-18  5:09     ` Jeffrey Carter [this message]
2014-11-18 11:23     ` Brian Drummond
2014-11-19  2:50       ` Hubert
2014-11-19  3:03         ` Jeffrey Carter
2014-11-19  9:13           ` Hubert
2014-11-19 10:22             ` J-P. Rosen
2014-11-19 17:37             ` Jeffrey Carter
2014-11-20 16:34         ` Stephen Leake
2014-11-20 21:11           ` Adam Beneschan
2014-11-21 15:25             ` Stephen Leake
2014-11-21 21:53             ` Randy Brukardt
2014-11-21  1:25           ` Hubert
2014-11-21  3:00           ` Brad Moore
2014-11-19 10:11   ` Jacob Sparre Andersen
2014-11-20  6:21     ` Hubert
2014-11-18  8:54 ` Dmitry A. Kazakov
2014-11-20 20:33 ` sbelmont700
2014-11-20 21:35   ` J-P. Rosen
2014-11-21  1:02     ` sbelmont700
2014-11-21  1:31       ` Hubert
2014-11-21  9:01     ` Dmitry A. Kazakov
2014-11-22  7:46       ` J-P. Rosen
2014-11-22  9:02         ` Dmitry A. Kazakov
replies disabled

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