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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news2.google.com!newsread.com!newsprint.newsread.com!news-out2.kabelfoon.nl!83.128.0.10.MISMATCH!newsfeed.kabelfoon.nl!213.193.255.2.MISMATCH!feeder1.cambrium.nl!feed.tweaknews.nl!skynet.be!newspost001!tjb!not-for-mail Date: Tue, 28 Dec 2004 20:48:17 +0100 From: Adrien Plisson Reply-To: aplisson-news@stochastique.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: fr-be, fr, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: newbie - OOP in Ada Set and Get Methods References: <1104237673.373489.128290@z14g2000cwz.googlegroups.com> <1104251213.061878.187430@f14g2000cwb.googlegroups.com> <1104255406.015130.138150@z14g2000cwz.googlegroups.com> In-Reply-To: <1104255406.015130.138150@z14g2000cwz.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <41d1b804$0$301$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 0903c64a.news.skynet.be X-Trace: 1104263173 news.skynet.be 301 217.136.179.187:12252 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news1.google.com comp.lang.ada:7270 Date: 2004-12-28T20:48:17+01:00 List-Id: R wrote: > because all OOP languages uses references to pass the objects as > parameters... > > it will be needed in my program ;-) oulalalalala... stop !!! you seems more trying to hack Ada from C++/Java then really trying to learn Ada. my advice would be: buy some good book on ada or read one online (see http://www.adapower.com/ section "books and tutorials" for references) in ada you can pass parameters in 4 ways, by specifying a mode for parameters: in, out, in out, access... you don't need an access type to pass a parameter by reference, and you don't really need to worry about passing by reference or other if you understand all the parameter modes. as pointed in an earlier reply, an Ada package in equivalent to a C++ namespace. in C++ you define an object and all methods related to this object in the same construction (namely a "class"). in Ada you define an object by defining a tagged record and a set of procedures/functions related to this tagged record. we group the tagged type and the methods in a package for clarity (but we can define as many object/methods as we want in the same package). if your C++/Java class has 7 variable members ("fields"), then you declare a tagged record containing 7 fields, not seven records... this way you pass to your methods 1 parameter of the type of your tagged record. btw, why are you trying to write this in Ada ? what is your goal ? -- rien