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.107.53.209 with SMTP id k78mr15954294ioo.76.1483451820827; Tue, 03 Jan 2017 05:57:00 -0800 (PST) X-Received: by 10.157.39.129 with SMTP id c1mr2818976otb.15.1483451820793; Tue, 03 Jan 2017 05:57:00 -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!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!75no5964947ite.0!news-out.google.com!g131ni16527itg.0!nntp.google.com!b123no5965864itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 3 Jan 2017 05:57:00 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=194.154.216.95; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 194.154.216.95 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: Tue, 03 Jan 2017 13:57:00 +0000 Content-Type: text/plain; charset=UTF-8 X-Received-Bytes: 2752 X-Received-Body-CRC: 3623257040 Xref: news.eternal-september.org comp.lang.ada:33020 Date: 2017-01-03T05:57:00-08:00 List-Id: On Tuesday, 3 January 2017 14:02:56 UTC+1, Brian Drummond wrote: > I recommend learning how to make the nicest looking one work; my > procedure was a first pass at guidance, not a complete solution. > > That would feel like cheating. Makes a lot fun to try to figure out how things work. > Procedure Set_Code_SIL (This : in out Base_Types.Antibiotics.Objects; > Code_SIL => "gen"); > > Where did you put this procedure? > > As Dmitry says, you need to provide setters if you're manipulating parts > of an object, so this procedure, a setter, should be part of the > Base_Types.Antibiotics package (with implementation in its body) so that > it has access to the private part, where the components are declared. > > The error message fragment (without file:location) you report suggests it > was probably somewhere else. > > -- Brian > After some sleep and a clean up of the code, everything is much clearer now. The only thing which I am not able to see is if I can transform this into a procedure and how I would do it. The Ptr confuses me because I don't understand where it should point to in a procedure. function Create (Value : String) return My_Safe_String is Ptr : My_String_Ptr := new My_String (Value'Length); begin Ptr.Value := Value; return Ref (Ptr); end Create; Item.Name.Set (Name=>"Something") looks better than Item.Name := My_Strings.Handle.Create (Value => Name); Thanks