From: Keith Thompson <kst@cts.com>
Subject: Re: Package Question [Newbie]
Date: 09 Jul 2001 17:23:24 -0700
Date: 2001-07-09T17:23:24-07:00 [thread overview]
Message-ID: <yec1ynphbsz.fsf@king.cts.com> (raw)
In-Reply-To: ssoakt067vi6drpdjatvp23qjqm94a7gak@4ax.com
JM <jmillard1@homey_remove_y.com> writes:
> Hi,
>
> I'm still very green wrt to Ada but after looking at few tutorials a
> have a couple of quick questions/observations. My background is C++ so
> I'm grasping for commonalities.
>
> 1. It looks as though basically the package is a class?
Not quite. In C++, a class is both a unit of encapsulation (a module)
and a data type. Ada separates these concepts. A package is a
module, but it's not a data type, (though you can declare data types
within it); it's similar to a C++ namespace. A record type is like a
C++ struct; a tagged type is like a class.
The closest Ada equivalent to a class is probably a package declaring
a single tagged type and the operations on it, but Ada packages
provide more flexibility.
--
Keith Thompson (The_Other_Keith) kst@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Cxiuj via bazo apartenas ni.
prev parent reply other threads:[~2001-07-10 0:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-06 7:06 Package Question [Newbie] JM
2001-07-06 10:59 ` Package Question [Newbie] (in C++ terms) Larry Kilgallen
2001-07-06 12:54 ` Package Question [Newbie] Marc A. Criley
2001-07-06 13:49 ` Ted Dennison
2001-07-06 13:54 ` DuckE
2001-07-06 14:13 ` Marin David Condic
2001-07-06 15:42 ` JM
2001-07-10 0:23 ` Keith Thompson [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox