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,d84bea4ad7f9234a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-09 17:23:25 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshub.sdsu.edu!newspeer.cts.com!galanthis.cts.com!127.0.0.1.MISMATCH!not-for-mail Sender: kst@king.cts.com Newsgroups: comp.lang.ada Subject: Re: Package Question [Newbie] References: From: Keith Thompson Date: 09 Jul 2001 17:23:24 -0700 Message-ID: X-Newsreader: Gnus v5.5/Emacs 20.3 NNTP-Posting-Host: 209.68.192.180 X-Trace: 994724604 nntp.cts.com 767 209.68.192.180 Xref: archiver1.google.com comp.lang.ada:9697 Date: 2001-07-09T17:23:24-07:00 List-Id: JM 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 San Diego Supercomputer Center <*> Cxiuj via bazo apartenas ni.