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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ccb21d128bf5f2ae X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s51.POSTED!53ab2750!not-for-mail From: "Jeff C r e e.m" Newsgroups: comp.lang.ada References: <1104237673.373489.128290@z14g2000cwz.googlegroups.com> Subject: Re: newbie - OOP in Ada Set and Get Methods X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 24.147.74.171 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s51 1104241014 24.147.74.171 (Tue, 28 Dec 2004 13:36:54 GMT) NNTP-Posting-Date: Tue, 28 Dec 2004 13:36:54 GMT Organization: Comcast Online Date: Tue, 28 Dec 2004 13:36:54 GMT Xref: g2news1.google.com comp.lang.ada:7258 Date: 2004-12-28T13:36:54+00:00 List-Id: You probably need to step back and read a few of the Ada tutorials rather than trying to hack-and-whack C++ in Ada. First, I hate to plug this website because it is old and unmaintained and should be shutdown....But this tutorial is short and is a very good starting point http://www.adahome.com/Ammo/cpp2ada.html A few tips to think about 1) Packages are closer to namespaces than classes. Your "field" variable is essentially just a stand alone 'global' value that is in no way tied to your class 2) Tagged records are closer to "classes" 3) There is no "this" in Ada so if you want an object to be visible within a subprogram it needs to be a parameter. 4) There is no special notation for OO calls v.s. non-OO calls in Ada and therefore (currently) you do not call a subprogram with object.method style but rather package.subprogram just as you would do for non-OO code. Ada 2005 will (probably) be adding object.method mostly because it really seems to be a hard thing for people from other programming lanaguages to swallow (my opinion. I have not seen any really strong technical argument for the feature..but perhaps there is one) After reading a few of the articles at adahome, you can ignore it and start using www.adapower.com and www.adaworld.com which are actually up to date.