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,8ab6ed0f71c479cd X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!20g2000yqt.googlegroups.com!not-for-mail From: christoph.grein@eurocopter.com Newsgroups: comp.lang.ada Subject: Re: API design problem - buffer scatter I/O Date: Sun, 23 Nov 2008 23:55:07 -0800 (PST) Organization: http://groups.google.com Message-ID: <1b06d68d-a6d8-4af3-8464-92e44224dcd6@20g2000yqt.googlegroups.com> References: NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1227513308 14789 127.0.0.1 (24 Nov 2008 07:55:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 24 Nov 2008 07:55:08 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 20g2000yqt.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 webwasher (Webwasher 6.8.2.3963) Xref: g2news2.google.com comp.lang.ada:3737 Date: 2008-11-23T23:55:07-08:00 List-Id: On 22 Nov., 23:16, Robert A Duff wrote: > I didn't read the whole wikibook, but the particular part you point to > above has quite a bit of misinformation. =A0Also, the early focus on > "fat pointers" vs. "thin pointers" is confusing. =A0There's no reason > to talk about such implementation details in an introductory tutorial. > Especially if the details are wrong. > > There is no such concept as "fat pointer" or "thin pointer" in Ada! > > It does point to a real problem, though. =A0Given your above declarations= , > you might want to say: > > =A0 =A0 This_Buf : aliased Stream_Element_Array (1..10); > =A0 =A0 That_Buf : aliased Stream_Element_Array (1..10_000); > > =A0 =A0 Scatter_Input_Data ((This_Buf'Access, That_Buf'Access)); -- wrong= ! > > but that's illegal. =A0You can do this instead: > > =A0 =A0 This_Buf : aliased Stream_Element_Array :=3D (1..10 =3D> <>); > =A0 =A0 That_Buf : aliased Stream_Element_Array :=3D (1..10_000 =3D> <>); > > =A0 =A0 Scatter_Input_Data ((This_Buf'Access, That_Buf'Access)); -- OK May be the nomenclature in wiki is wrong or confusing (and you always have to be skeptical about the contents), but the incompatibilities described there exist. And I remember a discussion with Robert Dewar that Access_To_Address_Conversion does not work for access to unconstrained just because of the bounds (in GNAT, this is just an Unchecked_Conversion of the Address in either way). So, Bob, could you please elaborate about what is wrong in this description. And I disagree that this should not be in wiki, because programmers inevitable will fall into this trap (as I did) and the corresponding RM pages are very difficult to grok. This is not an implementation detail. I do not know what a thin and a fat and a far pointer actually are, I'm no Ada implementor. From my point of view as language user, a thin pointer is simply an address, a fat pointer an address and the bounds. So just the use of "thin" and "fat" is wrong, because it's an implementation detail?