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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3736685ef876ab2 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!e4g2000hsg.googlegroups.com!not-for-mail From: braver Newsgroups: comp.lang.ada Subject: Re: OO Style with Ada Containers Date: Fri, 23 Nov 2007 14:52:29 -0800 (PST) Organization: http://groups.google.com Message-ID: <2ea3d2c9-6f8e-45c2-a605-8d919d7691e4@e4g2000hsg.googlegroups.com> References: <1195082906.420079.195000@d55g2000hsg.googlegroups.com> <1195084214.480299.13970@t8g2000prg.googlegroups.com> <1195084752.840598.174460@v65g2000hsc.googlegroups.com> <1195086265.070953.93180@d55g2000hsg.googlegroups.com> <2e37536e-55fb-42d5-a073-10b47cc31128@v4g2000hsf.googlegroups.com> <47475850.2080208@obry.net> NNTP-Posting-Host: 85.30.231.120 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1195858349 4017 127.0.0.1 (23 Nov 2007 22:52:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 23 Nov 2007 22:52:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e4g2000hsg.googlegroups.com; posting-host=85.30.231.120; posting-account=V2cESwoAAACnN32CFvmyu4DCs-heiisG User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.24 (Macintosh; Intel Mac OS X; U; en),gzip(gfe),gzip(gfe) Content-Disposition: inline Xref: g2news1.google.com comp.lang.ada:18594 Date: 2007-11-23T14:52:29-08:00 List-Id: On Nov 24, 1:46 am, Pascal Obry wrote: > braver a =E9crit : > > > Very ineteresting -- Matt, can you pls elucidate these idioms below? > > > On Nov 19, 5:24 am, Matthew Heaney > > wrote: > > >> type Scanner (<>) is tagged limited private; > > > What does (<>) say here -- that the type is unconstrained? > > Yes. Scanner has a privately defined discriminant. So the public view of > Scanner must be declared unconstrained. > > >> private > > >> type Handle (S : not null access Scanner) is limited null record; > > >> type Scanner (Last : Natural) is tagged limited record > >> H : Handle (Scanner'Access); > >> Line : String (1 .. Last); > >> Word_First : Positive; > >> Word_Last : Natural; > >> end record; > > > What's the logic behind the definition and usage of the Handle H > > throughout? > > It is for gaining write access to function in parameter. A simpler > solution is: > > type Scanner (Last : Natural) is tagged limited record > Self : access Scanner :=3D Scanner'Unchecked_Access; > Line : String (1 .. Last); > Word_First : Positive; > Word_Last : Natural; > end record; Ah. Didn't see H assigned -- in this case, Scanner'Access with the type name means the address of the actual parent type record instance? So basically to simplify even further, we'd just have procedures with honest in out parameters? Cheers, Alexy