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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.157.35.50 with SMTP id j47mr17055769otb.4.1483374464574; Mon, 02 Jan 2017 08:27:44 -0800 (PST) X-Received: by 10.157.8.134 with SMTP id 6mr2713933otf.17.1483374464543; Mon, 02 Jan 2017 08:27:44 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!b123no5714589itb.0!news-out.google.com!g131ni11759itg.0!nntp.google.com!b123no5714584itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 2 Jan 2017 08:27:44 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=88.207.167.150; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 88.207.167.150 References: <29380aa7-0c3b-4908-94c6-aa91f3996b42@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Experimenting with the OOP features in Ada From: Laurent Injection-Date: Mon, 02 Jan 2017 16:27:44 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:33003 Date: 2017-01-02T08:27:44-08:00 List-Id: On Monday, 2 January 2017 15:44:57 UTC+1, Brian Drummond wrote: > On Mon, 02 Jan 2017 14:11:40 +0000, Brian Drummond wrote: > So the following are equivalent: > > Test_Antibiotic := Base_Types.Antibiotics.Create_Code_SIL ( > This => Test_Antibiotic, > Code_SIL => "Test Antibiotic 3") > > Test_Antibiotic := Test_Antibiotic.Create_Code_SIL > (Code_SIL => "Test Antibiotic 3"); > > but the preferred form would be > > Test_Antibiotic.Set_Code_SIL (Code_SIL => "gen"); > > -- Brian Yes last one looks nice but doesn't work. No selector... Object is private. So 2nd one. Now I won't compile because Base_Types.Object is abstract. So I have to figure out how/where to put the overriding works. In John Barnes Book it looks so easy and light. Doing it myself feels clumsy :(