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-Thread: 103376,ccb21d128bf5f2ae X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!newsfeed.stueberl.de!news-mue1.dfn.de!news-ham1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: newbie - OOP in Ada Set and Get Methods Date: Wed, 29 Dec 2004 17:35:20 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <1104237673.373489.128290@z14g2000cwz.googlegroups.com> <1104251213.061878.187430@f14g2000cwb.googlegroups.com> <1104255406.015130.138150@z14g2000cwz.googlegroups.com> <1104314768.942556.71380@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1104341720 15137 134.91.1.34 (29 Dec 2004 17:35:20 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Wed, 29 Dec 2004 17:35:20 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:7303 Date: 2004-12-29T17:35:20+00:00 List-Id: R wrote: : : 'in parameters cannot be modified inside function'(sth like this), This helps you abide by a principle called query command separation: : procedure Set(this: in out rec1; s: Integer) is this is the command, and the Get function is the query. the principle says that queries should never modify the object. Commands do in general modify the object. (You can still implement a query using a procedure that has an out parameter.) -- Georg